1.3.2
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

◆ CDATA

#define CDATA (   icl,
  ivar 
)    (cdata[(icl) * nvar + (ivar)])

◆ DATA

#define DATA (   iech,
  ivar 
)    (data[(iech) * nvar + (ivar)])

◆ DATA1

#define DATA1 (   iech,
  ivar 
)    (data1[(iech) * nvar + (ivar)])

◆ DATA2

#define DATA2 (   iech,
  ivar 
)    (data2[(iech) * nvar + (ivar)])

◆ DBL_MAXIMUM

#define DBL_MAXIMUM   1.e30

◆ DISTMATRIX

#define DISTMATRIX (   i,
 
)    (distmatrix[(i) * nech + (j)])

Function Documentation

◆ kclusters()

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

◆ kmedoids()

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