TrdMCClusterR Fit Classifier
Functions
VectorUtilities Namespace Reference

Functions

double sumVector (const std::vector< double > &v)
 
template<typename T >
void printVector (const std::vector< T > &v)
 
void printVectorOfVectors (std::vector< std::vector< double >> const &mat)
 
std::map< int, int > GetUniqueElementsAndFrequency (const std::vector< int > &vec)
 
void filterAndShrinkMap (std::map< int, int > &frequencyMap, int threshold=2)
 
template<typename T >
bool areAllElementsEqual (const std::vector< T > &vec)
 
int getMajorityElement (const std::vector< int > &vec)
 
int countDifferentFromMajority (const std::vector< int > &vec)
 
std::vector< double > TVectorDToStdVector (const TVectorD &vec)
 
bool AreVectorsEqual (const std::vector< double > &vec1, const std::vector< double > &vec2, double tol=1e-4)
 

Function Documentation

◆ areAllElementsEqual()

template<typename T >
bool VectorUtilities::areAllElementsEqual ( const std::vector< T > &  vec)
Here is the caller graph for this function:

◆ AreVectorsEqual()

bool VectorUtilities::AreVectorsEqual ( const std::vector< double > &  vec1,
const std::vector< double > &  vec2,
double  tol = 1e-4 
)
Here is the caller graph for this function:

◆ countDifferentFromMajority()

int VectorUtilities::countDifferentFromMajority ( const std::vector< int > &  vec)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filterAndShrinkMap()

void VectorUtilities::filterAndShrinkMap ( std::map< int, int > &  frequencyMap,
int  threshold = 2 
)

Shrinking the map by swapping with a temporary copy.

Here is the caller graph for this function:

◆ getMajorityElement()

int VectorUtilities::getMajorityElement ( const std::vector< int > &  vec)

Count the frequency of each element in the vector

Find the majority element

Here is the caller graph for this function:

◆ GetUniqueElementsAndFrequency()

std::map<int, int> VectorUtilities::GetUniqueElementsAndFrequency ( const std::vector< int > &  vec)
Here is the caller graph for this function:

◆ printVector()

template<typename T >
void VectorUtilities::printVector ( const std::vector< T > &  v)
Here is the caller graph for this function:

◆ printVectorOfVectors()

void VectorUtilities::printVectorOfVectors ( std::vector< std::vector< double >> const &  mat)

useful for debugging; printing out particle vector of vectors to terminal

Here is the caller graph for this function:

◆ sumVector()

double VectorUtilities::sumVector ( const std::vector< double > &  v)

◆ TVectorDToStdVector()

std::vector<double> VectorUtilities::TVectorDToStdVector ( const TVectorD &  vec)
Here is the caller graph for this function: