GCC Code Coverage Report


Directory: ./
File: include/histogram.hpp
Date: 2024-04-18 12:22:13
Exec Total Coverage
Lines: 9 9 100.0%
Functions: 4 4 100.0%
Branches: 3 6 50.0%

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