Skip to content

Commit

Permalink
removing useless bin member
Browse files Browse the repository at this point in the history
  • Loading branch information
nadrino committed Dec 4, 2024
1 parent 301eda4 commit aad42ee
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
3 changes: 0 additions & 3 deletions src/Utils/include/Bin.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@ class Bin : public JsonBaseClass {

// setters
void setIndex(int index_){ _index_ = index_; }
void setIsLowMemoryUsageMode(bool isLowMemoryUsageMode_){ _isLowMemoryUsageMode_ = isLowMemoryUsageMode_; }
void setIsZeroWideRangesTolerated(bool isZeroWideRangesTolerated_){ _isZeroWideRangesTolerated_ = isZeroWideRangesTolerated_; } // make it explicit! -> double precision might not be enough if you play with long int
void addBinEdge(const std::string& variableName_, double lowEdge_, double highEdge_);

// const getters
[[nodiscard]] bool isLowMemoryUsageMode() const { return _isLowMemoryUsageMode_; }
[[nodiscard]] bool isZeroWideRangesTolerated() const { return _isZeroWideRangesTolerated_; }
[[nodiscard]] int getIndex() const { return _index_; }
[[nodiscard]] const std::string &getFormulaStr() const { return _formulaStr_; }
Expand Down Expand Up @@ -81,7 +79,6 @@ class Bin : public JsonBaseClass {
[[nodiscard]] std::vector<double> generateBinTarget(const std::vector<std::string>& varNameList_ = {}) const;

private:
bool _isLowMemoryUsageMode_{false};
bool _isZeroWideRangesTolerated_{false};
bool _includeLowerBoundVal_{true}; // by default it's [a,b[
bool _includeHigherBoundVal_{false};
Expand Down
4 changes: 0 additions & 4 deletions src/Utils/src/Bin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,6 @@ bool Bin::isInBin( const std::vector<double>& valuesList_) const{
return std::all_of(_binEdgesList_.begin(), _binEdgesList_.end(), [&](const Edges& edge){ return (this->isBetweenEdges(edge, *(buf++))); });
}
bool Bin::isVariableSet( const std::string& variableName_) const{
if( _isLowMemoryUsageMode_ ){
LogError << "Can't fetch variable name while in low memory mode. (var name is not stored)" << std::endl;
throw std::logic_error("can't fetch var name while _isLowMemoryUsageMode_");
}
return GenericToolbox::findElementIndex(variableName_, _binEdgesList_, [](const Edges& e_){ return e_.varName; }) != -1;
}
bool Bin::isBetweenEdges( const std::string& variableName_, double value_) const {
Expand Down

0 comments on commit aad42ee

Please sign in to comment.