| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <vector> | ||
| 4 | |||
| 5 | #include "multiindex.hpp" | ||
| 6 | |||
| 7 | struct Particle; | ||
| 8 | |||
| 9 | 37 | template <int d> class Histogram { | |
| 10 | public: | ||
| 11 | Multiindex<d, C> multiindex; | ||
| 12 | std::vector<double> values; | ||
| 13 | std::vector<double> valuesNormed; | ||
| 14 | |||
| 15 | Histogram() {} | ||
| 16 | |||
| 17 |
1/2✓ Branch 2 taken 19 times.
✗ Branch 3 not taken.
|
37 | Histogram(const Eigen::Array<int, d, 1> &bins) : multiindex(bins) { |
| 18 |
1/2✓ Branch 1 taken 19 times.
✗ Branch 2 not taken.
|
37 | this->values.resize(this->multiindex.linsize, 0); |
| 19 |
1/2✓ Branch 1 taken 19 times.
✗ Branch 2 not taken.
|
37 | this->valuesNormed.resize(this->multiindex.linsize, 0); |
| 20 | 37 | }; | |
| 21 | |||
| 22 | 10 | inline double &operator[](int i) { return values[i]; } | |
| 23 | |||
| 24 | 17 | inline double &operator[](const Eigen::Array<int, d, 1> &index) { | |
| 25 | 17 | return (*this)[multiindex.multi2lin(index)]; | |
| 26 | } | ||
| 27 | }; | ||
| 28 |