gk_proto.h
Go to the documentation of this file.
1 
10 #ifndef _GK_PROTO_H_
11 #define _GK_PROTO_H_
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 /*-------------------------------------------------------------
18  * blas.c
19  *-------------------------------------------------------------*/
20 GK_MKBLAS_PROTO(gk_c, char, int)
21 GK_MKBLAS_PROTO(gk_i, int, int)
22 GK_MKBLAS_PROTO(gk_i32, int32_t, int32_t)
23 GK_MKBLAS_PROTO(gk_i64, int64_t, int64_t)
24 GK_MKBLAS_PROTO(gk_z, ssize_t, ssize_t)
25 GK_MKBLAS_PROTO(gk_f, float, float)
26 GK_MKBLAS_PROTO(gk_d, double, double)
27 GK_MKBLAS_PROTO(gk_idx, gk_idx_t, gk_idx_t)
28 
29 
30 
31 
32 /*-------------------------------------------------------------
33  * io.c
34  *-------------------------------------------------------------*/
35 FILE *gk_fopen(char *, char *, const char *);
36 void gk_fclose(FILE *);
37 gk_idx_t gk_getline(char **lineptr, size_t *n, FILE *stream);
38 char **gk_readfile(char *fname, gk_idx_t *r_nlines);
39 int32_t *gk_i32readfile(char *fname, gk_idx_t *r_nlines);
40 int64_t *gk_i64readfile(char *fname, gk_idx_t *r_nlines);
41 int32_t *gk_i32readfilebin(char *fname, ssize_t *r_nelmnts);
42 int64_t *gk_i64readfilebin(char *fname, ssize_t *r_nelmnts);
43 float *gk_freadfilebin(char *fname, ssize_t *r_nelmnts);
44 size_t gk_fwritefilebin(char *fname, size_t n, float *a);
45 double *gk_dreadfilebin(char *fname, ssize_t *r_nelmnts);
46 
47 
48 
49 
50 /*-------------------------------------------------------------
51  * fs.c
52  *-------------------------------------------------------------*/
53 int gk_fexists(char *);
54 int gk_dexists(char *);
55 intmax_t gk_getfsize(char *);
56 void gk_getfilestats(char *fname, size_t *r_nlines, size_t *r_ntokens,
57  size_t *r_max_nlntokens, size_t *r_nbytes);
58 char *gk_getbasename(char *path);
59 char *gk_getextname(char *path);
60 char *gk_getfilename(char *path);
61 char *gk_getpathname(char *path);
62 int gk_mkpath(char *);
63 int gk_rmpath(char *);
64 
65 
66 
67 /*-------------------------------------------------------------
68  * memory.c
69  *-------------------------------------------------------------*/
70 GK_MKALLOC_PROTO(gk_c, char)
71 GK_MKALLOC_PROTO(gk_i, int)
72 GK_MKALLOC_PROTO(gk_i32, int32_t)
73 GK_MKALLOC_PROTO(gk_i64, int64_t)
74 GK_MKALLOC_PROTO(gk_z, ssize_t)
75 GK_MKALLOC_PROTO(gk_f, float)
76 GK_MKALLOC_PROTO(gk_d, double)
77 GK_MKALLOC_PROTO(gk_idx, gk_idx_t)
78 
79 GK_MKALLOC_PROTO(gk_ckv, gk_ckv_t)
80 GK_MKALLOC_PROTO(gk_ikv, gk_ikv_t)
81 GK_MKALLOC_PROTO(gk_i32kv, gk_i32kv_t)
82 GK_MKALLOC_PROTO(gk_i64kv, gk_i64kv_t)
83 GK_MKALLOC_PROTO(gk_zkv, gk_zkv_t)
84 GK_MKALLOC_PROTO(gk_fkv, gk_fkv_t)
85 GK_MKALLOC_PROTO(gk_dkv, gk_dkv_t)
86 GK_MKALLOC_PROTO(gk_skv, gk_skv_t)
87 GK_MKALLOC_PROTO(gk_idxkv, gk_idxkv_t)
88 
89 void gk_AllocMatrix(void ***, size_t, size_t , size_t);
90 void gk_FreeMatrix(void ***, size_t, size_t);
91 int gk_malloc_init();
92 void gk_malloc_cleanup(int showstats);
93 void *gk_malloc(size_t nbytes, char *msg);
94 void *gk_realloc(void *oldptr, size_t nbytes, char *msg);
95 void gk_free(void **ptr1,...);
96 size_t gk_GetCurMemoryUsed();
97 size_t gk_GetMaxMemoryUsed();
98 
99 
100 
101 /*-------------------------------------------------------------
102  * seq.c
103  *-------------------------------------------------------------*/
104 gk_seq_t *gk_seq_ReadGKMODPSSM(char *file_name);
105 gk_i2cc2i_t *gk_i2cc2i_create_common(char *alphabet);
106 void gk_seq_init(gk_seq_t *seq);
107 
108 
109 
110 
111 /*-------------------------------------------------------------
112  * pdb.c
113  *-------------------------------------------------------------*/
114 char gk_threetoone(char *res);
115 void gk_freepdbf(pdbf *p);
116 pdbf *gk_readpdbfile(char *fname);
117 void gk_writefullatom(pdbf *p, char *fname);
118 void gk_writebackbone(pdbf *p, char *fname);
119 void gk_writealphacarbons(pdbf *p, char *fname);
120 void gk_showcorruption(pdbf *p);
121 
122 
123 /*-------------------------------------------------------------
124  * error.c
125  *-------------------------------------------------------------*/
126 void gk_set_exit_on_error(int value);
127 void errexit(char *,...);
128 void gk_errexit(int signum, char *,...);
129 int gk_sigtrap();
130 int gk_siguntrap();
131 void gk_sigthrow(int signum);
132 void gk_SetSignalHandlers();
134 void gk_NonLocalExit_Handler(int signum);
135 char *gk_strerror(int errnum);
136 void PrintBackTrace();
137 
138 
139 /*-------------------------------------------------------------
140  * util.c
141  *-------------------------------------------------------------*/
142 void gk_RandomPermute(size_t, int *, int);
143 void gk_array2csr(size_t n, size_t range, int *array, int *ptr, int *ind);
144 int gk_log2(int);
145 int gk_ispow2(int);
146 float gk_flog2(float);
147 
148 
149 /*-------------------------------------------------------------
150  * time.c
151  *-------------------------------------------------------------*/
153 double gk_CPUSeconds(void);
154 
155 /*-------------------------------------------------------------
156  * string.c
157  *-------------------------------------------------------------*/
158 char *gk_strchr_replace(char *str, char *fromlist, char *tolist);
159 int gk_strstr_replace(char *str, char *pattern, char *replacement, char *options, char **new_str);
160 char *gk_strtprune(char *, char *);
161 char *gk_strhprune(char *, char *);
162 char *gk_strtoupper(char *);
163 char *gk_strtolower(char *);
164 char *gk_strdup(char *orgstr);
165 int gk_strcasecmp(char *s1, char *s2);
166 int gk_strrcmp(char *s1, char *s2);
167 char *gk_time2str(time_t time);
168 time_t gk_str2time(char *str);
169 int gk_GetStringID(gk_StringMap_t *strmap, char *key);
170 
171 
172 
173 /*-------------------------------------------------------------
174  * sort.c
175  *-------------------------------------------------------------*/
176 void gk_csorti(size_t, char *);
177 void gk_csortd(size_t, char *);
178 void gk_isorti(size_t, int *);
179 void gk_isortd(size_t, int *);
180 void gk_fsorti(size_t, float *);
181 void gk_fsortd(size_t, float *);
182 void gk_dsorti(size_t, double *);
183 void gk_dsortd(size_t, double *);
184 void gk_idxsorti(size_t, gk_idx_t *);
185 void gk_idxsortd(size_t, gk_idx_t *);
186 void gk_ckvsorti(size_t, gk_ckv_t *);
187 void gk_ckvsortd(size_t, gk_ckv_t *);
188 void gk_ikvsorti(size_t, gk_ikv_t *);
189 void gk_ikvsortd(size_t, gk_ikv_t *);
190 void gk_i32kvsorti(size_t, gk_i32kv_t *);
191 void gk_i32kvsortd(size_t, gk_i32kv_t *);
192 void gk_i64kvsorti(size_t, gk_i64kv_t *);
193 void gk_i64kvsortd(size_t, gk_i64kv_t *);
194 void gk_zkvsorti(size_t, gk_zkv_t *);
195 void gk_zkvsortd(size_t, gk_zkv_t *);
196 void gk_fkvsorti(size_t, gk_fkv_t *);
197 void gk_fkvsortd(size_t, gk_fkv_t *);
198 void gk_dkvsorti(size_t, gk_dkv_t *);
199 void gk_dkvsortd(size_t, gk_dkv_t *);
200 void gk_skvsorti(size_t, gk_skv_t *);
201 void gk_skvsortd(size_t, gk_skv_t *);
202 void gk_idxkvsorti(size_t, gk_idxkv_t *);
203 void gk_idxkvsortd(size_t, gk_idxkv_t *);
204 
205 
206 /*-------------------------------------------------------------
207  * Selection routines
208  *-------------------------------------------------------------*/
209 int gk_dfkvkselect(size_t, int, gk_fkv_t *);
210 int gk_ifkvkselect(size_t, int, gk_fkv_t *);
211 
212 
213 /*-------------------------------------------------------------
214  * Priority queue
215  *-------------------------------------------------------------*/
216 GK_MKPQUEUE_PROTO(gk_ipq, gk_ipq_t, int, gk_idx_t)
217 GK_MKPQUEUE_PROTO(gk_i32pq, gk_i32pq_t, int32_t, gk_idx_t)
218 GK_MKPQUEUE_PROTO(gk_i64pq, gk_i64pq_t, int64_t, gk_idx_t)
219 GK_MKPQUEUE_PROTO(gk_fpq, gk_fpq_t, float, gk_idx_t)
220 GK_MKPQUEUE_PROTO(gk_dpq, gk_dpq_t, double, gk_idx_t)
221 GK_MKPQUEUE_PROTO(gk_idxpq, gk_idxpq_t, gk_idx_t, gk_idx_t)
222 
223 
224 /*-------------------------------------------------------------
225  * HTable routines
226  *-------------------------------------------------------------*/
227 gk_HTable_t *HTable_Create(int nelements);
228 void HTable_Reset(gk_HTable_t *htable);
229 void HTable_Resize(gk_HTable_t *htable, int nelements);
230 void HTable_Insert(gk_HTable_t *htable, int key, int val);
231 void HTable_Delete(gk_HTable_t *htable, int key);
232 int HTable_Search(gk_HTable_t *htable, int key);
233 int HTable_GetNext(gk_HTable_t *htable, int key, int *val, int type);
234 int HTable_SearchAndDelete(gk_HTable_t *htable, int key);
235 void HTable_Destroy(gk_HTable_t *htable);
236 int HTable_HFunction(int nelements, int key);
237 
238 
239 /*-------------------------------------------------------------
240  * Tokenizer routines
241  *-------------------------------------------------------------*/
242 void gk_strtokenize(char *line, char *delim, gk_Tokens_t *tokens);
243 void gk_freetokenslist(gk_Tokens_t *tokens);
244 
245 /*-------------------------------------------------------------
246  * Encoder/Decoder
247  *-------------------------------------------------------------*/
248 void encodeblock(unsigned char *in, unsigned char *out);
249 void decodeblock(unsigned char *in, unsigned char *out);
250 void GKEncodeBase64(int nbytes, unsigned char *inbuffer, unsigned char *outbuffer);
251 void GKDecodeBase64(int nbytes, unsigned char *inbuffer, unsigned char *outbuffer);
252 
253 
254 /*-------------------------------------------------------------
255  * random.c
256  *-------------------------------------------------------------*/
257 GK_MKRANDOM_PROTO(gk_c, size_t, char)
258 GK_MKRANDOM_PROTO(gk_i, size_t, int)
259 GK_MKRANDOM_PROTO(gk_f, size_t, float)
260 GK_MKRANDOM_PROTO(gk_d, size_t, double)
261 GK_MKRANDOM_PROTO(gk_idx, size_t, gk_idx_t)
262 GK_MKRANDOM_PROTO(gk_z, size_t, ssize_t)
263 void gk_randinit(uint64_t);
264 uint64_t gk_randint64(void);
265 uint32_t gk_randint32(void);
266 
267 
268 /*-------------------------------------------------------------
269  * OpenMP fake functions
270  *-------------------------------------------------------------*/
271 #if !defined(__OPENMP__)
272 void omp_set_num_threads(int num_threads);
273 int omp_get_num_threads(void);
274 int omp_get_max_threads(void);
275 int omp_get_thread_num(void);
276 int omp_get_num_procs(void);
277 int omp_in_parallel(void);
278 void omp_set_dynamic(int num_threads);
279 int omp_get_dynamic(void);
280 void omp_set_nested(int nested);
281 int omp_get_nested(void);
282 #endif /* __OPENMP__ */
283 
284 
285 /*-------------------------------------------------------------
286  * CSR-related functions
287  *-------------------------------------------------------------*/
289 void gk_csr_Init(gk_csr_t *mat);
290 void gk_csr_Free(gk_csr_t **mat);
293 gk_csr_t *gk_csr_ExtractSubmatrix(gk_csr_t *mat, int rstart, int nrows);
294 gk_csr_t *gk_csr_ExtractRows(gk_csr_t *mat, int nrows, int *rind);
296 gk_csr_t **gk_csr_Split(gk_csr_t *mat, int *color);
297 gk_csr_t *gk_csr_Read(char *filename, int format, int readvals, int numbering);
298 void gk_csr_Write(gk_csr_t *mat, char *filename, int format, int writevals, int numbering);
299 gk_csr_t *gk_csr_Prune(gk_csr_t *mat, int what, int minf, int maxf);
300 gk_csr_t *gk_csr_LowFilter(gk_csr_t *mat, int what, int norm, float fraction);
301 gk_csr_t *gk_csr_TopKPlusFilter(gk_csr_t *mat, int what, int topk, float keepval);
302 gk_csr_t *gk_csr_ZScoreFilter(gk_csr_t *mat, int what, float zscore);
304 void gk_csr_SortIndices(gk_csr_t *mat, int what);
305 void gk_csr_CreateIndex(gk_csr_t *mat, int what);
306 void gk_csr_Normalize(gk_csr_t *mat, int what, int norm);
307 void gk_csr_Scale(gk_csr_t *mat, int type);
308 void gk_csr_ComputeSums(gk_csr_t *mat, int what);
309 void gk_csr_ComputeSquaredNorms(gk_csr_t *mat, int what);
310 float gk_csr_ComputeSimilarity(gk_csr_t *mat, int i1, int i2, int what, int simtype);
311 int gk_csr_GetSimilarRows(gk_csr_t *mat, int nqterms, int *qind, float *qval,
312  int simtype, int nsim, float minsim, gk_fkv_t *hits, int *_imarker,
313  gk_fkv_t *i_cand);
314 
315 
316 
317 /* itemsets.c */
318 void gk_find_frequent_itemsets(int ntrans, ssize_t *tranptr, int *tranind,
319  int minfreq, int maxfreq, int minlen, int maxlen,
320  void (*process_itemset)(void *stateptr, int nitems, int *itemind,
321  int ntrans, int *tranind),
322  void *stateptr);
323 
324 
325 /* evaluate.c */
326 float ComputeAccuracy(int n, gk_fkv_t *list);
327 float ComputeROCn(int n, int maxN, gk_fkv_t *list);
328 float ComputeMedianRFP(int n, gk_fkv_t *list);
329 float ComputeMean (int n, float *values);
330 float ComputeStdDev(int n, float *values);
331 
332 
333 /* mcore.c */
334 gk_mcore_t *gk_mcoreCreate(size_t coresize);
336 void gk_mcoreDestroy(gk_mcore_t **r_mcore, int showstats);
337 void gk_gkmcoreDestroy(gk_mcore_t **r_mcore, int showstats);
338 void *gk_mcoreMalloc(gk_mcore_t *mcore, size_t nbytes);
339 void gk_mcorePush(gk_mcore_t *mcore);
340 void gk_gkmcorePush(gk_mcore_t *mcore);
341 void gk_mcorePop(gk_mcore_t *mcore);
342 void gk_gkmcorePop(gk_mcore_t *mcore);
343 void gk_mcoreAdd(gk_mcore_t *mcore, int type, size_t nbytes, void *ptr);
344 void gk_gkmcoreAdd(gk_mcore_t *mcore, int type, size_t nbytes, void *ptr);
345 void gk_mcoreDel(gk_mcore_t *mcore, void *ptr);
346 void gk_gkmcoreDel(gk_mcore_t *mcore, void *ptr);
347 
348 /* rw.c */
349 int gk_rw_PageRank(gk_csr_t *mat, float lamda, float eps, int max_niter, float *pr);
350 
351 
352 /* graph.c */
357 gk_graph_t *gk_graph_Read(char *filename, int format, int isfewgts,
358  int isfvwgts, int isfvsizes);
359 void gk_graph_Write(gk_graph_t *graph, char *filename, int format);
361 gk_graph_t *gk_graph_ExtractSubgraph(gk_graph_t *graph, int vstart, int nvtxs);
362 gk_graph_t *gk_graph_Reorder(gk_graph_t *graph, int32_t *perm, int32_t *iperm);
363 int gk_graph_FindComponents(gk_graph_t *graph, int32_t *cptr, int32_t *cind);
364 void gk_graph_ComputeBFSOrdering(gk_graph_t *graph, int v, int32_t **r_perm,
365  int32_t **r_iperm);
366 void gk_graph_ComputeBestFOrdering0(gk_graph_t *graph, int v, int type,
367  int32_t **r_perm, int32_t **r_iperm);
368 void gk_graph_ComputeBestFOrdering(gk_graph_t *graph, int v, int type,
369  int32_t **r_perm, int32_t **r_iperm);
370 void gk_graph_SingleSourceShortestPaths(gk_graph_t *graph, int v, void **r_sps);
371 
372 
373 
374 
375 #ifdef __cplusplus
376 }
377 #endif
378 
379 
380 #endif
381 
void gk_csr_Scale(gk_csr_t *mat, int type)
Definition: csr.c:1386
void gk_isorti(size_t, int *)
Definition: sort.c:45
gk_graph_t * gk_graph_Read(char *filename, int format, int isfewgts, int isfvwgts, int isfvsizes)
Definition: GKlib/graph.c:85
void gk_csr_Write(gk_csr_t *mat, char *filename, int format, int writevals, int numbering)
Definition: csr.c:591
gk_csr_t * gk_csr_ExtractRows(gk_csr_t *mat, int nrows, int *rind)
Definition: csr.c:191
FILE * gk_fopen(char *, char *, const char *)
Definition: GKlib/io.c:24
void gk_fkvsorti(size_t, gk_fkv_t *)
Definition: sort.c:245
gk_csr_t * gk_csr_ExtractPartition(gk_csr_t *mat, int *part, int pid)
Definition: csr.c:230
void gk_randinit(uint64_t)
Definition: random.c:71
gk_csr_t * gk_csr_Prune(gk_csr_t *mat, int what, int minf, int maxf)
Definition: csr.c:669
void gk_freepdbf(pdbf *p)
Frees the memory of a pdbf structure.
Definition: pdb.c:105
ssize_t gk_idx_t
Definition: gk_types.h:22
void gk_csr_Free(gk_csr_t **mat)
Definition: csr.c:48
void gk_csr_CompactColumns(gk_csr_t *mat)
Definition: csr.c:1098
char * gk_time2str(time_t time)
Converts a time_t time into a string.
Definition: string.c:470
void gk_SetSignalHandlers()
Definition: error.c:145
void gk_i64kvsorti(size_t, gk_i64kv_t *)
Definition: sort.c:201
void gk_ikvsorti(size_t, gk_ikv_t *)
Definition: sort.c:157
void gk_showcorruption(pdbf *p)
Decodes the corruption bitswitch and prints any problems.
Definition: pdb.c:435
void gk_strtokenize(char *line, char *delim, gk_Tokens_t *tokens)
Definition: tokenizer.c:22
void PrintBackTrace()
Definition: error.c:198
char * gk_strtprune(char *, char *)
Prunes characters from the end of the string.
Definition: string.c:254
int gk_fexists(char *)
Definition: fs.c:21
idx_t idx_t idx_t idx_t idx_t idx_t idx_t real_t real_t idx_t idx_t idx_t * part
void gk_csr_FreeContents(gk_csr_t *mat)
Definition: csr.c:63
gk_graph_t * gk_graph_Reorder(gk_graph_t *graph, int32_t *perm, int32_t *iperm)
Definition: GKlib/graph.c:460
void gk_errexit(int signum, char *,...)
Definition: error.c:77
time_t gk_str2time(char *str)
Converts a date/time string into its equivalent time_t value.
Definition: string.c:499
void gk_skvsortd(size_t, gk_skv_t *)
Definition: sort.c:300
void gk_fsorti(size_t, float *)
Definition: sort.c:67
void gk_set_exit_on_error(int value)
Definition: error.c:43
void gk_mcoreDel(gk_mcore_t *mcore, void *ptr)
Definition: mcore.c:345
gk_csr_t ** gk_csr_Split(gk_csr_t *mat, int *color)
Definition: csr.c:277
pdbf * gk_readpdbfile(char *fname)
Reads a pdb file into a pdbf structure.
Definition: pdb.c:132
void gk_NonLocalExit_Handler(int signum)
Definition: error.c:166
void HTable_Resize(gk_HTable_t *htable, int nelements)
Definition: htable.c:46
void gk_graph_Write(gk_graph_t *graph, char *filename, int format)
Definition: GKlib/graph.c:277
void gk_zkvsorti(size_t, gk_zkv_t *)
Definition: sort.c:223
ArrayXcf v
Definition: Cwise_arg.cpp:1
size_t gk_GetMaxMemoryUsed()
Definition: memory.c:246
int gk_rmpath(char *)
Definition: fs.c:219
char * gk_strchr_replace(char *str, char *fromlist, char *tolist)
Replaces certain characters in a string.
Definition: string.c:37
Definition: numpy.h:543
void gk_graph_Free(gk_graph_t **graph)
Definition: GKlib/graph.c:48
int n
leaf::MyValues values
gk_graph_t * gk_graph_Create()
Definition: GKlib/graph.c:19
void gk_FreeMatrix(void ***, size_t, size_t)
Definition: memory.c:79
int omp_in_parallel(void)
idx_t idx_t idx_t idx_t idx_t idx_t * iperm
void gk_writealphacarbons(pdbf *p, char *fname)
Writes out all the alpha carbon atoms of a structure.
Definition: pdb.c:413
void gk_skvsorti(size_t, gk_skv_t *)
Definition: sort.c:289
void HTable_Insert(gk_HTable_t *htable, int key, int val)
Definition: htable.c:74
NonlinearFactorGraph graph
void gk_i32kvsortd(size_t, gk_i32kv_t *)
Definition: sort.c:190
gk_mcore_t * gk_gkmcoreCreate()
Definition: mcore.c:43
void gk_fkvsortd(size_t, gk_fkv_t *)
Definition: sort.c:256
int gk_log2(int)
Definition: GKlib/util.c:83
void gk_idxsorti(size_t, gk_idx_t *)
Definition: sort.c:111
void gk_writefullatom(pdbf *p, char *fname)
Writes all atoms in p in pdb-format to file fname.
Definition: pdb.c:371
void gk_gkmcoreAdd(gk_mcore_t *mcore, int type, size_t nbytes, void *ptr)
Definition: mcore.c:309
int gk_siguntrap()
Definition: error.c:116
int HTable_HFunction(int nelements, int key)
Definition: htable.c:244
void gk_mcoreAdd(gk_mcore_t *mcore, int type, size_t nbytes, void *ptr)
Definition: mcore.c:265
int omp_get_num_threads(void)
void GKDecodeBase64(int nbytes, unsigned char *inbuffer, unsigned char *outbuffer)
Definition: b64.c:85
char * gk_getfilename(char *path)
Definition: fs.c:173
int gk_ifkvkselect(size_t, int, gk_fkv_t *)
Definition: fkvkselect.c:84
char * gk_strtoupper(char *)
Converts a string to upper case.
Definition: string.c:328
Array33i a
int64_t intmax_t
Definition: ms_stdint.h:128
void * gk_mcoreMalloc(gk_mcore_t *mcore, size_t nbytes)
Definition: mcore.c:140
char * gk_strerror(int errnum)
Thread-safe implementation of strerror()
Definition: error.c:175
void gk_dsortd(size_t, double *)
Definition: sort.c:100
int gk_ispow2(int)
Definition: GKlib/util.c:95
char * gk_strtolower(char *)
Converts a string to lower case.
Definition: string.c:348
char * gk_getextname(char *path)
Definition: fs.c:159
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
gk_mcore_t * gk_mcoreCreate(size_t coresize)
Definition: mcore.c:18
size_t gk_GetCurMemoryUsed()
Definition: memory.c:233
void * gk_realloc(void *oldptr, size_t nbytes, char *msg)
Definition: memory.c:172
char * gk_getpathname(char *path)
float ComputeMedianRFP(int n, gk_fkv_t *list)
Definition: evaluate.c:81
void GKEncodeBase64(int nbytes, unsigned char *inbuffer, unsigned char *outbuffer)
Definition: b64.c:64
gk_wclock_t gk_WClockSeconds(void)
Definition: timers.c:19
void gk_ckvsortd(size_t, gk_ckv_t *)
Definition: sort.c:146
gk_idx_t gk_getline(char **lineptr, size_t *n, FILE *stream)
Definition: GKlib/io.c:57
void gk_idxkvsorti(size_t, gk_idxkv_t *)
Definition: sort.c:311
void encodeblock(unsigned char *in, unsigned char *out)
Definition: b64.c:28
void gk_freetokenslist(gk_Tokens_t *tokens)
Definition: tokenizer.c:73
void gk_csr_SortIndices(gk_csr_t *mat, int what)
Definition: csr.c:1146
void gk_array2csr(size_t n, size_t range, int *array, int *ptr, int *ind)
Converts an element-based set membership into a CSR-format set-based membership.
Definition: GKlib/util.c:62
void gk_ikvsortd(size_t, gk_ikv_t *)
Definition: sort.c:168
void gk_csortd(size_t, char *)
Definition: sort.c:34
char ** gk_readfile(char *fname, gk_idx_t *r_nlines)
Definition: GKlib/io.c:103
int gk_csr_GetSimilarRows(gk_csr_t *mat, int nqterms, int *qind, float *qval, int simtype, int nsim, float minsim, gk_fkv_t *hits, int *_imarker, gk_fkv_t *i_cand)
Definition: csr.c:1866
void gk_i64kvsortd(size_t, gk_i64kv_t *)
Definition: sort.c:212
void gk_graph_FreeContents(gk_graph_t *graph)
Definition: GKlib/graph.c:63
void gk_gkmcoreDestroy(gk_mcore_t **r_mcore, int showstats)
Definition: mcore.c:103
Definition: pytypes.h:928
float * ptr
void gk_csr_ComputeSquaredNorms(gk_csr_t *mat, int what)
Definition: csr.c:1643
gk_graph_t * gk_graph_ExtractSubgraph(gk_graph_t *graph, int vstart, int nvtxs)
Definition: GKlib/graph.c:391
double * gk_dreadfilebin(char *fname, ssize_t *r_nelmnts)
Definition: GKlib/io.c:354
void gk_graph_ComputeBestFOrdering0(gk_graph_t *graph, int v, int type, int32_t **r_perm, int32_t **r_iperm)
Definition: GKlib/graph.c:762
float * gk_freadfilebin(char *fname, ssize_t *r_nelmnts)
Definition: GKlib/io.c:292
signed __int64 int64_t
Definition: ms_stdint.h:94
float gk_flog2(float)
Definition: GKlib/util.c:104
unsigned int uint32_t
Definition: ms_stdint.h:85
unsigned __int64 uint64_t
Definition: ms_stdint.h:95
void omp_set_num_threads(int num_threads)
signed int int32_t
Definition: ms_stdint.h:82
void decodeblock(unsigned char *in, unsigned char *out)
Definition: b64.c:46
void gk_graph_ComputeBFSOrdering(gk_graph_t *graph, int v, int32_t **r_perm, int32_t **r_iperm)
Definition: GKlib/graph.c:665
char * gk_strhprune(char *, char *)
Prunes characters from the beginning of the string.
Definition: string.c:291
idx_t idx_t idx_t idx_t idx_t * perm
void gk_mcoreDestroy(gk_mcore_t **r_mcore, int showstats)
Definition: mcore.c:67
#define time
int gk_mkpath(char *)
Definition: fs.c:207
float ComputeMean(int n, float *values)
Definition: evaluate.c:107
int32_t * gk_i32readfilebin(char *fname, ssize_t *r_nelmnts)
Definition: GKlib/io.c:214
int HTable_SearchAndDelete(gk_HTable_t *htable, int key)
Definition: htable.c:200
gk_csr_t * gk_csr_LowFilter(gk_csr_t *mat, int what, int norm, float fraction)
Definition: csr.c:759
gk_HTable_t * HTable_Create(int nelements)
Definition: htable.c:16
void gk_malloc_cleanup(int showstats)
Definition: memory.c:118
void gk_RandomPermute(size_t, int *, int)
Definition: GKlib/util.c:20
gk_graph_t * gk_graph_Dup(gk_graph_t *graph)
Definition: GKlib/graph.c:340
void gk_gkmcorePush(gk_mcore_t *mcore)
Definition: mcore.c:187
char gk_threetoone(char *res)
Converts three-letter amino acid codes to one-leter codes.
Definition: pdb.c:24
gk_i2cc2i_t * gk_i2cc2i_create_common(char *alphabet)
This function creates the localizations for the various sequences.
Definition: seq.c:48
char * gk_strdup(char *orgstr)
Duplicates a string.
Definition: string.c:372
void gk_csr_CreateIndex(gk_csr_t *mat, int what)
Definition: csr.c:1223
void omp_set_nested(int nested)
size_t gk_fwritefilebin(char *fname, size_t n, float *a)
Definition: GKlib/io.c:331
void gk_fsortd(size_t, float *)
Definition: sort.c:78
int32_t * gk_i32readfile(char *fname, gk_idx_t *r_nlines)
Definition: GKlib/io.c:139
int gk_dexists(char *)
Definition: fs.c:35
Definition: pytypes.h:1301
int gk_strcasecmp(char *s1, char *s2)
Case insensitive string comparison.
Definition: string.c:405
#define GK_MKRANDOM_PROTO(FPRFX, RNGT, VALT)
Definition: gk_mkrandom.h:115
int gk_dfkvkselect(size_t, int, gk_fkv_t *)
Definition: fkvkselect.c:20
double gk_CPUSeconds(void)
Definition: timers.c:36
void gk_zkvsortd(size_t, gk_zkv_t *)
Definition: sort.c:234
void gk_graph_Init(gk_graph_t *graph)
Definition: GKlib/graph.c:36
void omp_set_dynamic(int num_threads)
double gk_wclock_t
Definition: gk_types.h:29
void gk_gkmcoreDel(gk_mcore_t *mcore, void *ptr)
Definition: mcore.c:373
void * gk_malloc(size_t nbytes, char *msg)
Definition: memory.c:140
void gk_free(void **ptr1,...)
Definition: memory.c:202
char * gk_getbasename(char *path)
Definition: fs.c:135
#define GK_MKALLOC_PROTO(PRFX, TYPE)
Definition: gk_mkmemory.h:130
void gk_sigthrow(int signum)
Definition: error.c:135
void gk_ckvsorti(size_t, gk_ckv_t *)
Definition: sort.c:135
int omp_get_max_threads(void)
int omp_get_num_procs(void)
void gk_dsorti(size_t, double *)
Definition: sort.c:89
int omp_get_dynamic(void)
gk_csr_t * gk_csr_ZScoreFilter(gk_csr_t *mat, int what, float zscore)
Definition: csr.c:1031
void HTable_Destroy(gk_HTable_t *htable)
Definition: htable.c:235
float gk_csr_ComputeSimilarity(gk_csr_t *mat, int i1, int i2, int what, int simtype)
Definition: csr.c:1694
float ComputeROCn(int n, int maxN, gk_fkv_t *list)
Definition: evaluate.c:47
void HTable_Delete(gk_HTable_t *htable, int key)
Definition: htable.c:107
int gk_rw_PageRank(gk_csr_t *mat, float lamda, float eps, int max_niter, float *pr)
Definition: rw.c:29
float * p
void HTable_Reset(gk_HTable_t *htable)
Definition: htable.c:33
gk_csr_t * gk_csr_Dup(gk_csr_t *mat)
Definition: csr.c:80
void gk_idxkvsortd(size_t, gk_idxkv_t *)
Definition: sort.c:322
gk_csr_t * gk_csr_ExtractSubmatrix(gk_csr_t *mat, int rstart, int nrows)
Definition: csr.c:135
void gk_idxsortd(size_t, gk_idx_t *)
Definition: sort.c:122
int HTable_GetNext(gk_HTable_t *htable, int key, int *val, int type)
Definition: htable.c:162
float ComputeAccuracy(int n, gk_fkv_t *list)
Definition: evaluate.c:16
void gk_dkvsortd(size_t, gk_dkv_t *)
Definition: sort.c:278
int64_t * gk_i64readfile(char *fname, gk_idx_t *r_nlines)
Definition: GKlib/io.c:177
uint64_t gk_randint64(void)
Definition: random.c:84
void errexit(char *,...)
Definition: error.c:54
int omp_get_nested(void)
int64_t * gk_i64readfilebin(char *fname, ssize_t *r_nelmnts)
Definition: GKlib/io.c:253
int gk_strstr_replace(char *str, char *pattern, char *replacement, char *options, char **new_str)
Regex-based search-and-replace function.
Definition: string.c:94
gk_csr_t * gk_csr_TopKPlusFilter(gk_csr_t *mat, int what, int topk, float keepval)
Definition: csr.c:901
gk_seq_t * gk_seq_ReadGKMODPSSM(char *file_name)
This function reads a pssm in the format of gkmod pssm.
Definition: seq.c:83
void gk_isortd(size_t, int *)
Definition: sort.c:56
void gk_fclose(FILE *)
Definition: GKlib/io.c:44
int gk_graph_FindComponents(gk_graph_t *graph, int32_t *cptr, int32_t *cind)
Definition: GKlib/graph.c:572
void gk_writebackbone(pdbf *p, char *fname)
Writes out all the backbone atoms of a structure in pdb format.
Definition: pdb.c:392
intmax_t gk_getfsize(char *)
Returns the size of the file in bytes.
Definition: fs.c:55
void gk_csorti(size_t, char *)
Definition: sort.c:23
int gk_GetStringID(gk_StringMap_t *strmap, char *key)
Definition: string.c:519
void gk_AllocMatrix(void ***, size_t, size_t, size_t)
Definition: memory.c:53
void gk_mcorePop(gk_mcore_t *mcore)
Definition: mcore.c:198
void gk_i32kvsorti(size_t, gk_i32kv_t *)
Definition: sort.c:179
gk_csr_t * gk_csr_Create()
Definition: csr.c:19
int gk_strrcmp(char *s1, char *s2)
Compare two strings in revere order.
Definition: string.c:433
int HTable_Search(gk_HTable_t *htable, int key)
Definition: htable.c:135
#define GK_MKPQUEUE_PROTO(FPRFX, PQT, KT, VT)
Definition: gk_mkpqueue.h:413
void gk_csr_ComputeSums(gk_csr_t *mat, int what)
Definition: csr.c:1597
void gk_mcorePush(gk_mcore_t *mcore)
Definition: mcore.c:175
int gk_malloc_init()
Definition: memory.c:99
void gk_UnsetSignalHandlers()
Definition: error.c:155
float ComputeStdDev(int n, float *values)
Definition: evaluate.c:121
void gk_seq_init(gk_seq_t *seq)
Definition: seq.c:27
void gk_csr_Normalize(gk_csr_t *mat, int what, int norm)
Definition: csr.c:1319
int gk_sigtrap()
Definition: error.c:98
uint32_t gk_randint32(void)
Definition: random.c:125
int omp_get_thread_num(void)
void gk_getfilestats(char *fname, size_t *r_nlines, size_t *r_ntokens, size_t *r_max_nlntokens, size_t *r_nbytes)
Definition: fs.c:79
void gk_gkmcorePop(gk_mcore_t *mcore)
Definition: mcore.c:237
gk_csr_t * gk_csr_Read(char *filename, int format, int readvals, int numbering)
Definition: csr.c:349
Definition: pytypes.h:897
void gk_graph_ComputeBestFOrdering(gk_graph_t *graph, int v, int type, int32_t **r_perm, int32_t **r_iperm)
Definition: GKlib/graph.c:887
void gk_csr_Init(gk_csr_t *mat)
Definition: csr.c:36
#define GK_MKBLAS_PROTO(PRFX, TYPE, OUTTYPE)
Definition: gk_mkblas.h:187
void gk_graph_SingleSourceShortestPaths(gk_graph_t *graph, int v, void **r_sps)
Definition: GKlib/graph.c:1084
void gk_dkvsorti(size_t, gk_dkv_t *)
Definition: sort.c:267
void gk_find_frequent_itemsets(int ntrans, ssize_t *tranptr, int *tranind, int minfreq, int maxfreq, int minlen, int maxlen, void(*process_itemset)(void *stateptr, int nitems, int *itemind, int ntrans, int *tranind), void *stateptr)


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:42:08