University of Rochester / Ultrasound Research Laboratory
2D Array Library

 
Class hierarchy   Compound list   File list   Header files   Compound Members   File Members   Examples  

mem.cpp File Reference

Routine to ALLOCATE and FREE memory. More...

Functions


Detailed Description

Routine to ALLOCATE and FREE memory.

$Id: mem.cpp,v 1.1 1999-03-05 16:32:30-05 ljb Exp ljb $ $Revision: 1.1 $

$Log: mem.cpp,v $ Revision 1.1 1999-03-05 16:32:30-05 ljb Initial revision


Function Documentation

float** get_2D_float( INT16 nr, INT16 nc)

Returns pointers to 2D array (nr,nc) of floats.

Example call:

  float **test;
  test = get_2D_float( 10,20); assert( test != 0);

test[i][j] can then be accessed as a 2D array i=0..9 and j=0..19

Later test is freed using the associated function:

  free_2d_float( test, 10);

INT16** get_2D_INT16( INT16 nr, INT16 nc)

Returns pointers to 2D array (nr,nc) of INT16.

Usage is similar to get_2D_float().

WORD** get_2D_WORD( INT16 nr, INT16 nc)

Returns pointers to 2D array (nr,nc) of WORD.

Usage is similar to get_2D_float().

INT32** get_2D_INT32( INT16 nr, INT16 nc)

Returns pointers to 2D array (nr,nc) of INT32.

Usage is similar to get_2D_float().

BYTE** get_2D_BYTE( INT16 nr, INT16 nc)

Returns pointers to 2D array (nr,nc) of BYTE.

Usage is similar to get_2D_float().

BYTE*** get_3D_BYTE( INT16 nr, INT16 nc, INT16 np)

Returns pointers to 3D array (nr,nc,np) of BYTE.

Example call:

  BYTE ***test;
  test = get_3D_BYTE( 10,20,30); assert( test != 0);

test[i][j][k] can then be accessed as a 3D array i=0..9, j=0..19, k=0..29

Later test is freed using the associated function:

  free_3D_BYTE( test, 10, 20);

Examples:
Txaper.cpp.

float** get_3D_float( INT16 nr, INT16 nc, INT16 np)

Returns pointers to 3D array (nr,nc,np) of float.

Usage is similar to get_3D_BYTE().

INT16** get_3D_INT16( INT16 nr, INT16 nc, INT16 np)

Returns pointers to 3D array (nr,nc,np) of INT16.

Usage is similar to get_3D_BYTE().

INT32** get_1D_INT32( INT16 n)

Returns pointers to 1D array (n) of INT32.

INT16* get_1D_INT16( INT16 n)

WORD* get_1D_WORD( INT16 n)

BYTE* get_1D_BYTE( INT16 n)

float* get_float( INT16 n)

void free_2D_INT16( INT16 **p, INT16 nr)

void free_2D_WORD( WORD **p, INT16 nr)

void free_2D_float( float **p, INT16 nr)

void free_2D_BYTE( BYTE **p, INT16 nr)

void free_2D_INT32( INT32 **p, INT16 nr)

WORD**** get_4D_WORD( INT16 na, INT16 nb, INT16 nc, INT16 nd)

Returns pointers to 4D array (na, nb, nc, nd) of WORD.

Example call:

  WORD ****test;
  test = get_4D_WORD( 10,20,30,40); assert( test != 0);

test[i][j][k][l] can then be accessed as a 4D array i=0..9, j=0..19, k=0..29, l=0..39

Later test is freed using the associated function:

  free_4D_WORD( test, 10, 20, 30);

void free_3D_BYTE( BYTE ***p, INT16 na, INT16 nb)

Examples:
Txaper.cpp.

void free_3D_float( float ***p, INT16 na, INT16 nb)

void free_3D_INT16( INT16 ***p, INT16 na, INT16 nb)

Software written by
Larry Busse of LJB Development
and Bill Glenn, Al Murphy and John Losche of TETRAD Corporation
Documentation generated 3/11/1999