![]() |
Fast Auxiliary Space Preconditioning 2.7.7 Aug/28/2022
|
Sparse matrix operations for dCSRmat matrices. More...
Go to the source code of this file.
Functions | |
dCSRmat | fasp_dcsr_create (const INT m, const INT n, const INT nnz) |
Create CSR sparse matrix data memory space. More... | |
iCSRmat | fasp_icsr_create (const INT m, const INT n, const INT nnz) |
Create CSR sparse matrix data memory space. More... | |
void | fasp_dcsr_alloc (const INT m, const INT n, const INT nnz, dCSRmat *A) |
Allocate CSR sparse matrix memory space. More... | |
void | fasp_dcsr_free (dCSRmat *A) |
Free CSR sparse matrix data memory space. More... | |
void | fasp_icsr_free (iCSRmat *A) |
Free CSR sparse matrix data memory space. More... | |
INT | fasp_dcsr_bandwidth (const dCSRmat *A) |
Get bandwith of matrix. More... | |
dCSRmat | fasp_dcsr_perm (dCSRmat *A, INT *P) |
Apply permutation of A, i.e. Aperm=PAP' by the orders given in P. More... | |
void | fasp_dcsr_sort (dCSRmat *A) |
Sort each row of A in ascending order w.r.t. column indices. More... | |
SHORT | fasp_dcsr_getblk (const dCSRmat *A, const INT *Is, const INT *Js, const INT m, const INT n, dCSRmat *B) |
Get a sub CSR matrix of A with specified rows and columns. More... | |
void | fasp_dcsr_getdiag (INT n, const dCSRmat *A, dvector *diag) |
Get first n diagonal entries of a CSR matrix A. More... | |
void | fasp_dcsr_getcol (const INT n, const dCSRmat *A, REAL *col) |
Get the n-th column of a CSR matrix A. More... | |
void | fasp_dcsr_diagpref (dCSRmat *A) |
Re-order the column and data arrays of a CSR matrix, so that the first entry in each row is the diagonal. More... | |
SHORT | fasp_dcsr_regdiag (dCSRmat *A, const REAL value) |
Regularize diagonal entries of a CSR sparse matrix. More... | |
void | fasp_icsr_cp (const iCSRmat *A, iCSRmat *B) |
Copy a iCSRmat to a new one B=A. More... | |
void | fasp_dcsr_cp (const dCSRmat *A, dCSRmat *B) |
copy a dCSRmat to a new one B=A More... | |
void | fasp_icsr_trans (const iCSRmat *A, iCSRmat *AT) |
Find transpose of iCSRmat matrix A. More... | |
INT | fasp_dcsr_trans (const dCSRmat *A, dCSRmat *AT) |
Find transpose of dCSRmat matrix A. More... | |
void | fasp_dcsr_transpose (INT *row[2], INT *col[2], REAL *val[2], INT *nn, INT *tniz) |
Transpose of a dCSRmat matrix. More... | |
void | fasp_dcsr_compress (const dCSRmat *A, dCSRmat *B, const REAL dtol) |
Compress a CSR matrix A and store in CSR matrix B by dropping small entries abs(aij)<=dtol. More... | |
SHORT | fasp_dcsr_compress_inplace (dCSRmat *A, const REAL dtol) |
Compress a CSR matrix A IN PLACE by dropping small entries abs(aij)<=dtol. More... | |
void | fasp_dcsr_shift (dCSRmat *A, const INT offset) |
Re-index a REAL matrix in CSR format to make the index starting from 0 or 1. More... | |
void | fasp_dcsr_symdiagscale (dCSRmat *A, const dvector *diag) |
Symmetric diagonal scaling D^{-1/2}AD^{-1/2}. More... | |
dCSRmat | fasp_dcsr_sympart (dCSRmat *A) |
Get symmetric part of a dCSRmat matrix. More... | |
void | fasp_dcsr_transz (dCSRmat *A, INT *p, dCSRmat *AT) |
Generalized transpose of A: (n x m) matrix given in dCSRmat format. More... | |
dCSRmat | fasp_dcsr_permz (dCSRmat *A, INT *p) |
Permute rows and cols of A, i.e. A=PAP' by the ordering in p. More... | |
void | fasp_dcsr_sortz (dCSRmat *A, const SHORT isym) |
Sort each row of A in ascending order w.r.t. column indices. More... | |
void | fasp_dcsr_multicoloring (dCSRmat *A, INT *flags, INT *groups) |
Use the greedy multi-coloring to get color groups of the adjacency graph of A. More... | |
void | dCSRmat_Multicoloring (dCSRmat *A, INT *rowmax, INT *groups) |
Use the greedy multicoloring algorithm to get color groups for for the adjacency graph of A. More... | |
void | dCSRmat_Multicoloring_Strong_Coupled (dCSRmat *A, iCSRmat *S, INT *flags, INT *groups) |
Use the greedy multicoloring algorithm to get color groups for the adjacency graph of A. More... | |
void | dCSRmat_Multicoloring_Theta (dCSRmat *A, REAL theta, INT *rowmax, INT *groups) |
Use the greedy multicoloring algorithm to get color groups for for the adjacency graph of A. More... | |
void | fasp_smoother_dcsr_gs_multicolor (dvector *u, dCSRmat *A, dvector *b, INT L, const INT order) |
Sparse matrix operations for dCSRmat matrices.
Copyright (C) 2009–Present by the FASP team. All rights reserved.
Definition in file BlaSparseCSR.c.
Use the greedy multicoloring algorithm to get color groups for for the adjacency graph of A.
A | Input dCSRmat |
rowmax | Max row nonzeros of A |
groups | Return group numbers |
Definition at line 1687 of file BlaSparseCSR.c.
Use the greedy multicoloring algorithm to get color groups for the adjacency graph of A.
A | Input dCSRmat |
S | Input iCSRmat Strong Coupled Matrix of A. |
flags | Flags for the independent group |
groups | Return group numbers |
Definition at line 1867 of file BlaSparseCSR.c.
Use the greedy multicoloring algorithm to get color groups for for the adjacency graph of A.
A | Input dCSRmat |
theta | Strength threshold parameter |
rowmax | Max row nonzeros of A |
groups | Return group numbers |
Definition at line 1984 of file BlaSparseCSR.c.
Allocate CSR sparse matrix memory space.
m | Number of rows |
n | Number of columns |
nnz | Number of nonzeros |
A | Pointer to the dCSRmat matrix |
Definition at line 138 of file BlaSparseCSR.c.
Get bandwith of matrix.
A | pointer to the dCSRmat matrix |
Definition at line 245 of file BlaSparseCSR.c.
Compress a CSR matrix A and store in CSR matrix B by dropping small entries abs(aij)<=dtol.
Modified by Chunsheng Feng, Zheng Li on 08/25/2012
Definition at line 1086 of file BlaSparseCSR.c.
Compress a CSR matrix A IN PLACE by dropping small entries abs(aij)<=dtol.
A | Pointer to dCSRmat CSR matrix |
dtol | Drop tolerance |
Modified by Chensong Zhang on 02/21/2013 Modified by Chunsheng Feng on 10/16/2020: Avoid filtering diagonal entries.
Definition at line 1166 of file BlaSparseCSR.c.
copy a dCSRmat to a new one B=A
Modified by Chunsheng Feng, Xiaoqiang Yue on 05/23/2012
Definition at line 851 of file BlaSparseCSR.c.
Create CSR sparse matrix data memory space.
m | Number of rows |
n | Number of columns |
nnz | Number of nonzeros |
Definition at line 47 of file BlaSparseCSR.c.
void fasp_dcsr_diagpref | ( | dCSRmat * | A | ) |
Re-order the column and data arrays of a CSR matrix, so that the first entry in each row is the diagonal.
A | Pointer to the matrix to be re-ordered |
Modified by Chensong Zhang on Dec/21/2012
Definition at line 680 of file BlaSparseCSR.c.
void fasp_dcsr_free | ( | dCSRmat * | A | ) |
Free CSR sparse matrix data memory space.
A | Pointer to the dCSRmat matrix |
Definition at line 184 of file BlaSparseCSR.c.
SHORT fasp_dcsr_getblk | ( | const dCSRmat * | A, |
const INT * | Is, | ||
const INT * | Js, | ||
const INT | m, | ||
const INT | n, | ||
dCSRmat * | B | ||
) |
Get a sub CSR matrix of A with specified rows and columns.
A | Pointer to dCSRmat matrix |
B | Pointer to dCSRmat matrix |
Is | Pointer to selected rows |
Js | Pointer to selected columns |
m | Number of selected rows |
n | Number of selected columns |
Modified by Chunsheng Feng, Xiaoqiang Yue on 05/23/2012
Definition at line 446 of file BlaSparseCSR.c.
Get the n-th column of a CSR matrix A.
n | Index of a column of A (0 <= n <= A.col-1) |
A | Pointer to dCSRmat CSR matrix |
col | Pointer to the column |
Modified by Chunsheng Feng, Zheng Li on 07/08/2012
Definition at line 602 of file BlaSparseCSR.c.
Get first n diagonal entries of a CSR matrix A.
n | Number of diagonal entries to get (if n=0, then get all diagonal entries) |
A | Pointer to dCSRmat CSR matrix |
diag | Pointer to the diagonal as a dvector |
Modified by Chunsheng Feng, Xiaoqiang Yue on 05/23/2012
Definition at line 537 of file BlaSparseCSR.c.
Use the greedy multi-coloring to get color groups of the adjacency graph of A.
A | Input dCSRmat |
flags | flags for the independent group |
groups | Return group numbers |
Definition at line 1602 of file BlaSparseCSR.c.
Apply permutation of A, i.e. Aperm=PAP' by the orders given in P.
A | Pointer to the original dCSRmat matrix |
P | Pointer to orders |
Modified by Chunsheng Feng, Zheng Li on 07/12/2012
Definition at line 275 of file BlaSparseCSR.c.
Permute rows and cols of A, i.e. A=PAP' by the ordering in p.
A | Pointer to the original dCSRmat matrix |
p | Pointer to ordering |
Definition at line 1540 of file BlaSparseCSR.c.
Regularize diagonal entries of a CSR sparse matrix.
A | Pointer to the dCSRmat matrix |
value | Set a value on diag(A) which is too close to zero to "value" |
Definition at line 786 of file BlaSparseCSR.c.
Re-index a REAL matrix in CSR format to make the index starting from 0 or 1.
A | Pointer to CSR matrix |
offset | Size of offset (1 or -1) |
Modified by Chunsheng Feng, Zheng Li on 07/11/2012
Definition at line 1212 of file BlaSparseCSR.c.
void fasp_dcsr_sort | ( | dCSRmat * | A | ) |
Sort each row of A in ascending order w.r.t. column indices.
A | Pointer to the dCSRmat matrix |
Definition at line 385 of file BlaSparseCSR.c.
Sort each row of A in ascending order w.r.t. column indices.
A | Pointer to the dCSRmat matrix |
isym | Flag for symmetry, =[0/nonzero]=[general/symmetric] matrix |
Definition at line 1571 of file BlaSparseCSR.c.
Symmetric diagonal scaling D^{-1/2}AD^{-1/2}.
A | Pointer to the dCSRmat matrix |
diag | Pointer to the diagonal entries |
Modified by Chunsheng Feng, Zheng Li on 07/11/2012
Definition at line 1270 of file BlaSparseCSR.c.
Get symmetric part of a dCSRmat matrix.
A | Pointer to the dCSRmat matrix |
Definition at line 1357 of file BlaSparseCSR.c.
Find transpose of dCSRmat matrix A.
Modified by Chunsheng Feng, Zheng Li on 06/20/2012
Definition at line 952 of file BlaSparseCSR.c.
Transpose of a dCSRmat matrix.
row | Pointers of the rows of the matrix and its transpose |
col | Pointers of the columns of the matrix and its transpose |
val | Pointers to the values of the matrix and its transpose |
nn | Pointer to the number of rows/columns of A and A' |
tniz | Pointer to the number of nonzeros A and A' |
Definition at line 1037 of file BlaSparseCSR.c.
Generalized transpose of A: (n x m) matrix given in dCSRmat format.
A | Pointer to matrix in dCSRmat for transpose, INPUT |
p | Permutation, INPUT |
AT | Pointer to matrix AT = transpose(A) if p = NULL, OR AT = transpose(A)p if p is not NULL |
Reference: Fred G. Gustavson. Two fast algorithms for sparse matrices: multiplication and permuted transposition. ACM Trans. Math. Software, 4(3):250�C269, 1978.
Definition at line 1416 of file BlaSparseCSR.c.
Create CSR sparse matrix data memory space.
m | Number of rows |
n | Number of columns |
nnz | Number of nonzeros |
Definition at line 96 of file BlaSparseCSR.c.
void fasp_icsr_free | ( | iCSRmat * | A | ) |
Free CSR sparse matrix data memory space.
A | Pointer to the iCSRmat matrix |
Definition at line 219 of file BlaSparseCSR.c.
Find transpose of iCSRmat matrix A.
Modified by Chunsheng Feng, Zheng Li on 06/20/2012
Definition at line 875 of file BlaSparseCSR.c.