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

Go to the source code of this file.

Functions

float * vector (long nl, long nh)
 
int * ivector (long nl, long nh)
 
long * lvector (long nl, long nh)
 
short * svector (long nl, long nh)
 
double * dvector (long nl, long nh)
 
char * cvector (long nl, long nh)
 
float ** matrix (long nrl, long nrh, long ncl, long nch)
 
int ** imatrix (long nrl, long nrh, long ncl, long nch)
 
short ** smatrix (long nrl, long nrh, long ncl, long nch)
 
long ** lmatrix (long nrl, long nrh, long ncl, long nch)
 
double ** dmatrix (long nrl, long nrh, long ncl, long nch)
 
char ** charmatrix (long nrl, long nrh, long ncl, long nch)
 
SHORTVECTORnew_shortvector (long nh)
 
INTVECTORnew_intvector (long nh)
 
FLOATVECTORnew_floatvector (long nh)
 
LONGVECTORnew_longvector (long nh)
 
DOUBLEVECTORnew_doublevector (long nh)
 
CHARVECTORnew_charvector (long nh)
 
SHORTMATRIXnew_shortmatrix (long nrh, long nch)
 
INTMATRIXnew_intmatrix (long nrh, long nch)
 
FLOATMATRIXnew_floatmatrix (long nrh, long nch)
 
LONGMATRIXnew_longmatrix (long nrh, long nch)
 
DOUBLEMATRIXnew_doublematrix (long nrh, long nch)
 
INTBINnew_intbin (LONGVECTOR *indx)
 
SHORTBINnew_shortbin (LONGVECTOR *indx)
 
LONGBINnew_longbin (LONGVECTOR *indx)
 
DOUBLEBINnew_doublebin (LONGVECTOR *indx)
 
STRINGBINnew_stringbin (LONGVECTOR *indx)
 
void free_svector (short *v, long nl)
 
void free_ivector (int *v, long nl)
 
void free_vector (float *v, long nl)
 
void free_lvector (long *v, long nl)
 
void free_dvector (double *v, long nl)
 
void free_cvector (char *v, long nl)
 
void free_smatrix (short **m, long nrl, long ncl)
 
void free_imatrix (int **m, long nrl, long ncl)
 
void free_matrix (float **m, long nrl, long ncl)
 
void free_lmatrix (long **m, long nrl, long ncl)
 
void free_dmatrix (double **m, long nrl, long ncl)
 
void free_charmatrix (char **m, long nrl, long ncl)
 
void free_shortvector (SHORTVECTOR *v)
 
void free_intvector (INTVECTOR *v)
 
void free_floatvector (FLOATVECTOR *v)
 
void free_longvector (LONGVECTOR *v)
 
void free_doublevector (DOUBLEVECTOR *v)
 
void free_charvector (CHARVECTOR *v)
 
void free_shortmatrix (SHORTMATRIX *m)
 
void free_intmatrix (INTMATRIX *m)
 
void free_floatmatrix (FLOATMATRIX *m)
 
void free_longmatrix (LONGMATRIX *m)
 
void free_doublematrix (DOUBLEMATRIX *m)
 
void free_intbin (INTBIN *l)
 
void free_shortbin (SHORTBIN *l)
 
void free_longbin (LONGBIN *l)
 
void free_doublebin (DOUBLEBIN *l)
 
void free_stringbin (STRINGBIN *l)
 
void free_header (HEADER H)
 

Function Documentation

char** charmatrix ( long  nrl,
long  nrh,
long  ncl,
long  nch 
)

Definition at line 741 of file alloc.c.

References NR_END, and t_error().

char* cvector ( long  nl,
long  nh 
)

Definition at line 237 of file alloc.c.

References NR_END, and t_error().

Referenced by new_charvector().

double ** dmatrix ( long  nrl,
long  nrh,
long  ncl,
long  nch 
)

Definition at line 654 of file alloc.c.

References NR_END, and t_error().

Referenced by new_doublematrix().

double * dvector ( long  nl,
long  nh 
)

Definition at line 189 of file alloc.c.

References NR_END, and t_error().

Referenced by new_doublevector().

void free_charmatrix ( char **  m,
long  nrl,
long  ncl 
)

Definition at line 2613 of file alloc.c.

References FREE_ARG, and NR_END.

void free_charvector ( CHARVECTOR v)
void free_cvector ( char *  v,
long  nl 
)

Definition at line 2425 of file alloc.c.

References FREE_ARG, and NR_END.

Referenced by free_charvector().

void free_dmatrix ( double **  m,
long  nrl,
long  ncl 
)

Definition at line 2578 of file alloc.c.

References FREE_ARG, and NR_END.

Referenced by free_doublematrix().

void free_doublebin ( DOUBLEBIN l)

Definition at line 3739 of file alloc.c.

References db::co, FREE_ARG, free_longvector(), db::index, db::isdynamic, LONGVECTOR::nl, NR_END, and t_error().

void free_dvector ( double *  v,
long  nl 
)

Definition at line 2398 of file alloc.c.

References FREE_ARG, and NR_END.

Referenced by free_doublevector().

void free_floatvector ( FLOATVECTOR v)

Definition at line 2799 of file alloc.c.

References FLOATVECTOR::co, free_vector(), FLOATVECTOR::isdynamic, FLOATVECTOR::nh, NL, FLOATVECTOR::nl, and t_error().

Referenced by convlv().

void free_header ( HEADER  )

Name: free_header

Version: 1.0

Synopsis: void free_header(HEADER )

General information: This section includes the deallocation routines for blocks and header. Types HEADER are allocated by read_header.

Authors & Date: Riccardo Rigon 1996-1997

FILE: LIBRARIES/BASICS/t_alloc.h, LIBRARIES/BASICS/alloc.c

Inputs: the name of the structure to be deallocated

Return: void

Examples: 1.example.c, 2.example.c

Keywords: Dynamic memory allocation, Pointers.

Definition at line 3954 of file alloc.c.

References HEADER::name.

Referenced by justread_floatmatrix(), read_charvector(), read_doublearray(), read_doublebin(), read_doublematrix(), read_doubletensor(), read_doublevector(), read_floatmatrix(), read_floatvector(), read_intbin(), read_intmatrix(), read_intvector(), read_longbin(), read_longmatrix(), read_longvector(), read_shortbin(), read_shortmatrix(), read_shortvector(), and read_stringarray().

void free_imatrix ( int **  m,
long  nrl,
long  ncl 
)

Definition at line 2488 of file alloc.c.

References FREE_ARG, and NR_END.

Referenced by free_intmatrix().

void free_intbin ( INTBIN l)
void free_intmatrix ( INTMATRIX m)
void free_intvector ( INTVECTOR v)
void free_ivector ( int *  v,
long  nl 
)

Definition at line 2314 of file alloc.c.

References FREE_ARG, and NR_END.

Referenced by free_intvector().

void free_lmatrix ( long **  m,
long  nrl,
long  ncl 
)

Definition at line 2548 of file alloc.c.

References FREE_ARG, and NR_END.

Referenced by free_longmatrix().

void free_lvector ( long *  v,
long  nl 
)

Definition at line 2371 of file alloc.c.

References FREE_ARG, and NR_END.

Referenced by free_longvector().

void free_matrix ( float **  m,
long  nrl,
long  ncl 
)

Definition at line 2518 of file alloc.c.

References FREE_ARG, and NR_END.

Referenced by free_floatmatrix().

void free_shortbin ( SHORTBIN l)
void free_shortvector ( SHORTVECTOR )

Name: free_

Description: This section includes the deallocation routines for the vector, matrixes and bins

Version: 1.0

Synopsis: void free_shortvector( SHORTVECTOR *); void free_intvector( INTVECTOR *); void free_longvector( LONGVECTOR *); void free_floatvector( FLOATVECTOR *); void free_doublevector( DOUBLEVECTOR *); void free_charvector( CHARVECTOR *);

void free_shortmatrix( SHORTMATRIX *); void free_intmatrix( INTMATRIX *); void free_longmatrix( LONGMATRIX *); void free_floatmatrix( FLOATMATRIX *); void free_doublematrix( DOUBLEMATRIX *);

void free_intbin( INTBIN *); void free_stringbin( STRINGBIN *); void free_shortbin( SHORTBIN *); void free_longbin( LONGBIN *); void free_doublebin( DOUBLEBIN *);

Authors & date: Paolo D'Odorico, Riccardo Rigon 1996-1997

FILE: LIBRARIES/BASICS/t_alloc.h, LIBRARIES/BASICS/alloc.c

Inputs: the name of the structure to be deallocated

Return: void

Related Routines: free, malloc

Keywords: Dynamic memory allocation, Pointers.

Examples: 1.example.c, 2.example.c

Definition at line 2649 of file alloc.c.

References SHORTVECTOR::co, free_svector(), SHORTVECTOR::isdynamic, SHORTVECTOR::nh, NL, SHORTVECTOR::nl, and t_error().

Referenced by ordi_kriging2().

void free_smatrix ( short **  m,
long  nrl,
long  ncl 
)

Definition at line 2458 of file alloc.c.

References FREE_ARG, and NR_END.

Referenced by free_shortmatrix().

void free_stringbin ( STRINGBIN l)
void free_svector ( short *  v,
long  nl 
)

Definition at line 2287 of file alloc.c.

References FREE_ARG, and NR_END.

Referenced by free_shortvector().

void free_vector ( float *  v,
long  nl 
)

Definition at line 2344 of file alloc.c.

References FREE_ARG, and NR_END.

Referenced by free_floatvector().

int** imatrix ( long  nrl,
long  nrh,
long  ncl,
long  nch 
)

Definition at line 381 of file alloc.c.

References NR_END, and t_error().

Referenced by new_intmatrix().

int* ivector ( long  nl,
long  nh 
)

Definition at line 63 of file alloc.c.

References NR_END, and t_error().

Referenced by new_intvector().

long** lmatrix ( long  nrl,
long  nrh,
long  ncl,
long  nch 
)

Definition at line 567 of file alloc.c.

References NR_END, and t_error().

Referenced by new_longmatrix().

long* lvector ( long  nl,
long  nh 
)

Definition at line 105 of file alloc.c.

References NR_END, and t_error().

Referenced by new_longvector().

float** matrix ( long  nrl,
long  nrh,
long  ncl,
long  nch 
)

Definition at line 294 of file alloc.c.

References NR_END, and t_error().

Referenced by doubletensor_dem(), and new_floatmatrix().

CHARVECTOR* new_charvector ( long  nh)
FLOATMATRIX* new_floatmatrix ( long  nrh,
long  nch 
)
INTBIN* new_intbin ( LONGVECTOR indx)
INTMATRIX* new_intmatrix ( long  nrh,
long  nch 
)
INTVECTOR* new_intvector ( long  nh)

Definition at line 903 of file alloc.c.

References INTVECTOR::co, isDynamic, INTVECTOR::isdynamic, ivector(), INTVECTOR::nh, NL, INTVECTOR::nl, and t_error().

Referenced by read_intvector().

SHORTMATRIX* new_shortmatrix ( long  nrh,
long  nch 
)
SHORTVECTOR* new_shortvector ( long  )

Name: new_

Synopsis:

SHORTVECTOR *new_shortvector(long);

INTVECTOR *new_intvector(long);

FLOATVECTOR *new_floatvector(long);

LONGVECTOR *new_longvector(long);

DOUBLEVECTOR *new_doublevector(long);

CHARVECTOR *new_charvector(long);

SHORTMATRIX *new_shortmatrix( long,long);

INTMATRIX *new_intmatrix( long,long);

FLOATMATRIX *new_floatmatrix( long,long);

LONGMATRIX *new_longmatrix( long,long);

DOUBLEMATRIX *new_doublematrix( long,long);

INTBIN *new_intbin(LONGVECTOR *);

STRINGBIN *new_stringbin(LONGVECTOR *);

SHORTBIN *new_shortbin(LONGVECTOR *);

LONGBIN *new_longbin(LONGVECTOR *);

DOUBLEBIN *new_doublebin(LONGVECTOR *);

Version: 1.0

Description: Allocate vectors, matrixes and bind. Strings length is not known apriori. Thus, the allocation program is one with the reading routine one finds in t_io.h.

Authors & Date: Paolo D'Odorico, Riccardo Rigon, 1996-1997

FILE: LIBRARIES/BASICS/t_alloc.h, LIBRARIES/BASICS/alloc.c

Inputs: the number of elements in the vector, the number of rows and columns matrixes, a LONGVECTOR for bins.

Return: a pointer to the allocated structure

See Also: vector, free

Keywords: Dynamic memory allocation, pointers.

Examples: 1.example.c, 2.example.c

Definition at line 846 of file alloc.c.

References SHORTVECTOR::co, isDynamic, SHORTVECTOR::isdynamic, SHORTVECTOR::nh, NL, SHORTVECTOR::nl, svector(), and t_error().

Referenced by esponentialsplit2realvectors(), ordi_kriging2(), read_shortarray(), and read_shortvector().

short** smatrix ( long  nrl,
long  nrh,
long  ncl,
long  nch 
)

Definition at line 480 of file alloc.c.

References NR_END, and t_error().

Referenced by new_shortmatrix().

short* svector ( long  nl,
long  nh 
)

Definition at line 147 of file alloc.c.

References NR_END, and t_error().

Referenced by new_shortvector().

float* vector ( long  nl,
long  nh 
)

Definition at line 18 of file alloc.c.

References NR_END, and t_error().

Referenced by new_floatvector(), and new_longmatrix_vector().