Skip to content
Snippets Groups Projects
Commit 717ac474 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Added missing overloads to SparseGrid.

Solves a bug with METAD + TARGET + GRID_SPARSE
See also #467
parent 0391c6ac
No related branches found
No related tags found
No related merge requests found
...@@ -821,6 +821,24 @@ void SparseGrid::writeToFile(OFile& ofile) { ...@@ -821,6 +821,24 @@ void SparseGrid::writeToFile(OFile& ofile) {
} }
} }
double SparseGrid::getMinValue() const {
double minval;
minval=0.0;
for(auto const & i : map_) {
if(i.second<minval) minval=i.second;
}
return minval;
}
double SparseGrid::getMaxValue() const {
double maxval;
maxval=0.0;
for(auto const & i : map_) {
if(i.second>maxval) maxval=i.second;
}
return maxval;
}
void Grid::projectOnLowDimension(double &val, std::vector<int> &vHigh, WeightBase * ptr2obj ) { void Grid::projectOnLowDimension(double &val, std::vector<int> &vHigh, WeightBase * ptr2obj ) {
unsigned i=0; unsigned i=0;
......
...@@ -271,6 +271,10 @@ public: ...@@ -271,6 +271,10 @@ public:
void writeToFile(OFile&); void writeToFile(OFile&);
virtual ~SparseGrid() {} virtual ~SparseGrid() {}
virtual double getMaxValue() const;
virtual double getMinValue() const;
}; };
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment