GRASS GIS 8 Programmer's Manual 8.3.2(2024)-exported
Loading...
Searching...
No Matches
dalloc.c File Reference

Matrix memory management functions. More...

#include <stdlib.h>
#include <grass/gis.h>
Include dependency graph for dalloc.c:

Go to the source code of this file.

Functions

double * G_alloc_vector (size_t n)
 Vector matrix memory allocation.
 
double ** G_alloc_matrix (int rows, int cols)
 Matrix memory allocation.
 
float * G_alloc_fvector (size_t n)
 Floating point vector memory allocation.
 
float ** G_alloc_fmatrix (int rows, int cols)
 Floating point matrix memory allocation.
 
void G_free_vector (double *v)
 Vector memory deallocation.
 
void G_free_fvector (float *v)
 Vector memory deallocation.
 
void G_free_matrix (double **m)
 Matrix memory deallocation.
 
void G_free_fmatrix (float **m)
 Floating point matrix memory deallocation.
 

Detailed Description

Matrix memory management functions.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Author
GRASS GIS Development Team
Date
2004-2006

Definition in file dalloc.c.

Function Documentation

◆ G_alloc_fmatrix()

float ** G_alloc_fmatrix ( int rows,
int cols )

Floating point matrix memory allocation.

Allocate a matrix of rows by cols floats initialized to zero.

Parameters
[in]rowsnumber of rows in matrix
[in]colsnumber of columns in matrix
Returns
float **

Definition at line 99 of file dalloc.c.

◆ G_alloc_fvector()

float * G_alloc_fvector ( size_t n)

Floating point vector memory allocation.

Allocate a vector (array) of n floats initialized to zero.

Parameters
[in]nsize of vector to allocate
Returns
float *

Definition at line 81 of file dalloc.c.

◆ G_alloc_matrix()

double ** G_alloc_matrix ( int rows,
int cols )

Matrix memory allocation.

Allocate a matrix of rows by cols doubles initialized to zero.

Parameters
[in]rowsnumber of rows in matrix
[in]colsnumber of columns in matrix
Returns
double **

Definition at line 57 of file dalloc.c.

Referenced by G_math_Asp_to_A(), G_math_Asp_to_sband_matrix(), G_math_cholesky_sband_invert(), G_math_matrix_to_sband_matrix(), G_math_sband_matrix_to_matrix(), G_math_solver_cholesky_sband(), G_math_solver_cholesky_sband_invert(), IL_interp_segments_2d(), IL_interp_segments_2d_parallel(), IL_resample_interp_segments_2d(), and N_alloc_les_param().

◆ G_alloc_vector()

double * G_alloc_vector ( size_t n)

Vector matrix memory allocation.

Allocate a vector (array) of n doubles initialized to zero.

Parameters
[in]nsize of vector to allocate
Returns
double *

Definition at line 39 of file dalloc.c.

Referenced by G_ludcmp(), G_math_cholesky_sband_invert(), G_math_solver_cholesky_sband_invert(), G_math_solver_gs(), G_math_solver_jacobi(), G_math_solver_lu(), G_math_solver_sparse_gs(), G_math_solver_sparse_jacobi(), IL_interp_segments_2d(), IL_interp_segments_2d_parallel(), IL_matrix_create(), and IL_resample_interp_segments_2d().

◆ G_free_fmatrix()

void G_free_fmatrix ( float ** m)

Floating point matrix memory deallocation.

Deallocate a matrix of floats.

Parameters
[in,out]mmatrix to free
Returns
void

Definition at line 181 of file dalloc.c.

References G_free(), and NULL.

◆ G_free_fvector()

void G_free_fvector ( float * v)

Vector memory deallocation.

Deallocate a vector (array) of floats.

Parameters
[in,out]vvector to free
Returns
void

Definition at line 142 of file dalloc.c.

References G_free(), and NULL.

◆ G_free_matrix()

void G_free_matrix ( double ** m)

Matrix memory deallocation.

Deallocate a matrix of doubles.

Parameters
[in,out]mmatrix to free
Returns
void

Definition at line 161 of file dalloc.c.

References G_free(), and NULL.

Referenced by G_math_cholesky_sband_invert(), G_math_solver_cholesky_sband(), G_math_solver_cholesky_sband_invert(), and N_free_les().

◆ G_free_vector()

void G_free_vector ( double * v)

Vector memory deallocation.

Deallocate a vector (array) of doubles.

Parameters
[in,out]vvector to free
Returns
void

Definition at line 123 of file dalloc.c.

References G_free(), and NULL.

Referenced by G_ludcmp(), G_math_cholesky_sband_invert(), and G_math_solver_cholesky_sband_invert().