Go to the source code of this file.
Functions | |
GK_MKBLAS_PROTO (gk_c, char, int) GK_MKBLAS_PROTO(gk_i | |
int | GK_MKBLAS_PROTO (gk_i32, int32_t, int32_t) GK_MKBLAS_PROTO(gk_i64 |
int int64_t | GK_MKBLAS_PROTO (gk_z, ssize_t, ssize_t) GK_MKBLAS_PROTO(gk_f |
int int64_t float | GK_MKBLAS_PROTO (gk_d, double, double) GK_MKBLAS_PROTO(gk_idx |
int int64_t float gk_idx_t FILE * | gk_fopen (char *, char *, const char *) |
void | gk_fclose (FILE *) |
gk_idx_t | gk_getline (char **lineptr, size_t *n, FILE *stream) |
char ** | gk_readfile (char *fname, gk_idx_t *r_nlines) |
int32_t * | gk_i32readfile (char *fname, gk_idx_t *r_nlines) |
int64_t * | gk_i64readfile (char *fname, gk_idx_t *r_nlines) |
int32_t * | gk_i32readfilebin (char *fname, ssize_t *r_nelmnts) |
int64_t * | gk_i64readfilebin (char *fname, ssize_t *r_nelmnts) |
float * | gk_freadfilebin (char *fname, ssize_t *r_nelmnts) |
size_t | gk_fwritefilebin (char *fname, size_t n, float *a) |
double * | gk_dreadfilebin (char *fname, ssize_t *r_nelmnts) |
int | gk_fexists (char *) |
int | gk_dexists (char *) |
intmax_t | gk_getfsize (char *) |
Returns the size of the file in bytes. | |
void | gk_getfilestats (char *fname, size_t *r_nlines, size_t *r_ntokens, size_t *r_max_nlntokens, size_t *r_nbytes) |
char * | gk_getbasename (char *path) |
char * | gk_getextname (char *path) |
char * | gk_getfilename (char *path) |
char * | gk_getpathname (char *path) |
int | gk_mkpath (char *) |
int | gk_rmpath (char *) |
GK_MKALLOC_PROTO (gk_c, char) GK_MKALLOC_PROTO(gk_i | |
int | GK_MKALLOC_PROTO (gk_i32, int32_t) GK_MKALLOC_PROTO(gk_i64 |
int int64_t | GK_MKALLOC_PROTO (gk_z, ssize_t) GK_MKALLOC_PROTO(gk_f |
int int64_t float | GK_MKALLOC_PROTO (gk_d, double) GK_MKALLOC_PROTO(gk_idx |
int int64_t float gk_idx_t | GK_MKALLOC_PROTO (gk_ckv, gk_ckv_t) GK_MKALLOC_PROTO(gk_ikv |
int int64_t float gk_idx_t gk_ikv_t | GK_MKALLOC_PROTO (gk_i32kv, gk_i32kv_t) GK_MKALLOC_PROTO(gk_i64kv |
int int64_t float gk_idx_t gk_ikv_t gk_i64kv_t | GK_MKALLOC_PROTO (gk_zkv, gk_zkv_t) GK_MKALLOC_PROTO(gk_fkv |
int int64_t float gk_idx_t gk_ikv_t gk_i64kv_t gk_fkv_t | GK_MKALLOC_PROTO (gk_dkv, gk_dkv_t) GK_MKALLOC_PROTO(gk_skv |
int int64_t float gk_idx_t gk_ikv_t gk_i64kv_t gk_fkv_t gk_skv_t | GK_MKALLOC_PROTO (gk_idxkv, gk_idxkv_t) void gk_AllocMatrix(void *** |
void | gk_FreeMatrix (void ***, size_t, size_t) |
int | gk_malloc_init () |
void | gk_malloc_cleanup (int showstats) |
void * | gk_malloc (size_t nbytes, char *msg) |
void * | gk_realloc (void *oldptr, size_t nbytes, char *msg) |
void | gk_free (void **ptr1,...) |
size_t | gk_GetCurMemoryUsed () |
size_t | gk_GetMaxMemoryUsed () |
gk_seq_t * | gk_seq_ReadGKMODPSSM (char *file_name) |
This function reads a pssm in the format of gkmod pssm. | |
gk_i2cc2i_t * | gk_i2cc2i_create_common (char *alphabet) |
This function creates the localizations for the various sequences. | |
void | gk_seq_init (gk_seq_t *seq) |
char | gk_threetoone (char *res) |
Converts three-letter amino acid codes to one-leter codes. | |
void | gk_freepdbf (pdbf *p) |
Frees the memory of a pdbf structure. | |
pdbf * | gk_readpdbfile (char *fname) |
Reads a pdb file into a pdbf structure. | |
void | gk_writefullatom (pdbf *p, char *fname) |
Writes all atoms in p in pdb-format to file fname. | |
void | gk_writebackbone (pdbf *p, char *fname) |
Writes out all the backbone atoms of a structure in pdb format. | |
void | gk_writealphacarbons (pdbf *p, char *fname) |
Writes out all the alpha carbon atoms of a structure. | |
void | gk_showcorruption (pdbf *p) |
Decodes the corruption bitswitch and prints any problems. | |
void | gk_set_exit_on_error (int value) |
void | errexit (char *,...) |
void | gk_errexit (int signum, char *,...) |
int | gk_sigtrap () |
int | gk_siguntrap () |
void | gk_sigthrow (int signum) |
void | gk_SetSignalHandlers () |
void | gk_UnsetSignalHandlers () |
void | gk_NonLocalExit_Handler (int signum) |
char * | gk_strerror (int errnum) |
Thread-safe implementation of strerror(). | |
void | PrintBackTrace () |
void | gk_RandomPermute (size_t, int *, int) |
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. | |
int | gk_log2 (int) |
int | gk_ispow2 (int) |
float | gk_flog2 (float) |
gk_wclock_t | gk_WClockSeconds (void) |
double | gk_CPUSeconds (void) |
char * | gk_strchr_replace (char *str, char *fromlist, char *tolist) |
Replaces certain characters in a string. | |
int | gk_strstr_replace (char *str, char *pattern, char *replacement, char *options, char **new_str) |
Regex-based search-and-replace function. | |
char * | gk_strtprune (char *, char *) |
Prunes characters from the end of the string. | |
char * | gk_strhprune (char *, char *) |
Prunes characters from the beginning of the string. | |
char * | gk_strtoupper (char *) |
Converts a string to upper case. | |
char * | gk_strtolower (char *) |
Converts a string to lower case. | |
char * | gk_strdup (char *orgstr) |
Duplicates a string. | |
int | gk_strcasecmp (char *s1, char *s2) |
Case insensitive string comparison. | |
int | gk_strrcmp (char *s1, char *s2) |
Compare two strings in revere order. | |
char * | gk_time2str (time_t time) |
Converts a time_t time into a string. | |
time_t | gk_str2time (char *str) |
Converts a date/time string into its equivalent time_t value. | |
int | gk_GetStringID (gk_StringMap_t *strmap, char *key) |
void | gk_csorti (size_t, char *) |
void | gk_csortd (size_t, char *) |
void | gk_isorti (size_t, int *) |
void | gk_isortd (size_t, int *) |
void | gk_fsorti (size_t, float *) |
void | gk_fsortd (size_t, float *) |
void | gk_dsorti (size_t, double *) |
void | gk_dsortd (size_t, double *) |
void | gk_idxsorti (size_t, gk_idx_t *) |
void | gk_idxsortd (size_t, gk_idx_t *) |
void | gk_ckvsorti (size_t, gk_ckv_t *) |
void | gk_ckvsortd (size_t, gk_ckv_t *) |
void | gk_ikvsorti (size_t, gk_ikv_t *) |
void | gk_ikvsortd (size_t, gk_ikv_t *) |
void | gk_i32kvsorti (size_t, gk_i32kv_t *) |
void | gk_i32kvsortd (size_t, gk_i32kv_t *) |
void | gk_i64kvsorti (size_t, gk_i64kv_t *) |
void | gk_i64kvsortd (size_t, gk_i64kv_t *) |
void | gk_zkvsorti (size_t, gk_zkv_t *) |
void | gk_zkvsortd (size_t, gk_zkv_t *) |
void | gk_fkvsorti (size_t, gk_fkv_t *) |
void | gk_fkvsortd (size_t, gk_fkv_t *) |
void | gk_dkvsorti (size_t, gk_dkv_t *) |
void | gk_dkvsortd (size_t, gk_dkv_t *) |
void | gk_skvsorti (size_t, gk_skv_t *) |
void | gk_skvsortd (size_t, gk_skv_t *) |
void | gk_idxkvsorti (size_t, gk_idxkv_t *) |
void | gk_idxkvsortd (size_t, gk_idxkv_t *) |
int | gk_dfkvkselect (size_t, int, gk_fkv_t *) |
int | gk_ifkvkselect (size_t, int, gk_fkv_t *) |
GK_MKPQUEUE_PROTO (gk_ipq, gk_ipq_t, int, gk_idx_t) GK_MKPQUEUE_PROTO(gk_i32pq | |
gk_idx_t | GK_MKPQUEUE_PROTO (gk_i64pq, gk_i64pq_t, int64_t, gk_idx_t) GK_MKPQUEUE_PROTO(gk_fpq |
gk_idx_t gk_idx_t | GK_MKPQUEUE_PROTO (gk_dpq, gk_dpq_t, double, gk_idx_t) GK_MKPQUEUE_PROTO(gk_idxpq |
gk_idx_t gk_idx_t gk_idx_t gk_HTable_t * | HTable_Create (int nelements) |
void | HTable_Reset (gk_HTable_t *htable) |
void | HTable_Resize (gk_HTable_t *htable, int nelements) |
void | HTable_Insert (gk_HTable_t *htable, int key, int val) |
void | HTable_Delete (gk_HTable_t *htable, int key) |
int | HTable_Search (gk_HTable_t *htable, int key) |
int | HTable_GetNext (gk_HTable_t *htable, int key, int *val, int type) |
int | HTable_SearchAndDelete (gk_HTable_t *htable, int key) |
void | HTable_Destroy (gk_HTable_t *htable) |
int | HTable_HFunction (int nelements, int key) |
void | gk_strtokenize (char *line, char *delim, gk_Tokens_t *tokens) |
void | gk_freetokenslist (gk_Tokens_t *tokens) |
void | encodeblock (unsigned char *in, unsigned char *out) |
void | decodeblock (unsigned char *in, unsigned char *out) |
void | GKEncodeBase64 (int nbytes, unsigned char *inbuffer, unsigned char *outbuffer) |
void | GKDecodeBase64 (int nbytes, unsigned char *inbuffer, unsigned char *outbuffer) |
GK_MKRANDOM_PROTO (gk_c, size_t, char) GK_MKRANDOM_PROTO(gk_i | |
int | GK_MKRANDOM_PROTO (gk_f, size_t, float) GK_MKRANDOM_PROTO(gk_d |
int double | GK_MKRANDOM_PROTO (gk_idx, size_t, gk_idx_t) GK_MKRANDOM_PROTO(gk_z |
int double ssize_t void | gk_randinit (uint64_t) |
uint64_t | gk_randint64 (void) |
uint32_t | gk_randint32 (void) |
void | omp_set_num_threads (int num_threads) |
int | omp_get_num_threads (void) |
int | omp_get_max_threads (void) |
int | omp_get_thread_num (void) |
int | omp_get_num_procs (void) |
int | omp_in_parallel (void) |
void | omp_set_dynamic (int num_threads) |
int | omp_get_dynamic (void) |
void | omp_set_nested (int nested) |
int | omp_get_nested (void) |
gk_csr_t * | gk_csr_Create () |
void | gk_csr_Init (gk_csr_t *mat) |
void | gk_csr_Free (gk_csr_t **mat) |
void | gk_csr_FreeContents (gk_csr_t *mat) |
gk_csr_t * | gk_csr_Dup (gk_csr_t *mat) |
gk_csr_t * | gk_csr_ExtractSubmatrix (gk_csr_t *mat, int rstart, int nrows) |
gk_csr_t * | gk_csr_ExtractRows (gk_csr_t *mat, int nrows, int *rind) |
gk_csr_t * | gk_csr_ExtractPartition (gk_csr_t *mat, int *part, int pid) |
gk_csr_t ** | gk_csr_Split (gk_csr_t *mat, int *color) |
gk_csr_t * | gk_csr_Read (char *filename, int format, int readvals, int numbering) |
void | gk_csr_Write (gk_csr_t *mat, char *filename, int format, int writevals, int numbering) |
gk_csr_t * | gk_csr_Prune (gk_csr_t *mat, int what, int minf, int maxf) |
gk_csr_t * | gk_csr_LowFilter (gk_csr_t *mat, int what, int norm, float fraction) |
gk_csr_t * | gk_csr_TopKPlusFilter (gk_csr_t *mat, int what, int topk, float keepval) |
gk_csr_t * | gk_csr_ZScoreFilter (gk_csr_t *mat, int what, float zscore) |
void | gk_csr_CompactColumns (gk_csr_t *mat) |
void | gk_csr_SortIndices (gk_csr_t *mat, int what) |
void | gk_csr_CreateIndex (gk_csr_t *mat, int what) |
void | gk_csr_Normalize (gk_csr_t *mat, int what, int norm) |
void | gk_csr_Scale (gk_csr_t *mat, int type) |
void | gk_csr_ComputeSums (gk_csr_t *mat, int what) |
void | gk_csr_ComputeSquaredNorms (gk_csr_t *mat, int what) |
float | gk_csr_ComputeSimilarity (gk_csr_t *mat, int i1, int i2, int what, int simtype) |
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) |
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) |
float | ComputeAccuracy (int n, gk_fkv_t *list) |
float | ComputeROCn (int n, int maxN, gk_fkv_t *list) |
float | ComputeMedianRFP (int n, gk_fkv_t *list) |
float | ComputeMean (int n, float *values) |
float | ComputeStdDev (int n, float *values) |
gk_mcore_t * | gk_mcoreCreate (size_t coresize) |
gk_mcore_t * | gk_gkmcoreCreate () |
void | gk_mcoreDestroy (gk_mcore_t **r_mcore, int showstats) |
void | gk_gkmcoreDestroy (gk_mcore_t **r_mcore, int showstats) |
void * | gk_mcoreMalloc (gk_mcore_t *mcore, size_t nbytes) |
void | gk_mcorePush (gk_mcore_t *mcore) |
void | gk_gkmcorePush (gk_mcore_t *mcore) |
void | gk_mcorePop (gk_mcore_t *mcore) |
void | gk_gkmcorePop (gk_mcore_t *mcore) |
void | gk_mcoreAdd (gk_mcore_t *mcore, int type, size_t nbytes, void *ptr) |
void | gk_gkmcoreAdd (gk_mcore_t *mcore, int type, size_t nbytes, void *ptr) |
void | gk_mcoreDel (gk_mcore_t *mcore, void *ptr) |
void | gk_gkmcoreDel (gk_mcore_t *mcore, void *ptr) |
int | gk_rw_PageRank (gk_csr_t *mat, float lamda, float eps, int max_niter, float *pr) |
gk_graph_t * | gk_graph_Create () |
void | gk_graph_Init (gk_graph_t *graph) |
void | gk_graph_Free (gk_graph_t **graph) |
void | gk_graph_FreeContents (gk_graph_t *graph) |
gk_graph_t * | gk_graph_Read (char *filename, int format, int isfewgts, int isfvwgts, int isfvsizes) |
void | gk_graph_Write (gk_graph_t *graph, char *filename, int format) |
gk_graph_t * | gk_graph_Dup (gk_graph_t *graph) |
gk_graph_t * | gk_graph_ExtractSubgraph (gk_graph_t *graph, int vstart, int nvtxs) |
gk_graph_t * | gk_graph_Reorder (gk_graph_t *graph, int32_t *perm, int32_t *iperm) |
int | gk_graph_FindComponents (gk_graph_t *graph, int32_t *cptr, int32_t *cind) |
void | gk_graph_ComputeBFSOrdering (gk_graph_t *graph, int v, int32_t **r_perm, int32_t **r_iperm) |
void | gk_graph_ComputeBestFOrdering0 (gk_graph_t *graph, int v, int type, int32_t **r_perm, int32_t **r_iperm) |
void | gk_graph_ComputeBestFOrdering (gk_graph_t *graph, int v, int type, int32_t **r_perm, int32_t **r_iperm) |
void | gk_graph_SingleSourceShortestPaths (gk_graph_t *graph, int v, void **r_sps) |
Variables | |
int | |
int | int64_t |
int int64_t | float |
int int64_t float | gk_idx_t |
int int64_t float gk_idx_t gk_ikv_t gk_i64kv_t gk_fkv_t gk_skv_t | size_t |
gk_i32pq_t | |
int32_t | |
gk_idx_t | gk_fpq_t |
gk_idx_t gk_idx_t | gk_idxpq_t |
$Id: gk_proto.h 12591 2012-09-01 19:03:15Z karypis $
Definition in file gk_proto.h.
GK_MKBLAS_PROTO | ( | gk_c | , | |
char | , | |||
int | ||||
) |
Definition at line 24 of file io.c.
References errexit().
Referenced by gk_csr_Read(), gk_csr_Write(), gk_dreadfilebin(), gk_freadfilebin(), gk_fwritefilebin(), gk_getfilestats(), gk_graph_Read(), gk_graph_Write(), gk_i32readfile(), gk_i32readfilebin(), gk_i64readfile(), gk_i64readfilebin(), gk_readfile(), gk_readpdbfile(), gk_seq_ReadGKMODPSSM(), gk_writealphacarbons(), gk_writebackbone(), gk_writecentersofmass(), gk_writefastafrompdb(), gk_writefullatom(), main(), ReadGraph(), ReadMesh(), ReadPOVector(), ReadTPwgts(), WriteGraph(), WriteMeshPartition(), WritePartition(), and WritePermutation().
void gk_fclose | ( | FILE * | ) |
Definition at line 44 of file io.c.
Referenced by gk_csr_Read(), gk_csr_Write(), gk_dreadfilebin(), gk_freadfilebin(), gk_fwritefilebin(), gk_getfilestats(), gk_graph_Read(), gk_graph_Write(), gk_i32readfile(), gk_i32readfilebin(), gk_i64readfile(), gk_i64readfilebin(), gk_readfile(), gk_seq_ReadGKMODPSSM(), main(), ReadGraph(), ReadMesh(), ReadPOVector(), ReadTPwgts(), WriteGraph(), WriteMeshPartition(), WritePartition(), and WritePermutation().
This function is the GKlib implementation of glibc's getline() function.
Definition at line 57 of file io.c.
References gk_malloc(), and gk_realloc().
Referenced by gk_csr_Read(), gk_graph_Read(), gk_i32readfile(), gk_i64readfile(), gk_readfile(), ReadGraph(), ReadMesh(), and ReadTPwgts().
char** gk_readfile | ( | char * | fname, | |
gk_idx_t * | r_nlines | |||
) |
This function reads the contents of a text file and returns it in the form of an array of strings.
fname | is the name of the file | |
r_nlines | is the number of lines in the file. If it is NULL, this information is not returned. |
Definition at line 103 of file io.c.
References gk_fclose(), gk_fopen(), gk_free(), gk_getfilestats(), gk_getline(), gk_malloc(), gk_strdup(), and gk_strtprune().
This function reads the contents of a file and returns it in the form of an array of int32_t.
fname | is the name of the file | |
r_nlines | is the number of lines in the file. If it is NULL, this information is not returned. |
Definition at line 139 of file io.c.
References array, gk_fclose(), gk_fopen(), gk_free(), gk_getfilestats(), gk_getline(), and int32_t.
This function reads the contents of a file and returns it in the form of an array of int64_t.
fname | is the name of the file | |
r_nlines | is the number of lines in the file. If it is NULL, this information is not returned. |
Definition at line 177 of file io.c.
References array, gk_fclose(), gk_fopen(), gk_free(), gk_getfilestats(), and gk_getline().
This function reads the contents of a binary file and returns it in the form of an array of int32_t.
fname | is the name of the file | |
r_nlines | is the number of lines in the file. If it is NULL, this information is not returned. |
Definition at line 214 of file io.c.
References array, gk_errexit(), gk_fclose(), gk_fopen(), gk_free(), gk_getfsize(), and int32_t.
This function reads the contents of a binary file and returns it in the form of an array of int64_t.
fname | is the name of the file | |
r_nlines | is the number of lines in the file. If it is NULL, this information is not returned. |
Definition at line 253 of file io.c.
References array, gk_errexit(), gk_fclose(), gk_fopen(), gk_free(), and gk_getfsize().
This function reads the contents of a binary file and returns it in the form of an array of float.
fname | is the name of the file | |
r_nlines | is the number of lines in the file. If it is NULL, this information is not returned. |
Definition at line 292 of file io.c.
References array, float, gk_errexit(), gk_fclose(), gk_fopen(), gk_free(), and gk_getfsize().
This function writes the contents of an array into a binary file.
fname | is the name of the file | |
n | the number of elements in the array. | |
a | the array to be written out. |
Definition at line 331 of file io.c.
References gk_fclose(), and gk_fopen().
double* gk_dreadfilebin | ( | char * | fname, | |
ssize_t * | r_nelmnts | |||
) |
This function reads the contents of a binary file and returns it in the form of an array of double.
fname | is the name of the file | |
r_nlines | is the number of lines in the file. If it is NULL, this information is not returned. |
Definition at line 354 of file io.c.
References array, gk_errexit(), gk_fclose(), gk_fopen(), gk_free(), and gk_getfsize().
int gk_fexists | ( | char * | ) |
Definition at line 21 of file fs.c.
Referenced by gk_csr_Read(), gk_graph_Read(), parse_cmdline(), ReadGraph(), ReadMesh(), and ReadTPwgts().
intmax_t gk_getfsize | ( | char * | filename | ) |
Returns the size of the file in bytes.
This function returns the size of a file as a 64 bit integer. If there were any errors in stat'ing the file, -1 is returned.
Definition at line 55 of file fs.c.
Referenced by gk_dreadfilebin(), gk_freadfilebin(), gk_i32readfilebin(), and gk_i64readfilebin().
void gk_getfilestats | ( | char * | fname, | |
size_t * | r_nlines, | |||
size_t * | r_ntokens, | |||
size_t * | r_max_nlntokens, | |||
size_t * | r_nbytes | |||
) |
This function gets some basic statistics about the file.
fname | is the name of the file | |
r_nlines | is the number of lines in the file. If it is NULL, this information is not returned. | |
r_ntokens | is the number of tokens in the file. If it is NULL, this information is not returned. | |
r_max_nlntokens | is the maximum number of tokens in any line in the file. If it is NULL this information is not returned. | |
r_nbytes | is the number of bytes in the file. If it is NULL, this information is not returned. |
Definition at line 79 of file fs.c.
References gk_fclose(), and gk_fopen().
Referenced by gk_csr_Read(), gk_i32readfile(), gk_i64readfile(), gk_readfile(), gk_seq_ReadGKMODPSSM(), and ReadMesh().
char* gk_getbasename | ( | char * | path | ) |
Definition at line 135 of file fs.c.
References gk_strdup().
Referenced by gk_seq_ReadGKMODPSSM().
char* gk_getextname | ( | char * | path | ) |
Definition at line 159 of file fs.c.
References gk_strdup().
char* gk_getfilename | ( | char * | path | ) |
Definition at line 173 of file fs.c.
References gk_strdup().
char* gk_getpathname | ( | char * | path | ) |
GK_MKALLOC_PROTO | ( | gk_c | , | |
char | ||||
) |
int int64_t float gk_idx_t gk_ikv_t gk_i64kv_t gk_fkv_t gk_skv_t GK_MKALLOC_PROTO | ( | gk_idxkv | , | |
gk_idxkv_t | ||||
) |
int gk_malloc_init | ( | ) |
This function initializes tracking of heap allocations.
Definition at line 101 of file memory.c.
References gk_gkmcoreCreate(), gk_gkmcorePush(), and gkmcore.
Referenced by main(), METIS_MeshToDual(), METIS_MeshToNodal(), METIS_NodeND(), METIS_PartGraphKway(), METIS_PartGraphRecursive(), METIS_PartMeshDual(), and METIS_PartMeshNodal().
void gk_malloc_cleanup | ( | int | showstats | ) |
This function frees the memory that has been allocated since the last call to gk_malloc_init().
Definition at line 120 of file memory.c.
References gk_mcore_t::cmop, gk_gkmcoreDestroy(), gk_gkmcorePop(), and gkmcore.
Referenced by main(), METIS_MeshToDual(), METIS_MeshToNodal(), METIS_NodeND(), METIS_PartGraphKway(), METIS_PartGraphRecursive(), METIS_PartMeshDual(), and METIS_PartMeshNodal().
void* gk_malloc | ( | size_t | nbytes, | |
char * | msg | |||
) |
This function is my wrapper around malloc that provides the following enhancements over malloc: It always allocates one byte of memory, even if 0 bytes are requested. This is to ensure that checks of returned values do not lead to NULL due to 0 bytes requested. It zeros-out the memory that is allocated. This is for a quick init of the underlying datastructures.
Definition at line 142 of file memory.c.
References gk_errexit(), gk_GetCurMemoryUsed(), gk_GetMaxMemoryUsed(), gk_gkmcoreAdd(), gkmcore, and malloc().
Referenced by Allocate2WayNodePartitionMemory(), AllocateKWayPartitionMemory(), AllocateRefinementWorkSpace(), CreateGraph(), CreateMesh(), FixGraph(), gk_csr_Create(), gk_csr_Split(), gk_getline(), gk_graph_Create(), gk_graph_Split(), gk_i2cc2i_create_common(), gk_mcoreCreate(), gk_mcoreMalloc(), GK_MKALLOC(), gk_readfile(), gk_readpdbfile(), gk_seq_ReadGKMODPSSM(), gk_strdup(), gk_strtokenize(), GrowBisectionNode(), GrowBisectionNode2(), HTable_Create(), main(), parse_cmdline(), SetupCtrl(), and SplitGraphOrderCC().
void* gk_realloc | ( | void * | oldptr, | |
size_t | nbytes, | |||
char * | msg | |||
) |
Definition at line 174 of file memory.c.
References gk_errexit(), gk_GetCurMemoryUsed(), gk_GetMaxMemoryUsed(), gk_gkmcoreAdd(), gk_gkmcoreDel(), gkmcore, and realloc().
Referenced by cnbrpoolGetNext(), gk_getline(), gk_strstr_replace(), and vnbrpoolGetNext().
void gk_free | ( | void ** | ptr1, | |
... | ||||
) |
Definition at line 204 of file memory.c.
References free(), gk_gkmcoreDel(), and gkmcore.
Referenced by CheckGraph(), CompressGraph(), ComputeElementBalance(), ComputeFillIn(), ComputeMaxCut(), ComputePartitionBalance(), ComputePartitionInfo(), ComputePartitionInfoBipartite(), ComputeVolume(), CreateGraphDual(), CreateGraphNodal(), FindPartitionInducedComponents(), FindSepInducedComponents(), FixGraph(), FreeCtrl(), FreeGraph(), FreeMesh(), FreeRData(), FreeWorkSpace(), gk_csr_CompactColumns(), gk_csr_ComputeSquaredNorms(), gk_csr_ComputeSums(), gk_csr_CreateIndex(), gk_csr_Free(), gk_csr_FreeContents(), gk_csr_GetSimilarRows(), gk_csr_LowFilter(), gk_csr_Prune(), gk_csr_Read(), gk_csr_Scale(), gk_csr_SortIndices(), gk_csr_TopKPlusFilter(), gk_dreadfilebin(), gk_find_frequent_itemsets(), gk_freadfilebin(), gk_FreeMatrix(), gk_freepdbf(), gk_freetokenslist(), gk_graph_ComputeBestFOrdering(), gk_graph_ComputeBestFOrdering0(), gk_graph_ComputeBFSOrdering(), gk_graph_FindComponents(), gk_graph_Free(), gk_graph_FreeContents(), gk_graph_Prune(), gk_graph_Read(), gk_graph_Reorder(), gk_graph_SingleSourceShortestPaths(), gk_graph_SortAdjacencies(), gk_i32readfile(), gk_i32readfilebin(), gk_i64readfile(), gk_i64readfilebin(), gk_mcoreDestroy(), gk_mcorePop(), GK_MKALLOC(), gk_readfile(), gk_rw_PageRank(), gk_seq_free(), gk_seq_ReadGKMODPSSM(), gk_strstr_replace(), HTable_Destroy(), HTable_Resize(), InduceRowPartFromColumnPart(), InitKWayPartitioning(), IsConnectedSubdomain(), main(), METIS_NodeND(), METIS_NodeNDP(), METIS_PartMeshDual(), MinCover(), MinCover_Decompose(), MlevelNestedDissectionCC(), PrintSubDomainGraph(), PruneGraph(), ReadGraph(), ReadMesh(), ReadTPwgts(), reorder_centroid(), smbfct(), and test_strstr_replace().
size_t gk_GetCurMemoryUsed | ( | ) |
Definition at line 235 of file memory.c.
References gk_mcore_t::cur_hallocs, and gkmcore.
Referenced by gk_malloc(), gk_realloc(), main(), and print_final_info().
size_t gk_GetMaxMemoryUsed | ( | ) |
Definition at line 248 of file memory.c.
References gkmcore, and gk_mcore_t::max_hallocs.
Referenced by gk_malloc(), gk_realloc(), main(), and print_final_info().
gk_seq_t* gk_seq_ReadGKMODPSSM | ( | char * | filename | ) |
This function reads a pssm in the format of gkmod pssm.
file_name | is the name of the pssm file |
Definition at line 83 of file seq.c.
References gk_i2cc2i_t::c2i, errexit(), gk_fclose(), gk_fopen(), gk_free(), gk_freetokenslist(), gk_getbasename(), gk_getfilestats(), gk_i2cc2i_create_common(), gk_idx_t, gk_malloc(), gk_seq_init(), gk_strtokenize(), gk_strtoupper(), int, gk_seq_t::len, len, gk_Tokens_t::list, gk_seq_t::name, gk_seq_t::nsymbols, gk_seq_t::psfm, gk_seq_t::pssm, and gk_seq_t::sequence.
gk_i2cc2i_t* gk_i2cc2i_create_common | ( | char * | alphabet | ) |
This function creates the localizations for the various sequences.
string | i.e amino acids, nucleotides, sequences |
Definition at line 48 of file seq.c.
References gk_i2cc2i_t::c2i, gk_idx_t, gk_malloc(), gk_i2cc2i_t::i2c, int, gk_i2cc2i_t::n, and PUP::t.
Referenced by gk_seq_ReadGKMODPSSM().
void gk_seq_init | ( | gk_seq_t * | seq | ) |
Definition at line 27 of file seq.c.
References gk_seq_t::len, gk_seq_t::name, gk_seq_t::psfm, gk_seq_t::pssm, and gk_seq_t::sequence.
Referenced by gk_seq_ReadGKMODPSSM().
char gk_threetoone | ( | char * | res | ) |
Converts three-letter amino acid codes to one-leter codes.
This function takes a three letter *
and converts it to a single
res | is the three-letter code to be converted. |
representing
the amino acid. Definition at line 24 of file pdb.c.
Referenced by gk_readpdbfile().
void gk_freepdbf | ( | pdbf * | p | ) |
Frees the memory of a pdbf structure.
This function takes a pdbf pointer and frees all the memory below it.
p | is the pdbf structure to be freed. |
Definition at line 105 of file pdb.c.
References pdbf::atoms, pdbf::bbs, pdbf::cas, pdbf::cm, gk_free(), atom::name, pdbf::natoms, pdbf::nresidues, atom::resname, pdbf::resSeq, and pdbf::threeresSeq.
pdbf* gk_readpdbfile | ( | char * | fname | ) |
Reads a pdb file into a pdbf structure.
This function allocates a pdbf structure and reads the file fname into that structure.
fname | is the file name to be read |
Definition at line 132 of file pdb.c.
References atom::altLoc, pdbf::atoms, pdbf::bbs, pdbf::cas, atom::chainid, pdbf::cm, pdbf::corruption, atom::element, gk_fopen(), gk_malloc(), gk_strdup(), gk_threetoone(), atom::icode, atom::name, center_of_mass::name, pdbf::natoms, pdbf::nbbs, pdbf::ncas, pdbf::nresidues, atom::opcy, atom::resname, pdbf::resSeq, atom::rserial, atom::serial, pdbf::threeresSeq, atom::tmpt, atom::x, center_of_mass::x, x, atom::y, center_of_mass::y, atom::z, and center_of_mass::z.
void gk_writefullatom | ( | pdbf * | p, | |
char * | fname | |||
) |
Writes all atoms in p in pdb-format to file fname.
This function takes a pdbf structure and writes out all the atom information to file fname.
p | is the pdbf structure to write out | |
fname | is the file name to be written |
Definition at line 371 of file pdb.c.
References atom::altLoc, pdbf::atoms, atom::chainid, gk_fopen(), atom::icode, atom::name, pdbf::natoms, atom::opcy, atom::resname, atom::rserial, atom::serial, atom::tmpt, atom::x, atom::y, and atom::z.
void gk_writebackbone | ( | pdbf * | p, | |
char * | fname | |||
) |
Writes out all the backbone atoms of a structure in pdb format.
This function takes a pdbf structure p and writes only the backbone atoms to a filename fname.
p | is the pdb structure to write out. | |
fname | is the file name to be written. |
Definition at line 392 of file pdb.c.
References atom::altLoc, pdbf::bbs, atom::chainid, gk_fopen(), atom::icode, atom::name, pdbf::nbbs, atom::opcy, atom::resname, atom::rserial, atom::serial, atom::tmpt, atom::x, atom::y, and atom::z.
void gk_writealphacarbons | ( | pdbf * | p, | |
char * | fname | |||
) |
Writes out all the alpha carbon atoms of a structure.
This function takes a pdbf structure p and writes only the alpha carbon atoms to a filename fname.
p | is the pdb structure to write out. | |
fname | is the file name to be written. |
Definition at line 413 of file pdb.c.
References atom::altLoc, pdbf::cas, atom::chainid, gk_fopen(), atom::icode, atom::name, pdbf::ncas, atom::opcy, atom::resname, atom::rserial, atom::serial, atom::tmpt, atom::x, atom::y, and atom::z.
void gk_showcorruption | ( | pdbf * | p | ) |
Decodes the corruption bitswitch and prints any problems.
Due to the totally unreliable nature of the pdb format, reading a pdb file stores a corruption bitswitch, and this function decodes that switch and prints the result on stdout.
p | is the pdb structure to write out. | |
fname | is the file name to be written. |
Definition at line 435 of file pdb.c.
References pdbf::corruption.
void gk_set_exit_on_error | ( | int | value | ) |
This function sets the gk_exit_on_error variable
Definition at line 45 of file error.c.
References gk_exit_on_error.
void errexit | ( | char * | f_str, | |
... | ||||
) |
This function prints an error message and exits
Definition at line 56 of file error.c.
References gk_exit_on_error.
Referenced by ComputeFillIn(), gk_csr_Read(), gk_fopen(), gk_mcorePop(), gk_seq_ReadGKMODPSSM(), main(), parse_cmdline(), ReadGraph(), ReadMesh(), ReadPOVector(), ReadTPwgts(), and reorder_centroid().
void gk_errexit | ( | int | signum, | |
char * | f_str, | |||
... | ||||
) |
This function prints an error message and raises a signum signal
Definition at line 79 of file error.c.
References gk_exit_on_error.
Referenced by AllocateKWayPartitionMemory(), AllocateRefinementWorkSpace(), CoarsenGraph(), CoarsenGraphNlevels(), ComputeKWayBoundary(), ComputeKWayPartitionParams(), ComputeSubDomainGraph(), CreateGraphDual(), CreateGraphNodal(), EliminateComponents(), EliminateSubDomainEdges(), gk_csr_ComputeSimilarity(), gk_csr_ComputeSquaredNorms(), gk_csr_ComputeSums(), gk_csr_CreateIndex(), gk_csr_GetSimilarRows(), gk_csr_LowFilter(), gk_csr_Prune(), gk_csr_Read(), gk_csr_Scale(), gk_csr_SortIndices(), gk_csr_TopKPlusFilter(), gk_csr_Write(), gk_csr_ZScoreFilter(), gk_dreadfilebin(), gk_freadfilebin(), gk_gkmcoreAdd(), gk_gkmcoreDel(), gk_gkmcorePop(), gk_graph_ComputeBestFOrdering(), gk_graph_ComputeBestFOrdering0(), gk_graph_Prune(), gk_graph_Read(), gk_graph_SortAdjacencies(), gk_graph_Write(), gk_i32readfilebin(), gk_i64readfilebin(), gk_malloc(), gk_mcoreAdd(), gk_mcoreDel(), gk_mcorePop(), gk_realloc(), GKDecodeBase64(), GKEncodeBase64(), Greedy_KWayOptimize(), HTable_SearchAndDelete(), Init2WayPartition(), InitKWayPartitioning(), InitSeparator(), METIS_PartGraphKway(), MlevelKWayPartitioning(), ProjectKWayPartition(), Refine2WayNode(), and SetupCtrl().
int gk_sigtrap | ( | ) |
This function sets a number of signal handlers and sets the return point of a longjmp
Definition at line 100 of file error.c.
References gk_cur_jbufs, gk_sigthrow(), old_SIGERR_handlers, and old_SIGMEM_handlers.
Referenced by METIS_MeshToDual(), METIS_MeshToNodal(), METIS_NodeND(), METIS_PartGraphKway(), METIS_PartGraphRecursive(), METIS_PartMeshDual(), and METIS_PartMeshNodal().
int gk_siguntrap | ( | ) |
This function sets the handlers for the signals to their default handlers
Definition at line 118 of file error.c.
References gk_cur_jbufs, old_SIGERR_handlers, and old_SIGMEM_handlers.
Referenced by METIS_MeshToDual(), METIS_MeshToNodal(), METIS_NodeND(), METIS_PartGraphKway(), METIS_PartGraphRecursive(), METIS_PartMeshDual(), and METIS_PartMeshNodal().
void gk_sigthrow | ( | int | signum | ) |
This function is the custome signal handler, which all it does is to perform a longjump to the most recent saved environment
Definition at line 137 of file error.c.
References gk_cur_jbufs, and gk_jbufs.
Referenced by gk_sigtrap().
void gk_SetSignalHandlers | ( | ) |
Definition at line 147 of file error.c.
References gk_NonLocalExit_Handler(), old_SIGERR_handler, and old_SIGMEM_handler.
void gk_UnsetSignalHandlers | ( | ) |
void gk_NonLocalExit_Handler | ( | int | signum | ) |
Definition at line 168 of file error.c.
References gk_jbuf.
Referenced by gk_SetSignalHandlers().
char* gk_strerror | ( | int | errnum | ) |
void PrintBackTrace | ( | ) |
Converts an element-based set membership into a CSR-format set-based membership.
For example, it takes an array such as part[] that stores where each element belongs to and returns a pair of arrays (pptr[], pind[]) that store in CSF format the list of elements belonging in each partition.
n | the number of elements in the array (e.g., # of vertices) | |
range | the cardinality of the set (e.g., # of partitions) | |
array | the array that stores the per-element set membership | |
ptr | the array that will store the starting indices in ind for the elements of each set. This is filled by the routine and its size should be at least range+1. | |
ind | the array that stores consecutively which elements belong to each set. The size of this array should be n. |
Definition at line 62 of file util.c.
References gk_idx_t.
Definition at line 83 of file util.c.
References gk_idx_t.
Referenced by gk_ispow2(), and METIS_PartGraphKway().
gk_wclock_t gk_WClockSeconds | ( | void | ) |
Definition at line 19 of file timers.c.
References stats::time().
char* gk_strchr_replace | ( | char * | str, | |
char * | fromlist, | |||
char * | tolist | |||
) |
Replaces certain characters in a string.
This function takes a string and replaces all the characters in the fromlist
with the corresponding characters from the tolist
. That is, each occurence of fromlist[i]
is replaced by tolist[i]
. If the tolist
is shorter than fromlist
, then the corresponding characters are deleted. The modifications on str
are done in place. It tries to provide a functionality similar to Perl's tr// function.
str | is the string whose characters will be replaced. | |
fromlist | is the set of characters to be replaced. | |
tolist | is the set of replacement characters . |
str
itself. Definition at line 40 of file string.c.
Referenced by ReadTPwgts().
int gk_strstr_replace | ( | char * | str, | |
char * | pattern, | |||
char * | replacement, | |||
char * | options, | |||
char ** | new_str | |||
) |
Regex-based search-and-replace function.
This function is a C implementation of Perl's s//
regular-expression based substitution function.
str | is the input string on which the operation will be performed. | |
pattern | is the regular expression for the pattern to be matched for substitution. | |
replacement | is the replacement string, in which the possible captured pattern substrings are referred to as $1, $2, ..., $9. The entire matched pattern is refered to as $0. | |
options | is a string specified options for the substitution operation. Currently the "i" (case insensitive) and "g" (global substitution) are supported. | |
new_str | is a reference to a pointer that will store a pointer to the newly created string that results from the substitutions. This string is allocated via gk_malloc() and needs to be freed using gk_free(). The string is returned even if no substitutions were performed. |
newstr
, which also needs to be freed afterwards. Definition at line 97 of file string.c.
References gk_free(), gk_idx_t, gk_realloc(), gk_strdup(), int, len, offset, REG_ESPACE, REG_NOMATCH, regcomp(), regerror(), regexec(), regfree(), regmatch_t::rm_eo, and regmatch_t::rm_so.
Referenced by test_strstr_replace().
char* gk_strtprune | ( | char * | str, | |
char * | rmlist | |||
) |
Prunes characters from the end of the string.
This function removes any trailing characters that are included in the rmlist
. The trimming stops at the last character (i.e., first character from the end) that is not in rmlist
. This function can be used to removed trailing spaces, newlines, etc. This is a distructive operation as it modifies the string.
str | is the string that will be trimmed. | |
rmlist | contains the set of characters that will be removed. |
str
itself. Definition at line 257 of file string.c.
Referenced by gk_readfile(), and main().
char* gk_strhprune | ( | char * | str, | |
char * | rmlist | |||
) |
Prunes characters from the beginning of the string.
This function removes any starting characters that are included in the rmlist
. The trimming stops at the first character that is not in rmlist
. This function can be used to removed leading spaces, tabs, etc. This is a distructive operation as it modifies the string.
str | is the string that will be trimmed. | |
rmlist | contains the set of characters that will be removed. |
str
itself. char* gk_strtoupper | ( | char * | str | ) |
Converts a string to upper case.
This function converts a string to upper case. This operation modifies the string itself.
str | is the string whose case will be changed. |
str
itself. Definition at line 331 of file string.c.
Referenced by gk_seq_ReadGKMODPSSM().
char* gk_strtolower | ( | char * | str | ) |
Converts a string to lower case.
This function converts a string to lower case. This operation modifies the string itself.
str | is the string whose case will be changed. |
str
itself. char* gk_strdup | ( | char * | orgstr | ) |
Duplicates a string.
This function is a replacement for C's standard strdup() function. The key differences between the two are that gk_strdup():
The string that is returned must be freed by gk_free().
orgstr | is the string that will be duplicated. |
Definition at line 375 of file string.c.
References gk_malloc(), and len.
Referenced by getpathname(), gk_getbasename(), gk_getextname(), gk_getfilename(), gk_readfile(), gk_readpdbfile(), gk_strstr_replace(), gk_strtokenize(), main(), parse_cmdline(), and test_skvsort().
int gk_strcasecmp | ( | char * | s1, | |
char * | s2 | |||
) |
Case insensitive string comparison.
This function compares two strings for equality by ignoring the case of the strings.
s1 | is the first string to be compared. | |
s2 | is the second string to be compared. |
1 | if the strings are identical, | |
0 | otherwise. |
Definition at line 408 of file string.c.
Referenced by gk_GetStringID().
int gk_strrcmp | ( | char * | s1, | |
char * | s2 | |||
) |
Compare two strings in revere order.
This function is similar to strcmp but it performs the comparison as if the two strings were reversed.
s1 | is the first string to be compared. | |
s2 | is the second string to be compared. |
-1,0,1,if | the s1 < s2, s1 == s2, or s1 > s2. |
char* gk_time2str | ( | time_t | time | ) |
Converts a time_t time into a string.
This function takes a time_t-specified time and returns a string-formated representation of the corresponding time. The format of the string is mm/dd/yyyy hh:mm:ss, in which the hours are in military time.
time | is the time to be converted. |
time_t gk_str2time | ( | char * | str | ) |
Converts a date/time string into its equivalent time_t value.
This function takes date and/or time specification and converts it in the equivalent time_t representation. The conversion is done using the strptime() function. The format that gk_str2time() understands is mm/dd/yyyy hh:mm:ss, in which the hours are in military time.
str | is the date/time string to be converted. |
int gk_GetStringID | ( | gk_StringMap_t * | strmap, | |
char * | key | |||
) |
Definition at line 524 of file string.c.
References gk_strcasecmp(), gk_StringMap_t::id, name, and gk_StringMap_t::name.
Referenced by parse_cmdline().
void gk_csorti | ( | size_t | n, | |
char * | base | |||
) |
void gk_csortd | ( | size_t | n, | |
char * | base | |||
) |
Sorts an array of integers in increasing order
Definition at line 45 of file sort.c.
Referenced by test_isort().
Sorts an array of integers in decreasing order
Definition at line 56 of file sort.c.
Referenced by test_isort().
Sorts an array of floats in increasing order
Definition at line 67 of file sort.c.
Referenced by test_fsort().
Sorts an array of floats in decreasing order
Definition at line 78 of file sort.c.
Referenced by test_fsort().
void gk_dsorti | ( | size_t | n, | |
double * | base | |||
) |
void gk_dsortd | ( | size_t | n, | |
double * | base | |||
) |
Sorts an array of gk_idx_t in increasing order
Definition at line 111 of file sort.c.
References gk_idx_t.
Referenced by test_idxsort().
Sorts an array of gk_idx_t in decreasing order
Definition at line 122 of file sort.c.
References gk_idx_t.
Referenced by test_idxsort().
void gk_ckvsorti | ( | size_t | n, | |
gk_ckv_t * | base | |||
) |
void gk_ckvsortd | ( | size_t | n, | |
gk_ckv_t * | base | |||
) |
void gk_ikvsorti | ( | size_t | n, | |
gk_ikv_t * | base | |||
) |
Sorts an array of gk_ikv_t in increasing order
Definition at line 157 of file sort.c.
Referenced by gk_csr_SortIndices(), gk_graph_SortAdjacencies(), itemsets_project_matrix(), and test_ikvsort().
void gk_ikvsortd | ( | size_t | n, | |
gk_ikv_t * | base | |||
) |
Sorts an array of gk_ikv_t in decreasing order
Definition at line 168 of file sort.c.
Referenced by gk_csr_CompactColumns(), and test_ikvsort().
void gk_i32kvsorti | ( | size_t | n, | |
gk_i32kv_t * | base | |||
) |
void gk_i32kvsortd | ( | size_t | n, | |
gk_i32kv_t * | base | |||
) |
void gk_i64kvsorti | ( | size_t | n, | |
gk_i64kv_t * | base | |||
) |
void gk_i64kvsortd | ( | size_t | n, | |
gk_i64kv_t * | base | |||
) |
void gk_zkvsorti | ( | size_t | n, | |
gk_zkv_t * | base | |||
) |
void gk_zkvsortd | ( | size_t | n, | |
gk_zkv_t * | base | |||
) |
void gk_fkvsorti | ( | size_t | n, | |
gk_fkv_t * | base | |||
) |
Sorts an array of gk_fkv_t in increasing order
Definition at line 245 of file sort.c.
Referenced by reorder_centroid(), and test_fkvsort().
void gk_fkvsortd | ( | size_t | n, | |
gk_fkv_t * | base | |||
) |
Sorts an array of gk_fkv_t in decreasing order
Definition at line 256 of file sort.c.
Referenced by gk_csr_GetSimilarRows(), gk_csr_LowFilter(), gk_csr_TopKPlusFilter(), and test_fkvsort().
void gk_dkvsorti | ( | size_t | n, | |
gk_dkv_t * | base | |||
) |
Sorts an array of gk_dkv_t in increasing order
Definition at line 267 of file sort.c.
Referenced by test_dkvsort().
void gk_dkvsortd | ( | size_t | n, | |
gk_dkv_t * | base | |||
) |
Sorts an array of gk_fkv_t in decreasing order
Definition at line 278 of file sort.c.
Referenced by test_dkvsort().
void gk_skvsorti | ( | size_t | n, | |
gk_skv_t * | base | |||
) |
Sorts an array of gk_skv_t in increasing order
Definition at line 289 of file sort.c.
Referenced by test_skvsort().
void gk_skvsortd | ( | size_t | n, | |
gk_skv_t * | base | |||
) |
Sorts an array of gk_skv_t in decreasing order
Definition at line 300 of file sort.c.
Referenced by test_skvsort().
void gk_idxkvsorti | ( | size_t | n, | |
gk_idxkv_t * | base | |||
) |
Sorts an array of gk_idxkv_t in increasing order
Definition at line 311 of file sort.c.
Referenced by test_idxkvsort().
void gk_idxkvsortd | ( | size_t | n, | |
gk_idxkv_t * | base | |||
) |
Sorts an array of gk_idxkv_t in decreasing order
Definition at line 322 of file sort.c.
Referenced by test_idxkvsort().
This function puts the 'topk' largest values in the beginning of the array
Definition at line 20 of file fkvkselect.c.
References key.
Referenced by gk_csr_GetSimilarRows().
This function puts the 'topk' smallest values in the beginning of the array
Definition at line 84 of file fkvkselect.c.
References key.
gk_idx_t gk_idx_t gk_idx_t gk_HTable_t* HTable_Create | ( | int | nelements | ) |
Definition at line 16 of file htable.c.
References gk_malloc(), gk_HTable_t::harray, HTable_Reset(), and gk_HTable_t::nelements.
void HTable_Reset | ( | gk_HTable_t * | htable | ) |
Definition at line 33 of file htable.c.
References gk_HTable_t::harray, gk_HTable_t::htsize, and gk_HTable_t::nelements.
Referenced by HTable_Create().
void HTable_Resize | ( | gk_HTable_t * | htable, | |
int | nelements | |||
) |
Definition at line 46 of file htable.c.
References gk_free(), gk_HTable_t::harray, HTable_Insert(), gk_HTable_t::htsize, key, and gk_HTable_t::nelements.
Referenced by HTable_Insert().
void HTable_Insert | ( | gk_HTable_t * | htable, | |
int | key, | |||
int | val | |||
) |
Definition at line 74 of file htable.c.
References gk_HTable_t::harray, HTable_HFunction(), HTable_Resize(), gk_HTable_t::htsize, and gk_HTable_t::nelements.
Referenced by HTable_Resize().
void HTable_Delete | ( | gk_HTable_t * | htable, | |
int | key | |||
) |
Definition at line 107 of file htable.c.
References gk_HTable_t::harray, HTable_HFunction(), gk_HTable_t::htsize, and gk_HTable_t::nelements.
int HTable_Search | ( | gk_HTable_t * | htable, | |
int | key | |||
) |
Definition at line 135 of file htable.c.
References gk_HTable_t::harray, HTable_HFunction(), and gk_HTable_t::nelements.
int HTable_GetNext | ( | gk_HTable_t * | htable, | |
int | key, | |||
int * | val, | |||
int | type | |||
) |
Definition at line 162 of file htable.c.
References gk_HTable_t::harray, HTable_HFunction(), and gk_HTable_t::nelements.
int HTable_SearchAndDelete | ( | gk_HTable_t * | htable, | |
int | key | |||
) |
Definition at line 200 of file htable.c.
References gk_errexit(), gk_HTable_t::harray, HTable_HFunction(), gk_HTable_t::htsize, and gk_HTable_t::nelements.
void HTable_Destroy | ( | gk_HTable_t * | htable | ) |
Definition at line 235 of file htable.c.
References gk_free(), and gk_HTable_t::harray.
Definition at line 244 of file htable.c.
Referenced by HTable_Delete(), HTable_GetNext(), HTable_Insert(), HTable_Search(), and HTable_SearchAndDelete().
void gk_strtokenize | ( | char * | line, | |
char * | delim, | |||
gk_Tokens_t * | tokens | |||
) |
Definition at line 22 of file tokenizer.c.
References gk_malloc(), gk_strdup(), gk_Tokens_t::list, gk_Tokens_t::ntoks, and gk_Tokens_t::strbuf.
Referenced by gk_seq_ReadGKMODPSSM().
void gk_freetokenslist | ( | gk_Tokens_t * | tokens | ) |
Definition at line 73 of file tokenizer.c.
References gk_free(), gk_Tokens_t::list, and gk_Tokens_t::strbuf.
Referenced by gk_seq_ReadGKMODPSSM().
void encodeblock | ( | unsigned char * | in, | |
unsigned char * | out | |||
) |
Definition at line 28 of file b64.c.
Referenced by GKEncodeBase64().
void decodeblock | ( | unsigned char * | in, | |
unsigned char * | out | |||
) |
Definition at line 46 of file b64.c.
Referenced by GKDecodeBase64().
void GKEncodeBase64 | ( | int | nbytes, | |
unsigned char * | inbuffer, | |||
unsigned char * | outbuffer | |||
) |
Definition at line 64 of file b64.c.
References encodeblock(), and gk_errexit().
void GKDecodeBase64 | ( | int | nbytes, | |
unsigned char * | inbuffer, | |||
unsigned char * | outbuffer | |||
) |
Definition at line 85 of file b64.c.
References decodeblock(), and gk_errexit().
GK_MKRANDOM_PROTO | ( | gk_c | , | |
size_t | , | |||
char | ||||
) |
uint64_t gk_randint64 | ( | void | ) |
Definition at line 84 of file random.c.
References gk_randinit(), int, and x.
Referenced by gk_randint32().
uint32_t gk_randint32 | ( | void | ) |
Definition at line 125 of file random.c.
References gk_randint64().
gk_csr_t* gk_csr_Create | ( | ) |
Allocate memory for a CSR matrix and initializes it
Definition at line 19 of file csr.c.
References gk_csr_Init(), gk_csr_t, and gk_malloc().
Referenced by gk_csr_Dup(), gk_csr_ExtractPartition(), gk_csr_ExtractRows(), gk_csr_ExtractSubmatrix(), gk_csr_LowFilter(), gk_csr_Prune(), gk_csr_Read(), gk_csr_Split(), gk_csr_TopKPlusFilter(), gk_csr_ZScoreFilter(), gk_find_frequent_itemsets(), and itemsets_project_matrix().
void gk_csr_Init | ( | gk_csr_t * | mat | ) |
Initializes the matrix
mat | is the matrix to be initialized. |
Definition at line 36 of file csr.c.
References gk_csr_t.
Referenced by gk_csr_Create().
void gk_csr_Free | ( | gk_csr_t ** | mat | ) |
Frees all the memory allocated for matrix.
mat | is the matrix to be freed. |
Definition at line 48 of file csr.c.
References gk_csr_FreeContents(), and gk_free().
Referenced by gk_csr_LowFilter(), gk_csr_Prune(), gk_csr_TopKPlusFilter(), gk_csr_ZScoreFilter(), gk_find_frequent_itemsets(), itemsets_find_frequent_itemsets(), and main().
void gk_csr_FreeContents | ( | gk_csr_t * | mat | ) |
Frees only the memory allocated for the matrix's different fields and sets them to NULL.
mat | is the matrix whose contents will be freed. |
Definition at line 63 of file csr.c.
References gk_free().
Referenced by gk_csr_Free().
Returns a copy of a matrix.
mat | is the matrix to be duplicated. |
Definition at line 80 of file csr.c.
References gk_csr_Create(), and gk_csr_t.
Returns a submatrix containint a set of consecutive rows.
mat | is the original matrix. | |
rstart | is the starting row. | |
nrows | is the number of rows from rstart to extract. |
Definition at line 135 of file csr.c.
References gk_csr_Create(), and gk_csr_t.
Returns a submatrix containing a certain set of rows.
mat | is the original matrix. | |
nrows | is the number of rows to extract. | |
rind | is the set of row numbers to extract. |
Definition at line 191 of file csr.c.
References gk_csr_Create(), and gk_csr_t.
Returns a submatrix corresponding to a specified partitioning of rows.
mat | is the original matrix. | |
part | is the partitioning vector of the rows. | |
pid | is the partition ID that will be extracted. |
Definition at line 230 of file csr.c.
References gk_csr_Create(), and gk_csr_t.
Splits the matrix into multiple sub-matrices based on the provided color array.
mat | is the original matrix. | |
color | is an array of size equal to the number of non-zeros in the matrix (row-wise structure). The matrix is split into as many parts as the number of colors. For meaningfull results, the colors should be numbered consecutively starting from 0. |
Definition at line 277 of file csr.c.
References gk_csr_Create(), gk_csr_t, and gk_malloc().
Reads a CSR matrix from the supplied file and stores it the matrix's forward structure.
filename | is the file that stores the data. | |
format | is either GK_CSR_FMT_METIS, GK_CSR_FMT_CLUTO, GK_CSR_FMT_CSR, GK_CSR_FMT_BINROW, GK_CSR_FMT_BINCOL specifying the type of the input format. The GK_CSR_FMT_CSR does not contain a header line, whereas the GK_CSR_FMT_BINROW is a binary format written by gk_csr_Write() using the same format specifier. | |
readvals | is either 1 or 0, indicating if the CSR file contains values or it does not. It only applies when GK_CSR_FMT_CSR is used. | |
numbering | is either 1 or 0, indicating if the numbering of the indices start from 1 or 0, respectively. If they start from 1, they are automatically decreamented during input so that they will start from 0. It only applies when GK_CSR_FMT_CSR is used. |
Definition at line 349 of file csr.c.
References errexit(), float, gk_csr_Create(), gk_csr_t, gk_errexit(), gk_fclose(), gk_fexists(), gk_fopen(), gk_free(), gk_getfilestats(), gk_getline(), int, int32_t, PUP::l, and ncon.
Referenced by main().
Writes the row-based structure of a matrix into a file.
mat | is the matrix to be written, | |
filename | is the name of the output file. | |
format | is one of: GK_CSR_FMT_CLUTO, GK_CSR_FMT_CSR, GK_CSR_FMT_BINROW, GK_CSR_FMT_BINCOL. | |
writevals | is either 1 or 0 indicating if the values will be written or not. This is only applicable when GK_CSR_FMT_CSR is used. | |
numbering | is either 1 or 0 indicating if the internal 0-based numbering will be shifted by one or not during output. This is only applicable when GK_CSR_FMT_CSR is used. |
Definition at line 591 of file csr.c.
References gk_errexit(), gk_fclose(), gk_fopen(), and int32_t.
Prunes certain rows/columns of the matrix. The prunning takes place by analyzing the row structure of the matrix. The prunning takes place by removing rows/columns but it does not affect the numbering of the remaining rows/columns.
mat | the matrix to be prunned, | |
what | indicates if the rows (GK_CSR_ROW) or the columns (GK_CSR_COL) of the matrix will be prunned, | |
minf | is the minimum number of rows (columns) that a column (row) must be present in order to be kept, | |
maxf | is the maximum number of rows (columns) that a column (row) must be present at in order to be kept. |
Definition at line 669 of file csr.c.
References gk_csr_Create(), gk_csr_Free(), gk_csr_t, gk_errexit(), and gk_free().
Eliminates certain entries from the rows/columns of the matrix. The filtering takes place by keeping only the highest weight entries whose sum accounts for a certain fraction of the overall weight of the row/column.
mat | the matrix to be prunned, | |
what | indicates if the rows (GK_CSR_ROW) or the columns (GK_CSR_COL) of the matrix will be prunned, | |
norm | indicates the norm that will be used to aggregate the weights and possible values are 1 or 2, | |
fraction | is the fraction of the overall norm that will be retained by the kept entries. |
Definition at line 759 of file csr.c.
References gk_csr_Create(), gk_csr_Free(), gk_csr_t, gk_errexit(), gk_fkvsortd(), and gk_free().
Eliminates certain entries from the rows/columns of the matrix. The filtering takes place by keeping only the highest weight top-K entries along each row/column and those entries whose weight is greater than a specified value.
mat | the matrix to be prunned, | |
what | indicates if the rows (GK_CSR_ROW) or the columns (GK_CSR_COL) of the matrix will be prunned, | |
topk | is the number of the highest weight entries to keep. | |
keepval | is the weight of a term above which will be kept. This is used to select additional terms past the first topk. |
Definition at line 901 of file csr.c.
References gk_csr_Create(), gk_csr_Free(), gk_csr_t, gk_errexit(), gk_fkvsortd(), gk_free(), and key.
Eliminates certain entries from the rows/columns of the matrix. The filtering takes place by keeping only the terms whose contribution to the total length of the document is greater than a user-splied multiple over the average.
This routine assumes that the vectors are normalized to be unit length.
mat | the matrix to be prunned, | |
what | indicates if the rows (GK_CSR_ROW) or the columns (GK_CSR_COL) of the matrix will be prunned, | |
zscore | is the multiplicative factor over the average contribution to the length of the document. |
Definition at line 1031 of file csr.c.
References gk_csr_Create(), gk_csr_Free(), gk_csr_t, and gk_errexit().
void gk_csr_CompactColumns | ( | gk_csr_t * | mat | ) |
Compacts the column-space of the matrix by removing empty columns. As a result of the compaction, the column numbers are renumbered. The compaction operation is done in place and only affects the row-based representation of the matrix. The new columns are ordered in decreasing frequency.
mat | the matrix whose empty columns will be removed. |
Definition at line 1098 of file csr.c.
References gk_free(), gk_ikvsortd(), and key.
Sorts the indices in increasing order
mat | the matrix itself, | |
what | is either GK_CSR_ROW or GK_CSR_COL indicating which set of indices to sort. |
Definition at line 1146 of file csr.c.
References gk_errexit(), gk_free(), gk_ikvsorti(), n, and nn.
Creates a row/column index from the column/row data.
mat | the matrix itself, | |
what | is either GK_CSR_ROW or GK_CSR_COL indicating which index will be created. |
Definition at line 1223 of file csr.c.
References gk_errexit(), and gk_free().
Referenced by gk_find_frequent_itemsets(), and main().
Normalizes the rows/columns of the matrix to be unit length.
mat | the matrix itself, | |
what | indicates what will be normalized and is obtained by specifying GK_CSR_ROW, GK_CSR_COL, GK_CSR_ROW|GK_CSR_COL. | |
norm | indicates what norm is to normalize to, 1: 1-norm, 2: 2-norm |
Definition at line 1319 of file csr.c.
References n.
Applies different row scaling methods.
mat | the matrix itself, | |
type | indicates the type of row scaling. Possible values are: GK_CSR_MAXTF, GK_CSR_SQRT, GK_CSR_LOG, GK_CSR_IDF, GK_CSR_MAXTF2. |
Definition at line 1389 of file csr.c.
References gk_errexit(), and gk_free().
Computes the sums of the rows/columns
mat | the matrix itself, | |
what | is either GK_CSR_ROW or GK_CSR_COL indicating which sums to compute. |
Definition at line 1600 of file csr.c.
References gk_errexit(), gk_free(), and n.
Computes the squared of the norms of the rows/columns
mat | the matrix itself, | |
what | is either GK_CSR_ROW or GK_CSR_COL indicating which squared norms to compute. |
Definition at line 1646 of file csr.c.
References gk_errexit(), gk_free(), and n.
Computes the similarity between two rows/columns
mat | the matrix itself. The routine assumes that the indices are sorted in increasing order. | |
i1 | is the first row/column, | |
i2 | is the second row/column, | |
what | is either GK_CSR_ROW or GK_CSR_COL indicating the type of objects between the similarity will be computed, | |
simtype | is the type of similarity and is one of GK_CSR_COS, GK_CSR_JAC, GK_CSR_MIN, GK_CSR_AMIN |
Definition at line 1697 of file csr.c.
References gk_errexit().
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 * | i_marker, | |||
gk_fkv_t * | i_cand | |||
) |
Finds the n most similar rows (neighbors) to the query using cosine similarity.
mat | the matrix itself | |
nqterms | is the number of columns in the query | |
qind | is the list of query columns | |
qval | is the list of correspodning query weights | |
simtype | is the type of similarity and is one of GK_CSR_COS, GK_CSR_JAC, GK_CSR_MIN, GK_CSR_AMIN | |
nsim | is the maximum number of requested most similar rows. If -1 is provided, then everything is returned unsorted. | |
minsim | is the minimum similarity of the requested most similar rows | |
hits | is the result set. This array should be at least of length nsim. | |
i_marker | is an array of size equal to the number of rows whose values are initialized to -1. If NULL is provided then this array is allocated and freed internally. | |
i_cand | is an array of size equal to the number of rows. If NULL is provided then this array is allocated and freed internally. |
Definition at line 1869 of file csr.c.
References gk_dfkvkselect(), gk_errexit(), gk_fkvsortd(), gk_free(), and key.
Definition at line 16 of file evaluate.c.
Definition at line 81 of file evaluate.c.
Definition at line 107 of file evaluate.c.
Referenced by ComputeStdDev().
Definition at line 121 of file evaluate.c.
References ComputeMean().
gk_mcore_t* gk_mcoreCreate | ( | size_t | coresize | ) |
This function creates an mcore
Definition at line 18 of file mcore.c.
References gk_mcore_t::cmop, gk_mcore_t::core, gk_mcore_t::corecpos, gk_mcore_t::coresize, gk_malloc(), gk_mcore_t::mops, and gk_mcore_t::nmops.
Referenced by AllocateWorkSpace().
gk_mcore_t* gk_gkmcoreCreate | ( | ) |
This function creates an mcore. This version is used for gkmcore.
Definition at line 43 of file mcore.c.
References gk_mcore_t::cmop, free(), malloc(), gk_mcore_t::mops, and gk_mcore_t::nmops.
Referenced by gk_malloc_init().
void gk_mcoreDestroy | ( | gk_mcore_t ** | r_mcore, | |
int | showstats | |||
) |
This function destroys an mcore.
Definition at line 67 of file mcore.c.
References gk_mcore_t::cmop, gk_mcore_t::core, gk_mcore_t::coresize, gk_mcore_t::cur_callocs, gk_mcore_t::cur_hallocs, gk_free(), gk_mcore_t::max_callocs, gk_mcore_t::max_hallocs, gk_mcore_t::mops, gk_mcore_t::nmops, gk_mcore_t::num_callocs, gk_mcore_t::num_hallocs, gk_mcore_t::size_callocs, and gk_mcore_t::size_hallocs.
Referenced by FreeWorkSpace().
void gk_gkmcoreDestroy | ( | gk_mcore_t ** | r_mcore, | |
int | showstats | |||
) |
This function destroys an mcore. This version is for gkmcore.
Definition at line 103 of file mcore.c.
References gk_mcore_t::cmop, gk_mcore_t::cur_hallocs, free(), gk_mcore_t::max_hallocs, gk_mcore_t::mops, gk_mcore_t::nmops, gk_mcore_t::num_hallocs, and gk_mcore_t::size_hallocs.
Referenced by gk_malloc_cleanup().
void* gk_mcoreMalloc | ( | gk_mcore_t * | mcore, | |
size_t | nbytes | |||
) |
This function allocate space from the core/heap
Definition at line 140 of file mcore.c.
References gk_mcore_t::core, gk_mcore_t::corecpos, gk_malloc(), and gk_mcoreAdd().
Referenced by wspacemalloc().
void gk_mcorePush | ( | gk_mcore_t * | mcore | ) |
This function sets a marker in the stack of malloc ops to be used subsequently for freeing purposes
Definition at line 175 of file mcore.c.
References gk_mcoreAdd().
Referenced by wspacepush().
void gk_gkmcorePush | ( | gk_mcore_t * | mcore | ) |
This function sets a marker in the stack of malloc ops to be used subsequently for freeing purposes. This is the gkmcore version.
Definition at line 187 of file mcore.c.
References gk_gkmcoreAdd().
Referenced by gk_malloc_init().
void gk_mcorePop | ( | gk_mcore_t * | mcore | ) |
This function frees all mops since the last push
Definition at line 198 of file mcore.c.
References gk_mcore_t::cmop, gk_mcore_t::corecpos, gk_mcore_t::coresize, gk_mcore_t::cur_callocs, gk_mcore_t::cur_hallocs, errexit(), gk_errexit(), gk_free(), gk_mcore_t::mops, gk_mop_t::nbytes, gk_mop_t::ptr, and gk_mop_t::type.
Referenced by wspacepop().
void gk_gkmcorePop | ( | gk_mcore_t * | mcore | ) |
This function frees all mops since the last push. This version is for poping the gkmcore and it uses free instead of gk_free.
Definition at line 237 of file mcore.c.
References gk_mcore_t::cmop, gk_mcore_t::cur_hallocs, free(), gk_errexit(), gk_mcore_t::mops, gk_mop_t::nbytes, gk_mop_t::ptr, and gk_mop_t::type.
Referenced by gk_malloc_cleanup().
void gk_mcoreAdd | ( | gk_mcore_t * | mcore, | |
int | type, | |||
size_t | nbytes, | |||
void * | ptr | |||
) |
Adds a memory allocation at the end of the list.
Definition at line 265 of file mcore.c.
References gk_mcore_t::cmop, gk_mcore_t::cur_callocs, gk_mcore_t::cur_hallocs, gk_errexit(), gk_mcore_t::max_callocs, gk_mcore_t::max_hallocs, gk_mcore_t::mops, gk_mop_t::nbytes, gk_mcore_t::nmops, gk_mcore_t::num_callocs, gk_mcore_t::num_hallocs, gk_mop_t::ptr, realloc(), gk_mcore_t::size_callocs, gk_mcore_t::size_hallocs, and gk_mop_t::type.
Referenced by gk_mcoreMalloc(), and gk_mcorePush().
void gk_gkmcoreAdd | ( | gk_mcore_t * | mcore, | |
int | type, | |||
size_t | nbytes, | |||
void * | ptr | |||
) |
Adds a memory allocation at the end of the list. This is the gkmcore version.
Definition at line 309 of file mcore.c.
References gk_mcore_t::cmop, gk_mcore_t::cur_hallocs, gk_errexit(), gk_mcore_t::max_hallocs, gk_mcore_t::mops, gk_mop_t::nbytes, gk_mcore_t::nmops, gk_mcore_t::num_hallocs, gk_mop_t::ptr, realloc(), gk_mcore_t::size_hallocs, and gk_mop_t::type.
Referenced by gk_gkmcorePush(), gk_malloc(), and gk_realloc().
void gk_mcoreDel | ( | gk_mcore_t * | mcore, | |
void * | ptr | |||
) |
This function deletes the mop associated with the supplied pointer. The mop has to be a heap allocation, otherwise it fails violently.
Definition at line 345 of file mcore.c.
References gk_mcore_t::cmop, gk_mcore_t::cur_hallocs, gk_errexit(), gk_mcore_t::mops, gk_mop_t::nbytes, gk_mop_t::ptr, and gk_mop_t::type.
void gk_gkmcoreDel | ( | gk_mcore_t * | mcore, | |
void * | ptr | |||
) |
This function deletes the mop associated with the supplied pointer. The mop has to be a heap allocation, otherwise it fails violently. This is the gkmcore version.
Definition at line 373 of file mcore.c.
References gk_mcore_t::cmop, gk_mcore_t::cur_hallocs, gk_errexit(), gk_mcore_t::mops, gk_mop_t::nbytes, gk_mop_t::ptr, and gk_mop_t::type.
Referenced by gk_free(), and gk_realloc().
Computes the (personalized) page-rank of the vertices in a graph.
mat | is the matrix storing the graph. | |
lamda | is the restart probability. | |
eps | is the error tolerance for convergance. | |
max_niter | is the maximum number of allowed iterations. | |
pr | on entry stores the restart distribution of the vertices. This allows for the computation of personalized page-rank scores by appropriately setting that parameter. On return, pr stores the computed page ranks. |
Definition at line 29 of file rw.c.
References gk_free().
Referenced by main().
gk_graph_t* gk_graph_Create | ( | ) |
Allocate memory for a graph and initializes it
Definition at line 19 of file graph.c.
References gk_graph_Init(), and gk_malloc().
Referenced by gk_graph_Dup(), gk_graph_ExtractPartition(), gk_graph_ExtractRows(), gk_graph_ExtractSubgraph(), gk_graph_Prune(), gk_graph_Read(), gk_graph_Reorder(), and gk_graph_Split().
void gk_graph_Init | ( | gk_graph_t * | graph | ) |
Initializes the graph.
Definition at line 36 of file graph.c.
References gk_graph_t::nvtxs.
Referenced by gk_graph_Create().
void gk_graph_Free | ( | gk_graph_t ** | graph | ) |
Frees all the memory allocated for a graph.
Definition at line 48 of file graph.c.
References gk_free(), and gk_graph_FreeContents().
Referenced by gk_graph_Prune(), and main().
void gk_graph_FreeContents | ( | gk_graph_t * | graph | ) |
Frees only the memory allocated for the graph's different fields and sets them to NULL.
Definition at line 63 of file graph.c.
References gk_graph_t::adjncy, gk_graph_t::fadjwgt, gk_graph_t::fvsizes, gk_graph_t::fvwgts, gk_free(), gk_graph_t::iadjwgt, gk_graph_t::ivsizes, gk_graph_t::ivwgts, gk_graph_t::vlabels, and gk_graph_t::xadj.
Referenced by gk_graph_Free().
gk_graph_t* gk_graph_Read | ( | char * | filename, | |
int | format, | |||
int | isfewgts, | |||
int | isfvwgts, | |||
int | isfvsizes | |||
) |
Reads a sparse graph from the supplied file
filename | is the file that stores the data. | |
format | is the graph format. The supported values are: GK_GRAPH_FMT_METIS. | |
isfewgts | is 1 if the edge-weights should be read as floats | |
isfvwgts | is 1 if the vertex-weights should be read as floats | |
isfvsizes | is 1 if the vertex-sizes should be read as floats |
Definition at line 85 of file graph.c.
References gk_graph_t::adjncy, gk_graph_t::fadjwgt, float, gk_graph_t::fvsizes, gk_graph_t::fvwgts, gk_errexit(), gk_fclose(), gk_fexists(), gk_fopen(), gk_free(), gk_getline(), gk_graph_Create(), gk_graph_t::iadjwgt, int, int32_t, gk_graph_t::ivsizes, gk_graph_t::ivwgts, PUP::l, ncon, gk_graph_t::nvtxs, and gk_graph_t::xadj.
Referenced by main().
void gk_graph_Write | ( | gk_graph_t * | graph, | |
char * | filename, | |||
int | format | |||
) |
Writes a graph into a file.
graph | is the graph to be written, | |
filename | is the name of the output file. | |
format | is one of GK_GRAPH_FMT_METIS specifying the format of the output file. |
Definition at line 277 of file graph.c.
References gk_graph_t::adjncy, gk_graph_t::fadjwgt, gk_graph_t::fvsizes, gk_graph_t::fvwgts, gk_errexit(), gk_fclose(), gk_fopen(), gk_graph_t::iadjwgt, gk_graph_t::ivsizes, gk_graph_t::ivwgts, gk_graph_t::nvtxs, xadj, and gk_graph_t::xadj.
Referenced by main().
gk_graph_t* gk_graph_Dup | ( | gk_graph_t * | graph | ) |
Returns a copy of a graph.
Definition at line 340 of file graph.c.
References gk_graph_t::adjncy, gk_graph_t::fadjwgt, gk_graph_t::fvsizes, gk_graph_t::fvwgts, gk_graph_Create(), gk_graph_t::iadjwgt, gk_graph_t::ivsizes, gk_graph_t::ivwgts, gk_graph_t::nvtxs, gk_graph_t::vlabels, and gk_graph_t::xadj.
gk_graph_t* gk_graph_ExtractSubgraph | ( | gk_graph_t * | graph, | |
int | vstart, | |||
int | nvtxs | |||
) |
Returns a subgraph containing a set of consecutive vertices.
graph | is the original graph. | |
vstart | is the starting vertex. | |
nvtxs | is the number of vertices from vstart to extract. |
Definition at line 391 of file graph.c.
References gk_graph_t::adjncy, gk_graph_t::fadjwgt, gk_graph_t::fvsizes, gk_graph_t::fvwgts, gk_graph_Create(), gk_graph_t::iadjwgt, gk_graph_t::ivsizes, gk_graph_t::ivwgts, gk_graph_t::nvtxs, gk_graph_t::vlabels, and gk_graph_t::xadj.
gk_graph_t* gk_graph_Reorder | ( | gk_graph_t * | graph, | |
int32_t * | perm, | |||
int32_t * | iperm | |||
) |
Returns a graph that has been reordered according to the permutation.
IN] | graph is the graph to be re-ordered. | |
IN] | perm is the new ordering of the graph's vertices | |
IN] | iperm is the original ordering of the re-ordered graph's vertices |
Definition at line 460 of file graph.c.
References gk_graph_t::adjncy, adjncy, gk_graph_t::fadjwgt, gk_graph_t::fvsizes, gk_graph_t::fvwgts, gk_free(), gk_graph_Create(), gk_graph_t::iadjwgt, int32_t, gk_graph_t::ivsizes, gk_graph_t::ivwgts, gk_graph_t::nvtxs, PUP::u, gk_graph_t::vlabels, gk_graph_t::xadj, and xadj.
Referenced by main().
int gk_graph_FindComponents | ( | gk_graph_t * | graph, | |
int32_t * | cptr, | |||
int32_t * | cind | |||
) |
This function finds the connected components in a graph.
graph | is the graph structure | |
cptr | is the ptr structure of the CSR representation of the components. The length of this vector must be graph->nvtxs+1. | |
cind | is the indices structure of the CSR representation of the components. The length of this vector must be graph->nvtxs. |
Definition at line 572 of file graph.c.
References gk_graph_t::adjncy, adjncy, gk_free(), int32_t, gk_graph_t::nvtxs, gk_graph_t::xadj, and xadj.
void gk_graph_ComputeBFSOrdering | ( | gk_graph_t * | graph, | |
int | v, | |||
int32_t ** | r_perm, | |||
int32_t ** | r_iperm | |||
) |
This function computes a permutation of the vertices based on a breadth-first-traversal. It can be used for re-ordering the graph to reduce its bandwidth for better cache locality. The algorithm used is a simplified version of the method used to find the connected components.
IN] | graph is the graph structure | |
IN] | v is the starting vertex of the BFS | |
OUT] | perm[i] stores the ID of vertex i in the re-ordered graph. | |
OUT] | iperm[i] stores the ID of the vertex that corresponds to the ith vertex in the re-ordered graph. |
Definition at line 665 of file graph.c.
References gk_graph_t::adjncy, adjncy, gk_free(), int32_t, gk_graph_t::nvtxs, gk_graph_t::xadj, and xadj.
Referenced by main().
void gk_graph_ComputeBestFOrdering0 | ( | gk_graph_t * | graph, | |
int | v, | |||
int | type, | |||
int32_t ** | r_perm, | |||
int32_t ** | r_iperm | |||
) |
This function computes a permutation of the vertices based on a best-first-traversal. It can be used for re-ordering the graph to reduce its bandwidth for better cache locality.
IN] | graph is the graph structure. | |
IN] | v is the starting vertex of the best-first traversal. | |
IN] | type indicates the criteria to use to measure the 'bestness' of a vertex. | |
OUT] | perm[i] stores the ID of vertex i in the re-ordered graph. | |
OUT] | iperm[i] stores the ID of the vertex that corresponds to the ith vertex in the re-ordered graph. |
Definition at line 762 of file graph.c.
References gk_graph_t::adjncy, adjncy, degrees, gk_errexit(), gk_free(), gk_i32pq_t, int32_t, gk_graph_t::nvtxs, Ck::IO::open(), perm, PUP::u, gk_graph_t::xadj, and xadj.
void gk_graph_ComputeBestFOrdering | ( | gk_graph_t * | graph, | |
int | v, | |||
int | type, | |||
int32_t ** | r_perm, | |||
int32_t ** | r_iperm | |||
) |
This function computes a permutation of the vertices based on a best-first-traversal. It can be used for re-ordering the graph to reduce its bandwidth for better cache locality.
IN] | graph is the graph structure. | |
IN] | v is the starting vertex of the best-first traversal. | |
IN] | type indicates the criteria to use to measure the 'bestness' of a vertex. | |
OUT] | perm[i] stores the ID of vertex i in the re-ordered graph. | |
OUT] | iperm[i] stores the ID of the vertex that corresponds to the ith vertex in the re-ordered graph. |
Definition at line 887 of file graph.c.
References gk_graph_t::adjncy, adjncy, degrees, gk_errexit(), gk_free(), gk_i32pq_t, int32_t, level, gk_graph_t::nvtxs, perm, PUP::u, gk_graph_t::xadj, and xadj.
Referenced by main().
void gk_graph_SingleSourceShortestPaths | ( | gk_graph_t * | graph, | |
int | v, | |||
void ** | r_sps | |||
) |
This function computes the single-source shortest path lengths from the root node to all the other nodes in the graph. If the graph is not connected then, the sortest part to the vertices in the other components is -1.
IN] | graph is the graph structure. | |
IN] | v is the root of the single-source shortest path computations. | |
IN] | type indicates the criteria to use to measure the 'bestness' of a vertex. | |
OUT] | sps[i] stores the length of the shortest path from v to vertex i. If no such path exists, then it is -1. Note that the returned array will be either an array of int32_t or an array of floats. The specific type is determined by the existance of non NULL iadjwgt and fadjwgt arrays. If both of these arrays exist, then priority is given to iadjwgt. |
Definition at line 1084 of file graph.c.
References gk_graph_t::adjncy, adjncy, adjwgt, gk_graph_t::fadjwgt, gk_fpq_t, gk_free(), gk_i32pq_t, gk_graph_t::iadjwgt, int32_t, gk_graph_t::nvtxs, PUP::u, gk_graph_t::xadj, and xadj.
Definition at line 21 of file gk_proto.h.
Definition at line 23 of file gk_proto.h.
Definition at line 25 of file gk_proto.h.
Referenced by PUP::fromTextFile::bytes(), CkDDT_DataType::CkDDT_DataType(), CreateLBFunc_Def(), PUP::machineInfo::current(), gk_csr_Read(), gk_freadfilebin(), gk_graph_Read(), CollideGrid3d::init(), DType::length(), CkViewpoint::project(), CkViewpoint::project_noz(), randFloat(), sendMsg(), sendRemoteMsg(), IDXL_Layout::type_size(), typesize(), and CollideGrid3d::world2grid().
Definition at line 27 of file gk_proto.h.
Referenced by gk_array2csr(), gk_FreeMatrix(), gk_i2cc2i_create_common(), gk_idxsortd(), gk_idxsorti(), gk_log2(), GK_MKALLOC(), gk_RandomPermute(), gk_seq_ReadGKMODPSSM(), gk_strchr_replace(), gk_strhprune(), gk_strstr_replace(), gk_strtprune(), test_dkvsort(), test_fkvsort(), test_fsort(), test_idxkvsort(), test_idxsort(), test_ikvsort(), test_isort(), and test_skvsort().
Definition at line 89 of file gk_proto.h.
Referenced by ADIOI_ZOIDFS_ReadStrided(), ADIOI_ZOIDFS_WriteStrided(), alignas(), build_wcs_upper_buffer(), call_startfn(), change_mparam(), CkUnpackRdmaPtrs(), CtgGlobalList::CtgGlobalList(), CthInit(), CthResume1(), rfmodel::DataMatrix::DataMatrix(), std::std::hash< CmiUInt16 >::hash_len_16(), init_mparams(), initialize_memory_wrapper(), internal_memalign(), LZ4_compress_generic(), LZ4_decompress_generic(), LZ4_setStreamDecode(), ndhThreadWork(), std::std::hash< CmiUInt16 >::operator()(), CkDDT_HIndexed::serialize(), CkDDT_HIndexed_Block::serialize(), CkDDT_Vector::serialize(), sys_alloc(), and try_largest_mmap_region().
Definition at line 217 of file gk_proto.h.
Referenced by gk_graph_ComputeBestFOrdering(), gk_graph_ComputeBestFOrdering0(), and gk_graph_SingleSourceShortestPaths().
Definition at line 217 of file gk_proto.h.
Referenced by ADIOI_PVFS2_OldReadStrided(), ADIOI_PVFS2_OldWriteStrided(), ADIOI_PVFS2_StridedListIO(), ADIOI_PVFS_ReadStridedListIO(), ADIOI_PVFS_WriteStridedListIO(), check_node_accept_bytes(), compute_compactness(), find_collation_sequence_value(), gk_csr_Read(), gk_csr_Write(), gk_graph_ComputeBestFOrdering(), gk_graph_ComputeBestFOrdering0(), gk_graph_ComputeBFSOrdering(), gk_graph_FindComponents(), gk_graph_Read(), gk_graph_Reorder(), gk_graph_SingleSourceShortestPaths(), gk_i32readfile(), gk_i32readfilebin(), main(), re_compile_fastmap_iter(), reorder_centroid(), Segment_blkidx_m2m(), Segment_index_m2m(), and Segment_vector_m2m().
Definition at line 221 of file gk_proto.h.