GEOSX
Public Types | Static Public Member Functions | List of all members
geosx::BlasLapackLA Class Reference

This class contains a collection of BLAS and LAPACK linear algebra operations for GEOSX array1d and array2d. More...

#include <BlasLapackLA.hpp>

Public Types

enum  RandomNumberDistribution : integer { RandomNumberDistribution::UNIFORM_01 = 1, RandomNumberDistribution::UNIFORM_m1p1 = 2, RandomNumberDistribution::NORMAL_01 = 3 }
 This enum class specifies the type of distribution for generating random real numbers. More...
 
template<typename T >
using Vec = arraySlice1d< T >
 Alias for 1d slice representing a vector.
 
template<typename T >
using MatRowMajor = arraySlice2d< T, MatrixLayout::ROW_MAJOR >
 Alias for 2d slice representing a row-major dense matrix.
 
template<typename T >
using MatColMajor = arraySlice2d< T, MatrixLayout::COL_MAJOR >
 Alias for 2d slice representing a column-major dense matrix.
 

Static Public Member Functions

static real64 vectorNorm1 (Vec< real64 const > const &X)
 Returns the 1-norm of the vector. More...
 
static real64 vectorNorm2 (Vec< real64 const > const &X)
 Returns the two norm of the vector. More...
 
static real64 vectorNormInf (Vec< real64 const > const &X)
 Returns the infinity-norm of the vector. More...
 
static real64 determinant (MatRowMajor< real64 const > const &A)
 Returns the determinant of a square matrix. More...
 
static real64 determinant (MatColMajor< real64 const > const &A)
 Returns the determinant of a square matrix. More...
 
static real64 matrixNormInf (MatRowMajor< real64 const > const &A)
 Returns the infinity norm of the matrix. More...
 
static real64 matrixNormInf (MatColMajor< real64 const > const &A)
 Returns the infinity norm of the matrix. More...
 
static real64 matrixNorm1 (MatRowMajor< real64 const > const &A)
 Returns the one norm of the matrix. More...
 
static real64 matrixNorm1 (MatColMajor< real64 const > const &A)
 Returns the one norm of the matrix. More...
 
static real64 matrixNormFrobenius (MatRowMajor< real64 const > const &A)
 Returns the Frobenius norm of the matrix. More...
 
static real64 matrixNormFrobenius (MatColMajor< real64 const > const &A)
 Returns the Frobenius norm of the matrix. More...
 
static void vectorVectorAdd (Vec< real64 const > const &X, Vec< real64 > const &Y, real64 const alpha=1.)
 Vector-Vector sum; Y = alpha*X + Y. More...
 
static void matrixMatrixAdd (MatRowMajor< real64 const > const &A, MatRowMajor< real64 > const &B, real64 const alpha=1.)
 Matrix-Matrix sum; B = alpha*A + B. More...
 
static void matrixMatrixAdd (MatColMajor< real64 const > const &A, MatColMajor< real64 > const &B, real64 const alpha=1.)
 Matrix-Matrix sum; B = alpha*A + B. More...
 
static void vectorScale (real64 const alpha, Vec< real64 > const &X)
 In-place scalar-vector product; X = alpha*X. More...
 
static void matrixScale (real64 const alpha, MatRowMajor< real64 > const &A)
 In-place scalar-matrix product; A = alpha*A. More...
 
static void matrixScale (real64 const alpha, MatColMajor< real64 > const &A)
 In-place scalar-matrix product; A = alpha*A. More...
 
static real64 vectorDot (Vec< real64 const > const &X, Vec< real64 const > const &Y)
 Returns the dot product of two vectors. More...
 
static void matrixVectorMultiply (MatRowMajor< real64 const > const &A, Vec< real64 const > const &X, Vec< real64 > const &Y, real64 const alpha=1.0, real64 const beta=0.0)
 Matrix-Vector product; Y = alpha*A*X + beta*Y. More...
 
static void matrixTVectorMultiply (MatRowMajor< real64 const > const &A, Vec< real64 const > const &X, Vec< real64 > const &Y, real64 const alpha=1.0, real64 const beta=0.0)
 transpose(Matrix)-Vector product; Y = alpha*transpose(A)*X + beta*Y. More...
 
static void matrixMatrixMultiply (MatRowMajor< real64 const > const &A, MatRowMajor< real64 const > const &B, MatRowMajor< real64 > const &C, real64 const alpha=1.0, real64 const beta=0.0)
 Matrix-Matrix product; C = alpha*A*B + beta*C. More...
 
static void matrixTMatrixMultiply (MatRowMajor< real64 const > const &A, MatRowMajor< real64 const > const &B, MatRowMajor< real64 > const &C, real64 const alpha=1.0, real64 const beta=0.0)
 transpose(Matrix)-Matrix product; C = alpha*transpose(A)*B + beta*C. More...
 
static void matrixMatrixTMultiply (MatRowMajor< real64 const > const &A, MatRowMajor< real64 const > const &B, MatRowMajor< real64 > const &C, real64 const alpha=1.0, real64 const beta=0.0)
 Matrix-transpose(Matrix) product; C = alpha*A*transpose(B) + beta*C. More...
 
static void matrixTMatrixTMultiply (MatRowMajor< real64 const > const &A, MatRowMajor< real64 const > const &B, MatRowMajor< real64 > const &C, real64 const alpha=1.0, real64 const beta=0.0)
 transpose(Matrix)-transpose(Matrix) product; C = alpha*transpose(A)*transpose(B) + beta*C. More...
 
static void matrixInverse (MatRowMajor< real64 const > const &A, MatRowMajor< real64 > const &Ainv, real64 &detA)
 Computes the inverse matrix; Ainv = inverse(A). More...
 
static void matrixInverse (MatColMajor< real64 const > const &A, MatColMajor< real64 > const &Ainv, real64 &detA)
 Computes the inverse matrix; Ainv = inverse(A). More...
 
static void matrixInverse (MatRowMajor< real64 const > const &A, MatRowMajor< real64 > const &Ainv)
 Computes the inverse matrix; Ainv = inverse(A). More...
 
static void matrixInverse (MatColMajor< real64 const > const &A, MatColMajor< real64 > const &Ainv)
 Computes the inverse matrix; Ainv = inverse(A). More...
 
static void vectorCopy (Vec< real64 const > const &X, Vec< real64 > const &Y)
 Vector copy; Y = X. More...
 
static void matrixCopy (MatRowMajor< real64 const > const &A, MatRowMajor< real64 > const &B)
 Matrix copy; B = A. More...
 
static void matrixCopy (MatColMajor< real64 const > const &A, MatColMajor< real64 > const &B)
 Matrix copy; B = A. More...
 
static void setRandomNumberGeneratorSeed (arraySlice1d< int const > const &seed)
 Set the random number generator seed. More...
 
static void getRandomNumberGeneratorSeed (arraySlice1d< int > const &seed)
 Get the random number generator seed. More...
 
static void vectorRand (Vec< real64 > const &X, RandomNumberDistribution const &idist=RandomNumberDistribution::UNIFORM_01)
 Sets vector entries to random real numbers. More...
 
static void matrixRand (MatRowMajor< real64 > const &A, RandomNumberDistribution const &idist=RandomNumberDistribution::UNIFORM_01)
 Sets matrix entries to random real numbers. More...
 
static void matrixRand (MatColMajor< real64 > const &A, RandomNumberDistribution const &idist=RandomNumberDistribution::UNIFORM_01)
 Sets matrix entries to random real numbers. More...
 
static void matrixSVD (MatRowMajor< real64 const > const &A, MatRowMajor< real64 > const &U, Vec< real64 > const &S, MatRowMajor< real64 > const &VT)
 Computes the singular value decomposition of A. More...
 
static void matrixSVD (MatColMajor< real64 const > const &A, MatColMajor< real64 > const &U, Vec< real64 > const &S, MatColMajor< real64 > const &VT)
 Computes the singular value decomposition of A. More...
 
static void matrixEigenvalues (MatRowMajor< real64 const > const &A, Vec< std::complex< real64 > > const &lambda)
 Computes the eigenvalues of A. More...
 
static void matrixEigenvalues (MatColMajor< real64 const > const &A, Vec< std::complex< real64 > > const &lambda)
 Computes the eigenvalues of A. More...
 

Detailed Description

This class contains a collection of BLAS and LAPACK linear algebra operations for GEOSX array1d and array2d.

Definition at line 34 of file BlasLapackLA.hpp.

Member Enumeration Documentation

◆ RandomNumberDistribution

This enum class specifies the type of distribution for generating random real numbers.

Enumerator
UNIFORM_01 

uniform distribution (0,1)

UNIFORM_m1p1 

uniform distribution (-1,1)

NORMAL_01 

normal distribution (0,1)

Definition at line 52 of file BlasLapackLA.hpp.

Member Function Documentation

◆ determinant() [1/2]

static real64 geosx::BlasLapackLA::determinant ( MatRowMajor< real64 const > const &  A)
static

Returns the determinant of a square matrix.

Parameters
[in]AGEOSX array2d.
Returns
the matrix determinant.
Note
This function is hardcoded for square matrices up to order four. For dimensions larger than four, the determinant is computed using LAPACK's function DGETRF. To avoid matrix transposition/copy due to the row major ordering used in GEOSX for array2d, the determinant is computed for the transpose matrix, i.e. assuming column major ordering, for best performance.

◆ determinant() [2/2]

static real64 geosx::BlasLapackLA::determinant ( MatColMajor< real64 const > const &  A)
static

Returns the determinant of a square matrix.

Parameters
[in]AGEOSX array2d.
Returns
the matrix determinant.
Note
This function is hardcoded for square matrices up to order four. For dimensions larger than four, the determinant is computed using LAPACK's function DGETRF. To avoid matrix transposition/copy due to the row major ordering used in GEOSX for array2d, the determinant is computed for the transpose matrix, i.e. assuming column major ordering, for best performance.

◆ getRandomNumberGeneratorSeed()

static void geosx::BlasLapackLA::getRandomNumberGeneratorSeed ( arraySlice1d< int > const &  seed)
static

Get the random number generator seed.

Parameters
[out]seedGEOSX array1d, dimension (4).

◆ matrixCopy() [1/2]

static void geosx::BlasLapackLA::matrixCopy ( MatRowMajor< real64 const > const &  A,
MatRowMajor< real64 > const &  B 
)
static

Matrix copy; B = A.

Parameters
[in]AGEOSX array2d.
[out]BGEOSX array2d.
Warning
Assumes that A and B have the same size.

◆ matrixCopy() [2/2]

static void geosx::BlasLapackLA::matrixCopy ( MatColMajor< real64 const > const &  A,
MatColMajor< real64 > const &  B 
)
static

Matrix copy; B = A.

Parameters
[in]AGEOSX array2d.
[out]BGEOSX array2d.
Warning
Assumes that A and B have the same size.

◆ matrixEigenvalues() [1/2]

static void geosx::BlasLapackLA::matrixEigenvalues ( MatRowMajor< real64 const > const &  A,
Vec< std::complex< real64 > > const &  lambda 
)
static

Computes the eigenvalues of A.

If size(A) = (N,N), this function expects: size(lambda) = N On exit, lambda contains the eigenvalues of A

Parameters
[in]AGEOSX array2d.
[out]lambdaGEOSX array1d.

◆ matrixEigenvalues() [2/2]

static void geosx::BlasLapackLA::matrixEigenvalues ( MatColMajor< real64 const > const &  A,
Vec< std::complex< real64 > > const &  lambda 
)
static

Computes the eigenvalues of A.

If size(A) = (N,N), this function expects: size(lambda) = N On exit, lambda contains the eigenvalues of A

Parameters
[in]AGEOSX array2d.
[out]lambdaGEOSX array1d.

◆ matrixInverse() [1/4]

static void geosx::BlasLapackLA::matrixInverse ( MatRowMajor< real64 const > const &  A,
MatRowMajor< real64 > const &  Ainv,
real64 detA 
)
static

Computes the inverse matrix; Ainv = inverse(A).

Computes the inverse of the square matrix A and stores it in Ainv, and also returns the determinant of A.

Parameters
[in]AGEOSX array2d.
[out]AinvGEOSX array2d.
[out]detADeterminant of matrix A.
Warning
Assumes Ainv already has the same size as A.
Note
This function is hardcoded for matrices up to order three. For dimensions larger than three, the function calls LAPACK functions DGETRF and DGETRI. Because of the row major ordering used by GEOSX array2d, the inverse of A is practically computed as the transpose matrix of the transpose matrix inverse using lapack operation based on column-major ordering. This removes the need for any copy/transposition that would be required operating with the row-major layout.

◆ matrixInverse() [2/4]

static void geosx::BlasLapackLA::matrixInverse ( MatColMajor< real64 const > const &  A,
MatColMajor< real64 > const &  Ainv,
real64 detA 
)
static

Computes the inverse matrix; Ainv = inverse(A).

Computes the inverse of the square matrix A and stores it in Ainv, and also returns the determinant of A.

Parameters
[in]AGEOSX array2d.
[out]AinvGEOSX array2d.
[out]detADeterminant of matrix A.
Warning
Assumes Ainv already has the same size as A.
Note
This function is hardcoded for matrices up to order three. For dimensions larger than three, the function calls LAPACK functions DGETRF and DGETRI. Because of the row major ordering used by GEOSX array2d, the inverse of A is practically computed as the transpose matrix of the transpose matrix inverse using lapack operation based on column-major ordering. This removes the need for any copy/transposition that would be required operating with the row-major layout.

◆ matrixInverse() [3/4]

static void geosx::BlasLapackLA::matrixInverse ( MatRowMajor< real64 const > const &  A,
MatRowMajor< real64 > const &  Ainv 
)
static

Computes the inverse matrix; Ainv = inverse(A).

Computes the inverse of the square matrix A and stores it in Ainv.

Parameters
[in]AGEOSX array2d.
[out]AinvGEOSX array2d.
Warning
Assumes Ainv already has the same size as A.
Note
This function is hardcoded for matrices up to order three. For dimensions larger than three, the function calls LAPACK functions DGETRF and DGETRI. Because of the row major ordering used by GEOSX array2d, the inverse of A is practically computed as the transpose matrix of the transpose matrix inverse using lapack operation based on column-major ordering. This removes the need for any copy/transposition that would be required operating with the row-major layout.

◆ matrixInverse() [4/4]

static void geosx::BlasLapackLA::matrixInverse ( MatColMajor< real64 const > const &  A,
MatColMajor< real64 > const &  Ainv 
)
static

Computes the inverse matrix; Ainv = inverse(A).

Computes the inverse of the square matrix A and stores it in Ainv.

Parameters
[in]AGEOSX array2d.
[out]AinvGEOSX array2d.
Warning
Assumes Ainv already has the same size as A.
Note
This function is hardcoded for matrices up to order three. For dimensions larger than three, the function calls LAPACK functions DGETRF and DGETRI. Because of the row major ordering used by GEOSX array2d, the inverse of A is practically computed as the transpose matrix of the transpose matrix inverse using lapack operation based on column-major ordering. This removes the need for any copy/transposition that would be required operating with the row-major layout.

◆ matrixMatrixAdd() [1/2]

static void geosx::BlasLapackLA::matrixMatrixAdd ( MatRowMajor< real64 const > const &  A,
MatRowMajor< real64 > const &  B,
real64 const  alpha = 1. 
)
static

Matrix-Matrix sum; B = alpha*A + B.

Computes (alpha*A + B) and overwrites the result on p B, with optional scaling.

Parameters
[in]AGEOSX array2d.
[in,out]BGEOSX array2d.
[in]alphaOptional scalar to multiply with A.
Warning
Assumes that A and B have the same size.

◆ matrixMatrixAdd() [2/2]

static void geosx::BlasLapackLA::matrixMatrixAdd ( MatColMajor< real64 const > const &  A,
MatColMajor< real64 > const &  B,
real64 const  alpha = 1. 
)
static

Matrix-Matrix sum; B = alpha*A + B.

Computes (alpha*A + B) and overwrites the result on p B, with optional scaling.

Parameters
[in]AGEOSX array2d.
[in,out]BGEOSX array2d.
[in]alphaOptional scalar to multiply with A.
Warning
Assumes that A and B have the same size.

◆ matrixMatrixMultiply()

static void geosx::BlasLapackLA::matrixMatrixMultiply ( MatRowMajor< real64 const > const &  A,
MatRowMajor< real64 const > const &  B,
MatRowMajor< real64 > const &  C,
real64 const  alpha = 1.0,
real64 const  beta = 0.0 
)
static

Matrix-Matrix product; C = alpha*A*B + beta*C.

Computes matrix-matrix product with optional scaling and accumulation.

Parameters
[in]AGEOSX array2d.
[in]BGEOSX array2d.
[in,out]CGEOSX array1d.
[in]alphaOptional scalar to multiply with A*B.
[in]betaOptional parameter to control the accumulation.
Warning
Assumes that A and B have compatible sizes and that C already has the right size.

◆ matrixMatrixTMultiply()

static void geosx::BlasLapackLA::matrixMatrixTMultiply ( MatRowMajor< real64 const > const &  A,
MatRowMajor< real64 const > const &  B,
MatRowMajor< real64 > const &  C,
real64 const  alpha = 1.0,
real64 const  beta = 0.0 
)
static

Matrix-transpose(Matrix) product; C = alpha*A*transpose(B) + beta*C.

Computes matrix-transpose(matrix) product with optional scaling and accumulation.

Parameters
[in]AGEOSX array2d.
[in]BGEOSX array2d.
[in,out]CGEOSX array1d.
[in]alphaOptional scalar to multiply with A*transpose(B).
[in]betaOptional parameter to control the accumulation.
Warning
Assumes that A and transpose(B) have compatible sizes and that C already has the right size.

◆ matrixNorm1() [1/2]

static real64 geosx::BlasLapackLA::matrixNorm1 ( MatRowMajor< real64 const > const &  A)
static

Returns the one norm of the matrix.

Parameters
[in]AGEOSX array2d.
Returns
the matrix 1-norm.
Note
Row major ordering is used for GEOSX array2d. Since LAPACK native routines are using a column major ordering (Fortran), the one norm is computed as the infinity norm of the transpose matrix, i.e. assuming column major ordering, for best performance.

◆ matrixNorm1() [2/2]

static real64 geosx::BlasLapackLA::matrixNorm1 ( MatColMajor< real64 const > const &  A)
static

Returns the one norm of the matrix.

Parameters
[in]AGEOSX array2d.
Returns
the matrix 1-norm.
Note
Row major ordering is used for GEOSX array2d. Since LAPACK native routines are using a column major ordering (Fortran), the one norm is computed as the infinity norm of the transpose matrix, i.e. assuming column major ordering, for best performance.

◆ matrixNormFrobenius() [1/2]

static real64 geosx::BlasLapackLA::matrixNormFrobenius ( MatRowMajor< real64 const > const &  A)
static

Returns the Frobenius norm of the matrix.

Parameters
[in]AGEOSX array2d.
Returns
the Frobenius norm of the matrix.
Note
Row major ordering is used for GEOSX array2d. Since LAPACK native routines are using a column major ordering (Fortran), the one norm is computed for the transpose matrix, i.e. assuming column major ordering, for best performance.

◆ matrixNormFrobenius() [2/2]

static real64 geosx::BlasLapackLA::matrixNormFrobenius ( MatColMajor< real64 const > const &  A)
static

Returns the Frobenius norm of the matrix.

Parameters
[in]AGEOSX array2d.
Returns
the Frobenius norm of the matrix.
Note
Row major ordering is used for GEOSX array2d. Since LAPACK native routines are using a column major ordering (Fortran), the one norm is computed for the transpose matrix, i.e. assuming column major ordering, for best performance.

◆ matrixNormInf() [1/2]

static real64 geosx::BlasLapackLA::matrixNormInf ( MatRowMajor< real64 const > const &  A)
static

Returns the infinity norm of the matrix.

Parameters
[in]AGEOSX array2d.
Returns
the matrix inf-norm.
Note
Row major ordering is used for GEOSX array2d. Since LAPACK native routines are using a column major ordering (Fortran), the infinity norm is computed as the one norm of the transpose matrix, i.e. assuming column major ordering, for best performance.

◆ matrixNormInf() [2/2]

static real64 geosx::BlasLapackLA::matrixNormInf ( MatColMajor< real64 const > const &  A)
static

Returns the infinity norm of the matrix.

Parameters
[in]AGEOSX array2d.
Returns
the matrix inf-norm.
Note
Row major ordering is used for GEOSX array2d. Since LAPACK native routines are using a column major ordering (Fortran), the infinity norm is computed as the one norm of the transpose matrix, i.e. assuming column major ordering, for best performance.

◆ matrixRand() [1/2]

static void geosx::BlasLapackLA::matrixRand ( MatRowMajor< real64 > const &  A,
RandomNumberDistribution const &  idist = RandomNumberDistribution::UNIFORM_01 
)
static

Sets matrix entries to random real numbers.

Sets matrix entries to random real numbers from a uniform or normal distribution without specifying the seed of the random number generator.

Parameters
[out]AGEOSX array1d.
[in]idistOptional RandomNumberDistribution enum value specifying the distribution of the random numbers.

◆ matrixRand() [2/2]

static void geosx::BlasLapackLA::matrixRand ( MatColMajor< real64 > const &  A,
RandomNumberDistribution const &  idist = RandomNumberDistribution::UNIFORM_01 
)
static

Sets matrix entries to random real numbers.

Sets matrix entries to random real numbers from a uniform or normal distribution without specifying the seed of the random number generator.

Parameters
[out]AGEOSX array1d.
[in]idistOptional RandomNumberDistribution enum value specifying the distribution of the random numbers.

◆ matrixScale() [1/2]

static void geosx::BlasLapackLA::matrixScale ( real64 const  alpha,
MatRowMajor< real64 > const &  A 
)
static

In-place scalar-matrix product; A = alpha*A.

Parameters
[in]alphaScalar to multiply with A.
[in,out]AGEOSX array2d.

◆ matrixScale() [2/2]

static void geosx::BlasLapackLA::matrixScale ( real64 const  alpha,
MatColMajor< real64 > const &  A 
)
static

In-place scalar-matrix product; A = alpha*A.

Parameters
[in]alphaScalar to multiply with A.
[in,out]AGEOSX array2d.

◆ matrixSVD() [1/2]

static void geosx::BlasLapackLA::matrixSVD ( MatRowMajor< real64 const > const &  A,
MatRowMajor< real64 > const &  U,
Vec< real64 > const &  S,
MatRowMajor< real64 > const &  VT 
)
static

Computes the singular value decomposition of A.

If size(A) = (M,N), this function expects: size(U) = (M,min(M,N)), size(VT) = (min(M,N),N), and size(S) = min(M,N) On exit, S contains the singular values of A and U contains an orthonormal basis of range(A)

Parameters
[in]AGEOSX array2d.
[out]UGEOSX array2d.
[out]SGEOSX array1d.
[out]VTGEOSX array2d.

◆ matrixSVD() [2/2]

static void geosx::BlasLapackLA::matrixSVD ( MatColMajor< real64 const > const &  A,
MatColMajor< real64 > const &  U,
Vec< real64 > const &  S,
MatColMajor< real64 > const &  VT 
)
static

Computes the singular value decomposition of A.

If size(A) = (M,N), this function expects: size(U) = (M,min(M,N)), size(VT) = (min(M,N),N), and size(S) = min(M,N) On exit, S contains the singular values of A and U contains an orthonormal basis of range(A)

Parameters
[in]AGEOSX array2d.
[out]UGEOSX array2d.
[out]SGEOSX array1d.
[out]VTGEOSX array2d.

◆ matrixTMatrixMultiply()

static void geosx::BlasLapackLA::matrixTMatrixMultiply ( MatRowMajor< real64 const > const &  A,
MatRowMajor< real64 const > const &  B,
MatRowMajor< real64 > const &  C,
real64 const  alpha = 1.0,
real64 const  beta = 0.0 
)
static

transpose(Matrix)-Matrix product; C = alpha*transpose(A)*B + beta*C.

Computes transpose(matrix)-matrix product with optional scaling and accumulation.

Parameters
[in]AGEOSX array2d.
[in]BGEOSX array2d.
[in,out]CGEOSX array2d.
[in]alphaOptional scalar to multiply with transpose(A)*B.
[in]betaOptional parameter to control the accumulation.
Warning
Assumes that transpose(A) and B have compatible sizes and that C already has the right size.

◆ matrixTMatrixTMultiply()

static void geosx::BlasLapackLA::matrixTMatrixTMultiply ( MatRowMajor< real64 const > const &  A,
MatRowMajor< real64 const > const &  B,
MatRowMajor< real64 > const &  C,
real64 const  alpha = 1.0,
real64 const  beta = 0.0 
)
static

transpose(Matrix)-transpose(Matrix) product; C = alpha*transpose(A)*transpose(B) + beta*C.

Computes transpose(matrix)-transpose(matrix) product with optional scaling and accumulation.

Parameters
[in]AGEOSX array2d.
[in]BGEOSX array2d.
[in,out]CGEOSX array1d.
[in]alphaOptional scalar to multiply with tranpose(A)*transpose(B).
[in]betaOptional parameter to control the accumulation.
Warning
Assumes that tranpose(A) and transpose(B) have compatible sizes and that C already has the right size.

◆ matrixTVectorMultiply()

static void geosx::BlasLapackLA::matrixTVectorMultiply ( MatRowMajor< real64 const > const &  A,
Vec< real64 const > const &  X,
Vec< real64 > const &  Y,
real64 const  alpha = 1.0,
real64 const  beta = 0.0 
)
static

transpose(Matrix)-Vector product; Y = alpha*transpose(A)*X + beta*Y.

Computes transpose(matrix)-vector product with optional scaling and accumulation.

Parameters
[in]AGEOSX array2d.
[in]XGEOSX array1d.
[in,out]YGEOSX array1d.
[in]alphaOptional scalar to multiply with transpose(A)*X.
[in]betaOptional parameter to control the accumulation.
Warning
Assumes that X and Y have compatible sizes with transpose(A).

◆ matrixVectorMultiply()

static void geosx::BlasLapackLA::matrixVectorMultiply ( MatRowMajor< real64 const > const &  A,
Vec< real64 const > const &  X,
Vec< real64 > const &  Y,
real64 const  alpha = 1.0,
real64 const  beta = 0.0 
)
static

Matrix-Vector product; Y = alpha*A*X + beta*Y.

Computes matrix-vector product with optional scaling and accumulation.

Parameters
[in]AGEOSX array2d.
[in]XGEOSX array1d.
[in,out]YGEOSX array1d.
[in]alphaOptional scalar to multiply with A*X.
[in]betaOptional parameter to control the accumulation.
Warning
Assumes that X and Y have compatible sizes with A.

◆ setRandomNumberGeneratorSeed()

static void geosx::BlasLapackLA::setRandomNumberGeneratorSeed ( arraySlice1d< int const > const &  seed)
static

Set the random number generator seed.

Parameters
[in]seedGEOSX array1d, dimension (4). The elements must be between 0 and 4095, and seed(4) must be odd.

◆ vectorCopy()

static void geosx::BlasLapackLA::vectorCopy ( Vec< real64 const > const &  X,
Vec< real64 > const &  Y 
)
static

Vector copy; Y = X.

Parameters
[in]XGEOSX array1d.
[out]YGEOSX array1d.
Warning
Assumes that X and Y have the same size.

◆ vectorDot()

static real64 geosx::BlasLapackLA::vectorDot ( Vec< real64 const > const &  X,
Vec< real64 const > const &  Y 
)
static

Returns the dot product of two vectors.

Parameters
[in]XGEOSX array1d.
[in]YGEOSX array1d.
Returns
the dot product of the two vectors.

◆ vectorNorm1()

static real64 geosx::BlasLapackLA::vectorNorm1 ( Vec< real64 const > const &  X)
static

Returns the 1-norm of the vector.

Parameters
[in]XGEOSX array1d.
Returns
the vector 1-norm.

◆ vectorNorm2()

static real64 geosx::BlasLapackLA::vectorNorm2 ( Vec< real64 const > const &  X)
static

Returns the two norm of the vector.

Parameters
[in]XGEOSX array1d.
Returns
the vector 2-norm.

◆ vectorNormInf()

static real64 geosx::BlasLapackLA::vectorNormInf ( Vec< real64 const > const &  X)
static

Returns the infinity-norm of the vector.

Parameters
[in]XGEOSX array1d.
Returns
the vector inf-norm.

◆ vectorRand()

static void geosx::BlasLapackLA::vectorRand ( Vec< real64 > const &  X,
RandomNumberDistribution const &  idist = RandomNumberDistribution::UNIFORM_01 
)
static

Sets vector entries to random real numbers.

Sets vector entries to random real numbers from a uniform or normal distribution without specifying the seed of the random number generator.

Parameters
[out]XGEOSX array1d.
[in]idistOptional RandomNumberDistribution enum value specifying the distribution of the random numbers.

◆ vectorScale()

static void geosx::BlasLapackLA::vectorScale ( real64 const  alpha,
Vec< real64 > const &  X 
)
static

In-place scalar-vector product; X = alpha*X.

Parameters
[in]alphaScalar to multiply with X.
[in,out]XGEOSX array1d.

◆ vectorVectorAdd()

static void geosx::BlasLapackLA::vectorVectorAdd ( Vec< real64 const > const &  X,
Vec< real64 > const &  Y,
real64 const  alpha = 1. 
)
static

Vector-Vector sum; Y = alpha*X + Y.

Computes (alpha*X + Y) and overwrites the result on Y, with optional scaling.

Parameters
[in]XGEOSX array1d.
[in,out]YGEOSX array1d.
[in]alphaOptional scalar to multiply with X.
Warning
Assumes that X and Y have the same size.

The documentation for this class was generated from the following file: