SpM Handbook 1.2.4
Loading...
Searching...
No Matches
const.h
Go to the documentation of this file.
1/**
2 *
3 * @file spm/const.h
4 *
5 * Spm API enums parameters.
6 *
7 * @copyright 2004-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
8 * Univ. Bordeaux. All rights reserved.
9 *
10 * @version 1.2.4
11 * @author Pierre Ramet
12 * @author Mathieu Faverge
13 * @author Tony Delarue
14 * @date 2024-05-29
15 *
16 * @addtogroup spm_const
17 * @{
18 *
19 **/
20#ifndef _spm_const_h_
21#define _spm_const_h_
22
23#include "spm/config.h"
24
25BEGIN_C_DECLS
26
27/********************************************************************
28 * CBLAS value address
29 */
30#ifndef CBLAS_SADDR
31/**
32 * @brief Macro to get the address if need in the cblas calls
33 * @param[in] \_a\_
34 * The parameter for which the address is needed.
35 */
36#define CBLAS_SADDR( _a_ ) (&(_a_))
37#endif
38
39/**
40 * @brief Distribution of the matrix storage
41 */
42#define SpmDistByColumn (0x1 << 0) /**< Storage in column distributed */
43#define SpmDistByRow (0x1 << 1) /**< Storage in row distributed */
44
45/**
46 * @brief Verbose modes
47 */
48typedef enum spm_verbose_e {
49 SpmVerboseNot = 0, /**< Nothing */
50 SpmVerboseNo = 1, /**< Default */
51 SpmVerboseYes = 2 /**< Extended */
53
54/**
55 * @brief Arithmetic types.
56 *
57 * This describes the different arithmetics that can be stored in a sparse matrix.
58 * @remark The values start at 2 for compatibility purpose with PLASMA and
59 * DPLASMA libraries.
60 */
61typedef enum spm_coeftype_e {
62 SpmPattern = 0, /**< Pattern only, no values are stored */
63 SpmFloat = 2, /**< Single precision real */
64 SpmDouble = 3, /**< Double precision real */
65 SpmComplex32 = 4, /**< Single precision complex */
66 SpmComplex64 = 5 /**< Double precision complex */
68
69/**
70 * @brief Sparse matrix format
71 */
72typedef enum spm_fmttype_e {
73 SpmCSC, /**< Compressed sparse column */
74 SpmCSR, /**< Compressed sparse row */
75 SpmIJV /**< Coordinates */
77
78/**
79 * @brief Error codes
80 */
81typedef enum spm_error_e {
82 SPM_SUCCESS = 0, /**< No error */
83 SPM_ERR_UNKNOWN = 1, /**< Unknown error */
84 SPM_ERR_ALLOC = 2, /**< Allocation error */
85 SPM_ERR_NOTIMPLEMENTED = 3, /**< Not implemented feature */
86 SPM_ERR_OUTOFMEMORY = 4, /**< Not enough memory */
87 SPM_ERR_THREAD = 5, /**< Error with threads */
88 SPM_ERR_INTERNAL = 6, /**< Internal error */
89 SPM_ERR_BADPARAMETER = 7, /**< Bad parameters given */
90 SPM_ERR_FILE = 8, /**< Error in In/Out operations */
91 SPM_ERR_INTEGER_TYPE = 9, /**< Error with integer types */
92 SPM_ERR_IO = 10, /**< Error with input/output */
93 SPM_ERR_MPI = 11 /**< Error with MPI calls */
95
96/**
97 * @brief The list of matrix driver readers and generators
98 */
99typedef enum spm_driver_e {
100 SpmDriverRSA, /**< RSA Fortran driver (deprecated) */
101 SpmDriverHB, /**< Harwell Boeing driver */
102 SpmDriverIJV, /**< IJV Coordinate driver */
103 SpmDriverMM, /**< Matrix Market C driver */
104 SpmDriverLaplacian, /**< 3, 5, or 7 points Laplacian stencil generator */
105 SpmDriverXLaplacian, /**< 15-points Laplacian stencil generator */
106 SpmDriverGraph, /**< Scotch Graph driver */
107 SpmDriverSPM, /**< SPM matrix driver */
108 /* SpmDriverDMM, /\**< Distributed Matrix Market driver *\/ */
109 /* SpmDriverCSCD, /\**< CSC distributed driver *\/ */
110 /* SpmDriverPetscS, /\**< Petsc Symmetric driver *\/ */
111 /* SpmDriverPetscU, /\**< Pestc Unssymmetric driver *\/ */
112 /* SpmDriverPetscH, /\**< Pestc Hermitian driver *\/ */
113 /* SpmDriverCCC, /\**< Not supported yet *\/ */
114 /* SpmDriverRCC, /\**< Not supported yet *\/ */
115 /* SpmDriverOlaf, /\**< Not supported yet *\/ */
116 /* SpmDriverPeer, /\**< Not supported yet *\/ */
117 /* SpmDriverBRGM, /\**< Not supported yet *\/ */
118 /* SpmDriverBRGMD, /\**< Not supported yet *\/ */
120
121/**
122 * @brief How to generate RHS
123 */
124typedef enum spm_rhstype_e {
125 SpmRhsOne,
126 SpmRhsI,
127 SpmRhsRndX,
128 SpmRhsRndB
130
131/**
132 *
133 * @name Constants compatible with CBLAS & LAPACK & PLASMA
134 * @{
135 * The naming and numbering of the following constants is consistent with:
136 *
137 * - CBLAS from Netlib (http://www.netlib.org/blas/blast-forum/cblas.tgz)
138 * - C Interface to LAPACK from Netlib (http://www.netlib.org/lapack/lapwrapc/)
139 * - Plasma (http://icl.cs.utk.edu/plasma/index.html)
140 *
141 */
142
143/**
144 * @brief Direction of the matrix storage
145 */
146typedef enum spm_layout_e {
147 SpmRowMajor = 101, /**< Storage in row major order */
148 SpmColMajor = 102 /**< Storage in column major order */
150
151/**
152 * @brief Transpostion
153 */
154typedef enum spm_trans_e {
155 SpmNoTrans = 111, /**< Use A */
156 SpmTrans = 112, /**< Use A^t */
157 SpmConjTrans = 113 /**< Use conj(A^t) */
159
160/**
161 * @brief Matrix symmetry type property.
162 * @remark Must match transposition.
163 */
164typedef enum spm_mtxtype_e {
165 SpmGeneral = SpmNoTrans, /**< The matrix is general */
166 SpmSymmetric = SpmTrans, /**< The matrix is symmetric */
167 SpmHermitian = SpmConjTrans /**< The matrix is hermitian */
169
170/**
171 * @brief Upper/Lower part
172 */
173typedef enum spm_uplo_e {
174 SpmUpper = 121, /**< Use lower triangle of A */
175 SpmLower = 122, /**< Use upper triangle of A */
176 SpmUpperLower = 123 /**< Use the full A */
178
179/**
180 * @brief Diagonal
181 */
182typedef enum spm_diag_e {
183 SpmNonUnit = 131, /**< Diagonal is non unitary */
184 SpmUnit = 132 /**< Diagonal is unitary */
186
187/**
188 * @brief Side of the operation
189 */
190typedef enum spm_side_e {
191 SpmLeft = 141, /**< Apply operator on the left */
192 SpmRight = 142 /**< Apply operator on the right */
194
195/**
196 * @brief Norms
197 */
198typedef enum spm_normtype_e {
199 SpmOneNorm = 171, /**< One norm: max_j( sum_i( |a_{ij}| ) ) */
200 SpmFrobeniusNorm = 174, /**< Frobenius norm: sqrt( sum_{i,j} (a_{ij}^2) ) */
201 SpmInfNorm = 175, /**< Inifinite norm: max_i( sum_j( |a_{ij}| ) ) */
202 SpmMaxNorm = 177 /**< Max norm: max_{i,j}( | a_{ij} | ) */
204
205/**
206 * @brief Direction
207 */
208typedef enum spm_dir_e {
209 SpmDirForward = 391, /**< Forward direction */
210 SpmDirBackward = 392, /**< Backward direction */
212
213/**
214 * @}
215 */
216
217END_C_DECLS
218
219#endif /* _spm_const_h_ */
220
221/**
222 * @}
223 */
spm_error_e
Error codes.
Definition const.h:81
spm_verbose_e
Verbose modes.
Definition const.h:48
enum spm_driver_e spm_driver_t
The list of matrix driver readers and generators.
spm_driver_e
The list of matrix driver readers and generators.
Definition const.h:99
enum spm_layout_e spm_layout_t
Direction of the matrix storage.
spm_rhstype_e
How to generate RHS.
Definition const.h:124
spm_trans_e
Transpostion.
Definition const.h:154
enum spm_verbose_e spm_verbose_t
Verbose modes.
spm_diag_e
Diagonal.
Definition const.h:182
enum spm_fmttype_e spm_fmttype_t
Sparse matrix format.
spm_layout_e
Direction of the matrix storage.
Definition const.h:146
spm_coeftype_e
Arithmetic types.
Definition const.h:61
enum spm_diag_e spm_diag_t
Diagonal.
enum spm_rhstype_e spm_rhstype_t
How to generate RHS.
spm_mtxtype_e
Matrix symmetry type property.
Definition const.h:164
spm_dir_e
Direction.
Definition const.h:208
enum spm_error_e spm_error_t
Error codes.
enum spm_uplo_e spm_uplo_t
Upper/Lower part.
enum spm_dir_e spm_dir_t
Direction.
enum spm_coeftype_e spm_coeftype_t
Arithmetic types.
spm_fmttype_e
Sparse matrix format.
Definition const.h:72
spm_normtype_e
Norms.
Definition const.h:198
spm_side_e
Side of the operation.
Definition const.h:190
spm_uplo_e
Upper/Lower part.
Definition const.h:173
enum spm_normtype_e spm_normtype_t
Norms.
enum spm_trans_e spm_trans_t
Transpostion.
enum spm_mtxtype_e spm_mtxtype_t
Matrix symmetry type property.
enum spm_side_e spm_side_t
Side of the operation.
@ SPM_ERR_INTERNAL
Definition const.h:88
@ SPM_ERR_INTEGER_TYPE
Definition const.h:91
@ SPM_ERR_BADPARAMETER
Definition const.h:89
@ SPM_SUCCESS
Definition const.h:82
@ SPM_ERR_IO
Definition const.h:92
@ SPM_ERR_MPI
Definition const.h:93
@ SPM_ERR_FILE
Definition const.h:90
@ SPM_ERR_ALLOC
Definition const.h:84
@ SPM_ERR_OUTOFMEMORY
Definition const.h:86
@ SPM_ERR_UNKNOWN
Definition const.h:83
@ SPM_ERR_NOTIMPLEMENTED
Definition const.h:85
@ SPM_ERR_THREAD
Definition const.h:87
@ SpmVerboseNo
Definition const.h:50
@ SpmVerboseYes
Definition const.h:51
@ SpmVerboseNot
Definition const.h:49
@ SpmDriverSPM
Definition const.h:107
@ SpmDriverHB
Definition const.h:101
@ SpmDriverRSA
Definition const.h:100
@ SpmDriverLaplacian
Definition const.h:104
@ SpmDriverXLaplacian
Definition const.h:105
@ SpmDriverMM
Definition const.h:103
@ SpmDriverIJV
Definition const.h:102
@ SpmDriverGraph
Definition const.h:106
@ SpmConjTrans
Definition const.h:157
@ SpmNoTrans
Definition const.h:155
@ SpmTrans
Definition const.h:156
@ SpmNonUnit
Definition const.h:183
@ SpmUnit
Definition const.h:184
@ SpmRowMajor
Definition const.h:147
@ SpmColMajor
Definition const.h:148
@ SpmComplex64
Definition const.h:66
@ SpmDouble
Definition const.h:64
@ SpmFloat
Definition const.h:63
@ SpmComplex32
Definition const.h:65
@ SpmPattern
Definition const.h:62
@ SpmGeneral
Definition const.h:165
@ SpmSymmetric
Definition const.h:166
@ SpmHermitian
Definition const.h:167
@ SpmDirForward
Definition const.h:209
@ SpmDirBackward
Definition const.h:210
@ SpmCSC
Definition const.h:73
@ SpmCSR
Definition const.h:74
@ SpmIJV
Definition const.h:75
@ SpmFrobeniusNorm
Definition const.h:200
@ SpmInfNorm
Definition const.h:201
@ SpmOneNorm
Definition const.h:199
@ SpmMaxNorm
Definition const.h:202
@ SpmRight
Definition const.h:192
@ SpmLeft
Definition const.h:191
@ SpmUpper
Definition const.h:174
@ SpmUpperLower
Definition const.h:176
@ SpmLower
Definition const.h:175