Skip to content

Commit 24df859

Browse files
committed
revised bounds checking
1 parent 20be565 commit 24df859

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

include/osp/graph_algorithms/computational_dag_construction_util.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace osp {
3434
* @tparam Graph_to The type of the target graph. Must satisfy `is_constructable_cdag_vertex`.
3535
* @param from The source graph.
3636
* @param to The target graph.
37-
*/
37+
*/
3838
template<typename Graph_from, typename Graph_to>
3939
void constructComputationalDag(const Graph_from &from, Graph_to &to) {
4040
static_assert(is_computational_dag_v<Graph_from>, "Graph_from must satisfy the computational_dag concept");
@@ -46,21 +46,21 @@ void constructComputationalDag(const Graph_from &from, Graph_to &to) {
4646
for (const auto &v_idx : from.vertices()) {
4747
if constexpr (has_typed_vertices_v<Graph_from> and has_typed_vertices_v<Graph_to>) {
4848
vertex_map.push_back(to.add_vertex(from.vertex_work_weight(v_idx), from.vertex_comm_weight(v_idx),
49-
from.vertex_mem_weight(v_idx), from.vertex_type(v_idx)));
49+
from.vertex_mem_weight(v_idx), from.vertex_type(v_idx)));
5050
} else {
5151
vertex_map.push_back(to.add_vertex(from.vertex_work_weight(v_idx), from.vertex_comm_weight(v_idx),
52-
from.vertex_mem_weight(v_idx)));
52+
from.vertex_mem_weight(v_idx)));
5353
}
5454
}
5555

5656
if constexpr (has_edge_weights_v<Graph_from> and has_edge_weights_v<Graph_to>) {
5757
for (const auto &e : edges(from)) {
58-
to.add_edge(vertex_map.at(source(e, from)), vertex_map.at(target(e, from)), from.edge_comm_weight(e));
58+
to.add_edge(vertex_map[source(e, from)], vertex_map[target(e, from)], from.edge_comm_weight(e));
5959
}
6060
} else {
6161
for (const auto &v : from.vertices()) {
6262
for (const auto &child : from.children(v)) {
63-
to.add_edge(vertex_map.at(v), vertex_map.at(child));
63+
to.add_edge(vertex_map[v], vertex_map[child]);
6464
}
6565
}
6666
}

include/osp/graph_implementations/adj_list_impl/vector_cast_view.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class vector_cast_view {
141141
* @param i The index of the element to access.
142142
* @return The element at index i, cast to to_t.
143143
*/
144-
[[nodiscard]] auto operator[](std::size_t i) const { return static_cast<to_t>(vec.at(i)); }
144+
[[nodiscard]] auto operator[](std::size_t i) const { return static_cast<to_t>(vec[i]); }
145145
};
146146

147147
} // namespace osp

0 commit comments

Comments
 (0)