SpM Handbook 1.2.4
Loading...
Searching...
No Matches
z_spm_2dense.c
Go to the documentation of this file.
1/**
2 *
3 * @file z_spm_2dense.c
4 *
5 * SParse Matrix package conversion to dense routine.
6 *
7 * @copyright 2016-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
8 * Univ. Bordeaux. All rights reserved.
9 *
10 * @version 1.2.4
11 * @author Mathieu Faverge
12 * @author Alban Bellot
13 * @author Matias Hastaran
14 * @author Tony Delarue
15 * @author Alycia Lisito
16 * @date 2024-06-25
17 *
18 * @generated from /builds/2mk6rsew/0/fpruvost/spm/src/z_spm_2dense.c, normal z -> z, Fri Nov 29 11:34:31 2024
19 *
20 **/
21#include "common.h"
22
23/**
24 *******************************************************************************
25 *
26 * @ingroup spm_dev_convert
27 *
28 * @brief Convert to dense a diagonal element within a symmetric/hermitian
29 * matrix with column/row major storage
30 *
31 *******************************************************************************
32 *
33 * Note that column major is using the low triangular part only of the diagonal
34 * element matrices, and row major, by symmetry, is using only the upper
35 * triangular part.
36 *
37 * The comments in the code are made for column major storage.
38 *
39 * @param[in] row
40 * The row (and column) index of the diagonal element matrix in the
41 * expended dense matrix
42 *
43 * @param[in] dofi
44 * The size of the element matrix dofi -by- dofi
45 *
46 * @param[in] conjfct
47 * The op() function to apply to each element among id() or conj()
48 *
49 * @param[in] valptr
50 * The element matrix of size dofi-by-dofi
51 *
52 * @param[out] A
53 * The reference dense matrix in which to copy the sparse one.
54 *
55 * @param[in] lda
56 * the leading dimension of the matrix A.
57 *
58 *******************************************************************************/
59static inline void
61 spm_int_t dofi,
62 spm_zconj_fct_t conjfct,
63 const spm_complex64_t *valptr,
64 spm_complex64_t *A,
65 spm_int_t lda )
66{
67 spm_int_t ii, jj;
68
69 for(jj=0; jj<dofi; jj++)
70 {
71 /* Skip unused upper triangular part */
72 for(ii=0; ii<jj; ii++) {
73 valptr++;
74 }
75
76 /* Diagonal element */
77 A[ lda * (row + jj) + (row + ii) ] = *valptr;
78 valptr++;
79
80 for(ii=jj+1; ii<dofi; ii++, valptr++)
81 {
82 /* Lower part */
83 A[ lda * (row + jj) + (row + ii) ] = *valptr;
84 /* Upper part */
85 A[ lda * (row + ii) + (row + jj) ] = conjfct(*valptr);
86 }
87 }
88 (void)conjfct;
89}
90
91/**
92 *******************************************************************************
93 *
94 * @ingroup spm_dev_convert
95 *
96 * @brief Convert to dense a general element matrix with column major storage
97 *
98 *******************************************************************************
99 *
100 * @param[in] row
101 * The row index of the element matrix in the expended dense
102 * matrix.
103 *
104 * @param[in] dofi
105 * The number of rows of the element matrix valptr
106 *
107 * @param[in] col
108 * The column index of the element matrix in the expended dense
109 * matrix.
110 *
111 * @param[in] dofj
112 * The number of columns of the element matrix valptr
113 *
114 * @param[in] conjfct
115 * The op() function to apply to each element among id() or conj()
116 *
117 * @param[in] valptr
118 * The element matrix of size dofi-by-dofj
119 *
120 * @param[out] A
121 * The reference dense matrix in which to copy the sparse one.
122 *
123 * @param[in] lda
124 * the leading dimension of the matrix A.
125 *
126 *******************************************************************************/
127static inline void
129 const spm_int_t dofi,
130 const spm_int_t col,
131 const spm_int_t dofj,
132 const spm_zconj_fct_t conjfct,
133 const spm_complex64_t *valptr,
134 spm_complex64_t *A,
135 const spm_int_t lda )
136{
137 spm_int_t ii, jj;
138
139 for(jj=0; jj<dofj; jj++)
140 {
141 for(ii=0; ii<dofi; ii++, valptr++)
142 {
143 A[ lda * (col + jj) + (row + ii) ] = conjfct(*valptr);
144 }
145 }
146}
147
148/**
149 *******************************************************************************
150 *
151 * @ingroup spm_dev_convert
152 *
153 * @brief Convert to dense a general element matrix with row major storage
154 *
155 *******************************************************************************
156 *
157 * @param[in] row
158 * The row index of the element matrix in the expended dense
159 * matrix.
160 *
161 * @param[in] dofi
162 * The number of rows of the element matrix valptr
163 *
164 * @param[in] col
165 * The column index of the element matrix in the expended dense
166 * matrix.
167 *
168 * @param[in] dofj
169 * The number of columns of the element matrix valptr
170 *
171 * @param[in] conjfct
172 * The op() function to apply to each element among id() or conj()
173 *
174 * @param[in] valptr
175 * The element matrix of size dofi-by-dofj
176 *
177 * @param[out] A
178 * The reference dense matrix in which to copy the sparse one.
179 *
180 * @param[in] lda
181 * the leading dimension of the matrix A.
182 *
183 *******************************************************************************/
184static inline void
186 const spm_int_t dofi,
187 const spm_int_t col,
188 const spm_int_t dofj,
189 const spm_zconj_fct_t conjfct,
190 const spm_complex64_t *valptr,
191 spm_complex64_t *A,
192 const spm_int_t lda )
193{
194 spm_int_t ii, jj;
195
196 for(ii=0; ii<dofi; ii++)
197 {
198 for(jj=0; jj<dofj; jj++, valptr++)
199 {
200 A[ lda * (col + jj) + (row + ii) ] = conjfct(*valptr);
201 }
202 }
203}
204
205/**
206 *******************************************************************************
207 *
208 * @ingroup spm_dev_convert
209 *
210 * @brief Convert to dense a general element matrix
211 *
212 *******************************************************************************
213 *
214 * @param[in] layout
215 * @arg SpmColMajor if valptr is stored in column major mode.
216 * @arg SpmRowMajor if valptr is stored in row major mode.
217 *
218 * @param[in] row
219 * The row index of the element matrix in the expended dense
220 * matrix.
221 *
222 * @param[in] dofi
223 * The number of rows of the element matrix valptr
224 *
225 * @param[in] col
226 * The column index of the element matrix in the expended dense
227 * matrix.
228 *
229 * @param[in] dofj
230 * The number of columns of the element matrix valptr
231 *
232 * @param[in] conjfct
233 * The op() function to apply to each element among id() or conj()
234 *
235 * @param[in] valptr
236 * The element matrix of size dofi-by-dofj
237 *
238 * @param[out] A
239 * The reference dense matrix in which to copy the sparse one.
240 *
241 * @param[in] lda
242 * the leading dimension of the matrix A.
243 *
244 *******************************************************************************/
245static inline void
247 const spm_int_t row,
248 const spm_int_t dofi,
249 const spm_int_t col,
250 const spm_int_t dofj,
251 const spm_zconj_fct_t conjfct,
252 const spm_complex64_t *valptr,
253 spm_complex64_t *A,
254 const spm_int_t lda )
255{
256 if ( layout == SpmColMajor ) {
257 z_spm_2dense_elt_gen_col( row, dofi, col, dofj, conjfct, valptr, A, lda );
258 }
259 else {
260 z_spm_2dense_elt_gen_row( row, dofi, col, dofj, conjfct, valptr, A, lda );
261 }
262}
263
264/**
265 *******************************************************************************
266 *
267 * @ingroup spm_dev_convert
268 *
269 * @brief Convert to dense an off-diagonal element matrix in the
270 * symmetric/hermitian case
271 *
272 *******************************************************************************
273 *
274 * @param[in] layout
275 * @arg SpmColMajor if valptr is stored in column major mode.
276 * @arg SpmRowMajor if valptr is stored in row major mode.
277 *
278 * @param[in] row
279 * The row index of the element matrix in the expended dense
280 * matrix.
281 *
282 * @param[in] dofi
283 * The number of rows of the element matrix valptr
284 *
285 * @param[in] col
286 * The column index of the element matrix in the expended dense
287 * matrix.
288 *
289 * @param[in] dofj
290 * The number of columns of the element matrix valptr
291 *
292 * @param[in] conjfct
293 * The op() function to apply to each element among id() or conj()
294 *
295 * @param[in] valptr
296 * The element matrix of size dofi-by-dofj
297 *
298 * @param[out] A
299 * The reference dense matrix in which to copy the sparse one.
300 *
301 * @param[in] lda
302 * the leading dimension of the matrix A.
303 *
304 *******************************************************************************/
305static inline void
307 const spm_int_t row,
308 const spm_int_t dofi,
309 const spm_int_t col,
310 const spm_int_t dofj,
311 const spm_zconj_fct_t conjfct,
312 const spm_complex64_t *valptr,
313 spm_complex64_t *A,
314 const spm_int_t lda )
315{
316 if ( layout == SpmColMajor ) {
317 /* A[ row, col ] */
318 z_spm_2dense_elt_gen_col( row, dofi, col, dofj, __spm_zid, valptr, A, lda );
319 /*
320 * A[ col, row ] = conj( A[ row, col ]^t )
321 * => Let's exploit the row major kernel to make it transpose
322 */
323 z_spm_2dense_elt_gen_row( col, dofj, row, dofi, conjfct, valptr, A, lda );
324 }
325 else {
326 z_spm_2dense_elt_gen_row( row, dofi, col, dofj, __spm_zid, valptr, A, lda );
327 z_spm_2dense_elt_gen_col( col, dofj, row, dofi, conjfct, valptr, A, lda );
328 }
329}
330
331/**
332 *******************************************************************************
333 *
334 * @ingroup spm_dev_convert
335 *
336 * @brief Convert to dense an element matrix
337 *
338 *******************************************************************************
339 *
340 * @param[in] mtxtype
341 * Define the matrix type
342 * @arg SpmGeneral if spm is general
343 * @arg SpmSymmetric if spm is symmetric
344 * @arg SpmHermitian if spm is hermitian
345 *
346 * @param[in] layout
347 * @arg SpmColMajor if valptr is stored in column major mode.
348 * @arg SpmRowMajor if valptr is stored in row major mode.
349 *
350 * @param[in] row
351 * The row index of the element matrix in the expended dense
352 * matrix.
353 *
354 * @param[in] dofi
355 * The number of rows of the element matrix valptr
356 *
357 * @param[in] col
358 * The column index of the element matrix in the expended dense
359 * matrix.
360 *
361 * @param[in] dofj
362 * The number of columns of the element matrix valptr
363 *
364 * @param[in] valptr
365 * The element matrix of size dofi-by-dofj
366 *
367 * @param[out] A
368 * The reference dense matrix in which to copy the sparse one.
369 *
370 * @param[in] lda
371 * the leading dimension of the matrix A.
372 *
373 *******************************************************************************/
374static inline void
376 const spm_layout_t layout,
377 const spm_int_t row,
378 const spm_int_t dofi,
379 const spm_int_t col,
380 const spm_int_t dofj,
381 const spm_complex64_t *valptr,
382 spm_complex64_t *A,
383 const spm_int_t lda )
384{
385 if ( mtxtype == SpmGeneral ) {
386 z_spm_2dense_elt_gen( layout, row, dofi, col, dofj, __spm_zid, valptr, A, lda );
387 }
388 else {
389 spm_zconj_fct_t conjfct;
390
391#if defined(PRECISION_c) || defined(PRECISION_z)
392 if ( mtxtype == SpmHermitian ) {
393 conjfct = __spm_zconj;
394 }
395 else
396#endif
397 {
398 conjfct = __spm_zid;
399 }
400
401 if ( row == col ) {
402 assert( dofi == dofj );
403 z_spm_2dense_elt_sym_diag( row, dofi, conjfct, valptr, A, lda );
404 }
405 else {
406 z_spm_2dense_elt_sym_offd( layout, row, dofi, col, dofj, conjfct, valptr, A, lda );
407 }
408 }
409}
410
411/**
412 *******************************************************************************
413 *
414 * @ingroup spm_dev_convert
415 *
416 * @brief Convert a CSC matrix into a dense matrix.
417 *
418 * The denses matrix is initialized with zeroes and filled with the spm matrix
419 * values. When the matrix is hermitian or symmetric, both sides (upper and
420 * lower) of the dense matrix are initialized.
421 *
422 *******************************************************************************
423 *
424 * @param[in] spm
425 * The sparse matrix in the CSC format.
426 *
427 * @param[inout] A
428 * On entry, the allocated A matrix of size spm->gNexp -by- spm->gNexp.
429 * On exit, the A matrix is initialized as the sparse matrix one.
430 *
431 *******************************************************************************/
432static inline void
434 spm_complex64_t *A )
435{
436 spm_int_t j, k, lda, baseval;
437 spm_int_t ig, dofi, row;
438 spm_int_t jg, dofj, col;
439 const spm_int_t *colptr;
440 const spm_int_t *rowptr;
441 const spm_int_t *dofs;
442 const spm_int_t *loc2glob;
443 const spm_complex64_t *valptr;
444
445 assert( spm->fmttype == SpmCSC );
446 assert( spm->flttype == SpmComplex64 );
447
448 lda = spm->gNexp;
449 memset( A, 0, lda * lda * sizeof(spm_complex64_t));
450
451 baseval = spm->baseval;
452
453 colptr = spm->colptr;
454 rowptr = spm->rowptr;
455 valptr = (spm_complex64_t*)(spm->values);
456 dofs = spm->dofs;
457 loc2glob = spm->loc2glob;
458
459 for(j=0; j<spm->n; j++, colptr++, loc2glob++)
460 {
461 jg = spm->replicated ? j : (*loc2glob) - baseval;
462 if ( spm->dof > 0 ) {
463 dofj = spm->dof;
464 col = spm->dof * jg;
465 }
466 else {
467 dofj = dofs[jg+1] - dofs[jg];
468 col = dofs[jg] - baseval;
469 }
470
471 for(k=colptr[0]; k<colptr[1]; k++, rowptr++)
472 {
473 ig = (*rowptr - baseval);
474 if ( spm->dof > 0 ) {
475 dofi = spm->dof;
476 row = spm->dof * ig;
477 }
478 else {
479 dofi = dofs[ig+1] - dofs[ig];
480 row = dofs[ig] - baseval;
481 }
482
483 z_spm_2dense_elt( spm->mtxtype, spm->layout,
484 row, dofi, col, dofj, valptr,
485 A, lda );
486 valptr += dofi * dofj;
487 }
488 }
489
490 return;
491}
492
493/**
494 *******************************************************************************
495 *
496 * @ingroup spm_dev_convert
497 *
498 * @brief Convert a CSR matrix into a dense matrix.
499 *
500 * The denses matrix is initialized with zeroes and filled with the spm matrix
501 * values. When the matrix is hermitian or symmetric, both sides (upper and
502 * lower) of the dense matrix are initialized.
503 *
504 *******************************************************************************
505 *
506 * @param[in] spm
507 * The sparse matrix in the CSR format.
508 *
509 * @param[inout] A
510 * On entry, the allocated A matrix of size spm->gNexp -by- spm->gNexp.
511 * On exit, the A matrix is initialized as the sparse matrix one.
512 *
513 *******************************************************************************/
514static inline void
516 spm_complex64_t *A )
517{
518 spm_int_t i, k, lda, baseval;
519 spm_int_t ig, dofi, row;
520 spm_int_t jg, dofj, col;
521 const spm_int_t *colptr;
522 const spm_int_t *rowptr;
523 const spm_int_t *dofs;
524 const spm_int_t *loc2glob;
525 const spm_complex64_t *valptr;
526
527 assert( spm->fmttype == SpmCSR );
528 assert( spm->flttype == SpmComplex64 );
529
530 lda = spm->gNexp;
531 memset( A, 0, lda * lda * sizeof(spm_complex64_t));
532
533 baseval = spm->baseval;
534
535 colptr = spm->colptr;
536 rowptr = spm->rowptr;
537 valptr = (spm_complex64_t*)(spm->values);
538 dofs = spm->dofs;
539 loc2glob = spm->loc2glob;
540
541 for(i=0; i<spm->n; i++, rowptr++, loc2glob++)
542 {
543 ig = spm->replicated ? i : (*loc2glob) - baseval;
544 if ( spm->dof > 0 ) {
545 dofi = spm->dof;
546 row = spm->dof * ig;
547 }
548 else {
549 dofi = dofs[ig+1] - dofs[ig];
550 row = dofs[ig] - baseval;
551 }
552
553 for(k=rowptr[0]; k<rowptr[1]; k++, colptr++)
554 {
555 jg = (*colptr - baseval);
556 if ( spm->dof > 0 ) {
557 dofj = spm->dof;
558 col = spm->dof * jg;
559 }
560 else {
561 dofj = dofs[jg+1] - dofs[jg];
562 col = dofs[jg] - baseval;
563 }
564
565 z_spm_2dense_elt( spm->mtxtype, spm->layout,
566 row, dofi, col, dofj, valptr,
567 A, lda );
568 valptr += dofi * dofj;
569 }
570 }
571
572 return;
573}
574
575/**
576 *******************************************************************************
577 *
578 * @ingroup spm_dev_convert
579 *
580 * @brief Convert a IJV matrix into a dense matrix.
581 *
582 * The denses matrix is initialized with zeroes and filled with the spm matrix
583 * values. When the matrix is hermitian or symmetric, both sides (upper and
584 * lower) of the dense matrix are initialized.
585 *
586 *******************************************************************************
587 *
588 * @param[in] spm
589 * The sparse matrix in the IJV format.
590 *
591 * @param[inout] A
592 * On entry, the allocated A matrix of size spm->gNexp -by- spm->gNexp.
593 * On exit, the A matrix is initialized as the sparse matrix one.
594 *
595 *******************************************************************************/
596static inline void
598 spm_complex64_t *A )
599{
600 spm_int_t k, lda, baseval;
601 spm_int_t i, dofi, row;
602 spm_int_t j, dofj, col;
603 const spm_int_t *colptr;
604 const spm_int_t *rowptr;
605 const spm_int_t *dofs;
606 const spm_complex64_t *valptr;
607
608 assert( spm->fmttype == SpmIJV );
609 assert( spm->flttype == SpmComplex64 );
610
611 lda = spm->gNexp;
612 memset( A, 0, lda * lda * sizeof(spm_complex64_t));
613
614 baseval = spm->baseval;
615
616 colptr = spm->colptr;
617 rowptr = spm->rowptr;
618 valptr = (spm_complex64_t*)(spm->values);
619 dofs = spm->dofs;
620
621 for(k=0; k<spm->nnz; k++, rowptr++, colptr++)
622 {
623 i = *rowptr - baseval;
624 j = *colptr - baseval;
625
626 if ( spm->dof > 0 ) {
627 dofi = spm->dof;
628 row = spm->dof * i;
629 dofj = spm->dof;
630 col = spm->dof * j;
631 }
632 else {
633 dofi = dofs[i+1] - dofs[i];
634 row = dofs[i] - baseval;
635 dofj = dofs[j+1] - dofs[j];
636 col = dofs[j] - baseval;
637 }
638
639 z_spm_2dense_elt( spm->mtxtype, spm->layout,
640 row, dofi, col, dofj, valptr,
641 A, lda );
642 valptr += dofi * dofj;
643 }
644
645 return;
646}
647
648/**
649 *******************************************************************************
650 *
651 * @ingroup spm_dev_convert
652 *
653 * @brief Convert a sparse matrix into a dense matrix.
654 *
655 * The denses matrix is initialized with zeroes and filled with the spm matrix
656 * values. When the matrix is hermitian or symmetric, both sides (upper and
657 * lower) of the dense matrix are initialized.
658 *
659 * @remark DO NOT USE with large matrices. This is for test purpose only.
660 *
661 *******************************************************************************
662 *
663 * @param[in] spm
664 * The sparse matrix to convert to dense format.
665 *
666 * @param[inout] A
667 * On entry, an allocated matrix of size spm->gNexp-by-spm->gNexp.
668 * On exit, the matrix A is set to the sparse matrix spm.
669 *
670 *******************************************************************************/
671void
673 spm_complex64_t *A )
674{
675 if ( !spm->replicated ) {
676 fprintf( stderr, "spm2dense: Conversion to dense matrix with distributed spm is not available\n");
677 return;
678 }
679
680 switch (spm->fmttype) {
681 case SpmCSC:
682 z_spmCSC2dense( spm, A );
683 break;
684 case SpmCSR:
685 z_spmCSR2dense( spm, A );
686 break;
687 case SpmIJV:
688 z_spmIJV2dense( spm, A );
689 break;
690 }
691
692 return;
693}
694
695/**
696 *******************************************************************************
697 *
698 * @ingroup spm_dev_print
699 *
700 * @brief Print a dense matrix to the given file
701 *
702 *******************************************************************************
703 *
704 * @param[in] f
705 * Open file descriptor on which to write the matrix.
706 *
707 * @param[in] m
708 * Number of rows of the matrix A.
709 *
710 * @param[in] n
711 * Number of columns of the matrix A.
712 *
713 * @param[in] A
714 * The matrix to print of size lda -by- n
715 *
716 * @param[in] lda
717 * the leading dimension of the matrix A. lda >= m
718 *
719 *******************************************************************************/
720void
722 spm_int_t m,
723 spm_int_t n,
724 const spm_complex64_t *A,
725 spm_int_t lda )
726{
727 spm_int_t i, j;
728
729 for(j=0; j<n; j++)
730 {
731 for(i=0; i<m; i++)
732 {
733 if ( cabs( A[ j * lda + i ] ) != 0. ) {
734 z_spmPrintElt( f, i, j, A[lda * j + i] );
735 }
736 }
737 }
738 return;
739}
enum spm_layout_e spm_layout_t
Direction of the matrix storage.
enum spm_mtxtype_e spm_mtxtype_t
Matrix symmetry type property.
@ SpmColMajor
Definition const.h:148
@ SpmComplex64
Definition const.h:66
@ SpmGeneral
Definition const.h:165
@ SpmHermitian
Definition const.h:167
@ SpmCSC
Definition const.h:73
@ SpmCSR
Definition const.h:74
@ SpmIJV
Definition const.h:75
static void z_spmIJV2dense(const spmatrix_t *spm, spm_complex64_t *A)
Convert a IJV matrix into a dense matrix.
static void z_spm_2dense_elt_gen_col(const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const spm_zconj_fct_t conjfct, const spm_complex64_t *valptr, spm_complex64_t *A, const spm_int_t lda)
Convert to dense a general element matrix with column major storage.
static void z_spm_2dense_elt_sym_offd(const spm_layout_t layout, const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const spm_zconj_fct_t conjfct, const spm_complex64_t *valptr, spm_complex64_t *A, const spm_int_t lda)
Convert to dense an off-diagonal element matrix in the symmetric/hermitian case.
static void z_spm_2dense_elt_gen_row(const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const spm_zconj_fct_t conjfct, const spm_complex64_t *valptr, spm_complex64_t *A, const spm_int_t lda)
Convert to dense a general element matrix with row major storage.
static void z_spm_2dense_elt_sym_diag(spm_int_t row, spm_int_t dofi, spm_zconj_fct_t conjfct, const spm_complex64_t *valptr, spm_complex64_t *A, spm_int_t lda)
Convert to dense a diagonal element within a symmetric/hermitian matrix with column/row major storage...
static void z_spmCSC2dense(const spmatrix_t *spm, spm_complex64_t *A)
Convert a CSC matrix into a dense matrix.
static void z_spm_2dense_elt_gen(const spm_layout_t layout, const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const spm_zconj_fct_t conjfct, const spm_complex64_t *valptr, spm_complex64_t *A, const spm_int_t lda)
Convert to dense a general element matrix.
void z_spm2dense(const spmatrix_t *spm, spm_complex64_t *A)
Convert a sparse matrix into a dense matrix.
static void z_spm_2dense_elt(const spm_mtxtype_t mtxtype, const spm_layout_t layout, const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const spm_complex64_t *valptr, spm_complex64_t *A, const spm_int_t lda)
Convert to dense an element matrix.
static void z_spmCSR2dense(const spmatrix_t *spm, spm_complex64_t *A)
Convert a CSR matrix into a dense matrix.
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:306
void z_spmDensePrint(FILE *f, spm_int_t m, spm_int_t n, const spm_complex64_t *A, spm_int_t lda)
Print a dense matrix to the given file.
spm_coeftype_t flttype
Definition spm.h:67
spm_int_t * dofs
Definition spm.h:85
void * values
Definition spm.h:92
spm_int_t nnz
Definition spm.h:75
spm_int_t * rowptr
Definition spm.h:90
spm_fmttype_t fmttype
Definition spm.h:69
spm_int_t dof
Definition spm.h:82
spm_int_t n
Definition spm.h:73
spm_mtxtype_t mtxtype
Definition spm.h:65
spm_int_t * loc2glob
Definition spm.h:91
spm_layout_t layout
Definition spm.h:87
spm_int_t baseval
Definition spm.h:71
spm_int_t * colptr
Definition spm.h:89
spm_int_t gNexp
Definition spm.h:77
int replicated
Definition spm.h:98
int spm_int_t
The main integer datatype used in spm arrays.
Definition datatypes.h:70
The sparse matrix data structure.
Definition spm.h:64