PLplot  5.13.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
plmem.c File Reference
#include "plplotP.h"

Go to the source code of this file.

Functions

void plAlloc2dGrid (PLFLT ***f, PLINT nx, PLINT ny)
 
void plFree2dGrid (PLFLT **f, PLINT nx, PLINT PL_UNUSED(ny))
 
void plMinMax2dGrid (PLFLT_MATRIX f, PLINT nx, PLINT ny, PLFLT *fnmax, PLFLT *fnmin)
 

Detailed Description

These functions provide allocation and deallocation of two-dimensional arrays.

Definition in file plmem.c.

Function Documentation

void plAlloc2dGrid ( PLFLT ***  f,
PLINT  nx,
PLINT  ny 
)

Allocates a block of memory for use as a 2-d grid of PLFLT's. Resulting array can be indexed as f[i][j] anywhere. This is to be used instead of PLFLT f[nx][ny], which is less useful. Note that this type of allocation is required by the PLplot functions which take a 2-d grids of PLFLT's as an argument, such as plcont() and plot3d(). Example usage:

PLFLT **z;

Alloc2dGrid(&z, XPTS, YPTS);

Parameters
fLocation of the storage (address of a **).
nxSize of the grid in x.
nySize of the grid in y.

Definition at line 60 of file plmem.c.

void plFree2dGrid ( PLFLT **  f,
PLINT  nx,
PLINT   PL_UNUSEDny 
)

Frees a block of memory allocated with Alloc2dGrid().

Parameters
fThe [][] to the storage.
nxSize of the grid in x.
PL_UNUSED(ny) Not used.

Definition at line 85 of file plmem.c.

void plMinMax2dGrid ( PLFLT_MATRIX  f,
PLINT  nx,
PLINT  ny,
PLFLT fnmax,
PLFLT fnmin 
)

Finds the maximum and minimum of a 2d matrix allocated with plAllc2dGrid(). NaN and +/- infinity values are ignored.

param f 2d matrix pointer. param nx Size of the grid in x. param ny Size of the grid in y. param fnmax Maximum value in the matrix. param fnmin Minimum value in the matrix.

Definition at line 110 of file plmem.c.