1.2.1
CCC
 
cluster.cpp File Reference
#include "geoslib_old_f.h"
#include "Basic/Law.hpp"
#include <limits.h>

Macros

#define DBL_MAXIMUM   1.e30
 
#define DATA(iech, ivar)   (data[(iech) * nvar + (ivar)])
 
#define DATA1(iech, ivar)   (data1[(iech) * nvar + (ivar)])
 
#define DATA2(iech, ivar)   (data2[(iech) * nvar + (ivar)])
 
#define CDATA(icl, ivar)   (cdata[(icl) * nvar + (ivar)])
 
#define DISTMATRIX(i, j)   (distmatrix[(i) * nech + (j)])
 

Functions

double * kclusters (double *data, int nvar, int nech, int nclusters, int npass, int mode, int verbose)
 
int * kmedoids (double *data, int nvar, int nech, int nclusters, int npass, int verbose)
 

Macro Definition Documentation

#define CDATA (   icl,
  ivar 
)    (cdata[(icl) * nvar + (ivar)])
#define DATA (   iech,
  ivar 
)    (data[(iech) * nvar + (ivar)])
#define DATA1 (   iech,
  ivar 
)    (data1[(iech) * nvar + (ivar)])
#define DATA2 (   iech,
  ivar 
)    (data2[(iech) * nvar + (ivar)])
#define DBL_MAXIMUM   1.e30
#define DISTMATRIX (   i,
 
)    (distmatrix[(i) * nech + (j)])

Function Documentation

double* kclusters ( double *  data,
int  nvar,
int  nech,
int  nclusters,
int  npass,
int  mode,
int  verbose 
)

Perform k-means clustering on a given set of variables. The number of clusters is given in input

Returns
Array of cluster coordinates
Parameters
[in]dataArray of values
[in]nvarNumber of samples
[in]nechNumber of variables
[in]nclustersNumber if clusters
[in]npassNumber of times clustering is performed
[in]mode0 for k-means and 1 for k-medians
[in]verboseVerbose option
int* kmedoids ( double *  data,
int  nvar,
int  nech,
int  nclusters,
int  npass,
int  verbose 
)

Perform k-medoids clustering on a given set of variables. The number of clusters is given in input

Returns
Array of cluster indices
Parameters
[in]dataArray of values
[in]nvarNumber of samples
[in]nechNumber of variables
[in]nclustersNumber if clusters
[in]npassNumber of times clustering is performed
[in]verboseVerbose option