GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-d6dec75dd4
blas_level_2.c File Reference
#include <math.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <grass/gmath.h>
#include <grass/gis.h>
Include dependency graph for blas_level_2.c:

Go to the source code of this file.

Macros

#define EPSILON   0.00000000000000001
 

Functions

void G_math_d_Ax (double **A, double *x, double *y, int rows, int cols)
 Compute the matrix - vector product of matrix A and vector x. More...
 
void G_math_f_Ax (float **A, float *x, float *y, int rows, int cols)
 Compute the matrix - vector product of matrix A and vector x. More...
 
void G_math_d_x_dyad_y (double *x, double *y, double **A, int rows, int cols)
 Compute the dyadic product of two vectors. The result is stored in the matrix A. More...
 
void G_math_f_x_dyad_y (float *x, float *y, float **A, int rows, int cols)
 Compute the dyadic product of two vectors. The result is stored in the matrix A. More...
 
void G_math_d_aAx_by (double **A, double *x, double *y, double a, double b, double *z, int rows, int cols)
 Compute the scaled matrix - vector product of matrix double **A and vector x and y. More...
 
void G_math_f_aAx_by (float **A, float *x, float *y, float a, float b, float *z, int rows, int cols)
 Compute the scaled matrix - vector product of matrix A and vectors x and y. More...
 
int G_math_d_A_T (double **A, int rows)
 Compute the transposition of matrix A. Matrix A will be overwritten. More...
 
int G_math_f_A_T (float **A, int rows)
 Compute the transposition of matrix A. Matrix A will be overwritten. More...
 

Macro Definition Documentation

◆ EPSILON

#define EPSILON   0.00000000000000001

Definition at line 26 of file blas_level_2.c.

Function Documentation

◆ G_math_d_A_T()

int G_math_d_A_T ( double **  A,
int  rows 
)

Compute the transposition of matrix A. Matrix A will be overwritten.

This function is multi-threaded with OpenMP and can be called within a parallel OpenMP region.

Returns 0.

Parameters
A(double **)
rows(int)
Returns
int

Definition at line 342 of file blas_level_2.c.

◆ G_math_d_aAx_by()

void G_math_d_aAx_by ( double **  A,
double *  x,
double *  y,
double  a,
double  b,
double *  z,
int  rows,
int  cols 
)

Compute the scaled matrix - vector product of matrix double **A and vector x and y.

z = a * A * x + b * y

This function is multi-threaded with OpenMP and can be called within a parallel OpenMP region.

Parameters
A(double **)
x(double *)
y(double *)
a(double)
b(double)
z(double *)
rows(int)
cols(int)
Returns
(void)

Definition at line 182 of file blas_level_2.c.

◆ G_math_d_Ax()

void G_math_d_Ax ( double **  A,
double *  x,
double *  y,
int  rows,
int  cols 
)

Compute the matrix - vector product of matrix A and vector x.

This function is multi-threaded with OpenMP and can be called within a parallel OpenMP region.

y = A * x

Parameters
A(double ** )
x(double *)
y(double *)
rows(int)
cols(int)
Returns
(void)

Definition at line 46 of file blas_level_2.c.

Referenced by N_les_integrate_dirichlet_2d(), and N_les_integrate_dirichlet_3d().

◆ G_math_d_x_dyad_y()

void G_math_d_x_dyad_y ( double *  x,
double *  y,
double **  A,
int  rows,
int  cols 
)

Compute the dyadic product of two vectors. The result is stored in the matrix A.

This function is multi-threaded with OpenMP and can be called within a parallel OpenMP region.

A = x * y^T

Parameters
x(double *)
y(double *)
A(float **) – matrix of size rows*cols
rows(int) – length of vector x
cols(int) – length of vector y
Returns
(void)

Definition at line 116 of file blas_level_2.c.

◆ G_math_f_A_T()

int G_math_f_A_T ( float **  A,
int  rows 
)

Compute the transposition of matrix A. Matrix A will be overwritten.

This function is multi-threaded with OpenMP and can be called within a parallel OpenMP region.

Returns 0.

Parameters
A(float **)
rows(int)
Returns
int

Definition at line 376 of file blas_level_2.c.

◆ G_math_f_aAx_by()

void G_math_f_aAx_by ( float **  A,
float *  x,
float *  y,
float  a,
float  b,
float *  z,
int  rows,
int  cols 
)

Compute the scaled matrix - vector product of matrix A and vectors x and y.

z = a * A * x + b * y

This function is multi-threaded with OpenMP and can be called within a parallel OpenMP region.

Parameters
A(float **)
x(float *)
y(float *)
a(float)
b(float)
z(float *)
rows(int)
cols(int)
Returns
(void)

Definition at line 265 of file blas_level_2.c.

◆ G_math_f_Ax()

void G_math_f_Ax ( float **  A,
float *  x,
float *  y,
int  rows,
int  cols 
)

Compute the matrix - vector product of matrix A and vector x.

This function is multi-threaded with OpenMP and can be called within a parallel OpenMP region.

y = A * x

Parameters
A(float ** )
x(float *)
y(float *)
rows(int)
cols(int)
Returns
(void)

Definition at line 81 of file blas_level_2.c.

◆ G_math_f_x_dyad_y()

void G_math_f_x_dyad_y ( float *  x,
float *  y,
float **  A,
int  rows,
int  cols 
)

Compute the dyadic product of two vectors. The result is stored in the matrix A.

This function is multi-threaded with OpenMP and can be called within a parallel OpenMP region.

A = x * y^T

Parameters
x(float *)
y(float *)
A(float **= – matrix of size rows*cols
rows(int) – length of vector x
cols(int) – length of vector y
Returns
(void)

Definition at line 147 of file blas_level_2.c.