KSquare Utilities
KKMLL::ClassProbList::VotesComparer Class Reference

Public Member Functions

 VotesComparer (bool _highToLow)
 
bool operator() (const ClassProbPtr left, const ClassProbPtr right)
 

Detailed Description

Definition at line 111 of file ClassProb.cpp.

Constructor & Destructor Documentation

KKMLL::ClassProbList::VotesComparer::VotesComparer ( bool  _highToLow)
inline

Definition at line 114 of file ClassProb.cpp.

Referenced by KKMLL::ClassProbList::SortByVotes().

114 : highToLow (_highToLow) {}

Member Function Documentation

bool KKMLL::ClassProbList::VotesComparer::operator() ( const ClassProbPtr  left,
const ClassProbPtr  right 
)
inline

Definition at line 116 of file ClassProb.cpp.

References KKMLL::ClassProb::probability, and KKMLL::ClassProb::votes.

119  {
120  if (left->votes == right->votes)
121  {
122  if (highToLow)
123  return (left->probability > right->probability);
124  else
125  return (left->probability < right->probability);
126  }
127  else
128  {
129  if (highToLow)
130  return (left->votes > right->votes);
131  else
132  return (left->votes < right->votes);
133  }
134  }
double probability
Definition: ClassProb.h:36

The documentation for this class was generated from the following file: