9.2
general documentation
cs_matrix.h
Go to the documentation of this file.
1#ifndef CS_MATRIX_H
2#define CS_MATRIX_H
3
4/*============================================================================
5 * Sparse Matrix Representation and Operations.
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2026 EDF S.A.
12
13 This program is free software; you can redistribute it and/or modify it under
14 the terms of the GNU General Public License as published by the Free Software
15 Foundation; either version 2 of the License, or (at your option) any later
16 version.
17
18 This program is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 details.
22
23 You should have received a copy of the GNU General Public License along with
24 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25 Street, Fifth Floor, Boston, MA 02110-1301, USA.
26*/
27
28/*----------------------------------------------------------------------------*/
29
30/*----------------------------------------------------------------------------
31 * Local headers
32 *----------------------------------------------------------------------------*/
33
34#include "base/cs_defs.h"
35
36#include "base/cs_dispatch.h"
37
38#include "base/cs_halo.h"
39#include "base/cs_numbering.h"
41
42/*============================================================================
43 * Macro definitions
44 *============================================================================*/
45
46/*============================================================================
47 * Type definitions
48 *============================================================================*/
49
50/* Matrix structure representation types */
51
52typedef enum {
53
67
68/* Matrix fill types (for tuning) */
69
70typedef enum {
71
72 CS_MATRIX_SCALAR, /* Simple scalar matrix */
73 CS_MATRIX_SCALAR_SYM, /* Simple scalar symmetric matrix */
74 CS_MATRIX_BLOCK_D, /* Matrix with diagonal blocks
75 (and m.I extradiagonal blocks) */
76 CS_MATRIX_BLOCK_D_66, /* Matrix with 6x6 diagonal blocks
77 (and 6.I extradiagonal blocks;
78 subcase of CS_MATRIX_BLOCK_D, allows
79 separate tuning) */
80 CS_MATRIX_BLOCK_D_SYM, /* Symmetric matrix with diagonal blocks
81 (and m.I extradiagonal blocks) */
82 CS_MATRIX_BLOCK, /* Block matrix */
83 CS_MATRIX_N_FILL_TYPES /* Number of possible matrix fill types */
84
86
93typedef enum {
94
101
102/* Structure associated with opaque matrix structure object */
103
104typedef struct _cs_matrix_structure_t cs_matrix_structure_t;
105
106/* Structure associated with opaque matrix object */
107
108typedef struct _cs_matrix_t cs_matrix_t;
109
110/* Structure associated with opaque matrix tuning results object */
111
112typedef struct _cs_matrix_variant_t cs_matrix_variant_t;
113
114/* Information structure for extraction of matrix row */
115
116typedef struct {
117
118 cs_lnum_t row_size; /*< Row size from last call */
119 cs_lnum_t buffer_size; /*< Allocated buffer size */
120 const cs_lnum_t *col_id; /*< Pointer to local column ids */
121 cs_lnum_t *_col_id; /*< Pointer to local column ids copy */
122 const cs_real_t *vals; /*< Pointer to local row values */
123 cs_real_t *_vals; /*< Pointer to local row values copy */
124
126
127/*============================================================================
128 * Global variables
129 *============================================================================*/
130
133extern const char *cs_matrix_fill_type_name[];
134
137extern const char *cs_matrix_spmv_type_name[];
138
139/*=============================================================================
140 * Public C++ function prototypes
141 *============================================================================*/
142
143/*----------------------------------------------------------------------------*/
144/*
145 * \brief Matrix.vector product y = A.x
146 *
147 * This function includes a halo update of x prior to multiplication by A.
148 *
149 * \param[in, out] ctx reference to dispatch context
150 * \param[in] matrix pointer to matrix structure
151 * \param[in, out] x multiplying vector values
152 * (ghost values updated)
153 * \param[out] y resulting vector
154 */
155/*----------------------------------------------------------------------------*/
156
157void
159 const cs_matrix_t *matrix,
160 cs_real_t x[],
161 cs_real_t y[]);
162
163/*----------------------------------------------------------------------------*/
164/*
165 * \brief Partial matrix.vector product.
166 *
167 * This function includes a halo update of x prior to multiplication,
168 * except for the CS_MATRIX_SPMV_L operation type, which does not require it,
169 * as halo adjacencies are only present and useful in the upper-diagonal part..
170 *
171 * \param[in, out] ctx reference to dispatch context
172 * \param[in] matrix pointer to matrix structure
173 * \param[in] op_type SpMV operation type
174 * \param[in, out] x multiplying vector values
175 * (ghost values updated)
176 * \param[out] y resulting vector
177 */
178/*----------------------------------------------------------------------------*/
179
180void
182(
183 [[maybe_unused]] cs_dispatch_context &ctx,
184 const cs_matrix_t *matrix,
185 cs_matrix_spmv_type_t op_type,
186 cs_real_t x[],
187 cs_real_t y[]
188);
189
190/*=============================================================================
191 * Public function prototypes
192 *============================================================================*/
193
194/*----------------------------------------------------------------------------
195 * Create a matrix structure.
196 *
197 * Note that the structure created usually maps to the given existing
198 * cell global number, face -> cell connectivity arrays, and cell halo
199 * structure, so it must be destroyed before they are freed
200 * (usually along with the code's main face -> cell structure).
201 *
202 * Note that the resulting matrix structure will contain a full main
203 * main diagonal, and that the extra-diagonal structure is always
204 * symmetric (though the coefficients my not be, and we may choose a
205 * matrix format that does not exploit this symmetry). If the edges
206 * connectivity argument is null, the matrix will be purely diagonal.
207 *
208 * parameters:
209 * type <-- type of matrix considered
210 * n_rows <-- local number of rows
211 * n_cols_ext <-- number of columns + ghosts
212 * n_edges <-- local number of (undirected) graph edges
213 * edges <-- edges (symmetric row <-> column) connectivity
214 * halo <-- halo structure associated with cells, or nullptr
215 * numbering <-- vectorization or thread-related numbering info, or nullptr
216 *
217 * returns:
218 * pointer to created matrix structure;
219 *----------------------------------------------------------------------------*/
220
223 cs_lnum_t n_rows,
224 cs_lnum_t n_cols_ext,
225 cs_lnum_t n_edges,
226 const cs_lnum_2_t *edges,
227 const cs_halo_t *halo,
228 const cs_numbering_t *numbering);
229
230/*----------------------------------------------------------------------------
231 * Create a matrix structure based on a MSR connectivity definition.
232 *
233 * Only CSR and MSR formats are handled.
234 *
235 * col_id is sorted row by row during the creation of this structure.
236 *
237 * In case the property of the row index and col_id arrays are transferred
238 * to the structure, the arrays pointers passed as arguments are set to nullptr,
239 * to help ensure the caller does not use the original arrays directly after
240 * this call.
241 *
242 * parameters:
243 * type <-- type of matrix considered
244 * transfer <-- transfer property of row_index and col_id
245 * if true, map them otherwise
246 * ordered <-- indicates if column ids are already ordered
247 * have_diag <-- indicates if the structure includes the
248 * diagonal (should be the same for all rows)
249 * n_rows <-- local number of rows
250 * n_cols_ext <-- local number of columns + ghosts
251 * row_index <-> pointer to index on rows
252 * col_id <-> pointer to array of colum ids related to the row index
253 * halo <-- halo structure for synchronization, or nullptr
254 * numbering <-- vectorization or thread-related numbering info, or nullptr
255 *
256 * returns:
257 * a pointer to a created matrix structure
258 *----------------------------------------------------------------------------*/
259
262 bool transfer,
263 bool have_diag,
264 bool ordered,
265 cs_lnum_t n_rows,
266 cs_lnum_t n_cols_ext,
267 cs_lnum_t **row_index,
268 cs_lnum_t **col_id,
269 const cs_halo_t *halo,
270 const cs_numbering_t *numbering);
271
272/*----------------------------------------------------------------------------
273 * Create an MSR matrix structure sharing an existing connectivity definition.
274 *
275 * Note that as the structure created maps to the given existing
276 * cell global number, face -> cell connectivity arrays, and cell halo
277 * structure, it must be destroyed before they are freed
278 * (usually along with the code's main face -> cell structure).
279 *
280 * parameters:
281 * direct_assembly <-- true if each value corresponds to a unique face
282 * n_rows <-- local number of rows
283 * n_cols_ext <-- local number of columns + ghosts
284 * row_index <-- pointer to index on rows
285 * col_id <-- pointer to array of colum ids related to the row index
286 * halo <-- halo structure for synchronization, or nullptr
287 * numbering <-- vectorization or thread-related numbering
288 * info, or nullptr
289 *
290 * returns:
291 * a pointer to a created matrix structure
292 *----------------------------------------------------------------------------*/
293
295cs_matrix_structure_create_msr_shared(bool direct_assmbly,
296 cs_lnum_t n_rows,
297 cs_lnum_t n_cols_ext,
298 const cs_lnum_t *row_index,
299 const cs_lnum_t *col_id,
300 const cs_halo_t *halo,
301 const cs_numbering_t *numbering);
302
303/*----------------------------------------------------------------------------*/
314/*----------------------------------------------------------------------------*/
315
319
320/*----------------------------------------------------------------------------
321 * Destroy a matrix structure.
322 *
323 * parameters:
324 * ms <-> pointer to matrix structure pointer
325 *----------------------------------------------------------------------------*/
326
327void
329
330/*----------------------------------------------------------------------------*/
331/*
332 * \brief Release arrays describing an MSR matrix structure.
333 *
334 * Ownership is provided back to the caller, if pointers are provided.
335 * If the matrix does not own a given array, a nullptr value is returned
336 * for that array.
337 *
338 * This function only works for an MSR matrix (i.e. there is
339 * no automatic conversion from another matrix type).
340 *
341 * \param[in, out] ms pointer to matrix structure
342 * \param[out] row_index MSR row index, or null
343 * \param[out] col_id MSR column id, or null
344 */
345/*----------------------------------------------------------------------------*/
346
347void
349 cs_lnum_t **row_index,
350 cs_lnum_t **col_id);
351
352/*----------------------------------------------------------------------------
353 * Create a matrix container using a given structure.
354 *
355 * Note that the matrix container maps to the assigned structure,
356 * so it must be destroyed before that structure.
357 *
358 * parameters:
359 * ms <-- associated matrix structure
360 *
361 * returns:
362 * pointer to created matrix structure;
363 *----------------------------------------------------------------------------*/
364
367
368/*----------------------------------------------------------------------------*/
379/*----------------------------------------------------------------------------*/
380
384
385/*----------------------------------------------------------------------------*/
398/*----------------------------------------------------------------------------*/
399
402
403/*----------------------------------------------------------------------------*/
415/*----------------------------------------------------------------------------*/
416
419
420/*----------------------------------------------------------------------------
421 * Destroy a matrix structure.
422 *
423 * In the case of a compoud matrix, sub-matrices are not destroyed.
424 *
425 * parameters:
426 * matrix <-> pointer to matrix structure pointer
427 *----------------------------------------------------------------------------*/
428
429void
431
432/*----------------------------------------------------------------------------
433 * Return type of matrix.
434 *
435 * parameters:
436 * matrix --> pointer to matrix structure
437 *----------------------------------------------------------------------------*/
438
440cs_matrix_get_type(const cs_matrix_t *matrix);
441
442/*----------------------------------------------------------------------------
443 * Return matrix type name.
444 *
445 * parameters:
446 * matrix --> pointer to matrix structure
447 *----------------------------------------------------------------------------*/
448
449const char *
451
452/*----------------------------------------------------------------------------
453 * Return matrix type full name.
454 *
455 * parameters:
456 * matrix --> pointer to matrix structure
457 *----------------------------------------------------------------------------*/
458
459const char *
461
462/*----------------------------------------------------------------------------*/
470/*----------------------------------------------------------------------------*/
471
474
475/*----------------------------------------------------------------------------*/
483/*----------------------------------------------------------------------------*/
484
486cs_matrix_get_n_rows(const cs_matrix_t *matrix);
487
488/*----------------------------------------------------------------------------*/
499/*----------------------------------------------------------------------------*/
500
503
504/*----------------------------------------------------------------------------*/
512/*----------------------------------------------------------------------------*/
513
516
517/*----------------------------------------------------------------------------*/
525/*----------------------------------------------------------------------------*/
526
529
530/*----------------------------------------------------------------------------*/
531/*
532 * \brief Return matrix assembler if present.
533 *
534 * \param[in] matrix pointer to matrix structure
535 */
536/*----------------------------------------------------------------------------*/
537
540
541/*----------------------------------------------------------------------------*/
549/*----------------------------------------------------------------------------*/
550
551const cs_halo_t *
552cs_matrix_get_halo(const cs_matrix_t *matrix);
553
554/*----------------------------------------------------------------------------*/
563/*----------------------------------------------------------------------------*/
564
565const cs_gnum_t *
567
568/*----------------------------------------------------------------------------*/
576/*----------------------------------------------------------------------------*/
577
580
581/*----------------------------------------------------------------------------*/
593/*----------------------------------------------------------------------------*/
594
595void
597 cs_alloc_mode_t alloc_mode);
598
599/*----------------------------------------------------------------------------*/
600/*
601 * \brief Query matrix allocation mode.
602 *
603 * \param[in] matrix pointer to matrix structure
604 *
605 * \return host/device allocation mode
606 */
607/*----------------------------------------------------------------------------*/
608
609bool
611
612/*----------------------------------------------------------------------------*/
613/*
614 *\brief Indicate whether matrix will need xa coefficients.
615 *
616 * \param[in, out] matrix pointer to matrix structure
617 * \param[in] need_xa is thr face-based xa array needed ?
618 */
619/*----------------------------------------------------------------------------*/
620
621void
623 bool need_xa);
624
625/*----------------------------------------------------------------------------
626 * Get matrix fill type, depending on block sizes.
627 *
628 * parameters:
629 * symmetric <-- indicates if matrix coefficients are symmetric
630 * diag_block_size <-- block sizes for diagonal
631 * extra_diag_block_size <-- block sizes for extra diagonal
632 *
633 * returns:
634 * matrix fill type
635 *----------------------------------------------------------------------------*/
636
638cs_matrix_get_fill_type(bool symmetric,
639 cs_lnum_t diag_block_size,
640 cs_lnum_t extra_diag_block_size);
641
642/*----------------------------------------------------------------------------
643 * Set matrix coefficients defined relative to a "native" edge graph,
644 * sharing arrays with the caller when possible.
645 *
646 * With shared arrays, the matrix becomes unusable if the arrays passed as
647 * arguments are not be modified (its coefficients should be unset first
648 * to mark this).
649 *
650 * Depending on current options and initialization, values will be copied
651 * or simply mapped.
652 *
653 * parameters:
654 * matrix <-> pointer to matrix structure
655 * symmetric <-- indicates if matrix coefficients are symmetric
656 * diag_block_size <-- block sizes for diagonal
657 * extra_diag_block_size <-- block sizes for extra diagonal
658 * n_edges <-- local number of graph edges
659 * edges <-- edges (row <-> column) connectivity
660 * da <-- diagonal values (nullptr if zero)
661 * xa <-- extradiagonal values (nullptr if zero)
662 * casts as:
663 * xa[n_edges] if symmetric,
664 * xa[n_edges][2] if non symmetric
665 *----------------------------------------------------------------------------*/
666
667void
669 bool symmetric,
670 cs_lnum_t diag_block_size,
671 cs_lnum_t extra_diag_block_size,
672 const cs_lnum_t n_edges,
673 const cs_lnum_2_t edges[],
674 const cs_real_t *da,
675 const cs_real_t *xa);
676
677/*----------------------------------------------------------------------------
678 * Transfer matrix coefficients defined relative to a "native" edge graph.
679 *
680 * parameters:
681 * matrix <-> pointer to matrix structure
682 * symmetric <-- indicates if matrix coefficients are symmetric
683 * diag_block_size <-- block sizes for diagonal
684 * extra_diag_block_size <-- block sizes for extra diagonal
685 * n_edges <-- local number of graph edges
686 * edges <-- edges (row <-> column) connectivity
687 * da <-- diagonal values (nullptr if zero)
688 * xa <-- extradiagonal values (nullptr if zero)
689 * casts as:
690 * xa[n_edges] if symmetric,
691 * xa[n_edges][2] if non symmetric
692 *----------------------------------------------------------------------------*/
693
694void
696 bool symmetric,
697 cs_lnum_t diag_block_size,
698 cs_lnum_t extra_diag_block_size,
699 const cs_lnum_t n_edges,
700 const cs_lnum_2_t edges[],
701 cs_real_t **d_val,
702 cs_real_t **x_val);
703
704/*----------------------------------------------------------------------------
705 * Set matrix coefficients in an MSR format, transferring the
706 * property of those arrays to the matrix.
707 *
708 * If the matrix is also in MSR format, this avoids an extra copy.
709 * If it is in a different format, values are copied to the structure,
710 * and the original arrays freed. In any case, the arrays pointers passed as
711 * arguments are set to nullptr, to help ensure the caller does not use the
712 * original arrays directly after this call.
713 *
714 * parameters:
715 * matrix <-> pointer to matrix structure
716 * symmetric <-- indicates if matrix coefficients are symmetric
717 * diag_block_size <-- block sizes for diagonal
718 * extra_diag_block_size <-- block sizes for extra diagonal
719 * row_index <-- MSR row index (0 to n-1)
720 * col_id <-- MSR column id (0 to n-1)
721 * d_val <-> diagonal values (nullptr if zero)
722 * x_val <-> extradiagonal values (nullptr if zero)
723 *----------------------------------------------------------------------------*/
724
725void
727 bool symmetric,
728 cs_lnum_t diag_block_size,
729 cs_lnum_t extra_diag_block_size,
730 const cs_lnum_t row_index[],
731 const cs_lnum_t col_id[],
732 cs_real_t **d_val,
733 cs_real_t **x_val);
734
735/*----------------------------------------------------------------------------*/
752/*----------------------------------------------------------------------------*/
753
754void
756 bool symmetric,
757 cs_lnum_t diag_block_size,
758 cs_lnum_t extra_diag_block_size,
759 cs_real_t **d_val,
760 cs_real_t **x_val);
761
762/*----------------------------------------------------------------------------*/
775/*----------------------------------------------------------------------------*/
776
779 cs_lnum_t diag_block_size,
780 cs_lnum_t extra_diag_block_size);
781
782/*----------------------------------------------------------------------------
783 * Release shared matrix coefficients.
784 *
785 * Pointers to mapped coefficients are set to nullptr, while
786 * coefficient copies owned by the matrix are not modified.
787 *
788 * This simply ensures the matrix does not maintain pointers
789 * to nonexistant data.
790 *
791 * parameters:
792 * matrix <-> pointer to matrix structure
793 *----------------------------------------------------------------------------*/
794
795void
797
798/*----------------------------------------------------------------------------
799 * Copy matrix diagonal values.
800 *
801 * In case of matrixes with block diagonal coefficients, only the true
802 * diagonal values are copied.
803 *
804 * parameters:
805 * matrix --> pointer to matrix structure
806 * da --> diagonal (pre-allocated, size: n_rows*block_size
807 *----------------------------------------------------------------------------*/
808
809void
811 cs_real_t *da);
812
813/*----------------------------------------------------------------------------
814 * Query matrix coefficients symmetry
815 *
816 * parameters:
817 * matrix <-- pointer to matrix structure
818 *
819 * returns:
820 * true if coefficients are symmetric, false otherwise
821 *----------------------------------------------------------------------------*/
822
823bool
825
826/*----------------------------------------------------------------------------*/
839/*----------------------------------------------------------------------------*/
840
841bool
843
844/*----------------------------------------------------------------------------
845 * Get matrix diagonal values.
846 *
847 * In case of matrixes with block diagonal coefficients, a pointer to
848 * the complete block diagonal is returned.
849 *
850 * parameters:
851 * matrix --> pointer to matrix structure
852 *
853 * returns:
854 * pointer to matrix diagonal array
855 *----------------------------------------------------------------------------*/
856
857const cs_real_t *
859
860/*----------------------------------------------------------------------------
861 * Get pointer to matrix extra-diagonal values in "native" format
862 *
863 * This function currently only functions if the matrix is in "native"
864 * format or the coefficients were mapped from native coefficients using
865 * cs_matrix_set_coefficients(), in which case the pointer returned is
866 * the same as the one passed to that function.
867 *
868 * parameters:
869 * matrix --> pointer to matrix structure
870 *
871 * returns:
872 * pointer to matrix diagonal array
873 *----------------------------------------------------------------------------*/
874
875const cs_real_t *
877
878/*----------------------------------------------------------------------------
879 * Initialize row info for a given matrix.
880 *
881 * parameters:
882 * r --> row info structure
883 *----------------------------------------------------------------------------*/
884
885void
887
888/*----------------------------------------------------------------------------
889 * Finalize row info for a given matrix.
890 *
891 * parameters:
892 * r <-> row info structure
893 *----------------------------------------------------------------------------*/
894
895void
897
898/*----------------------------------------------------------------------------
899 * Get row values for a given matrix.
900 *
901 * This function may not work for all matrix types.
902 *
903 * In the case of blocked matrixes, the true (non-blocked)
904 * values are returned.
905 *
906 * The row information structure must have been previously initialized
907 * using cs_matrix_row_init(), and should be finalized using
908 * using cs_matrix_row_finalize(), so as to free buffers it may have
909 * built for certain matrix formats.
910 *
911 * parameters:
912 * matrix <-- pointer to matrix structure
913 * row_id <-- id of row to query
914 * r <-> row info structure
915 *----------------------------------------------------------------------------*/
916
917void
918cs_matrix_get_row(const cs_matrix_t *matrix,
919 const cs_lnum_t row_id,
921
922/*----------------------------------------------------------------------------
923 * Get arrays describing a matrix in native format.
924 *
925 * This function works for matrix in native format.
926 *
927 * Matrix block sizes can be obtained by cs_matrix_get_diag_block_size()
928 * and cs_matrix_get_extra_diag_block_size().
929 *
930 * parameters:
931 * matrix <-- pointer to matrix structure
932 * symmetric --> true if symmetric
933 * n_edges --> number of associated faces
934 * edges --> edges (symmetric row <-> column) connectivity
935 * d_val --> diagonal values
936 * x_val --> extra-diagonal values
937 *----------------------------------------------------------------------------*/
938
939void
941 bool *symmetric,
942 cs_lnum_t *n_edges,
943 const cs_lnum_2_t **edges,
944 const cs_real_t **d_val,
945 const cs_real_t **x_val);
946
947/*----------------------------------------------------------------------------
948 * Get arrays describing a matrix in CSR format.
949 *
950 * This function only works for an CSR matrix (i.e. there is
951 * no automatic conversion from another matrix type).
952 *
953 * Matrix block sizes can be obtained by cs_matrix_get_diag_block_size()
954 * and cs_matrix_get_extra_diag_block_size().
955 *
956 * parameters:
957 * matrix <-- pointer to matrix structure
958 * row_index --> CSR row index
959 * col_id --> CSR column id
960 * val --> values
961 *----------------------------------------------------------------------------*/
962
963void
965 const cs_lnum_t **row_index,
966 const cs_lnum_t **col_id,
967 const cs_real_t **val);
968
969/*----------------------------------------------------------------------------
970 * Get arrays describing a matrix in MSR format.
971 *
972 * This function only works for an MSR matrix (i.e. there is
973 * no automatic conversion from another matrix type).
974 *
975 * Matrix block sizes can be obtained by cs_matrix_get_diag_block_size()
976 * and cs_matrix_get_extra_diag_block_size().
977 *
978 * parameters:
979 * matrix <-- pointer to matrix structure
980 * row_index --> MSR row index
981 * col_id --> MSR column id
982 * d_val --> diagonal values
983 * x_val --> extra-diagonal values
984 *----------------------------------------------------------------------------*/
985
986void
988 const cs_lnum_t **row_index,
989 const cs_lnum_t **col_id,
990 const cs_real_t **d_val,
991 const cs_real_t **x_val);
992
993/*----------------------------------------------------------------------------*/
994/*
995 * \brief Release arrays describing a matrix in MSR format.
996 *
997 * Ownership is provided back to the caller, if pointers are provided.
998 * If the matrix does not own a given array, a nullptr value is returned
999 * for that array.
1000 *
1001 * This function only works for an MSR matrix (i.e. there is
1002 * no automatic conversion from another matrix type).
1003 *
1004 * \param[in, out] matrix pointer to matrix structure
1005 * \param[out] row_index MSR row index, or null
1006 * \param[out] col_id MSR column id, or null
1007 * \param[out] d_val diagonal values, or null
1008 * \param[out] x_val extra-diagonal values, or null
1009 */
1010/*----------------------------------------------------------------------------*/
1011
1012void
1014 cs_lnum_t **row_index,
1015 cs_lnum_t **col_id,
1016 cs_real_t **d_val,
1017 cs_real_t **x_val);
1018
1019/*----------------------------------------------------------------------------*/
1020/*
1021 * \brief Associate mesh information with a matrix.
1022 *
1023 * This may be useful for multigrid smoothing.
1024 *
1025 * At least cell centers and volumes are needed for relaxation, and face
1026 * adjacency and normals are needed for the "classical" option.
1027 *
1028 * Note that cells and faces here do not need to be primary mesh elements,
1029 * but could be dual mesh elements of some sort.
1030 *
1031 * The arrays passed to the matrix are shared, so should have a lifetime
1032 * at least as long as the matrix.
1033 *
1034 * \param[in, out] matrix pointer to matrix structure
1035 * \param[in] c2f_idx cell to faces index, or nullptr
1036 * \param[in] c2f cell to faces adjacency, or nullptr
1037 * \param[in] c2f_sgn cell to faces adjacency sign, or nullptr
1038 * \param[in] cell_cen cell center coordinates
1039 * \param[in] cell_vol cell volumes
1040 * \param[in] face_u_normal face unit normal, or nullptr
1041 * \param[in] face_surf face surface, or nullptr
1042 */
1043/*----------------------------------------------------------------------------*/
1044
1045void
1047 const cs_lnum_t *c2f_idx,
1048 const cs_lnum_t *c2f,
1049 const short int *c2f_sgn,
1050 const cs_real_3_t *cell_cen,
1051 const cs_real_t *cell_vol,
1052 const cs_nreal_3_t *face_u_normal,
1053 const cs_real_t *face_surf);
1054
1055/*----------------------------------------------------------------------------*/
1056/*
1057 * \brief Query mesh information that me be associated with a matrix.
1058 *
1059 * This may be useful for multigrid smoothing.
1060 *
1061 * \param[in] matrix pointer to matrix structure
1062 * \param[out] c2f_idx cell to faces index, or nullptr
1063 * \param[out] c2f cell to faces adjacency, or nullptr
1064 * \param[out] c2f_sgn cell to faces adjacency sign, or nullptr
1065 * \param[out] cell_cen cell center coordinates, or nullptr
1066 * \param[out] cell_vol cell volumes, or nullptr
1067 * \param[out] face_u_normal face unit normal, or nullptr
1068 * \param[out] face_surf face surface, or nullptr
1069 */
1070/*----------------------------------------------------------------------------*/
1071
1072void
1074 const cs_lnum_t **c2f_idx,
1075 const cs_lnum_t **c2f,
1076 const short int **c2f_sgn,
1077 const cs_real_3_t **cell_cen,
1078 const cs_real_t **cell_vol,
1079 const cs_nreal_3_t **face_normal,
1080 const cs_real_t **face_surf);
1081
1082/*----------------------------------------------------------------------------
1083 * Assign functions based on a variant to a given matrix.
1084 *
1085 * If the matrix variant is incompatible with the structure, it is ignored,
1086 * and defaults for that structure are used instead.
1087 *
1088 * parameters:
1089 * m <-> associated matrix structure
1090 * mv <-- associated matrix variant
1091 *
1092 * returns:
1093 * pointer to created matrix structure;
1094 *----------------------------------------------------------------------------*/
1095
1096void
1098 const cs_matrix_variant_t *mv);
1099
1100/*----------------------------------------------------------------------------
1101 * Matrix.vector product y = A.x
1102 *
1103 * This function includes a halo update of x prior to multiplication by A.
1104 *
1105 * parameters:
1106 * matrix --> pointer to matrix structure
1107 * x <-> multipliying vector values (ghost values updated)
1108 * y --> resulting vector
1109 *----------------------------------------------------------------------------*/
1110
1111void
1113 cs_real_t *x,
1114 cs_real_t *y);
1115
1116#if defined(HAVE_ACCEL)
1117
1118/*----------------------------------------------------------------------------*/
1129/*----------------------------------------------------------------------------*/
1130
1131void
1132cs_matrix_vector_multiply_d(const cs_matrix_t *matrix,
1133 cs_real_t *x,
1134 cs_real_t *y);
1135
1136#endif /* defined(HAVE_ACCEL) */
1137
1138/*----------------------------------------------------------------------------
1139 * Matrix.vector product y = A.x with no prior halo update of x.
1140 *
1141 * This function does not include a halo update of x prior to multiplication
1142 * by A, so it should be called only when the halo of x is known to already
1143 * be up to date (in which case we avoid the performance penalty of a
1144 * redundant update by using this variant of the matrix.vector product).
1145 *
1146 * parameters:
1147 * matrix --> pointer to matrix structure
1148 * x --> multipliying vector values
1149 * y <-- resulting vector
1150 *----------------------------------------------------------------------------*/
1151
1152void
1154 cs_real_t *x,
1155 cs_real_t *y);
1156
1157/*----------------------------------------------------------------------------
1158 * Partial matrix.vector product.
1159 *
1160 * This function includes a halo update of x prior to multiplication,
1161 * except for the CS_MATRIX_SPMV_L operation type, which does not require it,
1162 * as halo adjacencies are only present and useful in the upper-diagonal part..
1163 *
1164 * parameters:
1165 * matrix <-- pointer to matrix structure
1166 * op_type <-- SpMV operation type
1167 * x <-> multipliying vector values (ghost values updated)
1168 * y --> resulting vector
1169 *----------------------------------------------------------------------------*/
1170
1171void
1173 cs_matrix_spmv_type_t op_type,
1174 cs_real_t *x,
1175 cs_real_t *y);
1176
1177#if defined(HAVE_ACCEL)
1178
1179/*----------------------------------------------------------------------------*/
1193/*----------------------------------------------------------------------------*/
1194
1195void
1196cs_matrix_vector_multiply_partial_d(const cs_matrix_t *matrix,
1197 cs_matrix_spmv_type_t op_type,
1198 cs_real_t *x,
1199 cs_real_t *y);
1200
1201#endif /* defined(HAVE_ACCEL) */
1202
1203/*----------------------------------------------------------------------------
1204 * Synchronize ghost values prior to matrix.vector product
1205 *
1206 * parameters:
1207 * matrix <-- pointer to matrix structure
1208 * x <-> multipliying vector values (ghost values updated)
1209 *----------------------------------------------------------------------------*/
1210
1211void
1213 cs_real_t *x);
1214
1215/*----------------------------------------------------------------------------*/
1226/*----------------------------------------------------------------------------*/
1227
1228void
1230 int *n_variants,
1231 cs_matrix_variant_t **m_variant);
1232
1233/*----------------------------------------------------------------------------*/
1242/*----------------------------------------------------------------------------*/
1243
1246
1247/*----------------------------------------------------------------------------
1248 * Destroy a matrix variant structure.
1249 *
1250 * parameters:
1251 * mv <-> Pointer to matrix variant pointer
1252 *----------------------------------------------------------------------------*/
1253
1254void
1256
1257/*----------------------------------------------------------------------------*/
1264/*----------------------------------------------------------------------------*/
1265
1266void
1269
1270/*----------------------------------------------------------------------------*/
1277/*----------------------------------------------------------------------------*/
1278
1279void
1282
1283/*----------------------------------------------------------------------------
1284 * Select the sparse matrix-vector product function to be used by a
1285 * matrix variant for a given fill type.
1286 *
1287 * Currently, possible variant functions are:
1288 *
1289 * CS_MATRIX_NATIVE (all fill types)
1290 * default
1291 * baseline
1292 * omp (for OpenMP with compatible numbering)
1293 * omp_atomic (for OpenMP with atomics)
1294 * vector (For vector machine with compatible numbering)
1295 *
1296 * CS_MATRIX_CSR (for CS_MATRIX_SCALAR or CS_MATRIX_SCALAR_SYM)
1297 * default
1298 * mkl (with MKL)
1299 *
1300 * CS_MATRIX_MSR (all fill types)
1301 * default
1302 * mkl (with MKL, for CS_MATRIX_SCALAR or CS_MATRIX_SCALAR_SYM)
1303 * omp_sched (For OpenMP with scheduling)
1304 *
1305 * parameters:
1306 * mv <-> pointer to matrix variant
1307 * numbering <-- mesh numbering info, or nullptr
1308 * fill type <-- matrix fill type to merge from
1309 * spmv_type <-- SpMV operation type (full or sub-matrix)
1310 * (all types if CS_MATRIX_SPMV_N_TYPES)
1311 * func_name <-- function type name
1312 *----------------------------------------------------------------------------*/
1313
1314void
1316 cs_matrix_fill_type_t fill_type,
1317 cs_matrix_spmv_type_t spmv_type,
1318 const cs_numbering_t *numbering,
1319 const char *func_name);
1320
1321/*----------------------------------------------------------------------------*/
1329/*----------------------------------------------------------------------------*/
1330
1333
1334/*----------------------------------------------------------------------------*/
1335
1336#endif /* CS_MATRIX_H */
Definition: cs_dispatch.h:2288
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
cs_nreal_t cs_nreal_3_t[3]
Definition: cs_defs.h:375
cs_lnum_t cs_lnum_2_t[2]
vector of 2 local mesh-entity ids
Definition: cs_defs.h:342
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:349
unsigned cs_gnum_t
global mesh entity number
Definition: cs_defs.h:317
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
void cs_matrix_row_finalize(cs_matrix_row_info_t *r)
Finalize row info for a given matrix.
Definition: cs_matrix.cpp:5824
void cs_matrix_copy_diagonal(const cs_matrix_t *matrix, cs_real_t *da)
struct _cs_matrix_variant_t cs_matrix_variant_t
Definition: cs_matrix.h:112
void cs_matrix_vector_multiply_partial(cs_dispatch_context &ctx, const cs_matrix_t *matrix, cs_matrix_spmv_type_t op_type, cs_real_t x[], cs_real_t y[])
Partial matrix.vector product.
Definition: cs_matrix.cpp:4227
bool cs_matrix_is_symmetric(const cs_matrix_t *matrix)
Query matrix coefficients symmetry.
Definition: cs_matrix.cpp:5701
cs_matrix_t * cs_matrix_create_by_copy(cs_matrix_t *src)
Create a matrix container by copying another.
Definition: cs_matrix.cpp:4763
bool cs_matrix_get_need_xa(const cs_matrix_t *matrix)
Query matrix allocation mode.
Definition: cs_matrix.cpp:5211
void cs_matrix_set_coefficients(cs_matrix_t *matrix, bool symmetric, cs_lnum_t diag_block_size, cs_lnum_t extra_diag_block_size, const cs_lnum_t n_edges, const cs_lnum_2_t edges[], const cs_real_t *da, const cs_real_t *xa)
Set matrix coefficients defined relative to a "native" edge graph, sharing arrays with the caller whe...
Definition: cs_matrix.cpp:5315
const cs_real_t * cs_matrix_get_diagonal(const cs_matrix_t *matrix)
Get matrix diagonal values.
Definition: cs_matrix.cpp:5746
cs_matrix_structure_t * cs_matrix_structure_create_msr_shared(bool direct_assmbly, cs_lnum_t n_rows, cs_lnum_t n_cols_ext, const cs_lnum_t *row_index, const cs_lnum_t *col_id, const cs_halo_t *halo, const cs_numbering_t *numbering)
Create an MSR matrix structure sharing an existing connectivity definition.
Definition: cs_matrix.cpp:4518
const char * cs_matrix_spmv_type_name[]
cs_matrix_structure_t * cs_matrix_structure_create_from_assembler(cs_matrix_type_t type, cs_matrix_assembler_t *ma)
Create a matrix structure using a matrix assembler.
Definition: cs_matrix.cpp:4568
const char * cs_matrix_get_type_name(const cs_matrix_t *matrix)
Definition: cs_matrix.cpp:4922
cs_matrix_variant_t * cs_matrix_variant_create(cs_matrix_t *m)
Build matrix variant.
Definition: cs_matrix.cpp:6712
void cs_matrix_set_need_xa(cs_matrix_t *matrix, bool need_xa)
Indicate whether matrix will need xa coefficients.
Definition: cs_matrix.cpp:5231
struct _cs_matrix_structure_t cs_matrix_structure_t
Definition: cs_matrix.h:104
cs_lnum_t cs_matrix_get_extra_diag_block_size(const cs_matrix_t *matrix)
Return the size of the extra-diagonal block for the given matrix.
Definition: cs_matrix.cpp:5070
cs_matrix_spmv_type_t
Definition: cs_matrix.h:93
@ CS_MATRIX_SPMV_N_TYPES
Definition: cs_matrix.h:98
@ CS_MATRIX_SPMV
Definition: cs_matrix.h:95
@ CS_MATRIX_SPMV_E
Definition: cs_matrix.h:96
cs_matrix_type_t cs_matrix_variant_type(const cs_matrix_variant_t *mv)
Get the type associated with a matrix variant.
Definition: cs_matrix.cpp:7215
void cs_matrix_variant_apply_tuned(cs_matrix_t *m, cs_matrix_variant_t *mv)
Apply variants defined by tuning to a given matrix.
Definition: cs_matrix.cpp:7103
struct _cs_matrix_t cs_matrix_t
Definition: cs_matrix.h:108
cs_lnum_t cs_matrix_get_n_entries(const cs_matrix_t *matrix)
Return the number of entries in matrix.
Definition: cs_matrix.cpp:4998
void cs_matrix_vector_multiply_nosync(const cs_matrix_t *matrix, cs_real_t *x, cs_real_t *y)
const cs_matrix_assembler_t * cs_matrix_get_assembler(const cs_matrix_t *matrix)
Return matrix assembler if present.
Definition: cs_matrix.cpp:5087
void cs_matrix_vector_multiply(cs_dispatch_context &ctx, const cs_matrix_t *matrix, cs_real_t x[], cs_real_t y[])
Matrix.vector product y = A.x.
Definition: cs_matrix.cpp:4142
void cs_matrix_transfer_coefficients(cs_matrix_t *matrix, bool symmetric, cs_lnum_t diag_block_size, cs_lnum_t extra_diag_block_size, const cs_lnum_t n_edges, const cs_lnum_2_t edges[], cs_real_t **d_val, cs_real_t **x_val)
Definition: cs_matrix.cpp:5385
void cs_matrix_destroy(cs_matrix_t **matrix)
Definition: cs_matrix.cpp:4873
void cs_matrix_variant_apply(cs_matrix_t *m, cs_matrix_variant_t *mv)
Apply a variant to a given matrix.
Definition: cs_matrix.cpp:7066
const cs_gnum_t * cs_matrix_get_l_range(const cs_matrix_t *matrix)
Return a pointer to local global row range associated with a matrix, if available.
Definition: cs_matrix.cpp:5126
cs_matrix_fill_type_t cs_matrix_get_fill_type(bool symmetric, cs_lnum_t diag_block_size, cs_lnum_t extra_diag_block_size)
Get matrix fill type, depending on block sizes.
Definition: cs_matrix.cpp:5254
cs_matrix_t * cs_matrix_create(const cs_matrix_structure_t *ms)
Create a matrix container using a given structure.
Definition: cs_matrix.cpp:4682
void cs_matrix_variant_set_func(cs_matrix_variant_t *mv, cs_matrix_fill_type_t fill_type, cs_matrix_spmv_type_t spmv_type, const cs_numbering_t *numbering, const char *func_name)
Select the sparse matrix-vector product function to be used by a matrix variant for a given fill type...
Definition: cs_matrix.cpp:7169
void cs_matrix_transfer_coefficients_msr(cs_matrix_t *matrix, bool symmetric, cs_lnum_t diag_block_size, cs_lnum_t extra_diag_block_size, const cs_lnum_t row_index[], const cs_lnum_t col_id[], cs_real_t **d_val, cs_real_t **x_val)
Set matrix coefficients in an MSR format, transferring the property of those arrays to the matrix.
Definition: cs_matrix.cpp:5451
cs_matrix_t * cs_matrix_create_from_assembler(cs_matrix_type_t type, cs_matrix_assembler_t *ma)
Create a matrix directly from assembler.
Definition: cs_matrix.cpp:4716
const char * cs_matrix_get_type_fullname(const cs_matrix_t *matrix)
Definition: cs_matrix.cpp:4938
void cs_matrix_release_msr_arrays(cs_matrix_t *matrix, cs_lnum_t **row_index, cs_lnum_t **col_id, cs_real_t **d_val, cs_real_t **x_val)
Release arrays describing a matrix in MSR format.
Definition: cs_matrix.cpp:6255
void cs_matrix_apply_variant(cs_matrix_t *m, const cs_matrix_variant_t *mv)
void cs_matrix_set_alloc_mode(cs_matrix_t *matrix, cs_alloc_mode_t alloc_mode)
Set matrix allocation mode.
Definition: cs_matrix.cpp:5169
void cs_matrix_get_csr_arrays(const cs_matrix_t *matrix, const cs_lnum_t **row_index, const cs_lnum_t **col_id, const cs_real_t **val)
Get arrays describing a matrix in CSR format.
Definition: cs_matrix.cpp:6155
cs_alloc_mode_t cs_matrix_get_alloc_mode(const cs_matrix_t *matrix)
Query matrix allocation mode.
Definition: cs_matrix.cpp:5149
cs_matrix_t * cs_matrix_create_by_local_restrict(const cs_matrix_t *src)
Create a matrix based on the local restriction of a base matrix.
Definition: cs_matrix.cpp:4801
void cs_matrix_get_mesh_association(const cs_matrix_t *matrix, const cs_lnum_t **c2f_idx, const cs_lnum_t **c2f, const short int **c2f_sgn, const cs_real_3_t **cell_cen, const cs_real_t **cell_vol, const cs_nreal_3_t **face_normal, const cs_real_t **face_surf)
Query mesh information that me be associated with a matrix.
Definition: cs_matrix.cpp:6365
void cs_matrix_row_init(cs_matrix_row_info_t *r)
Initialize row info for a given matrix.
Definition: cs_matrix.cpp:5805
void cs_matrix_get_msr_arrays(const cs_matrix_t *matrix, const cs_lnum_t **row_index, const cs_lnum_t **col_id, const cs_real_t **d_val, const cs_real_t **x_val)
Get arrays describing a matrix in MSR format.
Definition: cs_matrix.cpp:6199
cs_matrix_fill_type_t
Definition: cs_matrix.h:70
@ CS_MATRIX_BLOCK_D_66
Definition: cs_matrix.h:76
@ CS_MATRIX_N_FILL_TYPES
Definition: cs_matrix.h:83
@ CS_MATRIX_SCALAR
Definition: cs_matrix.h:72
@ CS_MATRIX_BLOCK_D
Definition: cs_matrix.h:74
@ CS_MATRIX_BLOCK
Definition: cs_matrix.h:82
@ CS_MATRIX_SCALAR_SYM
Definition: cs_matrix.h:73
@ CS_MATRIX_BLOCK_D_SYM
Definition: cs_matrix.h:80
const char * cs_matrix_fill_type_name[]
const cs_halo_t * cs_matrix_get_halo(const cs_matrix_t *matrix)
Return the pointer to the halo structure for the given matrix.
Definition: cs_matrix.cpp:5106
void cs_matrix_set_mesh_association(cs_matrix_t *matrix, const cs_lnum_t *c2f_idx, const cs_lnum_t *c2f, const short int *c2f_sgn, const cs_real_3_t *cell_cen, const cs_real_t *cell_vol, const cs_nreal_3_t *face_u_normal, const cs_real_t *face_surf)
Associate mesh information with a matrix.
Definition: cs_matrix.cpp:6328
cs_lnum_t cs_matrix_get_diag_block_size(const cs_matrix_t *matrix)
Return the size of the diagonal block for the given matrix.
Definition: cs_matrix.cpp:5051
void cs_matrix_variant_destroy(cs_matrix_variant_t **mv)
Destroy a matrix variant structure.
Definition: cs_matrix.cpp:7050
void cs_matrix_pre_vector_multiply_sync(const cs_matrix_t *matrix, cs_real_t *x)
cs_matrix_assembler_values_t * cs_matrix_assembler_values_init(cs_matrix_t *matrix, cs_lnum_t diag_block_size, cs_lnum_t extra_diag_block_size)
Create and initialize a CSR matrix assembler values structure.
Definition: cs_matrix.cpp:5635
cs_matrix_type_t
Definition: cs_matrix.h:52
@ CS_MATRIX_CSR
Definition: cs_matrix.h:55
@ CS_MATRIX_MSR
Definition: cs_matrix.h:56
@ CS_MATRIX_N_TYPES
Definition: cs_matrix.h:64
@ CS_MATRIX_NATIVE
Definition: cs_matrix.h:54
@ CS_MATRIX_DIST
Definition: cs_matrix.h:58
@ CS_MATRIX_N_BUILTIN_TYPES
Definition: cs_matrix.h:62
void cs_matrix_variant_build_list(const cs_matrix_t *m, int *n_variants, cs_matrix_variant_t **m_variant)
Build list of variants for tuning or testing.
Definition: cs_matrix.cpp:6756
bool cs_matrix_is_mapped_from_native(const cs_matrix_t *matrix)
Indicate whether coefficients were mapped from native face-based arrays.
Definition: cs_matrix.cpp:5722
void cs_matrix_release_coefficients(cs_matrix_t *matrix)
Release shared matrix coefficients.
Definition: cs_matrix.cpp:5591
void cs_matrix_get_row(const cs_matrix_t *matrix, const cs_lnum_t row_id, cs_matrix_row_info_t *r)
Get row values for a given matrix.
Definition: cs_matrix.cpp:5855
cs_matrix_type_t cs_matrix_get_type(const cs_matrix_t *matrix)
Return matrix type.
Definition: cs_matrix.cpp:4907
cs_lnum_t cs_matrix_get_n_rows(const cs_matrix_t *matrix)
Return the number of rows in matrix.
Definition: cs_matrix.cpp:4976
void cs_matrix_structure_release_msr_arrays(cs_matrix_structure_t *ms, cs_lnum_t **row_index, cs_lnum_t **col_id)
Release arrays describing an MSR matrix structure.
Definition: cs_matrix.cpp:4641
cs_matrix_structure_t * cs_matrix_structure_create_msr(cs_matrix_type_t type, bool transfer, bool have_diag, bool ordered, cs_lnum_t n_rows, cs_lnum_t n_cols_ext, cs_lnum_t **row_index, cs_lnum_t **col_id, const cs_halo_t *halo, const cs_numbering_t *numbering)
Create a matrix structure based on a MSR connectivity definition.
Definition: cs_matrix.cpp:4427
void cs_matrix_structure_destroy(cs_matrix_structure_t **ms)
Destroy a matrix structure.
Definition: cs_matrix.cpp:4609
cs_lnum_t cs_matrix_get_n_columns(const cs_matrix_t *matrix)
Return number of columns in a matrix.
Definition: cs_matrix.cpp:4957
void cs_matrix_get_native_arrays(const cs_matrix_t *matrix, bool *symmetric, cs_lnum_t *n_edges, const cs_lnum_2_t **edges, const cs_real_t **d_val, const cs_real_t **x_val)
Get arrays describing a matrix in native format.
Definition: cs_matrix.cpp:6101
const cs_real_t * cs_matrix_get_extra_diagonal(const cs_matrix_t *matrix)
Get pointer to matrix extra-diagonal values in "native" format.
Definition: cs_matrix.cpp:5781
cs_matrix_structure_t * cs_matrix_structure_create(cs_matrix_type_t type, cs_lnum_t n_rows, cs_lnum_t n_cols_ext, cs_lnum_t n_edges, const cs_lnum_2_t *edges, const cs_halo_t *halo, const cs_numbering_t *numbering)
void cs_matrix_get_coefficients_msr_w(cs_matrix_t *matrix, bool symmetric, cs_lnum_t diag_block_size, cs_lnum_t extra_diag_block_size, cs_real_t **d_val, cs_real_t **x_val)
Directly access matrix coefficients in an MSR format for writing.
Definition: cs_matrix.cpp:5526
struct _cs_matrix_assembler_t cs_matrix_assembler_t
Definition: cs_matrix_assembler.h:61
struct _cs_matrix_assembler_values_t cs_matrix_assembler_values_t
Definition: cs_matrix_assembler.h:65
cs_alloc_mode_t
Definition: cs_mem.h:46
Definition: cs_halo.h:74
Definition: cs_matrix.h:116
cs_lnum_t buffer_size
Definition: cs_matrix.h:119
cs_real_t * _vals
Definition: cs_matrix.h:123
const cs_lnum_t * col_id
Definition: cs_matrix.h:120
cs_lnum_t * _col_id
Definition: cs_matrix.h:121
cs_lnum_t row_size
Definition: cs_matrix.h:118
const cs_real_t * vals
Definition: cs_matrix.h:122
Definition: cs_numbering.h:91