![]() |
programmer's documentation
|
#include "cs_defs.h"
#include <string.h>
#include <assert.h>
#include <math.h>
#include <float.h>
#include <bft_mem.h>
#include <bft_printf.h>
#include "cs_sort.h"
#include "cs_search.h"
#include "cs_sla.h"
Macros | |
#define | SLA_MATRIX_DEBUG 0 |
Functions | |
static cs_sla_mat_prop_t * | _get_default_matrix_properties (void) |
static _spa_t * | _spa_init (size_t a_size, size_t l_size) |
Initialize a Sparse Accumulator (SPA) for MSR and CSR type. More... | |
static _spa_t * | _spa_free (_spa_t *spa) |
Free a Sparse Accumulator (SPA) for MSR and CSR type. More... | |
static _spa_dec_t * | _spa_dec_init (size_t a_size, size_t l_size) |
Initialize a Sparse Accumulator (SPA) for DEC type. More... | |
static _spa_dec_t * | _spa_dec_free (_spa_dec_t *spa) |
Free a Sparse Accumulator (SPA) for MSR and CSR type. More... | |
static void | _spa_add (_spa_t *spa, double value, cs_lnum_t pos, cs_lnum_t row_id) |
Add the contribution of a new entry. More... | |
static void | _spa_dec_add (_spa_dec_t *spa, short int value, cs_lnum_t pos, cs_lnum_t row_id) |
Add the contribution of a new entry. More... | |
static size_t | _spa_gather (_spa_t *spa, size_t idx, cs_lnum_t *col_id, double *val) |
Gather data from the current SPA state to update matrix structure Do not add zero entries. More... | |
static size_t | _spa_dec_gather (_spa_dec_t *spa, size_t idx, cs_lnum_t *col_id, short int *connect) |
Gather data from the current SPA state to update matrix structure Do not add zero entries. More... | |
static void | _estimate_sizes (const cs_sla_matrix_t *a, const cs_sla_matrix_t *b, size_t *nnz, size_t *stencil) |
Estimate roughly the number of nnz of the matrix c = a*b and the stencil of c. Size estimation is given by E. Cohen (1997) in Structure Prediction and Computation of Sparse Matrix Product. More... | |
static cs_sla_matrix_t * | _init_mat (const cs_sla_matrix_t *a, const cs_sla_matrix_t *b, cs_sla_matrix_type_t type, size_t guess_size) |
static void | _resize_mat (cs_sla_matrix_t *mat, size_t cur_size, size_t *max_size) |
static cs_sla_matrix_t * | _multiply_dec_matrices (const cs_sla_matrix_t *a, const cs_sla_matrix_t *b) |
Compute c = a*b for a and b in DEC storage. More... | |
static cs_sla_matrix_t * | _multiply_csr_matrices (const cs_sla_matrix_t *a, const cs_sla_matrix_t *b) |
Compute c = a*b for a and b in CSR storage. More... | |
static cs_sla_matrix_t * | _multiply_deccsr_matrices (const cs_sla_matrix_t *a, const cs_sla_matrix_t *b) |
Compute c = a*b for a in DEC storage and b in CSR storage. More... | |
static cs_sla_matrix_t * | _multiply_csrdec_matrices (const cs_sla_matrix_t *a, const cs_sla_matrix_t *b) |
Compute c = a*b for a in CSR storage and b in DEC storage. More... | |
static cs_sla_matrix_t * | _multiply_decmsr_matrices (const cs_sla_matrix_t *a, const cs_sla_matrix_t *b) |
Compute c = a*b for a in DEC storage and b in MSR storage. More... | |
static cs_sla_matrix_t * | _multiply_msrdec_matrices (const cs_sla_matrix_t *a, const cs_sla_matrix_t *b) |
Compute c = a*b for a in MSR storage and b in DEC storage. More... | |
static void | _decdec_AtDA (const cs_sla_matrix_t *At, const double D[], const cs_sla_matrix_t *A, cs_sla_matrix_t *C, int *w) |
Compute the product C = At * Diag * A where A and At are DEC matrices. More... | |
static void | _csrcsr_AtDA (const cs_sla_matrix_t *At, const double D[], const cs_sla_matrix_t *A, cs_sla_matrix_t *C, int *w) |
Compute the product C = At * Diag * A where A and At are CSR matrices. More... | |
static void | _pack_dec (cs_sla_matrix_t *final, const cs_sla_matrix_t *init, const cs_lnum_t *row_z2i_ids, const cs_lnum_t *col_i2z_ids) |
Fill a matrix resulting from an extraction of row/column for matrix in DEC format. More... | |
static void | _pack_csr (cs_sla_matrix_t *final, const cs_sla_matrix_t *init, const cs_lnum_t *row_z2i_ids, const cs_lnum_t *col_i2z_ids) |
Fill a matrix resulting from an extraction of row/column for matrix in CSR format. More... | |
static void | _pack_msr (cs_sla_matrix_t *final, const cs_sla_matrix_t *init, const cs_lnum_t *row_z2i_ids, const cs_lnum_t *col_i2z_ids, _Bool msr2csr) |
Fill a matrix resulting from an extraction of row/column for matrix in MSR format. More... | |
double | cs_sla_get_matrix_norm (const cs_sla_matrix_t *m) |
int | cs_sla_get_mat_spectral_radius (const cs_sla_matrix_t *matrix, int iter_max, double epsilon, double *lambda) |
cs_sla_matrix_t * | cs_sla_block2mat (cs_sla_matrix_t *A, const cs_sla_matrix_t *B, const cs_sla_matrix_t *C, const cs_sla_matrix_t *D, _Bool sym) |
cs_sla_matrix_t * | cs_sla_matrix_add (double alpha, const cs_sla_matrix_t *a, double beta, const cs_sla_matrix_t *b) |
Add two sparse matrices a and b. c = alpha*a + beta*b. More... | |
cs_sla_matrix_t * | cs_sla_matrix_multiply (const cs_sla_matrix_t *a, const cs_sla_matrix_t *b) |
Main subroutine to multiply two sparse matrices a and b. c= a*b. More... | |
cs_sla_matrix_t * | cs_sla_matrix_combine (double alpha, const cs_sla_matrix_t *a, double beta, const cs_sla_matrix_t *bt, const cs_sla_matrix_t *b) |
Specific matrix multiplication. Compute Bt * beta * B + alpha * A alpha and beta are scalar. More... | |
cs_sla_matrix_t * | cs_sla_multiply_AtDA (const cs_sla_matrix_t *At, const double D[], const cs_sla_matrix_t *A, int *w) |
Compute the product C = At * Diag * A. More... | |
void | cs_sla_matvec (const cs_sla_matrix_t *m, const double v[], double *inout[], _Bool reset) |
void | cs_sla_amxby (double alpha, const cs_sla_matrix_t *m, const double x[], double beta, const double y[], double *inout[]) |
void | cs_sla_matvec_block2 (const cs_sla_matrix_t *A, const cs_sla_matrix_t *B, const cs_sla_matrix_t *C, const cs_sla_matrix_t *D, const double X[], const double Y[], double *F[], double *G[], _Bool reset) |
Matrix block 2x2 multiply by a vector. More... | |
void | cs_sla_matrix_msr2csr (cs_sla_matrix_t *a) |
Change matrix representation from MSR to CSR. More... | |
void | cs_sla_matrix_csr2msr (cs_sla_matrix_t *a) |
Change matrix representation from CSR to MSR. More... | |
void | cs_sla_matrix_share2own (cs_sla_matrix_t *a) |
Allocate its own pattern if shared. More... | |
cs_sla_matrix_t * | cs_sla_matrix_pack (cs_lnum_t n_final_rows, cs_lnum_t n_final_cols, const cs_sla_matrix_t *init, const cs_lnum_t *row_z2i_ids, const cs_lnum_t *col_i2z_ids, _Bool keep_sym) |
Build a new matrix resulting from the extraction of some listed rows and columns. The output is a new matrix packed (or zipped) w.r.t the initial matrix. More... | |
void | cs_sla_matrix_diag_idx (cs_sla_matrix_t *m) |
Build diagonal index. More... | |
void | cs_sla_matrix_get_diag (const cs_sla_matrix_t *m, double *p_diag[]) |
Get the diagonal entries of a given matrix. More... | |
void | cs_sla_matrix_sort (cs_sla_matrix_t *m) |
Sort each row by increasing colomn number. More... | |
void | cs_sla_bread (const char *name, cs_sla_matrix_t **p_mat, double *p_rhs[], double *p_sol[]) |
Read from a binary file a matrix in CSR format, its righ hand side and the solution. Matrix must have a stride equal to 1. More... | |
void | cs_sla_bwrite (const char *name, const cs_sla_matrix_t *m, const double *rhs, const double *sol) |
Write in binary format a matrix in CSR format, its righ hand side and the solution. More... | |
cs_sla_matrix_t * | cs_sla_matrix_create (int n_rows, int n_cols, int stride, cs_sla_matrix_type_t type, _Bool sym) |
Create a cs_sla_matrix_t structure. More... | |
cs_sla_matrix_t * | cs_sla_matrix_create_from_pattern (const cs_sla_matrix_t *ref, cs_sla_matrix_type_t type, int stride) |
Create a cs_sla_matrix_t structure from an existing one. More... | |
cs_sla_matrix_t * | cs_sla_matrix_copy (const cs_sla_matrix_t *a, _Bool shared) |
Create a new matrix structure from the copy of an existing one. More... | |
cs_sla_matrix_t * | cs_sla_matrix_transpose (const cs_sla_matrix_t *a) |
Transpose a cs_sla_matrix_t structure. More... | |
cs_sla_matrix_t * | cs_sla_matrix_free (cs_sla_matrix_t *m) |
Free a cs_sla_matrix_t structure. More... | |
void | cs_sla_matrix_clean (cs_sla_matrix_t *m, double eps) |
Remove entries in a cs_sla_matrix_t structure below a given threshold. |a(i,j)| < eps * max|a(i,j)| i. More... | |
size_t | cs_sla_matrix_get_nnz (const cs_sla_matrix_t *m) |
Retrieve the number of non-zeros (nnz) elements in a matrix. More... | |
cs_sla_matrix_info_t | cs_sla_matrix_analyse (const cs_sla_matrix_t *m) |
Compute general information related to a cs_sla_matrix_t structure. More... | |
void | cs_sla_matrix_resume (const char *name, FILE *f, const cs_sla_matrix_t *m) |
Synthesis of a cs_sla_matrix_t structure. More... | |
void | cs_sla_matrix_dump (const char *name, FILE *f, const cs_sla_matrix_t *m) |
Dump a cs_sla_matrix_t structure. More... | |
void | cs_sla_system_dump (const char *name, FILE *f, const cs_sla_matrix_t *m, const double *rhs) |
Dump a cs_sla_matrix_t structure and its related right-hand side. More... | |
void | cs_sla_assemble_msr (const cs_toolbox_locmat_t *loc, cs_sla_matrix_t *ass) |
Assemble a MSR matrix from local contributions –> We assume that the local matrices are symmetric –> We assume that the assembled matrix has its columns sorted. More... | |
Variables | |
static const char | _sla_err_stride [] |
static const char | _sla_matrix_type [CS_SLA_MAT_N_TYPES][CS_CDO_LEN_NAME] |
#define SLA_MATRIX_DEBUG 0 |
|
static |
Compute the product C = At * Diag * A where A and At are CSR matrices.
[in] | At | pointer to a cs_sla_matrix_t struct. (CSR type) |
[in] | D | array standing for a diagonal operator |
[in] | A | pointer to a cs_sla_matrix_t struct. (CSR type) |
[in,out] | C | pointer to a cs_sla_matrix_t storing the result |
[in,out] | w | work buffer |
|
static |
Compute the product C = At * Diag * A where A and At are DEC matrices.
[in] | At | pointer to a cs_sla_matrix_t struct. (DEC type) |
[in] | D | array standing for a diagonal operator |
[in] | A | pointer to a cs_sla_matrix_t struct. (DEC type) |
[in,out] | C | pointer to a cs_sla_matrix_t storing the result |
[in,out] | w | work buffer |
|
static |
Estimate roughly the number of nnz of the matrix c = a*b and the stencil of c. Size estimation is given by E. Cohen (1997) in Structure Prediction and Computation of Sparse Matrix Product.
[in] | a | pointer to the matrix struct. a |
[in] | b | pointer to the matrix struct. b |
[in,out] | nnz | size_t element |
[in,out] | stencil | size_t element |
|
static |
|
static |
|
static |
Compute c = a*b for a and b in CSR storage.
[in] | a | pointer to the matrix struct. a |
[in] | b | pointer to the matrix struct. b |
|
static |
Compute c = a*b for a in CSR storage and b in DEC storage.
[in] | a | pointer to the matrix struct. a |
[in] | b | pointer to the matrix struct. b |
|
static |
Compute c = a*b for a and b in DEC storage.
[in] | a | pointer to the matrix struct. a |
[in] | b | pointer to the matrix struct. b |
|
static |
Compute c = a*b for a in DEC storage and b in CSR storage.
[in] | a | pointer to the matrix struct. a |
[in] | b | pointer to the matrix struct. b |
|
static |
Compute c = a*b for a in DEC storage and b in MSR storage.
[in] | a | pointer to the matrix struct. a |
[in] | b | pointer to the matrix struct. b |
|
static |
Compute c = a*b for a in MSR storage and b in DEC storage.
[in] | a | pointer to the matrix struct. a |
[in] | b | pointer to the matrix struct. b |
|
static |
Fill a matrix resulting from an extraction of row/column for matrix in CSR format.
[in,out] | final | pointer to the block matrix struct. |
[in] | init | init matrix to work with |
[in] | row_z2i_ids | zipped -> init numbering for rows |
[in] | col_i2z_ids | init -> zipped numbering for columns |
|
static |
Fill a matrix resulting from an extraction of row/column for matrix in DEC format.
[in,out] | final | pointer to the final matrix struct. |
[in] | init | init matrix to work with |
[in] | row_z2i_ids | zipped -> init numbering for rows |
[in] | col_i2z_ids | init -> zipped numbering for columns |
|
static |
Fill a matrix resulting from an extraction of row/column for matrix in MSR format.
[in,out] | final | pointer to the block matrix struct. |
[in] | init | init matrix to work with |
[in] | row_z2i_ids | zipped -> init numbering for rows |
[in] | col_i2z_ids | init -> zipped numbering for columns |
[in] | msr2csr | change matrix type |
|
static |
Add the contribution of a new entry.
[in,out] | spa | pointer to the SPA struct. to update |
[in] | value | value to add |
[in] | pos | position related to this value |
[in] | row_id | current row |
|
inlinestatic |
Add the contribution of a new entry.
[in,out] | spa | pointer to the SPA struct. to update |
[in] | value | value to add |
[in] | pos | position related to this value |
[in] | row_id | current row |
|
static |
Free a Sparse Accumulator (SPA) for MSR and CSR type.
[in,out] | spa | pointer to a SPA struct. to free |
|
static |
Gather data from the current SPA state to update matrix structure Do not add zero entries.
[in] | spa | pointer to the SPA struct. |
[in] | idx | current index position |
[in,out] | col_id | pointer to matrix->col_id array |
[in,out] | val | pointer to matrix->sgn array |
|
static |
Initialize a Sparse Accumulator (SPA) for DEC type.
[in] | a_size | size of tag and connect arrays |
[in] | l_size | size of lst |
|
static |
Free a Sparse Accumulator (SPA) for MSR and CSR type.
[in,out] | spa | pointer to a SPA struct. to free |
|
static |
Gather data from the current SPA state to update matrix structure Do not add zero entries.
[in] | spa | pointer to the SPA struct. |
[in] | idx | current index position |
[in,out] | col_id | pointer to matrix->col_id array |
[in,out] | val | pointer to matrix->val array |
|
static |
Initialize a Sparse Accumulator (SPA) for MSR and CSR type.
[in] | a_size | size of tag and val arrays |
[in] | l_size | size of lst |
void cs_sla_amxby | ( | double | alpha, |
const cs_sla_matrix_t * | m, | ||
const double | x[], | ||
double | beta, | ||
const double | y[], | ||
double * | inout[] | ||
) |
void cs_sla_assemble_msr | ( | const cs_toolbox_locmat_t * | loc, |
cs_sla_matrix_t * | ass | ||
) |
Assemble a MSR matrix from local contributions –> We assume that the local matrices are symmetric –> We assume that the assembled matrix has its columns sorted.
[in] | loc | pointer to a local matrix |
[in,out] | ass | pointer to a cs_sla_matrix_t struct. collecting data |
cs_sla_matrix_t* cs_sla_block2mat | ( | cs_sla_matrix_t * | A, |
const cs_sla_matrix_t * | B, | ||
const cs_sla_matrix_t * | C, | ||
const cs_sla_matrix_t * | D, | ||
_Bool | sym | ||
) |
void cs_sla_bread | ( | const char * | name, |
cs_sla_matrix_t ** | p_mat, | ||
double * | p_rhs[], | ||
double * | p_sol[] | ||
) |
Read from a binary file a matrix in CSR format, its righ hand side and the solution. Matrix must have a stride equal to 1.
[in] | name | name of the output file |
[in,out] | p_mat | system to solve |
[in,out] | p_rhs | right hand side |
[in,out] | p_sol | solution |
void cs_sla_bwrite | ( | const char * | name, |
const cs_sla_matrix_t * | m, | ||
const double * | rhs, | ||
const double * | sol | ||
) |
Write in binary format a matrix in CSR format, its righ hand side and the solution.
[in] | name | name of the output file |
[in] | A | system to solve |
[in] | rhs | right hand side |
[in] | x | solution |
int cs_sla_get_mat_spectral_radius | ( | const cs_sla_matrix_t * | matrix, |
int | iter_max, | ||
double | epsilon, | ||
double * | lambda | ||
) |
double cs_sla_get_matrix_norm | ( | const cs_sla_matrix_t * | m | ) |
cs_sla_matrix_t* cs_sla_matrix_add | ( | double | alpha, |
const cs_sla_matrix_t * | a, | ||
double | beta, | ||
const cs_sla_matrix_t * | b | ||
) |
Add two sparse matrices a and b. c = alpha*a + beta*b.
[in] | alpha | first coef. |
[in] | a | first matrix to add |
[in] | beta | second coef. |
[in] | b | second matrix to add |
cs_sla_matrix_info_t cs_sla_matrix_analyse | ( | const cs_sla_matrix_t * | m | ) |
Compute general information related to a cs_sla_matrix_t structure.
[in] | m | matrix to analyse |
void cs_sla_matrix_clean | ( | cs_sla_matrix_t * | m, |
double | eps | ||
) |
Remove entries in a cs_sla_matrix_t structure below a given threshold. |a(i,j)| < eps * max|a(i,j)| i.
Remove entries in a cs_sla_matrix_t structure below a given threshold. |a(i,j)| < eps * max|a(i,j)|.
[in,out] | mat | matrix to clean |
[in] | eps | value of the threshold |
cs_sla_matrix_t* cs_sla_matrix_combine | ( | double | alpha, |
const cs_sla_matrix_t * | a, | ||
double | beta, | ||
const cs_sla_matrix_t * | bt, | ||
const cs_sla_matrix_t * | b | ||
) |
Specific matrix multiplication. Compute Bt * beta * B + alpha * A alpha and beta are scalar.
[in] | alpha | real coefficient |
[in] | a | square sym. matrix |
[in] | beta | real coefficient |
[in] | b | matrix (CSR or DEC) |
[in] | bt | adjoint matrix of b |
cs_sla_matrix_t* cs_sla_matrix_copy | ( | const cs_sla_matrix_t * | a, |
_Bool | shared | ||
) |
Create a new matrix structure from the copy of an existing one.
[in] | a | matrix to copy |
[in] | shared | true: only pointer are copied other allocated |
cs_sla_matrix_t* cs_sla_matrix_create | ( | int | n_rows, |
int | n_cols, | ||
int | stride, | ||
cs_sla_matrix_type_t | type, | ||
_Bool | sym | ||
) |
Create a cs_sla_matrix_t structure.
[in] | n_rows | number of rows |
[in] | n_cols | number of columns |
[in] | stride | number of values related to each entry |
[in] | type | kind of matrix |
[in] | sym | true or false |
cs_sla_matrix_t* cs_sla_matrix_create_from_pattern | ( | const cs_sla_matrix_t * | ref, |
cs_sla_matrix_type_t | type, | ||
int | stride | ||
) |
Create a cs_sla_matrix_t structure from an existing one.
[in] | ref | pointer to a reference matrix with the same pattern |
[in] | type | type of the matrix to create |
[in] | stride | true or false |
void cs_sla_matrix_csr2msr | ( | cs_sla_matrix_t * | a | ) |
Change matrix representation from CSR to MSR.
[in,out] | a | matrix to transform |
void cs_sla_matrix_diag_idx | ( | cs_sla_matrix_t * | m | ) |
Build diagonal index.
[in,out] | m | matrix to work with |
void cs_sla_matrix_dump | ( | const char * | name, |
FILE * | f, | ||
const cs_sla_matrix_t * | m | ||
) |
Dump a cs_sla_matrix_t structure.
[in] | name | either name of the file if f is NULL or description |
[in] | f | pointer to a FILE struct. |
[in] | m | matrix to dump |
[in] | dump_level | level of information displayed |
cs_sla_matrix_t* cs_sla_matrix_free | ( | cs_sla_matrix_t * | m | ) |
void cs_sla_matrix_get_diag | ( | const cs_sla_matrix_t * | m, |
double * | p_diag[] | ||
) |
Get the diagonal entries of a given matrix.
[in] | m | matrix to work with |
[in,out] | p_diag | pointer to diag array to define (allocated if NULL) |
size_t cs_sla_matrix_get_nnz | ( | const cs_sla_matrix_t * | m | ) |
Retrieve the number of non-zeros (nnz) elements in a matrix.
[in] | mat | matrix |
void cs_sla_matrix_msr2csr | ( | cs_sla_matrix_t * | a | ) |
Change matrix representation from MSR to CSR.
[in,out] | a | matrix to transform |
cs_sla_matrix_t* cs_sla_matrix_multiply | ( | const cs_sla_matrix_t * | a, |
const cs_sla_matrix_t * | b | ||
) |
Main subroutine to multiply two sparse matrices a and b. c= a*b.
[in] | a | first matrix to multiply |
[in] | b | second matrix to multiply |
cs_sla_matrix_t* cs_sla_matrix_pack | ( | cs_lnum_t | n_final_rows, |
cs_lnum_t | n_final_cols, | ||
const cs_sla_matrix_t * | init, | ||
const cs_lnum_t * | row_z2i_ids, | ||
const cs_lnum_t * | col_i2z_ids, | ||
_Bool | keep_sym | ||
) |
Build a new matrix resulting from the extraction of some listed rows and columns. The output is a new matrix packed (or zipped) w.r.t the initial matrix.
[in] | n_final_rows | number of rows to extract |
[in] | n_final_cols | number of columns to extract |
[in] | init | init matrix to work with |
[in] | row_z2i_ids | zipped -> initial ids for rows |
[in] | col_i2z_ids | initial-> zipped ids for columns (-1 ==> remove) |
[in] | keep_sym | true or false |
void cs_sla_matrix_resume | ( | const char * | name, |
FILE * | f, | ||
const cs_sla_matrix_t * | m | ||
) |
Synthesis of a cs_sla_matrix_t structure.
[in] | name | either name of the file if f is NULL or description |
[in] | f | pointer to a FILE struct. |
[in] | m | matrix to dump |
void cs_sla_matrix_share2own | ( | cs_sla_matrix_t * | a | ) |
Allocate its own pattern if shared.
[in,out] | a | matrix to transform |
void cs_sla_matrix_sort | ( | cs_sla_matrix_t * | m | ) |
Sort each row by increasing colomn number.
[in] | mat | matrix to sort |
cs_sla_matrix_t* cs_sla_matrix_transpose | ( | const cs_sla_matrix_t * | a | ) |
Transpose a cs_sla_matrix_t structure.
[in] | mat | matrix to transpose |
void cs_sla_matvec | ( | const cs_sla_matrix_t * | m, |
const double | v[], | ||
double * | inout[], | ||
_Bool | reset | ||
) |
void cs_sla_matvec_block2 | ( | const cs_sla_matrix_t * | A, |
const cs_sla_matrix_t * | B, | ||
const cs_sla_matrix_t * | C, | ||
const cs_sla_matrix_t * | D, | ||
const double | X[], | ||
const double | Y[], | ||
double * | F[], | ||
double * | G[], | ||
_Bool | reset | ||
) |
Matrix block 2x2 multiply by a vector.
| A B | |X| = |F|= |AX + BY| | C D | |Y| |G| |CX + DY|
[in] | A | pointer to a cs_sla_matrix_t block (1,1) |
[in] | B | pointer to a cs_sla_matrix_t block (1,2) |
[in] | C | pointer to a cs_sla_matrix_t block (2,1) |
[in] | D | pointer to a cs_sla_matrix_t block (2,2) |
[in] | X | upper vector |
[in] | Y | lower vector |
[in,out] | F | upper result |
[in,out] | G | lower result |
[in] | reset | reset before computation (true/false) |
cs_sla_matrix_t* cs_sla_multiply_AtDA | ( | const cs_sla_matrix_t * | At, |
const double | D[], | ||
const cs_sla_matrix_t * | A, | ||
int * | w | ||
) |
Compute the product C = At * Diag * A.
[in] | At | pointer to a cs_sla_matrix_t struct. (DEC type) |
[in] | D | array standing for a diagonal operator |
[in] | A | pointer to a cs_sla_matrix_t struct. (DEC type) |
[in,out] | w | work buffer |
void cs_sla_system_dump | ( | const char * | name, |
FILE * | f, | ||
const cs_sla_matrix_t * | m, | ||
const double * | rhs | ||
) |
Dump a cs_sla_matrix_t structure and its related right-hand side.
[in] | name | either name of the file if f is NULL or description |
[in] | f | pointer to a FILE struct. |
[in] | m | matrix to dump |
[in] | rhs | right-hand side to dump |
|
static |
|
static |