gk_struct.h
Go to the documentation of this file.
1 
10 #ifndef _GK_STRUCT_H_
11 #define _GK_STRUCT_H_
12 
13 
14 /********************************************************************/
16 /********************************************************************/
17 #define GK_MKKEYVALUE_T(NAME, KEYTYPE, VALTYPE) \
18 typedef struct {\
19  KEYTYPE key;\
20  VALTYPE val;\
21 } NAME;\
22 
23 /* The actual KeyVal data structures */
24 GK_MKKEYVALUE_T(gk_ckv_t, char, ssize_t)
25 GK_MKKEYVALUE_T(gk_ikv_t, int, ssize_t)
26 GK_MKKEYVALUE_T(gk_i32kv_t, int32_t, ssize_t)
27 GK_MKKEYVALUE_T(gk_i64kv_t, int64_t, ssize_t)
29 GK_MKKEYVALUE_T(gk_fkv_t, float, ssize_t)
30 GK_MKKEYVALUE_T(gk_dkv_t, double, ssize_t)
31 GK_MKKEYVALUE_T(gk_skv_t, char *, ssize_t)
32 GK_MKKEYVALUE_T(gk_idxkv_t, gk_idx_t, gk_idx_t)
33 
34 
35 
36 /********************************************************************/
38 /********************************************************************/
39 #define GK_MKPQUEUE_T(NAME, KVTYPE)\
40 typedef struct {\
41  gk_idx_t nnodes;\
42  gk_idx_t maxnodes;\
43 \
44  /* Heap version of the data structure */ \
45  KVTYPE *heap;\
46  gk_idx_t *locator;\
47 } NAME;\
48 
49 GK_MKPQUEUE_T(gk_ipq_t, gk_ikv_t)
50 GK_MKPQUEUE_T(gk_i32pq_t, gk_i32kv_t)
51 GK_MKPQUEUE_T(gk_i64pq_t, gk_i64kv_t)
52 GK_MKPQUEUE_T(gk_fpq_t, gk_fkv_t)
53 GK_MKPQUEUE_T(gk_dpq_t, gk_dkv_t)
54 GK_MKPQUEUE_T(gk_idxpq_t, gk_idxkv_t)
55 
56 
57 #define GK_MKPQUEUE2_T(NAME, KTYPE, VTYPE)\
58 typedef struct {\
59  ssize_t nnodes;\
60  ssize_t maxnodes;\
61 \
62  /* Heap version of the data structure */ \
63  KTYPE *keys;\
64  VTYPE *vals;\
65 } NAME;\
66 
67 
68 
69 /*-------------------------------------------------------------
70  * The following data structure stores a sparse CSR format
71  *-------------------------------------------------------------*/
72 typedef struct gk_csr_t {
77  float *rowval, *colval;
78  float *rnorms, *cnorms;
79  float *rsums, *csums;
80  float *rsizes, *csizes;
81  float *rvols, *cvols;
82  float *rwgts, *cwgts;
83 } gk_csr_t;
84 
85 
86 /*-------------------------------------------------------------
87  * The following data structure stores a sparse graph
88  *-------------------------------------------------------------*/
89 typedef struct gk_graph_t {
94  float *fadjwgt;
96  float *fvwgts;
98  float *fvsizes;
100 } gk_graph_t;
101 
102 
103 /*-------------------------------------------------------------
104  * The following data structure stores stores a string as a
105  * pair of its allocated buffer and the buffer itself.
106  *-------------------------------------------------------------*/
107 typedef struct gk_str_t {
108  size_t len;
109  char *buf;
110 } gk_str_t;
111 
112 
113 
114 
115 /*-------------------------------------------------------------
116 * The following data structure implements a string-2-int mapping
117 * table used for parsing command-line options
118 *-------------------------------------------------------------*/
119 typedef struct gk_StringMap_t {
120  char *name;
121  int id;
123 
124 
125 /*------------------------------------------------------------
126  * This structure implements a simple hash table
127  *------------------------------------------------------------*/
128 typedef struct gk_HTable_t {
129  int nelements; /* The overall size of the hash-table */
130  int htsize; /* The current size of the hash-table */
131  gk_ikv_t *harray; /* The actual hash-table */
132 } gk_HTable_t;
133 
134 
135 /*------------------------------------------------------------
136  * This structure implements a gk_Tokens_t list returned by the
137  * string tokenizer
138  *------------------------------------------------------------*/
139 typedef struct gk_Tokens_t {
140  int ntoks; /* The number of tokens in the input string */
141  char *strbuf; /* The memory that stores all the entries */
142  char **list; /* Pointers to the strbuf for each element */
143 } gk_Tokens_t;
144 
145 /*------------------------------------------------------------
146  * This structure implements storage for an atom in a pdb file
147  *------------------------------------------------------------*/
148 typedef struct atom {
149  int serial;
150  char *name;
151  char altLoc;
152  char *resname;
153  char chainid;
154  int rserial;
155  char icode;
156  char element;
157  double x;
158  double y;
159  double z;
160  double opcy;
161  double tmpt;
162 } atom;
163 
164 
165 /*------------------------------------------------------------
166  * This structure implements storage for a center of mass for
167  * a single residue.
168  *------------------------------------------------------------*/
169 typedef struct center_of_mass {
170  char name;
171  double x;
172  double y;
173  double z;
175 
176 
177 /*------------------------------------------------------------
178  * This structure implements storage for a pdb protein
179  *------------------------------------------------------------*/
180 typedef struct pdbf {
181  int natoms; /* Number of atoms */
182  int nresidues; /* Number of residues based on coordinates */
183  int ncas;
184  int nbbs;
186  char *resSeq; /* Residue sequence based on coordinates */
187  char **threeresSeq; /* three-letter residue sequence */
192 } pdbf;
193 
194 
195 
196 /*************************************************************
197 * Localization Structures for converting characters to integers
198 **************************************************************/
199 typedef struct gk_i2cc2i_t {
200  int n;
201  char *i2c;
202  int *c2i;
203 } gk_i2cc2i_t;
204 
205 
206 /*******************************************************************
207  *This structure implements storage of a protein sequence
208  * *****************************************************************/
209 typedef struct gk_seq_t {
210 
211  int len; /*Number of Residues */
212  int *sequence; /* Stores the sequence*/
213 
214 
215  int **pssm; /* Stores the pssm matrix */
216  int **psfm; /* Stores the psfm matrix */
217  char *name; /* Stores the name of the sequence */
218 
219  int nsymbols;
220 
221 
222 } gk_seq_t;
223 
224 
225 
226 
227 /*************************************************************************/
231 /*************************************************************************/
232 typedef struct gk_mop_t {
233  int type;
235  void *ptr;
236 } gk_mop_t;
237 
238 
239 /*************************************************************************/
241 /*************************************************************************/
242 typedef struct gk_mcore_t {
243  /* Workspace information */
244  size_t coresize;
245  size_t corecpos;
246  void *core;
248  /* These are for implementing a stack-based allocation scheme using both
249  core and also dynamically allocated memory */
250  size_t nmops;
251  size_t cmop;
254  /* These are for keeping various statistics for wspacemalloc */
255  size_t num_callocs;
256  size_t num_hallocs;
257  size_t size_callocs;
258  size_t size_hallocs;
259  size_t cur_callocs;
260  size_t cur_hallocs;
261  size_t max_callocs;
262  size_t max_hallocs;
264 } gk_mcore_t;
265 
266 
267 
268 #endif
int32_t * iadjwgt
Definition: gk_struct.h:93
gk_ikv_t * harray
Definition: gk_struct.h:131
float * rnorms
Definition: gk_struct.h:78
double y
Definition: gk_struct.h:158
ssize_t gk_idx_t
Definition: gk_types.h:22
int nbbs
Definition: gk_struct.h:184
float * rsums
Definition: gk_struct.h:79
int32_t * adjncy
Definition: gk_struct.h:92
double opcy
Definition: gk_struct.h:160
double x
Definition: gk_struct.h:157
int serial
Definition: gk_struct.h:149
int32_t * ivsizes
Definition: gk_struct.h:97
size_t max_callocs
Definition: gk_struct.h:261
char icode
Definition: gk_struct.h:155
struct gk_csr_t gk_csr_t
int ** pssm
Definition: gk_struct.h:215
size_t cur_callocs
Definition: gk_struct.h:259
ssize_t * xadj
Definition: gk_struct.h:91
int32_t * rowind
Definition: gk_struct.h:75
ssize_t * colptr
Definition: gk_struct.h:74
int nsymbols
Definition: gk_struct.h:219
char * strbuf
Definition: gk_struct.h:141
float * cvols
Definition: gk_struct.h:81
int * c2i
Definition: gk_struct.h:202
void * ptr
Definition: gk_struct.h:235
float * rvols
Definition: gk_struct.h:81
float * colval
Definition: gk_struct.h:77
char * resname
Definition: gk_struct.h:152
gk_mop_t * mops
Definition: gk_struct.h:252
ssize_t nbytes
Definition: gk_struct.h:234
float * fadjwgt
Definition: gk_struct.h:94
float * rowval
Definition: gk_struct.h:77
float * rwgts
Definition: gk_struct.h:82
size_t cmop
Definition: gk_struct.h:251
int nelements
Definition: gk_struct.h:129
atom ** bbs
Definition: gk_struct.h:189
int len
Definition: gk_struct.h:211
float * csums
Definition: gk_struct.h:79
struct gk_StringMap_t gk_StringMap_t
size_t len
Definition: gk_struct.h:108
struct gk_mcore_t gk_mcore_t
struct gk_Tokens_t gk_Tokens_t
size_t coresize
Definition: gk_struct.h:244
char * i2c
Definition: gk_struct.h:201
char * name
Definition: gk_struct.h:150
struct gk_seq_t gk_seq_t
int * sequence
Definition: gk_struct.h:212
size_t nmops
Definition: gk_struct.h:250
int32_t * ivwgts
Definition: gk_struct.h:95
struct gk_HTable_t gk_HTable_t
char chainid
Definition: gk_struct.h:153
struct gk_str_t gk_str_t
float * cnorms
Definition: gk_struct.h:78
#define GK_MKKEYVALUE_T(NAME, KEYTYPE, VALTYPE)
Definition: gk_struct.h:17
int corruption
Definition: gk_struct.h:185
signed __int64 int64_t
Definition: ms_stdint.h:94
struct atom atom
char * name
Definition: gk_struct.h:217
signed int int32_t
Definition: ms_stdint.h:82
size_t num_hallocs
Definition: gk_struct.h:256
size_t max_hallocs
Definition: gk_struct.h:262
center_of_mass * cm
Definition: gk_struct.h:191
char element
Definition: gk_struct.h:156
float * csizes
Definition: gk_struct.h:80
void * core
Definition: gk_struct.h:246
float * rsizes
Definition: gk_struct.h:80
double tmpt
Definition: gk_struct.h:161
int natoms
Definition: gk_struct.h:181
int32_t * colind
Definition: gk_struct.h:75
int ** psfm
Definition: gk_struct.h:216
size_t corecpos
Definition: gk_struct.h:245
struct gk_graph_t gk_graph_t
struct gk_i2cc2i_t gk_i2cc2i_t
float * fvwgts
Definition: gk_struct.h:96
ssize_t * rowptr
Definition: gk_struct.h:74
#define GK_MKPQUEUE_T(NAME, KVTYPE)
Definition: gk_struct.h:39
int nresidues
Definition: gk_struct.h:182
float * cwgts
Definition: gk_struct.h:82
int32_t * colids
Definition: gk_struct.h:76
char ** list
Definition: gk_struct.h:142
char ** threeresSeq
Definition: gk_struct.h:187
size_t size_hallocs
Definition: gk_struct.h:258
int32_t nrows
Definition: gk_struct.h:73
int32_t ncols
Definition: gk_struct.h:73
char * resSeq
Definition: gk_struct.h:186
float * fvsizes
Definition: gk_struct.h:98
char * buf
Definition: gk_struct.h:109
int32_t * rowids
Definition: gk_struct.h:76
size_t num_callocs
Definition: gk_struct.h:255
struct pdbf pdbf
size_t cur_hallocs
Definition: gk_struct.h:260
char altLoc
Definition: gk_struct.h:151
atom * atoms
Definition: gk_struct.h:188
struct center_of_mass center_of_mass
int rserial
Definition: gk_struct.h:154
atom ** cas
Definition: gk_struct.h:190
int ncas
Definition: gk_struct.h:183
int32_t nvtxs
Definition: gk_struct.h:90
double z
Definition: gk_struct.h:159
int type
Definition: gk_struct.h:233
int32_t * vlabels
Definition: gk_struct.h:99
struct gk_mop_t gk_mop_t
size_t size_callocs
Definition: gk_struct.h:257


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:34:18