Fast Auxiliary Space Preconditioning  1.8.4 Feb/15/2016
blas_smat.c File Reference

BLAS2 operations for small dense matrices. More...

#include "fasp.h"
#include "fasp_functs.h"

Go to the source code of this file.

Functions

void fasp_blas_smat_axm (REAL *a, const INT n, const REAL alpha)
 Compute alpha*a, store in a. More...
 
void fasp_blas_smat_add (REAL *a, REAL *b, const INT n, const REAL alpha, const REAL beta, REAL *c)
 Compute c = alpha*a + beta*b. More...
 
void fasp_blas_smat_mxv_nc2 (REAL *a, REAL *b, REAL *c)
 Compute the product of a 2*2 matrix a and a array b, stored in c. More...
 
void fasp_blas_smat_mxv_nc3 (REAL *a, REAL *b, REAL *c)
 Compute the product of a 3*3 matrix a and a array b, stored in c. More...
 
void fasp_blas_smat_mxv_nc5 (REAL *a, REAL *b, REAL *c)
 Compute the product of a 5*5 matrix a and a array b, stored in c. More...
 
void fasp_blas_smat_mxv_nc7 (REAL *a, REAL *b, REAL *c)
 Compute the product of a 7*7 matrix a and a array b, stored in c. More...
 
void fasp_blas_smat_mxv (REAL *a, REAL *b, REAL *c, const INT n)
 Compute the product of a small full matrix a and a array b, stored in c. More...
 
void fasp_blas_smat_mul_nc2 (REAL *a, REAL *b, REAL *c)
 Compute the matrix product of two 2* matrices a and b, stored in c. More...
 
void fasp_blas_smat_mul_nc3 (REAL *a, REAL *b, REAL *c)
 Compute the matrix product of two 3*3 matrices a and b, stored in c. More...
 
void fasp_blas_smat_mul_nc5 (REAL *a, REAL *b, REAL *c)
 Compute the matrix product of two 5*5 matrices a and b, stored in c. More...
 
void fasp_blas_smat_mul_nc7 (REAL *a, REAL *b, REAL *c)
 Compute the matrix product of two 7*7 matrices a and b, stored in c. More...
 
void fasp_blas_smat_mul (REAL *a, REAL *b, REAL *c, const INT n)
 Compute the matrix product of two small full matrices a and b, stored in c. More...
 
void fasp_blas_array_axpyz_nc2 (const REAL a, REAL *x, REAL *y, REAL *z)
 z = a*x + y More...
 
void fasp_blas_array_axpyz_nc3 (const REAL a, REAL *x, REAL *y, REAL *z)
 z = a*x + y More...
 
void fasp_blas_array_axpyz_nc5 (const REAL a, REAL *x, REAL *y, REAL *z)
 z = a*x + y More...
 
void fasp_blas_array_axpyz_nc7 (const REAL a, REAL *x, REAL *y, REAL *z)
 z = a*x + y More...
 
void fasp_blas_array_axpy_nc2 (const REAL a, REAL *x, REAL *y)
 y = a*x + y, the length of x and y is 2 More...
 
void fasp_blas_array_axpy_nc3 (const REAL a, REAL *x, REAL *y)
 y = a*x + y, the length of x and y is 3 More...
 
void fasp_blas_array_axpy_nc5 (const REAL a, REAL *x, REAL *y)
 y = a*x + y, the length of x and y is 5 More...
 
void fasp_blas_array_axpy_nc7 (const REAL a, REAL *x, REAL *y)
 y = a*x + y, the length of x and y is 7 More...
 
void fasp_blas_smat_ypAx_nc2 (REAL *A, REAL *x, REAL *y)
 Compute y := y + Ax, where 'A' is a 2*2 dense matrix. More...
 
void fasp_blas_smat_ypAx_nc3 (REAL *A, REAL *x, REAL *y)
 Compute y := y + Ax, where 'A' is a 3*3 dense matrix. More...
 
void fasp_blas_smat_ypAx_nc5 (REAL *A, REAL *x, REAL *y)
 Compute y := y + Ax, where 'A' is a 5*5 dense matrix. More...
 
void fasp_blas_smat_ypAx_nc7 (REAL *A, REAL *x, REAL *y)
 Compute y := y + Ax, where 'A' is a 7*7 dense matrix. More...
 
void fasp_blas_smat_ypAx (REAL *A, REAL *x, REAL *y, const INT n)
 Compute y := y + Ax, where 'A' is a n*n dense matrix. More...
 
void fasp_blas_smat_ymAx_nc2 (REAL *A, REAL *x, REAL *y)
 Compute y := y - Ax, where 'A' is a n*n dense matrix. More...
 
void fasp_blas_smat_ymAx_nc3 (REAL *A, REAL *x, REAL *y)
 Compute y := y - Ax, where 'A' is a n*n dense matrix. More...
 
void fasp_blas_smat_ymAx_nc5 (REAL *A, REAL *x, REAL *y)
 Compute y := y - Ax, where 'A' is a n*n dense matrix. More...
 
void fasp_blas_smat_ymAx_nc7 (REAL *A, REAL *x, REAL *y)
 Compute y := y - Ax, where 'A' is a 7*7 dense matrix. More...
 
void fasp_blas_smat_ymAx (REAL *A, REAL *x, REAL *y, const INT n)
 Compute y := y - Ax, where 'A' is a n*n dense matrix. More...
 
void fasp_blas_smat_aAxpby (const REAL alpha, REAL *A, REAL *x, const REAL beta, REAL *y, const INT n)
 Compute y:=alpha*A*x + beta*y. More...
 
void fasp_blas_smat_ymAx_ns2 (REAL *A, REAL *x, REAL *y)
 Compute ys := ys - Ass*xs, where 'A' is a 2*2 dense matrix, Ass is its saturaton part 1*1. More...
 
void fasp_blas_smat_ymAx_ns3 (REAL *A, REAL *x, REAL *y)
 Compute ys := ys - Ass*xs, where 'A' is a 3*3 dense matrix, Ass is its saturaton part 2*2. More...
 
void fasp_blas_smat_ymAx_ns5 (REAL *A, REAL *x, REAL *y)
 Compute ys := ys - Ass*xs, where 'A' is a 5*5 dense matrix, Ass is its saturaton part 4*4. More...
 
void fasp_blas_smat_ymAx_ns7 (REAL *A, REAL *x, REAL *y)
 Compute ys := ys - Ass*xs, where 'A' is a 7*7 dense matrix, Ass is its saturaton part 6*6. More...
 
void fasp_blas_smat_ymAx_ns (REAL *A, REAL *x, REAL *y, const INT n)
 Compute ys := ys - Ass*xs, where 'A' is a n*n dense matrix, Ass is its saturaton part (n-1)*(n-1). More...
 

Detailed Description

BLAS2 operations for small dense matrices.

Warning
The rountines are designed for full matrices only!

Definition in file blas_smat.c.

Function Documentation

void fasp_blas_array_axpy_nc2 ( const REAL  a,
REAL x,
REAL y 
)

y = a*x + y, the length of x and y is 2

Parameters
aREAL factor a
xPointer to the original array
yPointer to the destination array
Author
Xiaozhe Hu
Date
18/11/2011

Definition at line 685 of file blas_smat.c.

void fasp_blas_array_axpy_nc3 ( const REAL  a,
REAL x,
REAL y 
)

y = a*x + y, the length of x and y is 3

Parameters
aREAL factor a
xPointer to the original array
yPointer to the destination array
Author
Xiaozhe Hu, Shiquan Zhang
Date
05/01/2010

Definition at line 708 of file blas_smat.c.

void fasp_blas_array_axpy_nc5 ( const REAL  a,
REAL x,
REAL y 
)

y = a*x + y, the length of x and y is 5

Parameters
aREAL factor a
xPointer to the original array
yPointer to the destination array
Author
Xiaozhe Hu, Shiquan Zhang
Date
05/01/2010

Definition at line 737 of file blas_smat.c.

void fasp_blas_array_axpy_nc7 ( const REAL  a,
REAL x,
REAL y 
)

y = a*x + y, the length of x and y is 7

Parameters
aREAL factor a
xPointer to the original array
yPointer to the destination array
Author
Xiaozhe Hu, Shiquan Zhang
Date
05/01/2010

Definition at line 784 of file blas_smat.c.

void fasp_blas_array_axpyz_nc2 ( const REAL  a,
REAL x,
REAL y,
REAL z 
)

z = a*x + y

Parameters
aREAL factor a
xPointer to the original array 1
yPointer to the original array 2
zPointer to the destination array
Author
Xiaozhe Hu
Date
18/11/2011
Note
z is the third array and the length of x, y and z is 2

Definition at line 500 of file blas_smat.c.

void fasp_blas_array_axpyz_nc3 ( const REAL  a,
REAL x,
REAL y,
REAL z 
)

z = a*x + y

Parameters
aREAL factor a
xPointer to the original array 1
yPointer to the original array 2
zPointer to the destination array
Author
Xiaozhe Hu, Shiquan Zhang
Date
05/01/2010
Note
z is the third array and the length of x, y and z is 3

Definition at line 527 of file blas_smat.c.

void fasp_blas_array_axpyz_nc5 ( const REAL  a,
REAL x,
REAL y,
REAL z 
)

z = a*x + y

Parameters
aREAL factor a
xPointer to the original array 1
yPointer to the original array 2
zPointer to the destination array
Author
Xiaozhe Hu, Shiquan Zhang
Date
05/01/2010
Note
z is the third array and the length of x, y and z is 5

Definition at line 560 of file blas_smat.c.

void fasp_blas_array_axpyz_nc7 ( const REAL  a,
REAL x,
REAL y,
REAL z 
)

z = a*x + y

Parameters
aREAL factor a
xPointer to the original array 1
yPointer to the original array 2
zPointer to the destination array
Author
Xiaozhe Hu, Shiquan Zhang
Date
05/01/2010
Note
z is the third array and the length of x, y and z is 7

Definition at line 611 of file blas_smat.c.

void fasp_blas_smat_aAxpby ( const REAL  alpha,
REAL A,
REAL x,
const REAL  beta,
REAL y,
const INT  n 
)

Compute y:=alpha*A*x + beta*y.

Parameters
alphaREAL factor alpha
APointer to the REAL array which stands for a n*n full matrix
xPointer to the REAL array with length n
betaREAL factor beta
yPointer to the REAL array with length n
nLength of array x and y
Author
Zhiyang Zhou
Date
2010/10/25

Definition at line 1308 of file blas_smat.c.

void fasp_blas_smat_add ( REAL a,
REAL b,
const INT  n,
const REAL  alpha,
const REAL  beta,
REAL c 
)

Compute c = alpha*a + beta*b.

Parameters
aPointer to the REAL array which stands a n*n matrix
bPointer to the REAL array which stands a n*n matrix
nDimension of the matrix
alphaScalar
betaScalar
cPointer to the REAL array which stands a n*n matrix
Author
Xiaozhe Hu
Date
05/26/2014

Definition at line 54 of file blas_smat.c.

void fasp_blas_smat_axm ( REAL a,
const INT  n,
const REAL  alpha 
)

Compute alpha*a, store in a.

Parameters
aPointer to the REAL array which stands a n*n matrix
nDimension of the matrix
alphaScalar
Author
Xiaozhe Hu
Date
05/26/2014

Definition at line 26 of file blas_smat.c.

void fasp_blas_smat_mul ( REAL a,
REAL b,
REAL c,
const INT  n 
)

Compute the matrix product of two small full matrices a and b, stored in c.

Parameters
aPointer to the REAL array which stands a n*n matrix
bPointer to the REAL array which stands a n*n matrix
cPointer to the REAL array which stands a n*n matrix
nDimension of the matrix
Author
Xiaozhe Hu, Shiquan Zhang
Date
04/21/2010

Definition at line 448 of file blas_smat.c.

void fasp_blas_smat_mul_nc2 ( REAL a,
REAL b,
REAL c 
)

Compute the matrix product of two 2* matrices a and b, stored in c.

Parameters
aPointer to the REAL array which stands a n*n matrix
bPointer to the REAL array which stands a n*n matrix
cPointer to the REAL array which stands a n*n matrix
Author
Xiaozhe Hu
Date
18/11/2011

Definition at line 233 of file blas_smat.c.

void fasp_blas_smat_mul_nc3 ( REAL a,
REAL b,
REAL c 
)

Compute the matrix product of two 3*3 matrices a and b, stored in c.

Parameters
aPointer to the REAL array which stands a n*n matrix
bPointer to the REAL array which stands a n*n matrix
cPointer to the REAL array which stands a n*n matrix
Author
Xiaozhe Hu, Shiquan Zhang
Date
05/01/2010

Definition at line 262 of file blas_smat.c.

void fasp_blas_smat_mul_nc5 ( REAL a,
REAL b,
REAL c 
)

Compute the matrix product of two 5*5 matrices a and b, stored in c.

Parameters
aPointer to the REAL array which stands a 5*5 matrix
bPointer to the REAL array which stands a 5*5 matrix
cPointer to the REAL array which stands a 5*5 matrix
Author
Xiaozhe Hu, Shiquan Zhang
Date
05/01/2010

Definition at line 299 of file blas_smat.c.

void fasp_blas_smat_mul_nc7 ( REAL a,
REAL b,
REAL c 
)

Compute the matrix product of two 7*7 matrices a and b, stored in c.

Parameters
aPointer to the REAL array which stands a 7*7 matrix
bPointer to the REAL array which stands a 7*7 matrix
cPointer to the REAL array which stands a 7*7 matrix
Author
Xiaozhe Hu, Shiquan Zhang
Date
05/01/2010

Definition at line 358 of file blas_smat.c.

void fasp_blas_smat_mxv ( REAL a,
REAL b,
REAL c,
const INT  n 
)

Compute the product of a small full matrix a and a array b, stored in c.

Parameters
aPointer to the REAL array which stands a n*n matrix
bPointer to the REAL array with length n
cPointer to the REAL array with length n
nDimension of the matrix
Author
Xiaozhe Hu, Shiquan Zhang
Date
04/21/2010

Definition at line 183 of file blas_smat.c.

void fasp_blas_smat_mxv_nc2 ( REAL a,
REAL b,
REAL c 
)

Compute the product of a 2*2 matrix a and a array b, stored in c.

Parameters
aPointer to the REAL array which stands a 2*2 matrix
bPointer to the REAL array with length 2
cPointer to the REAL array with length 2
Author
Xiaozhe Hu
Date
18/11/2010

Definition at line 83 of file blas_smat.c.

void fasp_blas_smat_mxv_nc3 ( REAL a,
REAL b,
REAL c 
)

Compute the product of a 3*3 matrix a and a array b, stored in c.

Parameters
aPointer to the REAL array which stands a 3*3 matrix
bPointer to the REAL array with length 3
cPointer to the REAL array with length 3
Author
Xiaozhe Hu, Shiquan Zhang
Date
05/01/2010

Definition at line 105 of file blas_smat.c.

void fasp_blas_smat_mxv_nc5 ( REAL a,
REAL b,
REAL c 
)

Compute the product of a 5*5 matrix a and a array b, stored in c.

Parameters
aPointer to the REAL array which stands a 5*5 matrix
bPointer to the REAL array with length 5
cPointer to the REAL array with length 5
Author
Xiaozhe Hu, Shiquan Zhang
Date
05/01/2010

Definition at line 128 of file blas_smat.c.

void fasp_blas_smat_mxv_nc7 ( REAL a,
REAL b,
REAL c 
)

Compute the product of a 7*7 matrix a and a array b, stored in c.

Parameters
aPointer to the REAL array which stands a 7*7 matrix
bPointer to the REAL array with length 7
cPointer to the REAL array with length 7
Author
Xiaozhe Hu, Shiquan Zhang
Date
05/01/2010

Definition at line 154 of file blas_smat.c.

void fasp_blas_smat_ymAx ( REAL A,
REAL x,
REAL y,
const INT  n 
)

Compute y := y - Ax, where 'A' is a n*n dense matrix.

Parameters
APointer to the n*n dense matrix
xPointer to the REAL array with length n
yPointer to the REAL array with length n
nthe dimension of the dense matrix
Author
Zhiyang Zhou, Xiaozhe Hu
Date
2010/10/25

Definition at line 1207 of file blas_smat.c.

void fasp_blas_smat_ymAx_nc2 ( REAL A,
REAL x,
REAL y 
)

Compute y := y - Ax, where 'A' is a n*n dense matrix.

Parameters
APointer to the 2*2 dense matrix
xPointer to the REAL array with length 3
yPointer to the REAL array with length 3
Author
Xiaozhe Hu
Date
18/11/2011
Note
Works for 2-component

Definition at line 1077 of file blas_smat.c.

void fasp_blas_smat_ymAx_nc3 ( REAL A,
REAL x,
REAL y 
)

Compute y := y - Ax, where 'A' is a n*n dense matrix.

Parameters
APointer to the 3*3 dense matrix
xPointer to the REAL array with length 3
yPointer to the REAL array with length 3
Author
Xiaozhe Hu, Zhiyang Zhou
Date
01/06/2011
Note
Works for 3-component

Definition at line 1105 of file blas_smat.c.

void fasp_blas_smat_ymAx_nc5 ( REAL A,
REAL x,
REAL y 
)

Compute y := y - Ax, where 'A' is a n*n dense matrix.

Parameters
APointer to the 5*5 dense matrix
xPointer to the REAL array with length 5
yPointer to the REAL array with length 5
Author
Xiaozhe Hu, Zhiyang Zhou
Date
01/06/2011
Note
Works for 5-component

Definition at line 1135 of file blas_smat.c.

void fasp_blas_smat_ymAx_nc7 ( REAL A,
REAL x,
REAL y 
)

Compute y := y - Ax, where 'A' is a 7*7 dense matrix.

Parameters
APointer to the 7*7 dense matrix
xPointer to the REAL array with length 7
yPointer to the REAL array with length 7
Author
Xiaozhe Hu, Zhiyang Zhou
Date
01/06/2011
Note
Works for 7-component

Definition at line 1169 of file blas_smat.c.

void fasp_blas_smat_ymAx_ns ( REAL A,
REAL x,
REAL y,
const INT  n 
)

Compute ys := ys - Ass*xs, where 'A' is a n*n dense matrix, Ass is its saturaton part (n-1)*(n-1).

Parameters
APointer to the n*n dense matrix
xPointer to the REAL array with length n-1
yPointer to the REAL array with length n-1
nthe dimension of the dense matrix
Author
Xiaozhe Hu
Date
2010/10/25
Note
Only for block smoother for saturation block without explictly use saturation block!!

Definition at line 1482 of file blas_smat.c.

void fasp_blas_smat_ymAx_ns2 ( REAL A,
REAL x,
REAL y 
)

Compute ys := ys - Ass*xs, where 'A' is a 2*2 dense matrix, Ass is its saturaton part 1*1.

Parameters
APointer to the 2*2 dense matrix
xPointer to the REAL array with length 1
yPointer to the REAL array with length 1
Author
Xiaozhe Hu
Date
2011/11/18
Note
Works for 2-component (Xiaozhe) Only for block smoother for saturation block without explictly use saturation block!!

Definition at line 1358 of file blas_smat.c.

void fasp_blas_smat_ymAx_ns3 ( REAL A,
REAL x,
REAL y 
)

Compute ys := ys - Ass*xs, where 'A' is a 3*3 dense matrix, Ass is its saturaton part 2*2.

Parameters
APointer to the 3*3 dense matrix
xPointer to the REAL array with length 2
yPointer to the REAL array with length 2
Author
Xiaozhe Hu
Date
2010/10/25
Note
Works for 3-component (Xiaozhe) Only for block smoother for saturation block without explictly use saturation block!!

Definition at line 1382 of file blas_smat.c.

void fasp_blas_smat_ymAx_ns5 ( REAL A,
REAL x,
REAL y 
)

Compute ys := ys - Ass*xs, where 'A' is a 5*5 dense matrix, Ass is its saturaton part 4*4.

Parameters
APointer to the 5*5 dense matrix
xPointer to the REAL array with length 4
yPointer to the REAL array with length 4
Author
Xiaozhe Hu
Date
2010/10/25
Note
Works for 5-component (Xiaozhe) Only for block smoother for saturation block without explictly use saturation block!!

Definition at line 1410 of file blas_smat.c.

void fasp_blas_smat_ymAx_ns7 ( REAL A,
REAL x,
REAL y 
)

Compute ys := ys - Ass*xs, where 'A' is a 7*7 dense matrix, Ass is its saturaton part 6*6.

Parameters
APointer to the 7*7 dense matrix
xPointer to the REAL array with length 6
yPointer to the REAL array with length 6
Author
Xiaozhe Hu
Date
2010/10/25
Note
Works for 7-component (Xiaozhe) Only for block smoother for saturation block without explictly use saturation block!!

Definition at line 1444 of file blas_smat.c.

void fasp_blas_smat_ypAx ( REAL A,
REAL x,
REAL y,
const INT  n 
)

Compute y := y + Ax, where 'A' is a n*n dense matrix.

Parameters
APointer to the n*n dense matrix
xPointer to the REAL array with length n
yPointer to the REAL array with length n
nDimension of the dense matrix
Author
Zhiyang Zhou
Date
2010/10/25

Definition at line 976 of file blas_smat.c.

void fasp_blas_smat_ypAx_nc2 ( REAL A,
REAL x,
REAL y 
)

Compute y := y + Ax, where 'A' is a 2*2 dense matrix.

Parameters
APointer to the 3*3 dense matrix
xPointer to the REAL array with length 3
yPointer to the REAL array with length 3
Author
Xiaozhe Hu
Date
2011/11/18

Definition at line 857 of file blas_smat.c.

void fasp_blas_smat_ypAx_nc3 ( REAL A,
REAL x,
REAL y 
)

Compute y := y + Ax, where 'A' is a 3*3 dense matrix.

Parameters
APointer to the 3*3 dense matrix
xPointer to the REAL array with length 3
yPointer to the REAL array with length 3
Author
Zhiyang Zhou, Xiaozhe Hu
Date
2010/10/25

Definition at line 883 of file blas_smat.c.

void fasp_blas_smat_ypAx_nc5 ( REAL A,
REAL x,
REAL y 
)

Compute y := y + Ax, where 'A' is a 5*5 dense matrix.

Parameters
APointer to the 5*5 dense matrix
xPointer to the REAL array with length 5
yPointer to the REAL array with length 5
Author
Zhiyang Zhou, Xiaozhe Hu
Date
2010/10/25

Definition at line 910 of file blas_smat.c.

void fasp_blas_smat_ypAx_nc7 ( REAL A,
REAL x,
REAL y 
)

Compute y := y + Ax, where 'A' is a 7*7 dense matrix.

Parameters
APointer to the 7*7 dense matrix
xPointer to the REAL array with length 7
yPointer to the REAL array with length 7
Author
Zhiyang Zhou, Xiaozhe Hu
Date
2010/10/25

Definition at line 941 of file blas_smat.c.