MADNESS 0.10.1
Enumerations | Functions
madness::cblas Namespace Reference

Enumerations

enum  CBLAS_TRANSPOSE { NoTrans =0 , Trans =1 , ConjTrans =2 }
 Matrix operations for BLAS function calls. More...
 

Functions

template<typename T >
const blas_complex_floatto_cptr (const T *ptr)
 
template<typename T >
std::enable_if<!std::is_const< T >::value, blas_complex_float * >::type to_cptr (T *ptr)
 
template<typename T >
const blas_complex_doubleto_zptr (const T *ptr)
 
template<typename T >
std::enable_if<!std::is_const< T >::value, blas_complex_double * >::type to_zptr (T *ptr)
 
void gemm (const CBLAS_TRANSPOSE OpA, const CBLAS_TRANSPOSE OpB, const integer m, const integer n, const integer k, const float alpha, const float *a, const integer lda, const float *b, const integer ldb, const float beta, float *c, const integer ldc)
 Multiplies a matrix by a vector.
 
void gemm (const CBLAS_TRANSPOSE OpA, const CBLAS_TRANSPOSE OpB, const integer m, const integer n, const integer k, const double alpha, const double *a, const integer lda, const double *b, const integer ldb, const double beta, double *c, const integer ldc)
 
void gemm (const CBLAS_TRANSPOSE OpA, const CBLAS_TRANSPOSE OpB, const integer m, const integer n, const integer k, const complex_real4 alpha, const complex_real4 *a, const integer lda, const complex_real4 *b, const integer ldb, const complex_real4 beta, complex_real4 *c, const integer ldc)
 
void gemm (const CBLAS_TRANSPOSE OpA, const CBLAS_TRANSPOSE OpB, const integer m, const integer n, const integer k, const complex_real8 alpha, const complex_real8 *a, const integer lda, const complex_real8 *b, const integer ldb, const complex_real8 beta, complex_real8 *c, const integer ldc)
 
void gemv (const CBLAS_TRANSPOSE OpA, const integer m, const integer n, const float alpha, const float *A, const integer lda, const float *x, const integer incx, const float beta, float *y, const integer incy)
 Multiplies a matrix by a vector.
 
void gemv (const CBLAS_TRANSPOSE OpA, const integer m, const integer n, const double alpha, const double *A, const integer lda, const double *x, const integer incx, const double beta, double *y, const integer incy)
 
void gemv (const CBLAS_TRANSPOSE OpA, const integer m, const integer n, const complex_real4 alpha, const complex_real4 *A, const integer lda, const complex_real4 *x, const integer incx, const complex_real4 beta, complex_real4 *y, const integer incy)
 
void gemv (const CBLAS_TRANSPOSE OpA, const integer m, const integer n, const complex_real8 alpha, const complex_real8 *A, const integer lda, const complex_real8 *x, const integer incx, const complex_real8 beta, complex_real8 *y, const integer incy)
 
void ger (const integer m, const integer n, const float alpha, const float *x, const integer incx, const float *y, const integer incy, float *A, const integer lda)
 Multiplies vector $ \mathbf{x} $ by the transform of vector $ \mathbf{y} $.
 
void ger (const integer m, const integer n, const double alpha, const double *x, const integer incx, const double *y, const integer incy, double *A, const integer lda)
 
void ger (const integer m, const integer n, const complex_real4 alpha, const complex_real4 *x, const integer incx, const complex_real4 *y, const integer incy, complex_real4 *A, const integer lda)
 
void ger (const integer m, const integer n, const complex_real8 alpha, const complex_real8 *x, const integer incx, const complex_real8 *y, const integer incy, complex_real8 *A, const integer lda)
 
float dot (const integer n, const float *x, const integer incx, const float *y, const integer incy)
 Compute the dot product of vectors $ \mathbf{x} $ and $ \mathbf{y} $.
 
double dot (const integer n, const double *x, const integer incx, const double *y, const integer incy)
 
complex_real4 dot (const integer n, const complex_real4 *x, const integer incx, const complex_real4 *y, const integer incy)
 
complex_real8 dot (const integer n, const complex_real8 *x, const integer incx, const complex_real8 *y, const integer incy)
 
void scal (const integer n, const float alpha, float *x, const integer incx)
 Scale a vector.
 
void scal (const integer n, const double alpha, double *x, const integer incx)
 
void scal (const integer n, const complex_real4 alpha, complex_real4 *x, const integer incx)
 
void scal (const integer n, const complex_real8 alpha, complex_real8 *x, const integer incx)
 
void scal (const integer n, const float alpha, complex_real4 *x, const integer incx)
 
void scal (const integer n, const double alpha, complex_real8 *x, const integer incx)
 
void axpy (const integer n, const float alpha, float *x, const integer incx, float *y, const integer incy)
 Scale and add a vector to another.
 
void axpy (const integer n, const double alpha, double *x, const integer incx, double *y, const integer incy)
 
void axpy (const integer n, const complex_real4 alpha, complex_real4 *x, const integer incx, complex_real4 *y, const integer incy)
 
void axpy (const integer n, const complex_real8 alpha, complex_real8 *x, const integer incx, complex_real8 *y, const integer incy)
 

Detailed Description

Todo:
Description needed

Enumeration Type Documentation

◆ CBLAS_TRANSPOSE

Matrix operations for BLAS function calls.

Enumerator
NoTrans 
Trans 
ConjTrans 

Function Documentation

◆ axpy() [1/4]

void madness::cblas::axpy ( const integer  n,
const complex_real4  alpha,
complex_real4 x,
const integer  incx,
complex_real4 y,
const integer  incy 
)
inline

References alpha, F77_CAXPY(), and to_cptr().

◆ axpy() [2/4]

void madness::cblas::axpy ( const integer  n,
const complex_real8  alpha,
complex_real8 x,
const integer  incx,
complex_real8 y,
const integer  incy 
)
inline

References alpha, F77_ZAXPY(), and to_zptr().

◆ axpy() [3/4]

void madness::cblas::axpy ( const integer  n,
const double  alpha,
double *  x,
const integer  incx,
double *  y,
const integer  incy 
)
inline

References alpha, and F77_DAXPY().

◆ axpy() [4/4]

void madness::cblas::axpy ( const integer  n,
const float  alpha,
float *  x,
const integer  incx,
float *  y,
const integer  incy 
)
inline

Scale and add a vector to another.

\[
 \mathbf{y} \leftarrow \alpha \mathbf{x} + \mathbf{y}
 \]

Parameters
nThe size of the vector
alphaThe scaling factor for vector $ \mathbf{x} $
xPointer to vector $ \mathbf{x} $
incxStride for vector $ \mathbf{x} $
yPointer to vector $ \mathbf{y} $
incyStride for vector $ \mathbf{y} $

References alpha, and F77_SAXPY().

Referenced by madness::aligned_axpy(), madness::aligned_axpy(), and madness::aligned_axpy().

◆ dot() [1/4]

complex_real4 madness::cblas::dot ( const integer  n,
const complex_real4 x,
const integer  incx,
const complex_real4 y,
const integer  incy 
)
inline

References F77_CDOTU(), and to_cptr().

◆ dot() [2/4]

complex_real8 madness::cblas::dot ( const integer  n,
const complex_real8 x,
const integer  incx,
const complex_real8 y,
const integer  incy 
)
inline

References F77_ZDOTU(), and to_zptr().

◆ dot() [3/4]

double madness::cblas::dot ( const integer  n,
const double *  x,
const integer  incx,
const double *  y,
const integer  incy 
)
inline

References F77_DDOT().

◆ dot() [4/4]

float madness::cblas::dot ( const integer  n,
const float *  x,
const integer  incx,
const float *  y,
const integer  incy 
)
inline

Compute the dot product of vectors $ \mathbf{x} $ and $ \mathbf{y} $.

\[
 u \leftarrow  \alpha \mathbf{x} \cdot \mathbf{y}
 \]

Parameters
nSize of the vectors $ \mathbf{x} $ and $ \mathbf{y} $
xPointer to vector $ \mathbf{x} $
incxStride of vector $ \mathbf{x} $
yPointer to vector $ \mathbf{y} $
incyStride of vector $ \mathbf{y} $
Returns
The dot product of x and y

References F77_SDOT().

◆ gemm() [1/4]

void madness::cblas::gemm ( const CBLAS_TRANSPOSE  OpA,
const CBLAS_TRANSPOSE  OpB,
const integer  m,
const integer  n,
const integer  k,
const complex_real4  alpha,
const complex_real4 a,
const integer  lda,
const complex_real4 b,
const integer  ldb,
const complex_real4  beta,
complex_real4 c,
const integer  ldc 
)
inline

References a, alpha, b, beta, c, F77_CGEMM(), k, m, op(), and to_cptr().

◆ gemm() [2/4]

void madness::cblas::gemm ( const CBLAS_TRANSPOSE  OpA,
const CBLAS_TRANSPOSE  OpB,
const integer  m,
const integer  n,
const integer  k,
const complex_real8  alpha,
const complex_real8 a,
const integer  lda,
const complex_real8 b,
const integer  ldb,
const complex_real8  beta,
complex_real8 c,
const integer  ldc 
)
inline

References a, alpha, b, beta, c, F77_ZGEMM(), k, m, op(), and to_zptr().

◆ gemm() [3/4]

void madness::cblas::gemm ( const CBLAS_TRANSPOSE  OpA,
const CBLAS_TRANSPOSE  OpB,
const integer  m,
const integer  n,
const integer  k,
const double  alpha,
const double *  a,
const integer  lda,
const double *  b,
const integer  ldb,
const double  beta,
double *  c,
const integer  ldc 
)
inline

References a, alpha, b, beta, c, ConjTrans, F77_DGEMM(), k, m, MADNESS_ASSERT, and op().

◆ gemm() [4/4]

void madness::cblas::gemm ( const CBLAS_TRANSPOSE  OpA,
const CBLAS_TRANSPOSE  OpB,
const integer  m,
const integer  n,
const integer  k,
const float  alpha,
const float *  a,
const integer  lda,
const float *  b,
const integer  ldb,
const float  beta,
float *  c,
const integer  ldc 
)
inline

Multiplies a matrix by a vector.

\[
 \mathbf{C} \leftarrow \alpha \mathbf{A}^{\mathrm{OpA}} \mathbf{B}^{\mathrm{OpB}} + \beta \mathbf{C}
 \]

Parameters
OpAOperation to be applied to matrix $ \mathbf{A} $
OpBOperation to be applied to matrix $ \mathbf{B} $
mRows in matrix $ \mathbf{C} $
nColumns in matrix $ \mathbf{C} $
kInner dimension size for matrices $ \mathbf{A} $ and $ \mathbf{B} $
alphaScaling factor applied to $ \mathbf{A} $ * $ \mathbf{B} $
aPointer to matrix $ \mathbf{A} $
ldaThe size of the leading-order dimension of matrix $ \mathbf{A} $
bPointer to matrix $ \mathbf{A} $
ldbThe size of the leading-order dimension of matrix $ \mathbf{B} $
betaScaling factor for matrix $ \mathbf{C} $
cPointer to matrix $ \mathbf{C} $
ldcThe size of the leading-order dimension of matrix $ \mathbf{C} $

References a, alpha, b, beta, c, ConjTrans, F77_SGEMM(), k, m, MADNESS_ASSERT, and op().

Referenced by madness::mTxm(), mTxm_dgemm(), madness::mTxmq(), madness::mTxmT(), madness::mxm(), and madness::mxmT().

◆ gemv() [1/4]

void madness::cblas::gemv ( const CBLAS_TRANSPOSE  OpA,
const integer  m,
const integer  n,
const complex_real4  alpha,
const complex_real4 A,
const integer  lda,
const complex_real4 x,
const integer  incx,
const complex_real4  beta,
complex_real4 y,
const integer  incy 
)
inline

References alpha, beta, F77_CGEMV(), m, op(), and to_cptr().

◆ gemv() [2/4]

void madness::cblas::gemv ( const CBLAS_TRANSPOSE  OpA,
const integer  m,
const integer  n,
const complex_real8  alpha,
const complex_real8 A,
const integer  lda,
const complex_real8 x,
const integer  incx,
const complex_real8  beta,
complex_real8 y,
const integer  incy 
)
inline

References alpha, beta, F77_ZGEMV(), m, op(), and to_zptr().

◆ gemv() [3/4]

void madness::cblas::gemv ( const CBLAS_TRANSPOSE  OpA,
const integer  m,
const integer  n,
const double  alpha,
const double *  A,
const integer  lda,
const double *  x,
const integer  incx,
const double  beta,
double *  y,
const integer  incy 
)
inline

◆ gemv() [4/4]

void madness::cblas::gemv ( const CBLAS_TRANSPOSE  OpA,
const integer  m,
const integer  n,
const float  alpha,
const float *  A,
const integer  lda,
const float *  x,
const integer  incx,
const float  beta,
float *  y,
const integer  incy 
)
inline

Multiplies a matrix by a vector.

\[
 \mathbf{y} \leftarrow  \alpha \mathbf{A}^{\mathrm{OpA}} \mathbf{x} + \beta \mathbf{y}
 \]

Parameters
OpAOperation to be applied to matrix $ \mathbf{A} $
mRows in matrix $ \mathbf{A} $
nColumns in matrix $ \mathbf{A} $
alphaScaling factor applied to $ \mathbf{A} $ * $ \mathbf{x} $
APointer to matrix $ \mathbf{A} $
ldaThe size of the leading-order dimension of matrix $ \mathbf{A} $
xPointer to vector $ \mathbf{x} $
incxStride of vector $ \mathbf{x} $
betaScaling factor for vector $ \mathbf{y} $
yPointer to vector $ \mathbf{y} $
incyStride of vector $ \mathbf{y} $

References alpha, beta, ConjTrans, F77_SGEMV(), m, MADNESS_ASSERT, and op().

◆ ger() [1/4]

void madness::cblas::ger ( const integer  m,
const integer  n,
const complex_real4  alpha,
const complex_real4 x,
const integer  incx,
const complex_real4 y,
const integer  incy,
complex_real4 A,
const integer  lda 
)
inline

References alpha, F77_CGER(), and m.

◆ ger() [2/4]

void madness::cblas::ger ( const integer  m,
const integer  n,
const complex_real8  alpha,
const complex_real8 x,
const integer  incx,
const complex_real8 y,
const integer  incy,
complex_real8 A,
const integer  lda 
)
inline

References alpha, F77_ZGER(), and m.

◆ ger() [3/4]

void madness::cblas::ger ( const integer  m,
const integer  n,
const double  alpha,
const double *  x,
const integer  incx,
const double *  y,
const integer  incy,
double *  A,
const integer  lda 
)
inline

References alpha, F77_DGER(), and m.

◆ ger() [4/4]

void madness::cblas::ger ( const integer  m,
const integer  n,
const float  alpha,
const float *  x,
const integer  incx,
const float *  y,
const integer  incy,
float *  A,
const integer  lda 
)
inline

Multiplies vector $ \mathbf{x} $ by the transform of vector $ \mathbf{y} $.

\[
 \mathbf{A} \leftarrow  \alpha \mathbf{x} \mathbf{y}^{\mathrm{T}} + \mathbf{A}
 \]

Parameters
mRows in matrix $ \mathbf{A} $
nColumns in matrix $ \mathbf{A} $
alphaScaling factor applied to $ \mathbf{x} \mathbf{y}^{\mathrm{T}} $
xPointer to vector $ \mathbf{x} $
incxStride of vector $ \mathbf{x} $
yPointer to vector $ \mathbf{y} $
incyStride of vector $ \mathbf{y} $
APointer to matrix $ \mathbf{A} $
ldaThe size of the leading-order dimension of matrix $ \mathbf{A} $

References alpha, F77_SGER(), and m.

◆ scal() [1/6]

void madness::cblas::scal ( const integer  n,
const complex_real4  alpha,
complex_real4 x,
const integer  incx 
)
inline

References alpha, F77_CSCAL(), and to_cptr().

◆ scal() [2/6]

void madness::cblas::scal ( const integer  n,
const complex_real8  alpha,
complex_real8 x,
const integer  incx 
)
inline

References alpha, F77_ZSCAL(), and to_zptr().

◆ scal() [3/6]

void madness::cblas::scal ( const integer  n,
const double  alpha,
complex_real8 x,
const integer  incx 
)
inline

References alpha, F77_ZDSCAL(), and to_zptr().

◆ scal() [4/6]

void madness::cblas::scal ( const integer  n,
const double  alpha,
double *  x,
const integer  incx 
)
inline

References alpha, and F77_DSCAL().

◆ scal() [5/6]

void madness::cblas::scal ( const integer  n,
const float  alpha,
complex_real4 x,
const integer  incx 
)
inline

References alpha, F77_CSSCAL(), and to_cptr().

◆ scal() [6/6]

void madness::cblas::scal ( const integer  n,
const float  alpha,
float *  x,
const integer  incx 
)
inline

Scale a vector.

\[
 \mathbf{x} \leftarrow \alpha \mathbf{x}
 \]

Parameters
nThe size of the vector
alphaThe scaling factor for vector $ \mathbf{x} $
xPointer to vector $ \mathbf{x} $
incxStride for vector $ \mathbf{x} $

References alpha, and F77_SSCAL().

◆ to_cptr() [1/2]

template<typename T >
const blas_complex_float * madness::cblas::to_cptr ( const T ptr)

References blas_complex_float, and T().

Referenced by axpy(), dot(), gemm(), gemv(), scal(), and scal().

◆ to_cptr() [2/2]

template<typename T >
std::enable_if<!std::is_const< T >::value, blas_complex_float * >::type madness::cblas::to_cptr ( T ptr)

References blas_complex_float, and T().

◆ to_zptr() [1/2]

template<typename T >
const blas_complex_double * madness::cblas::to_zptr ( const T ptr)

References blas_complex_double, and T().

Referenced by axpy(), dot(), gemm(), gemv(), scal(), and scal().

◆ to_zptr() [2/2]

template<typename T >
std::enable_if<!std::is_const< T >::value, blas_complex_double * >::type madness::cblas::to_zptr ( T ptr)

References blas_complex_double, and T().