Skip to content
Snippets Groups Projects
Commit 1a3df149 authored by Sam Yates's avatar Sam Yates
Browse files

Merge remote-tracking branch 'origin/bugfix/serial-gathered-vector' into feature/fvm-multicell

parents 0225e8f8 cb1591db
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,7 @@ public: ...@@ -20,7 +20,7 @@ public:
partition_(std::move(p)) partition_(std::move(p))
{ {
EXPECTS(std::is_sorted(partition_.begin(), partition_.end())); EXPECTS(std::is_sorted(partition_.begin(), partition_.end()));
EXPECTS(std::size_t(partition_.back()) == v.size()); EXPECTS(std::size_t(partition_.back()) == values_.size());
} }
/// the partition of distribution /// the partition of distribution
......
...@@ -15,7 +15,11 @@ struct serial_global_policy { ...@@ -15,7 +15,11 @@ struct serial_global_policy {
template <typename Spike> template <typename Spike>
static gathered_vector<Spike> static gathered_vector<Spike>
gather_spikes(const std::vector<Spike>& local_spikes) { gather_spikes(const std::vector<Spike>& local_spikes) {
return gathered_vector<Spike>(std::vector<Spike>(local_spikes), {0u, 1u}); using count_type = typename gathered_vector<Spike>::count_type;
return gathered_vector<Spike>(
std::vector<Spike>(local_spikes),
{0u, static_cast<count_type>(local_spikes.size())}
);
} }
static int id() { static int id() {
......
...@@ -87,9 +87,9 @@ struct range { ...@@ -87,9 +87,9 @@ struct range {
std::swap(right, other.right); std::swap(right, other.right);
} }
decltype(*left) front() const { return *left; } auto front() const -> decltype(*left) { return *left; }
decltype(*left) back() const { return *upto(left, right); } auto back() const -> decltype(*left) { return *upto(left, right); }
template <typename V = iterator> template <typename V = iterator>
enable_if_t<is_random_access_iterator<V>::value, decltype(*left)> enable_if_t<is_random_access_iterator<V>::value, decltype(*left)>
...@@ -200,7 +200,7 @@ public: ...@@ -200,7 +200,7 @@ public:
// forward and input iterator requirements // forward and input iterator requirements
auto operator*() const -> decltype(*iter()) { return *iter(); } auto operator*() const -> decltype(*(this->iter())) { return *iter(); }
I operator->() const { return e_.template ptr<0>(); } I operator->() const { return e_.template ptr<0>(); }
...@@ -271,7 +271,7 @@ public: ...@@ -271,7 +271,7 @@ public:
return iter()-x.iter(); return iter()-x.iter();
} }
auto operator[](difference_type n) const -> decltype(*iter()){ auto operator[](difference_type n) const -> decltype(*(this->iter())) {
return *(iter()+n); return *(iter()+n);
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment