Skip to content

Commit

Permalink
Network: Used iterator + size span constructors, because of Apple cla…
Browse files Browse the repository at this point in the history
…ng weirdness
  • Loading branch information
MSallermann committed Mar 9, 2024
1 parent 7fc843b commit e080d8c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ std::vector<std::vector<size_t>> Seldon::Network::strongly_connected_components(

std::span<const size_t> Seldon::Network::get_neighbours( std::size_t agent_idx ) const
{
return std::span( neighbour_list[agent_idx].cbegin(), neighbour_list[agent_idx].cend() );
return std::span( neighbour_list[agent_idx].begin(), neighbour_list[agent_idx].size() );
}

std::span<size_t> Seldon::Network::get_neighbours( std::size_t agent_idx )
{
return std::span( neighbour_list[agent_idx].begin(), neighbour_list[agent_idx].end() );
return std::span( neighbour_list[agent_idx].begin(), neighbour_list[agent_idx].size() );
}

void Seldon::Network::set_neighbours_and_weights(
Expand Down Expand Up @@ -84,12 +84,12 @@ void Seldon::Network::push_back_neighbour_and_weight( size_t i, size_t j, Weight

std::span<const Seldon::Network::WeightT> Seldon::Network::get_weights( std::size_t agent_idx ) const
{
return std::span<const Seldon::Network::WeightT>( weight_list[agent_idx].cbegin(), weight_list[agent_idx].cend() );
return std::span<const Seldon::Network::WeightT>( weight_list[agent_idx].cbegin(), weight_list[agent_idx].size() );
}

std::span<Seldon::Network::WeightT> Seldon::Network::get_weights( std::size_t agent_idx )
{
return std::span<Seldon::Network::WeightT>( weight_list[agent_idx].begin(), weight_list[agent_idx].end() );
return std::span<Seldon::Network::WeightT>( weight_list[agent_idx].begin(), weight_list[agent_idx].size() );
}

void Seldon::Network::set_weights( std::size_t agent_idx, std::span<const Seldon::Network::WeightT> weights )
Expand Down

0 comments on commit e080d8c

Please sign in to comment.