SpM Handbook 1.3.0
Loading...
Searching...
No Matches
spm.h
Go to the documentation of this file.
1/**
2 *
3 * @file spm.h
4 *
5 * SParse Matrix package header.
6 *
7 * @copyright 2016-2026 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
8 * Univ. Bordeaux. All rights reserved.
9 *
10 * @version 1.3.0
11 * @author Mathieu Faverge
12 * @author Pierre Ramet
13 * @author Tony Delarue
14 * @author Matias Hastaran
15 * @author Florent Pruvost
16 * @author Fatima-Zahra Salhi
17 * @date 2026-07-15
18 *
19 **/
20#ifndef _spm_h_
21#define _spm_h_
22
23#include <stdlib.h>
24#include <assert.h>
25#include <stdio.h>
26#include "spm/config.h"
27#include "spm/const.h"
28#include "spm/datatypes.h"
29#include "spm/mpi.h"
30
31#include "spm/z_spm.h"
32#include "spm/c_spm.h"
33#include "spm/d_spm.h"
34#include "spm/s_spm.h"
35#include "spm/p_spm.h"
36
37BEGIN_C_DECLS
38
39/**
40 * @addtogroup spm
41 * @{
42 * @brief Describe all the internals routines of the SParse Matrix package.
43 *
44 * This library provides a set of subroutines to manipulate sparse matrices in
45 * different format such as compressed sparse column (CSC), compressed sparse
46 * row (CSR), or coordinate (IJV) with single or multiple degrees of freedom
47 * per unknown. It provides basic BLAS 1 and BLAS 2 functions for those
48 * matrices, as well as norms computations and converter tools.
49 */
50
51/**
52 *
53 * @brief The sparse matrix data structure
54 *
55 * This structure describes matrices with different characteristics that can be useful to any
56 * solver:
57 * - the storage format (SpmCSC, SpmCSR or SpmIJV)
58 * - the properties (SpmGeneral, SpmHermitian, SpmSymmetric)
59 * - the base value (0 in C or 1 in Fortran)
60 *
61 * All arrays indicated with [+baseval] are using indices in the baseval numbering (C, or Fortran).
62 * It is also possible to describe a matrix with constant or variable degrees of freedom.
63 *
64 */
65typedef struct spmatrix_s {
66 spm_mtxtype_t mtxtype; /**< Matrix structure: SpmGeneral, SpmSymmetric
67 or SpmHermitian. */
68 spm_coeftype_t flttype; /**< values datatype: SpmPattern, SpmFloat, SpmDouble,
69 SpmComplex32 or SpmComplex64 */
70 spm_fmttype_t fmttype; /**< Matrix storage format: SpmCSC, SpmCSR, SpmIJV */
71
72 spm_int_t baseval; /**< The base value [C, Fortran] of the indices in the arrays */
73 spm_int_t gN; /**< Global number of vertices in the compressed graph (Computed) */
74 spm_int_t n; /**< Local number of vertices in the compressed graph */
75 spm_int_t gnnz; /**< Global number of non zeroes in the compressed graph (Computed) */
76 spm_int_t nnz; /**< Local number of non zeroes in the compressed graph */
77
78 spm_int_t gNexp; /**< Global number of vertices in the compressed graph (Computed) */
79 spm_int_t nexp; /**< Local number of vertices in the compressed graph (Computed) */
80 spm_int_t gnnzexp; /**< Global number of non zeroes in the compressed graph (Computed) */
81 spm_int_t nnzexp; /**< Local number of non zeroes in the compressed graph (Computed) */
82
83 spm_int_t dof; /**< Number of degrees of freedom per unknown,
84 if > 0, constant degree of freedom
85 otherwise, irregular degree of freedom (refer to dofs) */
86 spm_int_t *dofs; /**< Array of the first column of each element in the
87 expanded matrix [+baseval] */
88 spm_layout_t layout; /**< SpmColMajor, or SpmRowMajor */
89
90 spm_int_t *colptr; /**< List of indirections to rows for each vertex [+baseval] */
91 spm_int_t *rowptr; /**< List of edges for each vertex [+baseval] */
92 spm_int_t *loc2glob;/**< Corresponding numbering from local to global [+baseval] */
93 void *values; /**< Values stored in the matrix */
94
95 spm_int_t *glob2loc; /**< Corresponding numbering from global to local [0-based], -(owner+1) if remote */
96 int clustnum; /**< Rank of the MPI node */
97 int clustnbr; /**< Number of MPI nodes in the communicator */
98 SPM_Comm comm; /**< Spm communicator to exhange datas */
99 int replicated; /**< 0 if the matrix is distributed, 1 if it is replicated on all nodes */
101
102/**
103 * @name SPM basic subroutines
104 * @{
105 */
106void spmInit( spmatrix_t *spm );
107void spmInitDist( spmatrix_t *spm, SPM_Comm comm );
108void spmAlloc( spmatrix_t *spm );
109void spmExit( spmatrix_t *spm );
110
111void spmCopy( const spmatrix_t *spm_in, spmatrix_t *spm_out );
112void spmBase( spmatrix_t *spm, int baseval );
113spm_int_t spmFindBase( const spmatrix_t *spm );
114spm_int_t spmGetDegree( const spmatrix_t *spm );
115int spmConvert( int ofmttype, spmatrix_t *ospm );
117void spmGenFakeValues( spmatrix_t *spm );
118
119/**
120 * @}
121 * @name SPM distribution subroutines
122 * @{
123 */
124int spmScatter( spmatrix_t *spm_scattered,
125 int root,
126 const spmatrix_t *opt_spm_gathered,
127 spm_int_t opt_n,
128 const spm_int_t *opt_loc2glob,
129 int opt_distByColumn,
130 SPM_Comm opt_comm );
131int spmGather( const spmatrix_t *spm_scattered,
132 int root,
133 spmatrix_t *opt_spm_gathered );
134int spmGatherInPlace( spmatrix_t *spm );
135int spmRedistribute( const spmatrix_t *spm,
136 spm_int_t new_n,
137 const spm_int_t *newl2g,
138 spmatrix_t *newspm );
139
140/**
141 * @}
142 * @name SPM BLAS subroutines
143 * @{
144 */
145double spmNorm ( spm_normtype_t ntype, const spmatrix_t *spm );
146double spmNormVec( spm_normtype_t ntype, const spmatrix_t *spm, const void *x, spm_int_t incx );
147double spmNormMat( spm_normtype_t ntype, const spmatrix_t *spm, spm_int_t n, const void *A, spm_int_t lda );
148
149int spmMatVec( spm_trans_t trans, double alpha, const spmatrix_t *spm, const void *x, double beta, void *y );
150int spmMatMat( spm_trans_t trans, spm_int_t n,
151 double alpha, const spmatrix_t *A,
152 const void *B, spm_int_t ldb,
153 double beta, void *C, spm_int_t ldc );
154
155void spmScal ( double alpha, spmatrix_t *spm );
156void spmScalVec( double alpha, const spmatrix_t *spm, void *x, spm_int_t incx );
157void spmScalMat( double alpha, const spmatrix_t *spm, spm_int_t n, void *A, spm_int_t lda );
158
159void spmScalMatrix( double alpha, spmatrix_t *spm ) __attribute__((__deprecated__("Please replace by spmScal() function (will be removed in 1.3.0)")));
160void spmScalVector( spm_coeftype_t flt, double alpha, spm_int_t n, void *A, spm_int_t lda ) __attribute__((__deprecated__("Please replace by spmScalVec() or spmScalMat() depending on usage (will be removed in 1.3.0)")));
161
162/**
163 * @}
164 * @name SPM subroutines to check format
165 * @{
166 */
167int spmSort( spmatrix_t *spm );
170int spmCheckAndCorrect( const spmatrix_t *spm_in, spmatrix_t *spm_out );
171
172/**
173 * @}
174 * @name SPM subroutines to check factorization/solve
175 * @{
176 */
177int spmGenMat( spm_rhstype_t type,
178 spm_int_t nrhs,
179 const spmatrix_t *spm,
180 void *alpha,
181 unsigned long long int seed,
182 void *A,
183 spm_int_t lda );
184int spmGenVec( spm_rhstype_t type,
185 const spmatrix_t *spm,
186 void *alpha,
187 unsigned long long int seed,
188 void *x,
189 spm_int_t incx );
190int spmGenRHS( spm_rhstype_t type,
191 spm_int_t nrhs,
192 const spmatrix_t *spm,
193 void * opt_X,
194 spm_int_t opt_ldx,
195 void * B,
196 spm_int_t ldb );
197int spmCheckAxb( double eps,
198 spm_int_t nrhs,
199 const spmatrix_t *spm,
200 void * opt_X0,
201 spm_int_t opt_ldx0,
202 void * B,
203 spm_int_t ldb,
204 const void * X,
205 spm_int_t ldx );
206
207/**
208 * @}
209 * @name SPM subroutines to manipulate RHS
210 * @{
211 */
213 const spmatrix_t *spm,
214 const void *Bg,
215 spm_int_t ldbg,
216 void *Bl,
217 spm_int_t ldbl );
218int spmReduceRHS( spm_int_t nrhs,
219 const spmatrix_t *spm,
220 void *Bg,
221 spm_int_t ldbg,
222 void *Bl,
223 spm_int_t ldbl );
224int spmGatherRHS( spm_int_t nrhs,
225 const spmatrix_t *spm,
226 const void *Bl,
227 spm_int_t ldbl,
228 int root,
229 void *Bg,
230 spm_int_t ldbg );
231
232/**
233 * @}
234 * @name SPM subroutines to manipulate integers arrays
235 * @{
236 */
237void spmIntConvert( spm_int_t n, const int *input, spm_int_t *output );
238void spmIntSort1Asc1( void *const pbase, spm_int_t n );
239void spmIntSort2Asc1( void *const pbase, spm_int_t n );
240void spmIntSort2Asc2( void *const pbase, spm_int_t n );
241void spmIntMSortIntAsc( void **const pbase, spm_int_t n );
242
243/**
244 * @}
245 * @name SPM IO subroutines
246 * @{
247 */
248int spmLoadDist( spmatrix_t *spm, const char *filename, SPM_Comm comm );
249int spmLoad( spmatrix_t *spm, const char *filename );
250int spmSave( const spmatrix_t *spm, const char *filename );
251
252/**
253 * @}
254 * @name SPM driver
255 * @{
256 */
257int spmReadDriver ( spm_driver_t driver,
258 const char *filename,
259 spmatrix_t *spm );
261 const char *filename,
262 spmatrix_t *spm,
263 SPM_Comm comm );
264
265int spmParseLaplacianInfo( const char *filename,
266 spm_coeftype_t *flttype,
267 spm_int_t *dim1,
268 spm_int_t *dim2,
269 spm_int_t *dim3,
270 double *alpha,
271 double *beta,
272 spm_int_t *dof );
273
274/**
275 * @}
276 * @name SPM debug subroutines
277 * @{
278 */
279void spm2Dense( const spmatrix_t *spm, void *A );
280void spmPrint( const spmatrix_t *spm, FILE *f );
281void spmPrintRHS( const spmatrix_t *spm, int nrhs, const void *x, spm_int_t ldx, FILE *stream );
282void spmPrintInfo( const spmatrix_t *spm, FILE *f );
283void spmExpand( const spmatrix_t *spm_in, spmatrix_t *spm_out );
284int spmDofExtend( const spmatrix_t *spm, int type, int dof, spmatrix_t *spm_out );
285
286/**
287 * @}
288 * @}
289 * @name SPM dev printing subroutines
290 * @{
291 *
292 */
293
294/**
295 * @ingroup spm_dev_print
296 * @brief Subroutines to print one element of an spm structure
297 *
298 * @param[in] f Pointer to the file
299 * @param[in] i Row index of the element
300 * @param[in] j Column index of the element
301 * @param[in] A Value of the element A|i,j]
302 *
303 * Double complex case
304 *
305 */
306static inline void
308{
309 fprintf( f, "%ld %ld %e %e\n", (long)i, (long)j, creal( A ), cimag( A ) );
310}
311
312/**
313 * @copydoc z_spmPrintElt
314 * @details Single complex case
315 */
316static inline void
318{
319 fprintf( f, "%ld %ld %e %e\n", (long)i, (long)j, crealf( A ), cimagf( A ) );
320}
321/**
322 * @copydoc z_spmPrintElt
323 * @details Double real case
324 */
325static inline void
326d_spmPrintElt( FILE *f, spm_int_t i, spm_int_t j, double A )
327{
328 fprintf( f, "%ld %ld %e\n", (long)i, (long)j, A );
329}
330/**
331 * @copydoc z_spmPrintElt
332 * @details Single real case
333 */
334static inline void
335s_spmPrintElt( FILE *f, spm_int_t i, spm_int_t j, float A )
336{
337 fprintf( f, "%ld %ld %e\n", (long)i, (long)j, A );
338}
339/**
340 * @copydoc z_spmPrintElt
341 * @details Pattern case
342 *
343 * @remark: uses a macro to avoid accessing A that would generate segfault.
344 */
345#define p_spmPrintElt( f, i, j, A ) \
346 { \
347 fprintf( f, "%ld %ld\n", (long)( i ), (long)( j ) ); \
348 }
349
350/**
351 * @}
352 */
353
354/*
355 * Functions to handle number of Blas threads.
356 */
357int spmBlasGetNumThreads(void);
358int spmBlasSetNumThreads( int nt );
360
361/**
362 * @}
363 * @name SPM subroutines to detect diagonal zeros
364 * @{
365 */
366int spmGetDiagonalZeros( const spmatrix_t *spm,
367 spm_int_t *zeros_n,
368 spm_int_t **zeros_list );
369
370/**
371 * @}
372 */
373
374END_C_DECLS
375
376#endif /* _spm_h_ */
enum spm_driver_e spm_driver_t
The list of matrix driver readers and generators.
enum spm_layout_e spm_layout_t
Direction of the matrix storage.
enum spm_fmttype_e spm_fmttype_t
Sparse matrix format.
enum spm_rhstype_e spm_rhstype_t
How to generate RHS.
enum spm_coeftype_e spm_coeftype_t
Arithmetic types.
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.
static void z_spmPrintElt(FILE *f, spm_int_t i, spm_int_t j, spm_complex64_t A)
Subroutines to print one element of an spm structure.
Definition spm.h:307
spm_coeftype_t flttype
Definition spm.h:68
spm_int_t * dofs
Definition spm.h:86
spm_int_t nexp
Definition spm.h:79
void * values
Definition spm.h:93
int clustnbr
Definition spm.h:97
spm_int_t nnz
Definition spm.h:76
spm_int_t nnzexp
Definition spm.h:81
spm_int_t * rowptr
Definition spm.h:91
spm_int_t gnnz
Definition spm.h:75
spm_fmttype_t fmttype
Definition spm.h:70
spm_int_t dof
Definition spm.h:83
spm_int_t n
Definition spm.h:74
spm_mtxtype_t mtxtype
Definition spm.h:66
spm_int_t * loc2glob
Definition spm.h:92
spm_layout_t layout
Definition spm.h:88
SPM_Comm comm
Definition spm.h:98
spm_int_t baseval
Definition spm.h:72
spm_int_t * glob2loc
Definition spm.h:95
spm_int_t gnnzexp
Definition spm.h:80
spm_int_t * colptr
Definition spm.h:90
spm_int_t gNexp
Definition spm.h:78
int clustnum
Definition spm.h:96
spm_int_t gN
Definition spm.h:73
int replicated
Definition spm.h:99
int spmGetDiagonalZeros(const spmatrix_t *spm, spm_int_t *zeros_n, spm_int_t **zeros_list)
Detect unknowns whose diagonal entry is zero or absent.
int spmGather(const spmatrix_t *spm_scattered, int root, spmatrix_t *opt_spm_gathered)
Gather a distributed Sparse Matrix on a single node.
Definition spm_gather.c:436
int spmParseLaplacianInfo(const char *filename, spm_coeftype_t *flttype, spm_int_t *dim1, spm_int_t *dim2, spm_int_t *dim3, double *alpha, double *beta, spm_int_t *dof)
Parse information given through the filename string to configure the laplacian matrix to generate.
Definition laplacian.c:96
double spmNormMat(spm_normtype_t ntype, const spmatrix_t *spm, spm_int_t n, const void *A, spm_int_t lda)
Compute the norm of the spm.
Definition spm.c:703
void spmAlloc(spmatrix_t *spm)
Allocate the arrays of an spm structure.
Definition spm.c:179
int spmLoadDist(spmatrix_t *spm, const char *filename, SPM_Comm comm)
Load the spm structure from a file (internal format).
Definition spm_io.c:664
void spmExit(spmatrix_t *spm)
Cleanup the spm structure but do not free the spm pointer.
Definition spm.c:234
int spmLoad(spmatrix_t *spm, const char *filename)
Load the spm structure from a file (internal format).
Definition spm_io.c:752
spm_int_t spmSymmetrize(spmatrix_t *spm)
Symmetrize the pattern of the spm.
int spmReduceRHS(spm_int_t nrhs, const spmatrix_t *spm, void *Bg, spm_int_t ldbg, void *Bl, spm_int_t ldbl)
Reduce an RHS thanks to spm distribution.
Definition spm_rhs.c:273
void spmUpdateComputedFields(spmatrix_t *spm)
Update all the computed fields based on the static values stored.
int spmGenRHS(spm_rhstype_t type, spm_int_t nrhs, const spmatrix_t *spm, void *opt_X, spm_int_t opt_ldx, void *B, spm_int_t ldb)
Generate right hand side vectors associated to a given matrix.
Definition spm_rhs.c:124
void spmBase(spmatrix_t *spm, int baseval)
Rebase the arrays of the spm to the given value.
Definition spm.c:281
struct spmatrix_s spmatrix_t
The sparse matrix data structure.
int spmScatter(spmatrix_t *spm_scattered, int root, const spmatrix_t *opt_spm_gathered, spm_int_t opt_n, const spm_int_t *opt_loc2glob, int opt_distByColumn, SPM_Comm opt_comm)
Scatter the SPM thanks to loc2glob.
spm_int_t spmFindBase(const spmatrix_t *spm)
Search the base used in the spm structure.
Definition spm.c:358
int spmMatVec(spm_trans_t trans, double alpha, const spmatrix_t *spm, const void *x, double beta, void *y)
Compute a matrix-vector product.
Definition spm.c:1245
void spmPrintRHS(const spmatrix_t *spm, int nrhs, const void *x, spm_int_t ldx, FILE *stream)
Print a set of vector associated to an spm matrix.
Definition spm_rhs.c:45
int spmCheckAxb(double eps, spm_int_t nrhs, const spmatrix_t *spm, void *opt_X0, spm_int_t opt_ldx0, void *B, spm_int_t ldb, const void *X, spm_int_t ldx)
Check the backward error, and the forward error if x0 is provided.
Definition spm.c:1434
void spmInitDist(spmatrix_t *spm, SPM_Comm comm)
Init the spm structure with a specific communicator.
Definition spm.c:101
int spmConvert(int ofmttype, spmatrix_t *ospm)
Convert the storage format of the spm.
Definition spm.c:429
int spmExtractLocalRHS(spm_int_t nrhs, const spmatrix_t *spm, const void *Bg, spm_int_t ldbg, void *Bl, spm_int_t ldbl)
Stores the local values of a global RHS in the local one thanks to spm distribution.
Definition spm_rhs.c:193
int spmGatherRHS(spm_int_t nrhs, const spmatrix_t *spm, const void *Bl, spm_int_t ldbl, int root, void *Bg, spm_int_t ldbg)
Gather an RHS thanks to spm distribution.
Definition spm_rhs.c:356
double spmNormVec(spm_normtype_t ntype, const spmatrix_t *spm, const void *x, spm_int_t incx)
Compute the norm of the spm.
Definition spm.c:607
spm_int_t spmMergeDuplicate(spmatrix_t *spm)
Merge multiple entries in a spm by summing their values together.
Definition spm.c:807
int spmMatMat(spm_trans_t trans, spm_int_t n, double alpha, const spmatrix_t *A, const void *B, spm_int_t ldb, double beta, void *C, spm_int_t ldc)
Compute a matrix-matrix product.
Definition spm.c:1338
void spmGenFakeValues(spmatrix_t *spm)
Generate the fake values array such that .
int spmRedistribute(const spmatrix_t *spm, spm_int_t new_n, const spm_int_t *newl2g, spmatrix_t *newspm)
Create a copy of a given SPM with a new distribution corresponding to the given loc2glob array.
int spmCheckAndCorrect(const spmatrix_t *spm_in, spmatrix_t *spm_out)
Check the correctness of a spm.
Definition spm.c:888
int spmGatherInPlace(spmatrix_t *spm)
This routine performs a allgather of a distributed spm in place.
Definition spm_gather.c:565
int spmReadDriver(spm_driver_t driver, const char *filename, spmatrix_t *spm)
Import a matrix file into a spm structure.
int spmSort(spmatrix_t *spm)
Sort the subarray of edges of each vertex.
Definition spm.c:757
void spmScal(double alpha, spmatrix_t *spm)
Scale the spm.
Definition spm.c:1492
void spmExpand(const spmatrix_t *spm_in, spmatrix_t *spm_out)
Expand a multi-dof spm matrix into an spm with constant dof set to 1.
Definition spm.c:1179
int spmDofExtend(const spmatrix_t *spm, int type, int dof, spmatrix_t *spm_out)
Generate a random multidof spm from a given spm (with dof=1).
void spmPrint(const spmatrix_t *spm, FILE *f)
Print an spm matrix into into a given file.
Definition spm.c:1130
void spmScalVec(double alpha, const spmatrix_t *spm, void *x, spm_int_t incx)
Scale a vector associated to a sparse matrix. Deprecated function replaced by spmScalVec() or spmScal...
Definition spm.c:1556
void spmIntConvert(spm_int_t n, const int *input, spm_int_t *output)
Convert integer array to spm_int_t format.
void spmScalMat(double alpha, const spmatrix_t *spm, spm_int_t n, void *A, spm_int_t lda)
Scale a matrix associated to a sparse matrix.
Definition spm.c:1613
void spmScalMatrix(double alpha, spmatrix_t *spm) __attribute__((__deprecated__("Please replace by spmScal() function (will be removed in 1.3.0)")))
Scale the spm.
Definition spm.c:1523
int spmReadDriverDist(spm_driver_t driver, const char *filename, spmatrix_t *spm, SPM_Comm comm)
Import a matrix file into an spm structure for a specific communicator.
int spmSave(const spmatrix_t *spm, const char *filename)
Save the spm structure into a file (internal format).
Definition spm_io.c:1068
double _Complex spm_complex64_t
The double complex arithmetic datatype.
Definition datatypes.h:162
int spmGenVec(spm_rhstype_t type, const spmatrix_t *spm, void *alpha, unsigned long long int seed, void *x, spm_int_t incx)
Generate a vector associated to a given matrix.
Definition spm.c:1813
double spmNorm(spm_normtype_t ntype, const spmatrix_t *spm)
Compute the norm of the spm.
Definition spm.c:525
void spm2Dense(const spmatrix_t *spm, void *A)
Convert the spm matrix into a dense matrix for test purpose.
Definition spm.c:461
void spmCopy(const spmatrix_t *spm_in, spmatrix_t *spm_out)
Create a copy of the spm.
Definition spm.c:980
void spmInit(spmatrix_t *spm)
Init the spm structure.
Definition spm.c:156
int spm_int_t
The main integer datatype used in spm arrays.
Definition datatypes.h:70
int spmGenMat(spm_rhstype_t type, spm_int_t nrhs, const spmatrix_t *spm, void *alpha, unsigned long long int seed, void *A, spm_int_t lda)
Generate a set of vectors associated to a given matrix.
Definition spm.c:1743
void spmScalVector(spm_coeftype_t flt, double alpha, spm_int_t n, void *A, spm_int_t lda) __attribute__((__deprecated__("Please replace by spmScalVec() or spmScalMat() depending on usage (will be removed in 1.3.0)")))
Scale a vector according to the spm type.
Definition spm.c:1676
float _Complex spm_complex32_t
The real complex arithmetic datatype.
Definition datatypes.h:161
void spmPrintInfo(const spmatrix_t *spm, FILE *f)
Print basic informations about the spm matrix into a given stream.
Definition spm.c:1037
The sparse matrix data structure.
Definition spm.h:65
int spmBlasSetNumThreadsOne(void)
Set the number of threads for blas calls (BLIS, MKL, OpenBLAS) to 1 and return the previous number of...
Definition spm.c:2347
static void s_spmPrintElt(FILE *f, spm_int_t i, spm_int_t j, float A)
Subroutines to print one element of an spm structure.
Definition spm.h:335
static void d_spmPrintElt(FILE *f, spm_int_t i, spm_int_t j, double A)
Subroutines to print one element of an spm structure.
Definition spm.h:326
int spmBlasGetNumThreads(void)
Return the current number of threads used for blas calls.
Definition spm.c:2293
int spmBlasSetNumThreads(int nt)
Set the number of threads for blas calls (BLIS, MKL, OpenBLAS) and return the previous number of blas...
Definition spm.c:2321
static void c_spmPrintElt(FILE *f, spm_int_t i, spm_int_t j, spm_complex32_t A)
Subroutines to print one element of an spm structure.
Definition spm.h:317