@@ -17,10 +17,9 @@ namespace arb {
17
17
18
18
// cell_label_range methods
19
19
cell_label_range::cell_label_range (std::vector<cell_size_type> size_vec,
20
- std::vector<cell_tag_type> label_vec,
20
+ const std::vector<cell_tag_type>& label_vec,
21
21
std::vector<lid_range> range_vec):
22
- sizes (std::move(size_vec)), ranges(std::move(range_vec))
23
- {
22
+ sizes (std::move(size_vec)), ranges(std::move(range_vec)) {
24
23
std::transform (label_vec.begin (), label_vec.end (),
25
24
std::back_inserter (labels),
26
25
hash_value<const std::string&>);
@@ -30,8 +29,7 @@ cell_label_range::cell_label_range(std::vector<cell_size_type> size_vec,
30
29
cell_label_range::cell_label_range (std::vector<cell_size_type> size_vec,
31
30
std::vector<hash_type> label_vec,
32
31
std::vector<lid_range> range_vec):
33
- sizes (std::move(size_vec)), labels(std::move(label_vec)), ranges(std::move(range_vec))
34
- {
32
+ sizes (std::move(size_vec)), labels(std::move(label_vec)), ranges(std::move(range_vec)) {
35
33
arb_assert (check_invariant ());
36
34
};
37
35
@@ -75,10 +73,11 @@ bool cell_labels_and_gids::check_invariant() const {
75
73
/* The n-th local item (by index) to its identifier (lid). The lids are organised
76
74
in potentially discontiguous ranges.
77
75
78
- idx --------
76
+ idx -------- len0 <= idx < len0 + len1
79
77
\
80
78
v
81
79
| [s0, e0) [s1, e1), ... [sk, ek), ... |
80
+ len0 len1
82
81
*/
83
82
cell_lid_type label_resolution_map::range_set::at (unsigned idx) const {
84
83
if (0 == size) throw arbor_internal_error (" no valid lids" );
@@ -94,14 +93,6 @@ const label_resolution_map::range_set& label_resolution_map::at(cell_gid_type gi
94
93
return map.at (std::make_pair (gid, hash));
95
94
}
96
95
97
- const label_resolution_map::range_set& label_resolution_map::at (cell_gid_type gid, const cell_tag_type& tag) const {
98
- return map.at (std::make_pair (gid, hash_value (tag)));
99
- }
100
-
101
- std::size_t label_resolution_map::count (cell_gid_type gid, const cell_tag_type& tag) const {
102
- return map.count (std::make_pair (gid, hash_value (tag)));
103
- }
104
-
105
96
std::size_t label_resolution_map::count (cell_gid_type gid, hash_type hash) const {
106
97
return map.count (std::make_pair (gid, hash));
107
98
}
@@ -139,7 +130,7 @@ cell_lid_type resolver::resolve(cell_gid_type gid, const cell_local_label_type&
139
130
auto hash = hash_value (tag);
140
131
if (!label_map_->count (gid, hash)) throw arb::bad_connection_label (gid, tag, " label does not exist" );
141
132
const auto & range_set = label_map_->at (gid, hash);
142
- if (range_set.size < 1 ) throw arb::bad_connection_label (gid, tag, " no valid lids" );
133
+ if (range_set.size <= 0 ) throw arb::bad_connection_label (gid, tag, " no valid lids" );
143
134
auto idx = 0ul ;
144
135
if (pol == lid_selection_policy::assert_univalent) {
145
136
// must have single-entry range_set
0 commit comments