15PairBuilder :: PairBuilder()
18PairBuilder ::~ PairBuilder()
23void PairBuilder ::inputx(
const int xstrip){
24 bool xValueInserted =
m_xvalues.insert(xstrip).second;
27void PairBuilder ::inputy(
const int ystrip){
28 bool yValueInserted =
m_yvalues.insert(ystrip).second;
31void PairBuilder ::inputxy(
const int xystrip){
32 bool xValueInserted =
m_xvalues.insert(xystrip).second;
33 bool yValueInserted =
m_yvalues.insert(xystrip).second;
34 if ((not
m_xvalues.empty()) and (not
m_yvalues.empty()) and xValueInserted and yValueInserted) {
61 IntSet::iterator pthisY;
67 IntSet::iterator pthisX;
74 int arrSize = e.numberOfPairs();
75 for(
int i=0; i<arrSize;++i){
76 os <<
"( " << e.xOfPairAt(i) <<
", " << e.yOfPairAt(i) <<
" )" << std::endl;
std::ostream & operator<<(std::ostream &os, const PairBuilder &e)
Overloaded "operator <<" for output of PairBuilder objects.
Contains class declaration for PairBuilder, and overloaded "operator <<" for output of same.
Class to build pairs of XY values.
int xOfPairAt(const int indx) const
Return the X value of a specific pair.
void formNewPairsWithY(const int yval)
int numberOfPairs() const
Return the number of XY pairs made.
const PairVector & pairs() const
Return the pairs as a vector of pairs of integers.
float weight() const
Return the 'weight', = 1/(number of pairs)
int yOfPairAt(const int indx) const
Return the Y value of a specific pair.
std::vector< XYPair > PairVector
void formNewPairsWithX(const int xval)
PairVector m_pairs
Vector to hold the pairs produced.
std::pair< int, int > XYPair
XYPair pairAtIndex(const int indx) const
Return a specific XY pair at some vector index.
IntSet m_xvalues
use sets to avoid duplicate values