CCEX-1.0.0
Loading...
Searching...
No Matches
cluster.h
1#ifndef __CCEX_CLUSTER_H_
2#define __CCEX_CLUSTER_H_
3
4#include "general.h"
5#include "bath.h"
6#include "utilities.h"
7
16typedef struct {
17
21 int order;
22
27 int sK;
30
31 bool kmeans_pp;
33
37 char method[MAX_CHARARRAY_LENGTH];
38
60 int* nk;
61
74
99 int*** clusinfo;
100
101} Cluster;
102
103/* High Level --------------------------------------------------------*/
104
105
106
107// init
108Cluster* Cluster_init();
109void Cluster_clusterize(Cluster* cls, BathArray* ba, Config* config);
110
111// free
112void Cluster_freeAll(Cluster* cls);
113
114// MPI
115// int*** Clsuter_getLocalClusters_MPI(Cluster* cls);
116
117// find clusters
118// void Cluster_find_clusinfo_hash(Cluster* cls, BathArray* batharr, Config* config); // normal (hash) algorithm
119// void Cluster_find_clusinfo_dsj(Cluster* cls, BathArray* batharr, Config* config); // disjoint algorithm
120// void Cluster_find_clusinfo_itb(Cluster* cls, BathArray* batharr, Config* config); // inter-bathcluster algorithm
121// void Cluster_find_clusinfo_dsjitb(Cluster* cls, BathArray* batharr, Config* config); // disjoint + inter-bathcluster algorithm
122
123// report
124void Cluster_report(Cluster* cls);
125void Cluster_reportNk(Cluster* cls);
126void Cluster_reportClusinfo(Cluster* cls);
127void reportClusinfo(int*** clusinfo, int order);
128
129/* Low Level --------------------------------------------------------*/
130
131// clusinfo controller
132
133void Cluster_allocClusinfo(Cluster* cls, int order); // alloc clusinfo[order+1] : 0 ~ order
134void Cluster_freeClusinfo(Cluster* cls);
135
136void Cluster_setClusinfo_0th(Cluster* cls); // Actually do nothing
137void Cluster_setClusinfo_1th(Cluster* cls, BathArray* ba); // bathspins = clusinfo[1][j][k]
138int Cluster_setClusinfo_addcluster(Cluster* cls, int order, int iter, int* cluster); // add new cluster, return the index of the cluster
139void Cluster_setClusinfo_chgcluster(Cluster* cls, int order, int* cluster, int ic); // change cluster at ic-th cluster
140void Cluster_setClusinfo_chgiter(Cluster* cls, int order, int iter, int ic); // change iter at ic-th cluster
141
142//void Cluster_setSk(Cluster* cls, int sk); //
143//void Cluster_getSk(Cluster* cls); // output
144
145
146
147// what's iter :
148// The number how many you will multiply/divide
149// in the coherence calculation for 0 th order
150
151int Cluster_getClusinfo_ncluster(Cluster* cls, int order); // get the number of clusters at order
152int* Cluster_getClusinfo_itercluster(Cluster* cls, int order, int ic); // get ic-th iter+cluster at order [0] = iter, [1~] = cluster
153int Cluster_getClusinfo_iter(Cluster* cls, int order, int ic); // get ic-th iter+cluster at order [0] = iter, [1~] = cluster
154int* Cluster_getClusinfo_cluster_copy(Cluster* cls, int order, int ic); // get ic-th cluster at order (copy)
155int*** Cluster_getClusinfo(Cluster* cls);
156
157// nk controller
158void Cluster_allocNk(Cluster* cls);
159void Cluster_freeNk(Cluster* qa);
160int Cluster_getNk_order(Cluster* cls, int i); // get the number of clusters at ith-orderr at ith-order
161int* Cluster_getNk(Cluster* cls);
162
163// others controller
164char* Cluster_getMethod(Cluster* cls);
165int Cluster_getOrder(Cluster* cls);
166bool Cluster_getAddsubclus(Cluster* cls);
167int Cluster_getSk(Cluster* cls);
168int Cluster_getMax_iter(Cluster* cls);
169int Cluster_getMax_trial(Cluster* cls);
170bool Cluster_getKmeans_pp(Cluster* cls);
171bool Cluster_getIter_detail(Cluster* cls);
172
173// set
174void Cluster_setOrder(Cluster* cls, int order);
175void Cluster_setMethod(Cluster* cls, char* method);
176void Cluster_setAddsubclus(Cluster* cls, bool addsubclus);
177void Cluster_setNk(Cluster* cls, int* nk); // set the number of clusters at ith-order
178void Cluster_setSk(Cluster* cls, int sK);
179void Cluster_setMax_trial(Cluster* cls, int max_trial);
180void Cluster_setMax_iter(Cluster* cls, int max_iter);
181void Cluster_setKmeans_pp(Cluster* cls, bool kmeans_pp);
182void Cluster_setIter_detail(Cluster* cls, bool iter_detail);
183
184#endif // __CCEX_CLUSTER_H_
Definition bath.h:131
Definition cluster.h:16
int * nk
The number of clusters for each order "k".
Definition cluster.h:60
int max_trial
Definition cluster.h:28
int max_iter
Definition cluster.h:29
bool addsubclus
Include all sub-clusters of the highest order : on | off.
Definition cluster.h:73
int sK
parameters of pCCE
Definition cluster.h:27
bool iter_detail
Definition cluster.h:32
char method[MAX_CHARARRAY_LENGTH]
Clustering algorithm : See details in Config::method.
Definition cluster.h:37
bool kmeans_pp
Definition cluster.h:31
int order
Clusterizing order : See details in Config::order.
Definition cluster.h:21
int *** clusinfo
The clusters for each order "k".
Definition cluster.h:99
Definition general.h:12