16 #include "l/l_sys_def.h"
18 #warning "[Code police] Do not put 'using namespace' in global scope of header."
20 #warning "[Code police] Do not put 'using namespace' in global scope of header."
21 using namespace kjb_c;
58 CKMeans(
const int P,
const int K,
const int D,
float** ppData,
59 bool bTransposeData =
true);
71 void RefinedInit(
const int& SubsampleSize,
const int& J);
74 void InitWithMeanVectors(
float** ppMeanVectors);
87 int Iterate(
const int& nMaxIters = -1,
const int& nMaxChanges = -1,
88 const int& SmallestClusterSize = -1,
89 const int& Width = -1,
const int& Height = -1);
94 void Prune(
const float& StoppingFactor,
95 const int& StoppingK = -1);
101 int nK() {
return m_nK; }
111 kjb_int32* pRes = m_pPtClusters; m_pPtClusters = NULL;
return pRes;
115 inline void SwapParents(
const int& p,
const int& iNearestK,
116 const int& iParentK);
118 void CleanupMemberships2D(
const int& Width,
const int& Height);
123 void AssignClustersToPoints();
127 void ComputeClusterMeans();
129 void RemoveSmallClusters(
const int& SmallestSizeAllowed = 1);
132 inline int FindNearestClusterToPoint(
const int p);
138 inline float ComputeSquareDistance(
const int k,
const int p);
141 float ComputeTotalError();
168 bool m_bDeallocatePtsDims;
172 kjb_int32* m_pPtClusters;
176 int* m_pClusterNumpts;
182 float** m_ppClusterDimSums;
186 float** m_ppClusterDimMeans;
190 int* m_pClusterNumpts2;
191 float** m_ppClusterDimSums2;
192 float** m_ppClusterDimMeans2;
for k
Definition: APPgetLargeConnectedEdges.m:61
kjb_int32 * pPtClustersDetach()
Definition: kmeans.h:110
kjb_int32 * pPtClusters()
Definition: kmeans.h:106
int nK()
Definition: kmeans.h:101
D
Definition: APPgetLargeConnectedEdges.m:106