PLplot
5.13.0
|
#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) |
These functions provide allocation and deallocation of two-dimensional arrays.
Definition in file plmem.c.
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);
f | Location of the storage (address of a **). |
nx | Size of the grid in x. |
ny | Size of the grid in y. |
Frees a block of memory allocated with Alloc2dGrid().
f | The [][] to the storage. |
nx | Size of the grid in x. |
PL_UNUSED( | ny) Not used. |
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.