-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.h
More file actions
62 lines (54 loc) · 1.35 KB
/
Copy pathtypes.h
File metadata and controls
62 lines (54 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef _PARAMS_H
#define _PARAMS_H
#include <stdlib.h>
/**
* K Number of cluster
* T Number of iterations
* docs Number of docs
* trueK Number of classes
* ifile_nm Name of input file
* cfile_nm Name of class file
* ofile_nm Name of output file
*/
typedef struct {
int K, T, docs, dims, trueK;
char *ifile_nm, *cfile_nm, *ofile_nm;
} Params;
/**
* dnorms Array of document lengths
* cnorms Array of centroid lengths
* labels Array of assigned clusters
* docids Array of document ids
* classes Array of classes for each document
* best Array of best found labels
* K Same as Params.K: number of clusters
*/
typedef struct {
double *dnorms, *cnorms;
int *labels, *docids, *classes, *best;
int **C;
int K;
} Aux;
/**
* value Array of values in csr matrix
* row_ptr Array of begining row values (size = CSR.N)
* col_idx Array of column indeces corresponding to each value
* N Number of rows (Params.docs+1)
*/
typedef struct {
int *value, *row_ptr, *col_idx, N;
} CSR;
/**
* seed The seed which the current object represents
* obj The value of the objective function
* entropy The corresponding entropy value
* purity The corresponding purity value
*/
typedef struct {
int seed;
double obj, entropy, purity;
} Stats;
void free_params(Params p);
void free_aux(Aux a);
void free_csr(CSR csr);
#endif