TheBoussinesqModel  3.2.1
 All Data Structures Files Functions Variables Typedefs Macros Pages
list.c File Reference
#include "turtle.h"
#include "t_datamanipulation.h"
#include "t_random.h"

Go to the source code of this file.

Macros

#define MAX_NAME   256
 

Functions

LONGPAIRbuffer2list (long *s, LONGPAIR *nxt)
 
REALPAIRrealbuffer2list (double *s, REALPAIR *nxt)
 
LONGPAIRnew_longpair ()
 
LONGPOKERnew_longpoker ()
 
REALPAIRnew_realpair ()
 
IXnew_ix ()
 
IJXnew_ijx ()
 
XYZnew_xyz ()
 
PHRASEnew_word (long n, char *text)
 
void print_longlist_elements (LONGPAIR *list, short columns)
 
void print_pokerlist_elements (LONGPOKER *list, short columns)
 
void write_indexed_pokerlist_elements (FILE *ostream, LONGPOKER *list, short columns)
 
void print_reallist_elements (REALPAIR *list, short columns)
 
void print_ix_elements (IX *list, short columns)
 
void print_ijx_elements (IJX *list, short columns)
 
void print_xyz_elements (XYZ *list, short columns)
 
void print_phrase_elements (PHRASE *list, short columns)
 
long count_longpair_elements (LONGPAIR *head)
 
long count_longpoker_elements (LONGPOKER *head)
 
long count_ix_elements (IX *head)
 
long count_realpair_elements (REALPAIR *head)
 
long count_ijx_elements (IJX *head)
 
long count_xyz_elements (XYZ *head)
 
long count_phrase_elements (PHRASE *head)
 
LONGPAIRpoint2longpair (LONGPAIR *head, long point)
 
LONGPOKERpoint2longpoker (LONGPOKER *head, long point)
 
REALPAIRpoint2realpair (REALPAIR *head, long point)
 
IXpoint2ix (IX *head, long point)
 
IJXpoint2ijx (IJX *head, long point)
 
XYZpoint2measure (XYZ *head, long point)
 
LONGPAIRdelete_longpair (LONGPAIR *head, LONGPAIR *ante)
 
LONGPOKERdelete_longpoker (LONGPOKER *head, LONGPOKER *ante)
 
LONGPAIRdeleteshuffle_longpair (LONGPAIR *head, LONGPAIR *ante)
 
REALPAIRdelete_realpair (REALPAIR *head, REALPAIR *ante)
 
IXdelete_ix (IX *head, IX *ante)
 
IJXdelete_ijx (IJX *head, IJX *ante)
 
XYZdelete_xyz (XYZ *head, XYZ *ante)
 
void delete_longpair_list (LONGPAIR *head)
 
void delete_longpoker_list (LONGPOKER *head)
 
void delete_realpair_list (REALPAIR *head)
 
void delete_ix_list (IX *head)
 
void delete_ijx_list (IJX *head)
 
void delete_xyz_list (XYZ *head)
 
void delete_phrase (PHRASE *head)
 
LONGPAIRappendto (LONGPAIR *head, LONGPAIR *element)
 
PHRASEjoin_words (PHRASE *head, PHRASE *element)
 
LONGPAIRprependto (LONGPAIR *head, LONGPAIR *element)
 
LONGPAIRrotateleft (LONGPAIR *head)
 
LONGPAIRrotate (LONGPAIR *head, int n)
 

Macro Definition Documentation

#define MAX_NAME   256

Definition at line 5 of file list.c.

Referenced by new_word().

Function Documentation

LONGPAIR* appendto ( LONGPAIR head,
LONGPAIR element 
)

Name: appendto

Version: 1.0

Synopsis:

LONGPAIR * appendto(LONGPAIR * head, LONGPAIR * element);

Description: appends element to a given linear linked list of the specified type

Inputs: 1) a pointer to the head of the linear linked list; 2) a pointer to the element to be appended.

Return: a pointer to the head of the linear linked list

Authors & Date: Riccardo Rigon, 1997

FILE: LIBRARIES/BASICS/t_list.h, LIBRARIES/BASICS/list.c

Definition at line 907 of file list.c.

References longpair::next.

Referenced by deleteshuffle_longpair().

LONGPAIR* buffer2list ( long *  s,
LONGPAIR nxt 
)

Definition at line 11 of file list.c.

References buffer2list(), longpair::i, longpair::j, longpair::next, and t_error().

Referenced by buffer2list().

long count_ijx_elements ( IJX head)

Definition at line 452 of file list.c.

References count_ijx_elements(), and ijx::next.

Referenced by count_ijx_elements().

long count_ix_elements ( IX head)

Definition at line 430 of file list.c.

References count_ix_elements(), and ix::next.

Referenced by count_ix_elements().

long count_longpair_elements ( LONGPAIR head)

Definition at line 408 of file list.c.

References count_longpair_elements(), and longpair::next.

Referenced by count_longpair_elements().

long count_longpoker_elements ( LONGPOKER head)

Name: count__elements

Version: 1.0

Synopsis:

long count_longpair_elements(LONGPAIR * head); long count_realpair_elements(REALPAIR * head); long count_ix_elements(IX * head); long count_ijx_elements(IJX * head); long count_xyz_elements(XYZ * head);

Description: They counts the number of elements in the linear linked list of the specified type

Inputs: 1) The pointer to the head of the linear linked list

Return: the number of elements in the list

Authors & Date: Riccardo Rigon, 1997

FILE: LIBRARIES/BASICS/t_list.h, LIBRARIES/BASICS/list.c

Definition at line 419 of file list.c.

References count_longpoker_elements(), and longpoker::next.

Referenced by count_longpoker_elements().

long count_phrase_elements ( PHRASE head)

Definition at line 475 of file list.c.

References count_phrase_elements(), and phrase::next.

Referenced by count_phrase_elements().

long count_realpair_elements ( REALPAIR head)

Definition at line 441 of file list.c.

References count_realpair_elements(), and realpair::next.

Referenced by count_realpair_elements().

long count_xyz_elements ( XYZ head)

Definition at line 464 of file list.c.

References count_xyz_elements(), and xyz::next.

Referenced by count_xyz_elements().

IJX* delete_ijx ( IJX head,
IJX ante 
)

Definition at line 699 of file list.c.

References ijx::next, and t_error().

void delete_ijx_list ( IJX head)

Definition at line 873 of file list.c.

References delete_ijx_list(), and ijx::next.

Referenced by delete_ijx_list().

IX* delete_ix ( IX head,
IX ante 
)

Definition at line 680 of file list.c.

References ix::next, and t_error().

void delete_ix_list ( IX head)

Definition at line 863 of file list.c.

References delete_ix_list(), and ix::next.

Referenced by delete_ix_list().

LONGPAIR* delete_longpair ( LONGPAIR head,
LONGPAIR ante 
)

Definition at line 604 of file list.c.

References longpair::next, and t_error().

void delete_longpair_list ( LONGPAIR head)
LONGPOKER* delete_longpoker ( LONGPOKER head,
LONGPOKER ante 
)

Definition at line 622 of file list.c.

References longpoker::next, and t_error().

void delete_longpoker_list ( LONGPOKER head)

Name: select_

Version: 1.0

Synopsis:

LONGPAIR * select_longpair_randomly(LONGPAIR * pointer); REALPAIR * select_realpair_randomly(REALPAIR * pointer); IX * select_ix_randomly(IX * pointer); IJX * select_ijx_randomly(IJX * pointer); XYZ * select_xyz_randomly(XYZ * pointer);

Description: Select an element of a linear linked list choset at random

Inputs: a pointer to the head of the list

Return: the pointer to the selected element

Authors & Date: Riccardo Rigon, 1997

FILE: LIBRARIES/BASICS/t_list.h, LIBRARIES/BASICS/list.c

Name: delete__list

Version: 1.0

Synopsis:

void delete_longpair_list(LONGPAIR * head); void delete_realpair_list(REALPAIR * head); void delete_ix_list(IX * head); void delete_ijx_list(IJX * head); void delete_xyz_list(XYZ * head);

Description: Delete a list of the specified type

Inputs: A pointer to the head of the list

Return: void

Authors & Date: Riccardo Rigon, 1997

FILE: LIBRARIES/BASICS/t_list.h, LIBRARIES/BASICS/list.c

Definition at line 844 of file list.c.

References delete_longpoker_list(), and longpoker::next.

Referenced by delete_longpoker_list().

void delete_phrase ( PHRASE head)

Definition at line 895 of file list.c.

References delete_phrase(), phrase::next, and phrase::word.

Referenced by delete_phrase().

REALPAIR* delete_realpair ( REALPAIR head,
REALPAIR ante 
)

Definition at line 662 of file list.c.

References realpair::next, and t_error().

void delete_realpair_list ( REALPAIR head)

Definition at line 854 of file list.c.

References delete_realpair_list(), and realpair::next.

Referenced by delete_realpair_list().

XYZ* delete_xyz ( XYZ head,
XYZ ante 
)

Definition at line 718 of file list.c.

References xyz::next, and t_error().

Referenced by exponentialhystogram(), and simplehystogram().

void delete_xyz_list ( XYZ head)

Definition at line 885 of file list.c.

References delete_xyz_list(), and xyz::next.

Referenced by delete_xyz_list(), exponentialhystogram(), and simplehystogram().

LONGPAIR* deleteshuffle_longpair ( LONGPAIR head,
LONGPAIR ante 
)

Definition at line 642 of file list.c.

References appendto(), longpair::next, and t_error().

PHRASE* join_words ( PHRASE head,
PHRASE element 
)

Definition at line 923 of file list.c.

References phrase::next.

IJX* new_ijx ( void  )

Definition at line 127 of file list.c.

References ijx::i, ijx::j, ijx::next, t_error(), and ijx::x.

IX* new_ix ( void  )

Definition at line 108 of file list.c.

References ix::i, ix::next, t_error(), and ix::x.

LONGPAIR* new_longpair ( void  )

Name: new_

Version: 0.9

Synopsis:

LONGPAIR *new_longpair(void); REALPAIR *new_realpair(void); IX * new_ix(void); IJX *new_ijx(void); XYZ *new_xyz(void);

Description: *_new_*creates aan element of a linear linked list of the specified types

Inputs: void

Return: a pointer to: LONGPAIR, REALPAIR, IX and IJX respectively

Authors & Date: Riccardo Rigon, 1997

FILE: LIBRARIES/BASICS/t_list.h, LIBRARIES/BASICS/list.c

Definition at line 51 of file list.c.

References longpair::i, longpair::j, longpair::next, and t_error().

Referenced by esponentialsplit(), esponentialsplit2realvectors(), split(), and split2realvectors().

LONGPOKER* new_longpoker ( void  )

Definition at line 70 of file list.c.

References longpoker::i, longpoker::j, longpoker::k, longpoker::l, longpoker::next, and t_error().

REALPAIR* new_realpair ( void  )

Definition at line 90 of file list.c.

References realpair::next, t_error(), realpair::x, and realpair::y.

PHRASE* new_word ( long  n,
char *  text 
)

Definition at line 166 of file list.c.

References MAX_NAME, phrase::next, phrase::nh, t_error(), and phrase::word.

XYZ* new_xyz ( void  )

Definition at line 146 of file list.c.

References xyz::next, t_error(), xyz::x, xyz::y, and xyz::z.

Referenced by exponentialhystogram(), and simplehystogram().

IJX* point2ijx ( IJX head,
long  point 
)

Definition at line 563 of file list.c.

References ijx::next, point2ijx(), and t_error().

Referenced by point2ijx().

IX* point2ix ( IX head,
long  point 
)

Definition at line 545 of file list.c.

References ix::next, point2ix(), and t_error().

Referenced by point2ix().

LONGPAIR* point2longpair ( LONGPAIR head,
long  point 
)

Name: delete_@

Version: 1.0

Synopsis:

LONGPAIR * delete_longpair(LONGPAIR * head,LONGPAIR * ante); REALPAIR * delete_realpair(REALPAIR * head,REALPAIR * ante); IX * delete_ix(IX * head,IX * ante); IJX * delete_ijx(IJX * head,IJX * ante); XYZ * delete_xyz(XYZ * head,XYZ * ante);

Description: They delete and deallocate an element of the specified type from a linear linked list

Inputs: a pointer to 1) The head of the linear linked list; 2) a pointer to the element preceding the element to be deleted (if this is Null the head is deleted)

Return: the pointer to the head of the list

Authors & Date: Riccardo Rigon, 1997

FILE: LIBRARIES/BASICS/t_list.h, LIBRARIES/BASICS/list.c

Definition at line 489 of file list.c.

References longpair::next, point2longpair(), and t_error().

Referenced by point2longpair().

LONGPOKER* point2longpoker ( LONGPOKER head,
long  point 
)

Definition at line 511 of file list.c.

References longpoker::next, point2longpoker(), and t_error().

Referenced by point2longpoker().

XYZ* point2measure ( XYZ head,
long  point 
)

Definition at line 580 of file list.c.

References xyz::next, point2measure(), and t_error().

Referenced by point2measure().

REALPAIR* point2realpair ( REALPAIR head,
long  point 
)

Definition at line 527 of file list.c.

References realpair::next, point2realpair(), and t_error().

Referenced by point2realpair().

LONGPAIR* prependto ( LONGPAIR head,
LONGPAIR element 
)

Name: prependto

Version: 1.0

Synopsis:

LONGPAIR * prependto(LONGPAIR * head, LONGPAIR * element);

Description: append to the given element a the given linear linked list

Inputs: 1) a pointer to the head of the linear linked list; 2) a pointer to the element to be prepend

Return: a pointer to the head of the list

Authors & Date: Riccardo Rigon, 1997

Authors & Date: Riccardo Rigon, 1997

FILE: LIBRARIES/BASICS/t_list.h, LIBRARIES/BASICS/list.c

Definition at line 941 of file list.c.

References longpair::next.

void print_ijx_elements ( IJX list,
short  columns 
)

Definition at line 323 of file list.c.

References ijx::i, ijx::j, ijx::next, and ijx::x.

void print_ix_elements ( IX list,
short  columns 
)

Definition at line 298 of file list.c.

References ix::i, ix::next, and ix::x.

void print_longlist_elements ( LONGPAIR list,
short  columns 
)

Definition at line 195 of file list.c.

References longpair::i, longpair::j, and longpair::next.

void print_phrase_elements ( PHRASE list,
short  columns 
)

Definition at line 373 of file list.c.

References phrase::next, and phrase::word.

void print_pokerlist_elements ( LONGPOKER list,
short  columns 
)

Name: print__elements

Version: 1.0

Synopsis:

void print_longlist_elements(LONGPAIR * list,short columns); void print_reallist_elements(REALPAIR * list,short columns); void print_ix_elements(IX * list,short columns); void print_ijx_elements(IJX * list,short columns); void print_xyz_elements(XYZ * list,short columns);

Description: They print the specified type of linear linked list

Inputs: 1) the head of the linear linked list, the number of columns that will be printed on the screen

Authors & Date: Riccardo Rigon, 1997

FILE: LIBRARIES/BASICS/t_list.h, LIBRARIES/BASICS/list.c

Definition at line 222 of file list.c.

References longpoker::i, longpoker::j, longpoker::k, longpoker::l, and longpoker::next.

void print_reallist_elements ( REALPAIR list,
short  columns 
)

Definition at line 273 of file list.c.

References realpair::next, realpair::x, and realpair::y.

void print_xyz_elements ( XYZ list,
short  columns 
)

Definition at line 348 of file list.c.

References xyz::next, xyz::x, xyz::y, and xyz::z.

REALPAIR* realbuffer2list ( double *  s,
REALPAIR nxt 
)

Definition at line 31 of file list.c.

References realpair::next, realbuffer2list(), t_error(), realpair::x, and realpair::y.

Referenced by realbuffer2list().

LONGPAIR* rotate ( LONGPAIR head,
int  n 
)

Name: rotate

Version: 1.0

Synopsis:

LONGPAIR * rotate(LONGPAIR * head,int n);

Description: appends the last element of a linear linked list to the head and repeat the operation n times

Inputs: the head of the linear linked list to be rotated and the number of rotations

Return: the new head of the lsit

Authors & Date: Riccardo Rigon, 1997

FILE: LIBRARIES/BASICS/t_list.h, LIBRARIES/BASICS/list.c

Definition at line 982 of file list.c.

References longpair::next, and rotate().

Referenced by rotate().

LONGPAIR* rotateleft ( LONGPAIR head)

Name: rotateleft

Version: 1.0

Synopsis:

LONGPAIR * rotateleft(LONGPAIR * head);

Description: Take a linear linked list and put the first element at the end of the list

Inputs: the pointer to the head of the list

Return: a pointer to the new head of the list

Authors & Date: Riccardo Rigon, 1997

References:

Examples: metropolis

Authors & Date: Riccardo Rigon, 1997

FILE: LIBRARIES/BASICS/t_list.h, LIBRARIES/BASICS/list.c

Definition at line 962 of file list.c.

References longpair::next.

void write_indexed_pokerlist_elements ( FILE *  ostream,
LONGPOKER list,
short  columns 
)

Definition at line 248 of file list.c.

References longpoker::i, longpoker::j, longpoker::k, longpoker::l, and longpoker::next.