src/FitnessFunctions.cpp
int EchoBay::Comparator::get_nClasses(const Eigen::Ref<const MatrixBO> label)
{
    // Copy label
    ArrayBO _label = label.col(0).array();
    // Get number of classes
    // Sort vector
    std::sort(_label.data(), _label.data() + _label.size(), std::less<floatBO>());
    // Get uniques
    _nClasses = std::distance(_label.data(), std::unique(_label.data(), _label.data() + _label.size()));
    return _nClasses;
}
/**
 * @brief Return the number of classes in a classification label vector
 * 
 * @param label Eigen Matrix containing the different classes
 * @return int Number of unique classes found in the label Matrix
 */
@brief Return the number of classes in a classification label vector

@param label Eigen Matrix containing the different classes
@return int Number of unique classes found in the label Matrix
@brief Return the number of classes in a classification label vector @param label Eigen Matrix containing the different classes @return int Number of unique classes found in the label Matrix
int EchoBay::Comparator::get_nClasses(const Eigen::Ref<const MatrixBO> label)
{
    ArrayBO _label = label.col(0).array();
    std::sort(_label.data(), _label.data() + _label.size(), std::less<floatBO>());
    _nClasses = std::distance(_label.data(), std::unique(_label.data(), _label.data() + _label.size()));
    return _nClasses;
}
int EchoBay :: Comparator :: get_nClasses ( const Eigen :: Ref < const MatrixBO > label ) { ArrayBO _label = label . col ( 0 ) . array ( ) ; std :: sort ( _label . data ( ) , _label . data ( ) + _label . size ( ) , std :: less < floatBO > ( ) ) ; _nClasses = std :: distance ( _label . data ( ) , std :: unique ( _label . data ( ) , _label . data ( ) + _label . size ( ) ) ) ; return _nClasses ; }
@brief Return the number of classes in a classification label vector
@brief Return the number of classes in a classification label vector
// Copy label // Get number of classes // Sort vector // Get uniques