001 #include "AtlfastAlgs/BinID.h"
002 #include <assert.h>
003
004 namespace Atlfast {
005
006
007
008
009
010
011
012 BinID::BinID(int intID, double low1, double high1): m_int(intID) {
013 m_lowEdge.push_back(low1);
014 m_highEdge.push_back(high1);
015 }
016
017 BinID::BinID(int intID, double low1, double high1, double low2,double high2):
018 m_int(intID) {
019 m_lowEdge.push_back(low1);
020 m_lowEdge.push_back(low2);
021 m_highEdge.push_back(high1);
022 m_highEdge.push_back(high2);
023 }
024
025 BinID::BinID(int intID, std::vector<double> low, std::vector<double> high):
026 m_int(intID), m_lowEdge(low), m_highEdge(high) {}
027
028
029 double BinID::low(int n) const {return m_lowEdge[n];}
030
031 double BinID::high(int n) const {return m_highEdge[n];}
032
033 bool BinID::isInBin(const double& var) const{
034 std::vector<double> vec(1, var);
035 return this->isInBin(vec);
036 }
037
038 bool BinID::isInBin(const std::vector<double>& var) const{
039 std::vector<double>::const_iterator vIter = var.begin();
040 std::vector<double>::const_iterator vEnd = var.end();
041 std::vector<double>::const_iterator lowIter = m_lowEdge.begin();
042 std::vector<double>::const_iterator highIter = m_highEdge.begin();
043
044 assert(var.size() <=m_lowEdge.size() );
045
046 for (;vIter != vEnd; ++vIter) {
047 if ( (*vIter) < (*lowIter) || (*vIter) > (*highIter) ) {
048 return false;
049 }
050 ++lowIter;
051 ++highIter;
052 }
053 return true;
054 }
055
056
057 bool BinID::operator<(const BinID& other) const {
058 return (m_int < other.m_int);
059 }
060
061 }
| Due to the LXR bug, the updates fail sometimes to remove references to deleted files. The Saturday's full rebuilds fix these problems |
|
This page was automatically generated by the
LXR engine.
|
|