GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-602118adcc
la.h
Go to the documentation of this file.
1 /**
2  * \file la.h
3  *
4  * \brief Wrapper headers for BLAS/LAPACK.
5  *
6  * This program is free software under the GNU General Public License
7  * (>=v2). Read the file COPYING that comes with GRASS for details.
8  *
9  * \author David D. Gray, ddgray@armacde.demon co uk
10  * \author GRASS GIS Development Team
11  *
12  * \date 2000-2007
13  */
14 
15 #ifndef HAVE_LIBBLAS
16 #error GRASS GIS is not configured with BLAS (la.h cannot be included)
17 #endif
18 
19 #ifndef HAVE_LIBLAPACK
20 #error GRASS GIS is not configured with LAPACK (la.h cannot be included)
21 #endif
22 
23 #ifndef GRASS_LA_H
24 #define GRASS_LA_H
25 
26 #include <grass/config.h>
27 #include <stdio.h>
28 
29 /* Useful defines */
30 
31 #define MAX_POS 1 /* Indicates maximum value */
32 #define MAX_NEG -1 /* Indicates minimum value */
33 #define MAX_ABS 0 /* Indicates absolute value */
34 
35 #define DO_COMPACT 0 /* Eliminate unnecessary rows (cols) in matrix */
36 #define NO_COMPACT 1 /* ... or not */
37 
38 /* Operations should know type of coefficient matrix, so that
39  they can call the right driver
40  */
41 
42 typedef enum { NONSYM, SYM, HERMITIAN } mat_type;
43 typedef enum { MATRIX_, ROWVEC_, COLVEC_ } mat_spec;
44 typedef enum { RVEC, CVEC } vtype;
45 
46 /************************************************************
47  * *
48  * A general matrix wrapper for use with BLAS / LAPACK *
49  * routines, and perhaps elsewhere *
50  * *
51  ************************************************************/
52 
53 typedef struct matrix_ {
54 
55  mat_spec type; /* matrix, row vector or column vector? */
56  int v_indx; /* If a vector, which row(column) is active?
57  * If a matrix this is ignored. If value is < 0,
58  * the first row(column) is assumed, ie. index 0. */
59  int rows, cols; /* Rows and columns of matrix */
60  int ldim; /* Lead dimension of matrix. How many `rows' are
61  * alloc'ed? May exceed real number of rows `rows' */
62  double *vals; /* The values (should be dimensioned to lda * cols */
63  int is_init; /* Is matrix initialised: values array
64  * is allocated and parameters set ? */
66 
68 
69 #include <grass/defs/la.h>
70 
71 #endif /* GRASS_LA_H */
vtype
Definition: la.h:44
@ CVEC
Definition: la.h:44
@ RVEC
Definition: la.h:44
mat_struct vec_struct
Definition: la.h:67
mat_type
Definition: la.h:42
@ SYM
Definition: la.h:42
@ NONSYM
Definition: la.h:42
@ HERMITIAN
Definition: la.h:42
struct matrix_ mat_struct
mat_spec
Definition: la.h:43
@ COLVEC_
Definition: la.h:43
@ MATRIX_
Definition: la.h:43
@ ROWVEC_
Definition: la.h:43
Definition: la.h:53
int v_indx
Definition: la.h:56
mat_spec type
Definition: la.h:55
int rows
Definition: la.h:59
int is_init
Definition: la.h:63
int ldim
Definition: la.h:60
double * vals
Definition: la.h:62
int cols
Definition: la.h:59