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;
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
atom::icode
char icode
Definition: gk_struct.h:155
gk_i2cc2i_t::n
int n
Definition: gk_struct.h:202
gk_str_t
struct gk_str_t gk_str_t
gk_graph_t::ivwgts
int32_t * ivwgts
Definition: gk_struct.h:95
center_of_mass
struct center_of_mass center_of_mass
pdbf::ncas
int ncas
Definition: gk_struct.h:183
GK_MKPQUEUE_T
#define GK_MKPQUEUE_T(NAME, KVTYPE)
Definition: gk_struct.h:39
gk_mcore_t::num_callocs
size_t num_callocs
Definition: gk_struct.h:255
gk_csr_t
Definition: gk_struct.h:72
gk_graph_t::adjncy
int32_t * adjncy
Definition: gk_struct.h:92
gk_csr_t::rsums
float * rsums
Definition: gk_struct.h:79
gk_mcore_t::cmop
size_t cmop
Definition: gk_struct.h:251
ssize_t
Py_ssize_t ssize_t
Definition: wrap/pybind11/include/pybind11/detail/common.h:489
atom::opcy
double opcy
Definition: gk_struct.h:160
gk_mcore_t::num_hallocs
size_t num_hallocs
Definition: gk_struct.h:256
center_of_mass::name
char name
Definition: gk_struct.h:170
gk_csr_t::cvols
float * cvols
Definition: gk_struct.h:81
gk_graph_t::nvtxs
int32_t nvtxs
Definition: gk_struct.h:90
gk_mop_t
Definition: gk_struct.h:232
gk_csr_t::rvols
float * rvols
Definition: gk_struct.h:81
atom::y
double y
Definition: gk_struct.h:158
gk_mcore_t
struct gk_mcore_t gk_mcore_t
gk_HTable_t
struct gk_HTable_t gk_HTable_t
gk_StringMap_t
struct gk_StringMap_t gk_StringMap_t
gk_Tokens_t::strbuf
char * strbuf
Definition: gk_struct.h:141
gk_seq_t::nsymbols
int nsymbols
Definition: gk_struct.h:221
gk_seq_t::len
int len
Definition: gk_struct.h:213
gk_mcore_t::cur_hallocs
size_t cur_hallocs
Definition: gk_struct.h:260
gk_idx_t
ssize_t gk_idx_t
Definition: gk_types.h:22
gk_csr_t::colval
float * colval
Definition: gk_struct.h:77
atom::name
char * name
Definition: gk_struct.h:150
gk_mcore_t::max_callocs
size_t max_callocs
Definition: gk_struct.h:261
gk_str_t
Definition: gk_struct.h:107
atom::chainid
char chainid
Definition: gk_struct.h:153
gk_csr_t::colptr
ssize_t * colptr
Definition: gk_struct.h:74
gk_Tokens_t
Definition: gk_struct.h:139
gk_Tokens_t::list
char ** list
Definition: gk_struct.h:142
pdbf
struct pdbf pdbf
gk_graph_t::xadj
ssize_t * xadj
Definition: gk_struct.h:91
center_of_mass
Definition: gk_struct.h:169
pdbf
Definition: gk_struct.h:180
atom::resname
char * resname
Definition: gk_struct.h:152
pdbf::cm
center_of_mass * cm
Definition: gk_struct.h:191
gk_seq_t::sequence
int * sequence
Definition: gk_struct.h:214
gk_mcore_t::size_callocs
size_t size_callocs
Definition: gk_struct.h:257
gk_csr_t::rowval
float * rowval
Definition: gk_struct.h:77
gk_csr_t::rwgts
float * rwgts
Definition: gk_struct.h:82
int64_t
signed __int64 int64_t
Definition: ms_stdint.h:94
pdbf::bbs
atom ** bbs
Definition: gk_struct.h:189
atom
Definition: gk_struct.h:148
gk_Tokens_t::ntoks
int ntoks
Definition: gk_struct.h:140
gk_csr_t::csums
float * csums
Definition: gk_struct.h:79
gk_HTable_t::nelements
int nelements
Definition: gk_struct.h:129
gk_mcore_t::cur_callocs
size_t cur_callocs
Definition: gk_struct.h:259
gk_str_t::len
size_t len
Definition: gk_struct.h:108
gk_graph_t
Definition: gk_struct.h:89
gk_mcore_t::corecpos
size_t corecpos
Definition: gk_struct.h:245
gk_StringMap_t::name
char * name
Definition: gk_struct.h:120
pdbf::corruption
int corruption
Definition: gk_struct.h:185
gk_csr_t::cnorms
float * cnorms
Definition: gk_struct.h:78
gk_mop_t::type
int type
Definition: gk_struct.h:233
gk_csr_t::rowptr
ssize_t * rowptr
Definition: gk_struct.h:74
gk_Tokens_t
struct gk_Tokens_t gk_Tokens_t
atom::tmpt
double tmpt
Definition: gk_struct.h:161
gk_csr_t::colind
int32_t * colind
Definition: gk_struct.h:75
gk_mcore_t
Definition: gk_struct.h:242
atom::element
char element
Definition: gk_struct.h:156
gk_seq_t
struct gk_seq_t gk_seq_t
gk_HTable_t::harray
gk_ikv_t * harray
Definition: gk_struct.h:131
gk_csr_t::csizes
float * csizes
Definition: gk_struct.h:80
pdbf::resSeq
char * resSeq
Definition: gk_struct.h:186
gk_seq_t::psfm
int ** psfm
Definition: gk_struct.h:218
gk_mcore_t::mops
gk_mop_t * mops
Definition: gk_struct.h:252
gk_HTable_t
Definition: gk_struct.h:128
gk_str_t::buf
char * buf
Definition: gk_struct.h:109
gk_csr_t::ncols
int32_t ncols
Definition: gk_struct.h:73
center_of_mass::z
double z
Definition: gk_struct.h:173
GK_MKKEYVALUE_T
#define GK_MKKEYVALUE_T(NAME, KEYTYPE, VALTYPE)
Definition: gk_struct.h:17
gk_seq_t::name
char * name
Definition: gk_struct.h:219
atom
struct atom atom
pdbf::nresidues
int nresidues
Definition: gk_struct.h:182
atom::altLoc
char altLoc
Definition: gk_struct.h:151
center_of_mass::y
double y
Definition: gk_struct.h:172
gk_csr_t::cwgts
float * cwgts
Definition: gk_struct.h:82
pdbf::threeresSeq
char ** threeresSeq
Definition: gk_struct.h:187
gk_csr_t::colids
int32_t * colids
Definition: gk_struct.h:76
pdbf::natoms
int natoms
Definition: gk_struct.h:181
atom::rserial
int rserial
Definition: gk_struct.h:154
center_of_mass::x
double x
Definition: gk_struct.h:171
gk_csr_t::rsizes
float * rsizes
Definition: gk_struct.h:80
gk_i2cc2i_t::c2i
int * c2i
Definition: gk_struct.h:204
gk_graph_t::iadjwgt
int32_t * iadjwgt
Definition: gk_struct.h:93
gk_mcore_t::coresize
size_t coresize
Definition: gk_struct.h:244
gk_mcore_t::max_hallocs
size_t max_hallocs
Definition: gk_struct.h:262
gk_graph_t::fvsizes
float * fvsizes
Definition: gk_struct.h:98
gk_csr_t::rowids
int32_t * rowids
Definition: gk_struct.h:76
gk_csr_t
struct gk_csr_t gk_csr_t
int32_t
signed int int32_t
Definition: ms_stdint.h:82
gk_StringMap_t::id
int id
Definition: gk_struct.h:121
gk_mcore_t::nmops
size_t nmops
Definition: gk_struct.h:250
gk_mcore_t::size_hallocs
size_t size_hallocs
Definition: gk_struct.h:258
gk_StringMap_t
Definition: gk_struct.h:119
gk_graph_t::fadjwgt
float * fadjwgt
Definition: gk_struct.h:94
gk_graph_t::ivsizes
int32_t * ivsizes
Definition: gk_struct.h:97
gk_graph_t
struct gk_graph_t gk_graph_t
gk_i2cc2i_t::i2c
char * i2c
Definition: gk_struct.h:203
gk_i2cc2i_t
Definition: gk_struct.h:199
gk_seq_t
Definition: gk_struct.h:209
atom::x
double x
Definition: gk_struct.h:157
gk_HTable_t::htsize
int htsize
Definition: gk_struct.h:130
gk_mop_t::ptr
void * ptr
Definition: gk_struct.h:235
pdbf::atoms
atom * atoms
Definition: gk_struct.h:188
atom::z
double z
Definition: gk_struct.h:159
gk_i2cc2i_t
struct gk_i2cc2i_t gk_i2cc2i_t
gk_graph_t::fvwgts
float * fvwgts
Definition: gk_struct.h:96
gk_graph_t::vlabels
int32_t * vlabels
Definition: gk_struct.h:99
atom::serial
int serial
Definition: gk_struct.h:149
gk_mop_t::nbytes
ssize_t nbytes
Definition: gk_struct.h:234
gk_seq_t::pssm
int ** pssm
Definition: gk_struct.h:217
gk_csr_t::nrows
int32_t nrows
Definition: gk_struct.h:73
pdbf::cas
atom ** cas
Definition: gk_struct.h:190
gk_csr_t::rnorms
float * rnorms
Definition: gk_struct.h:78
pdbf::nbbs
int nbbs
Definition: gk_struct.h:184
gk_mop_t
struct gk_mop_t gk_mop_t
gk_csr_t::rowind
int32_t * rowind
Definition: gk_struct.h:75
gk_mcore_t::core
void * core
Definition: gk_struct.h:246


gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:32:38