kmeans.hh File Reference
#include <vector>
#include <numeric>
#include <cmath>
#include <stdexcept>
#include <iomanip>
#include <limits>
#include <mia/core/defines.hh>
#include <mia/core/errormacro.hh>
#include <mia/core/msgstream.hh>
#include <boost/concept/requires.hpp>
#include <boost/concept_check.hpp>
Include dependency graph for kmeans.hh:

Go to the source code of this file.

Functions

template<typename InputIterator , typename OutputIterator >
void kmeans (InputIterator ibegin, InputIterator iend, OutputIterator obegin, std::vector< double > &classes)
 
int EXPORT_CORE kmeans_get_closest_clustercenter (const std::vector< double > &classes, size_t l, double value)
 
template<typename InputIterator , typename OutputIterator >
bool kmeans_step (InputIterator ibegin, InputIterator iend, OutputIterator obegin, std::vector< double > &classes, size_t l, int &biggest_class)
 
template<typename InputIterator , typename OutputIterator >
bool kmeans_step_with_fixed_centers (InputIterator ibegin, InputIterator iend, OutputIterator obegin, std::vector< double > &classes, const std::vector< bool > &fixed_center, size_t l, int &biggest_class)
 

Function Documentation

◆ kmeans_get_closest_clustercenter()

int EXPORT_CORE kmeans_get_closest_clustercenter ( const std::vector< double > &  classes,
size_t  l,
double  value 
)

◆ kmeans_step()

template<typename InputIterator , typename OutputIterator >
bool kmeans_step ( InputIterator  ibegin,
InputIterator  iend,
OutputIterator  obegin,
std::vector< double > &  classes,
size_t  l,
int &  biggest_class 
)

Definition at line 41 of file kmeans.hh.

References cvdebug(), cverb, cvinfo(), fabs(), and kmeans_get_closest_clustercenter().

Referenced by kmeans().

◆ kmeans_step_with_fixed_centers()

template<typename InputIterator , typename OutputIterator >
bool kmeans_step_with_fixed_centers ( InputIterator  ibegin,
InputIterator  iend,
OutputIterator  obegin,
std::vector< double > &  classes,
const std::vector< bool > &  fixed_center,
size_t  l,
int &  biggest_class 
)

Definition at line 105 of file kmeans.hh.

References cvdebug(), cverb, cvinfo(), fabs(), and kmeans_get_closest_clustercenter().