TheBoussinesqModel  3.2.1
 All Data Structures Files Functions Variables Typedefs Macros Pages
t_list.h
Go to the documentation of this file.
1 /*
2 
3  LONGPAIR
4 
5 
6 Description: It is a structure containing two long and a pointer to
7 a structure of the same type.
8 
9 
10 
11 */
12 
13 
14 struct longpair{
15  long i,j;
16  struct longpair *next;
17  };
18 
19 typedef struct longpair LONGPAIR;
20 
21 /*
22 
23  LONGPOKER
24 
25 
26 Description: It is a structure containing four long and a pointer to
27 a structure of the same type.
28 
29 
30 
31 */
32 
33 
34 struct longpoker{
35  long i,j,k,l;
36  struct longpoker*next;
37  };
38 
39 typedef struct longpoker LONGPOKER;
40 
41 /*
42 
43  REAL PAIR
44 
45 
46 Description: It is a structure containing two double and a pointer to
47 a structure of the same type.
48 
49 
50 
51 
52 */
53 
54 struct realpair{
55  double x,y;
56  struct realpair *next;
57  };
58 
59 typedef struct realpair REALPAIR;
60 
61 
62 /*
63 
64  IX
65 
66 
67 Description: It is a structure containing a long (i) and a double (x) and a pointer to
68 a structure of the same type.
69 
70 
71 
72 
73 */
74 
75 struct ix{
76  long i;
77  double x;
78  struct ix *next;
79  };
80 
81 typedef struct ix IX;
82 
83 /*
84 
85  IJX
86 
87 
88 Description: It is a structure containing two long, double and a pointer to
89 a structure of the same type.
90 
91 
92 
93 */
94 
95 struct ijx{
96  long i,j;
97  double x;
98  struct ijx *next;
99  };
100 
101 typedef struct ijx IJX;
102 
103 /*
104 
105  XYZ
106 
107 
108 Description: It is a structure containing three double and a pointer to
109 a structure of the same type.
110 
111 
112 
113 */
114 
115 struct xyz{
116  double x,y,z;
117  struct xyz *next;
118  };
119 
120 typedef struct xyz XYZ;
121 
122 
123 struct measure{
124 
125 long i,j; /*Pixel coordinates */
126 DOUBLEVECTOR *data; /*Pointing to a vector containing a set of measures */
127 DOUBLEVECTOR *precision; /*Pointing to a vector containing the precision of each
128  measure. Usually a vector gloabally defined */
129 struct measure *next;
130 
131 };
132 
133 typedef struct measure MEASURES;
134 
135 
136 
137 
138 struct phrase{
139 
140 char *word;
141 long nh;
142 struct phrase *next;
143 
144 };
145 
146 
147 typedef struct phrase PHRASE;
148 
149 /*
150 
151 Name: buffer2list
152 
153 Version: 1.0
154 
155 Synopsis:
156 
157 LONGPAIR* buffer2list(long *s,LONGPAIR* nxt);
158 REALPAIR* realbuffer2list(double *s,REALPAIR* nxt);
159 
160 Authors & Date: Riccardo Rigon, 1998
161 
162 FILE: LIBRARIES/BASICS/t_list.h, LIBRARIES/BASICS/list.c
163 
164 Description: They transform a vector of long or double (in the normal sense of
165 C programming) to a linear linked list of the correspondent type
166 
167  Inputs a pointer to: 1) the vector to be transformed; 2) a LONG PAIR
168  or REALPAIR
169 
170  Return: the pointer to the head of the linear linked list created
171 
172 
173 
174 See Also: Coupledfields_moments
175 
176 */
177 
178 LONGPAIR* buffer2list(long *s,LONGPAIR* nxt);
179 REALPAIR* realbuffer2list(double *s,REALPAIR* nxt);
180 
212 LONGPAIR *new_longpair(void);
213 LONGPOKER *new_longpoker(void);
214 REALPAIR *new_realpair(void);
215 IX * new_ix(void);
216 IJX *new_ijx(void);
217 XYZ *new_xyz(void);
218 PHRASE *new_word(long n,char *text);
219 
247 void print_pokerlist_elements(LONGPOKER * list,short columns);
248 void print_longlist_elements(LONGPAIR * list,short columns);
249 void print_reallist_elements(REALPAIR * list,short columns);
250 void print_ix_elements(IX * list,short columns);
251 void print_ijx_elements(IJX * list,short columns);
252 void print_xyz_elements(XYZ * list,short columns);
253 void print_phrase_elements(PHRASE * list,short columns);
254 
285 long count_longpair_elements(LONGPAIR * head);
286 long count_realpair_elements(REALPAIR * head);
287 long count_ix_elements(IX * head);
288 long count_ijx_elements(IJX * head);
289 long count_xyz_elements(XYZ * head);
290 long count_phrase_elements(PHRASE * head);
291 void delete_phrase(PHRASE *head);
292 
324 LONGPAIR * point2longpair(LONGPAIR * head,long point);
325 REALPAIR * point2realpair(REALPAIR * head,long point);
326 IX * point2ix(IX * head,long point);
327 IJX * point2ijx(IJX * head,long point);
328 XYZ * point2measure(XYZ * head,long point);
330 LONGPAIR * delete_longpair(LONGPAIR * head,LONGPAIR * ante);
331 REALPAIR * delete_realpair(REALPAIR * head,REALPAIR * ante);
332 IX * delete_ix(IX * head,IX * ante);
333 IJX * delete_ijx(IJX * head,IJX * ante);
334 XYZ * delete_xyz(XYZ * head,XYZ * ante);
335 LONGPOKER * point2longpoker(LONGPOKER * head,long point);
336 
338 
366 /* commentata per warning: integer overflow in expression
367 LONGPAIR * select_longpair_randomly(LONGPAIR * pointer);
368 REALPAIR * select_realpair_randomly(REALPAIR * pointer);
369 IX * select_ix_randomly(IX * pointer);
370 IJX * select_ijx_randomly(IJX * pointer);
371 XYZ * select_xyz_randomly(XYZ * pointer);
372 */
373 
401 void delete_longpoker_list(LONGPOKER * head);
402 void delete_longpair_list(LONGPAIR * head);
403 void delete_realpair_list(REALPAIR * head);
404 void delete_ix_list(IX * head);
405 void delete_ijx_list(IJX * head);
406 void delete_xyz_list(XYZ * head);
407 
432 LONGPAIR * appendto(LONGPAIR * head, LONGPAIR * element);
433 PHRASE * join_words(PHRASE * head, PHRASE* element);
434 
463 LONGPAIR * prependto(LONGPAIR * head, LONGPAIR * element);
464 
496 LONGPAIR * rotateleft(LONGPAIR * head);
497 
523 LONGPAIR * rotate(LONGPAIR * head,int n);
524 
525 
527 void write_indexed_pokerlist_elements(FILE *ostream,LONGPOKER * list,short columns);
528