Fast Auxiliary Space Preconditioning
1.8.4 Feb/15/2016

Routines for sparse matrix operations. More...
Go to the source code of this file.
Functions  
void  fasp_sparse_abybms_ (INT *ia, INT *ja, INT *ib, INT *jb, INT *nap, INT *map, INT *mbp, INT *ic, INT *jc) 
Multiplication of two sparse matrices: calculating the nonzero structure of the result if jc is not null. If jc is null only finds num of nonzeroes. More...  
void  fasp_sparse_abyb_ (INT *ia, INT *ja, REAL *a, INT *ib, INT *jb, REAL *b, INT *nap, INT *map, INT *mbp, INT *ic, INT *jc, REAL *c) 
Multiplication of two sparse matrices: calculating the numerical values in the result. More...  
void  fasp_sparse_iit_ (INT *ia, INT *ja, INT *na, INT *ma, INT *iat, INT *jat) 
Transpose a boolean matrix (only given by ia, ja) More...  
void  fasp_sparse_aat_ (INT *ia, INT *ja, REAL *a, INT *na, INT *ma, INT *iat, INT *jat, REAL *at) 
transpose a boolean matrix (only given by ia, ja) More...  
void  fasp_sparse_aplbms_ (INT *ia, INT *ja, INT *ib, INT *jb, INT *nab, INT *mab, INT *ic, INT *jc) 
Addition of two sparse matrices: calculating the nonzero structure of the result if jc is not null. if jc is null only finds num of nonzeroes. More...  
void  fasp_sparse_aplusb_ (INT *ia, INT *ja, REAL *a, INT *ib, INT *jb, REAL *b, INT *nab, INT *mab, INT *ic, INT *jc, REAL *c) 
Addition of two sparse matrices: calculating the numerical values in the result. More...  
void  fasp_sparse_rapms_ (INT *ir, INT *jr, INT *ia, INT *ja, INT *ip, INT *jp, INT *nin, INT *ncin, INT *iac, INT *jac, INT *maxrout) 
Calculates the nonzero structure of R*A*P, if jac is not null. If jac is null only finds num of nonzeroes. More...  
void  fasp_sparse_wtams_ (INT *jw, INT *ia, INT *ja, INT *nwp, INT *map, INT *jv, INT *nvp, INT *icp) 
Finds the nonzeroes in the result of v^t = w^t A, where w is a sparse vector and A is sparse matrix. jv is an integer array containing the indices of the nonzero elements in the result. More...  
void  fasp_sparse_wta_ (INT *jw, REAL *w, INT *ia, INT *ja, REAL *a, INT *nwp, INT *map, INT *jv, REAL *v, INT *nvp) 
Calculate v^t = w^t A, where w is a sparse vector and A is sparse matrix. v is an array of dimension = number of columns in A. More...  
void  fasp_sparse_ytxbig_ (INT *jy, REAL *y, INT *nyp, REAL *x, REAL *s) 
Calculates s = y^t x. ysparse, x  no. More...  
void  fasp_sparse_ytx_ (INT *jy, REAL *y, INT *jx, REAL *x, INT *nyp, INT *nxp, INT *icp, REAL *s) 
Calculates s = y^t x. y is sparse, x is sparse. More...  
void  fasp_sparse_rapcmp_ (INT *ir, INT *jr, REAL *r, INT *ia, INT *ja, REAL *a, INT *ipt, INT *jpt, REAL *pt, INT *nin, INT *ncin, INT *iac, INT *jac, REAL *ac, INT *idummy) 
Calculates R*A*P after the nonzero structure of the result is known. iac,jac,ac have to be allocated before call to this function. More...  
ivector  fasp_sparse_MIS (dCSRmat *A) 
get the maximal independet set of a CSR matrix More...  
Routines for sparse matrix operations.
Definition in file sparse_util.c.
void fasp_sparse_aat_  (  INT *  ia, 
INT *  ja,  
REAL *  a,  
INT *  na,  
INT *  ma,  
INT *  iat,  
INT *  jat,  
REAL *  at  
) 
transpose a boolean matrix (only given by ia, ja)
ia  array of row pointers (as usual in CSR) 
ja  array of column indices 
a  array of entries of teh input 
na  number of rows of A 
ma  number of cols of A 
iat  array of row pointers in the result 
jat  array of column indices 
at  array of entries of the result 
Definition at line 272 of file sparse_util.c.
void fasp_sparse_abyb_  (  INT *  ia, 
INT *  ja,  
REAL *  a,  
INT *  ib,  
INT *  jb,  
REAL *  b,  
INT *  nap,  
INT *  map,  
INT *  mbp,  
INT *  ic,  
INT *  jc,  
REAL *  c  
) 
Multiplication of two sparse matrices: calculating the numerical values in the result.
ia  array of row pointers 1st multiplicand 
ja  array of column indices 1st multiplicand 
a  entries of the 1st multiplicand 
ib  array of row pointers 2nd multiplicand 
jb  array of column indices 2nd multiplicand 
b  entries of the 2nd multiplicand 
ic  array of row pointers in c=a*b 
jc  array of column indices in c=a*b 
c  entries of the result: c= a*b 
nap  number of rows in the 1st multiplicand 
map  number of columns in the 1st multiplicand 
mbp  number of columns in the 2nd multiplicand 
Modified by Chensong Zhang on 09/11/2012
Definition at line 124 of file sparse_util.c.
void fasp_sparse_abybms_  (  INT *  ia, 
INT *  ja,  
INT *  ib,  
INT *  jb,  
INT *  nap,  
INT *  map,  
INT *  mbp,  
INT *  ic,  
INT *  jc  
) 
Multiplication of two sparse matrices: calculating the nonzero structure of the result if jc is not null. If jc is null only finds num of nonzeroes.
ia  array of row pointers 1st multiplicand 
ia  array of row pointers 1st multiplicand 
ja  array of column indices 1st multiplicand 
ib  array of row pointers 2nd multiplicand 
jb  array of column indices 2nd multiplicand 
nap  number of rows of A 
map  number of cols of A 
mbp  number of cols of b 
ic  array of row pointers in the result (this is also computed here again, so that we can have a stand alone call of this routine, if for some reason the number of nonzeros in the result is known) 
jc  array of column indices in the result c=a*b 
Modified by Chensong Zhang on 09/11/2012
Definition at line 53 of file sparse_util.c.
void void fasp_sparse_aplbms_  (  INT *  ia, 
INT *  ja,  
INT *  ib,  
INT *  jb,  
INT *  nab,  
INT *  mab,  
INT *  ic,  
INT *  jc  
) 
Addition of two sparse matrices: calculating the nonzero structure of the result if jc is not null. if jc is null only finds num of nonzeroes.
ia  array of row pointers 1st summand 
ia  array of row pointers 1st summand 
ja  array of column indices 1st summand 
ib  array of row pointers 2nd summand 
jb  array of column indices 2nd summand 
nab  number of rows 
mab  number of cols 
ic  array of row pointers in the result (this is also computed here again, so that we can have a stand alone call of this routine, if for some reason the number of nonzeros in the result is known) 
jc  array of column indices in the result c=a+b 
Definition at line 359 of file sparse_util.c.
void fasp_sparse_aplusb_  (  INT *  ia, 
INT *  ja,  
REAL *  a,  
INT *  ib,  
INT *  jb,  
REAL *  b,  
INT *  nab,  
INT *  mab,  
INT *  ic,  
INT *  jc,  
REAL *  c  
) 
Addition of two sparse matrices: calculating the numerical values in the result.
ia  array of row pointers 1st summand 
ja  array of column indices 1st summand 
a  entries of the 1st summand 
ib  array of row pointers 2nd summand 
jb  array of column indices 2nd summand 
b  entries of the 2nd summand 
nab  number of rows 
mab  number of cols 
ic  array of row pointers in c=a+b 
jc  array of column indices in c=a+b 
c  entries of the result: c=a+b 
Definition at line 431 of file sparse_util.c.
Transpose a boolean matrix (only given by ia, ja)
ia  array of row pointers (as usual in CSR) 
ja  array of column indices 
na  number of rows 
ma  number of cols 
iat  array of row pointers in the result 
jat  array of column indices 
Definition at line 197 of file sparse_util.c.
get the maximal independet set of a CSR matrix
A  pointer to the matrix 
information of A
work space
return
Definition at line 909 of file sparse_util.c.
void fasp_sparse_rapcmp_  (  INT *  ir, 
INT *  jr,  
REAL *  r,  
INT *  ia,  
INT *  ja,  
REAL *  a,  
INT *  ipt,  
INT *  jpt,  
REAL *  pt,  
INT *  nin,  
INT *  ncin,  
INT *  iac,  
INT *  jac,  
REAL *  ac,  
INT *  idummy  
) 
Calculates R*A*P after the nonzero structure of the result is known. iac,jac,ac have to be allocated before call to this function.
ir  :I: array of row pointers for R 
jr  :I: array of column indices for R 
r  :I: entries of R 
ia  :I: array of row pointers for A 
ja  :I: array of column indices for A 
a  :I: entries of A 
ipt  :I: array of row pointers for P 
jpt  :I: array of column indices for P 
pt  :I: entries of P 
nin  :I: number of rows in R 
ncin  :I: number of rows in 
iac  :O: array of row pointers for P 
jac  :O: array of column indices for P 
ac  :O: entries of P 
idummy  not changed 
Definition at line 788 of file sparse_util.c.
void fasp_sparse_rapms_  (  INT *  ir, 
INT *  jr,  
INT *  ia,  
INT *  ja,  
INT *  ip,  
INT *  jp,  
INT *  nin,  
INT *  ncin,  
INT *  iac,  
INT *  jac,  
INT *  maxrout  
) 
Calculates the nonzero structure of R*A*P, if jac is not null. If jac is null only finds num of nonzeroes.
ir  :I: array of row pointers for R 
jr  :I: array of column indices for R 
ia  :I: array of row pointers for A 
ja  :I: array of column indices for A 
ip  :I: array of row pointers for P 
jp  :I: array of column indices for P 
nin  :I: number of rows in R 
ncin  :I: number of columns in R 
iac  :O: array of row pointers for Ac 
jac  :O: array of column indices for Ac 
maxrout  :O: the maximum nonzeroes per row for R 
Modified by Chensong Zhang on 09/11/2012
Definition at line 514 of file sparse_util.c.
void fasp_sparse_wta_  (  INT *  jw, 
REAL *  w,  
INT *  ia,  
INT *  ja,  
REAL *  a,  
INT *  nwp,  
INT *  map,  
INT *  jv,  
REAL *  v,  
INT *  nvp  
) 
Calculate v^t = w^t A, where w is a sparse vector and A is sparse matrix. v is an array of dimension = number of columns in A.
jw  :I: indices such that w[jw] is nonzero 
w  :I: the values of w 
ia  :I: array of row pointers for A 
ja  :I: array of column indices for A 
a  :I: entries of A 
nwp  :I: number of nonzeroes in w (the length of w) 
map  :I: number of columns in A 
jv  :O: indices such that v[jv] is nonzero 
v  :O: the result v^t=w^t A 
nvp  :I: number of nonzeroes in v 
Definition at line 648 of file sparse_util.c.
void fasp_sparse_wtams_  (  INT *  jw, 
INT *  ia,  
INT *  ja,  
INT *  nwp,  
INT *  map,  
INT *  jv,  
INT *  nvp,  
INT *  icp  
) 
Finds the nonzeroes in the result of v^t = w^t A, where w is a sparse vector and A is sparse matrix. jv is an integer array containing the indices of the nonzero elements in the result.
:I: is input :O: is output :IO: is both
jw  :I: indices such that w[jw] is nonzero 
ia  :I: array of row pointers for A 
ja  :I: array of column indices for A 
nwp  :I: number of nonzeroes in w (the length of w) 
map  :I: number of columns in A 
jv  :O: indices such that v[jv] is nonzero 
nvp  :I: number of nonzeroes in v 
icp  :IO: is a working array of length (*map) which on output satisfies icp[jv[k]1]=k; Values of icp[] at positions * other than (jv[k]1) remain unchanged. 
Modified by Chensong Zhang on 09/11/2012
Definition at line 595 of file sparse_util.c.
void fasp_sparse_ytx_  (  INT *  jy, 
REAL *  y,  
INT *  jx,  
REAL *  x,  
INT *  nyp,  
INT *  nxp,  
INT *  icp,  
REAL *  s  
) 
Calculates s = y^t x. y is sparse, x is sparse.
note :I: is input :O: is output :IO: is both
jy  :I: indices such that y[jy] is nonzero 
y  :I: is a sparse vector. 
nyp  :I: number of nonzeroes in y 
jx  :I: indices such that x[jx] is nonzero 
x  :I: is a sparse vector. 
nxp  :I: number of nonzeroes in x 
icp  ??? 
s  :O: s = y^t x. 
Definition at line 733 of file sparse_util.c.
Calculates s = y^t x. ysparse, x  no.
jy  :I: indices such that y[jy] is nonzero 
y  :I: is a sparse vector. 
nyp  :I: number of nonzeroes in v 
x  :I: also a vector assumed to have entry for any j=jy[i]1; for i=1:nyp. This means that x here does not have to be sparse. 
s  :O: s = y^t x. 
Definition at line 699 of file sparse_util.c.