Collaboration diagram for C-style interface to BLAS:
![]() |
Defines | |
#define | Macro_SVM(T) bool ScalarVectorMultiply( const T &scalar, dataview_interface<T> &vec ) |
A parameterized macro for declaring ScalarVectorMultiply(...). | |
#define | Macro_VC(T) bool VectorCopy( dataview_interface<T> &dest, const dataview_interface<T> &src ) |
A parameterized macro for declaring VectorCopy(...). | |
#define | Macro_VSA(T) bool VectorScaleAdd( dataview_interface<T> &dest, const dataview_interface<T> &src, const T &scalar ) |
A parameterized macro for declaring VectorScaleAdd(...). | |
#define | Macro_VVD(T) T VectorVectorDot( const dataview_interface<T> &v1, const dataview_interface<T> &v2 ) |
A parameterized macro for declaring VectorVectorDot(...). | |
#define | Macro_VVCD(T) T VectorVectorConjugateDot( const dataview_interface<T> &conjv, const dataview_interface<T> ®v ) |
A parameterized macro for declaring VectorVectorConjugateDot(...). | |
#define | Macro_VN(T) double VectorNorm( const dataview_interface<T> &v ) |
A parameterized macro for declaring VectorNorm(...). | |
#define | Macro_SMM(T) bool ScalarMatrixMultiply( const T &scalar, dataview_interface<T> &mat ) |
A parameterized macro for declaring ScalarMatrixMultiply(...). | |
#define | Macro_MC(T) bool MatrixCopy( dataview_interface<T> &dest, const dataview_interface<T> &src ) |
A parameterized macro for declaring MatrixCopy(...). | |
#define | Macro_MSA(T) bool MatrixScaleAdd( dataview_interface<T> &dest, const dataview_interface<T> &src, const T &scalar ) |
A parameterized macro for declaring MatrixScaleAdd(...). | |
#define | Macro_MMD(T) T MatrixMatrixDot( const dataview_interface<T> &m1, const dataview_interface<T> &m2 ) |
A parameterized macro for declaring MatrixMatrixDot(...). | |
#define | Macro_MMCD(T) T MatrixMatrixConjugateDot( const dataview_interface<T> &m1, const dataview_interface<T> &m2 ) |
A parameterized macro for declaring MatrixMatrixConjugateDot(...). | |
#define | Macro_MN(T) double MatrixNorm( const dataview_interface<T> &m ) |
A parameterized macro for declaring MatrixNorm(...). | |
#define | Macro_MVMA(T) |
A parameterized macro for declaring MatrixVectorMultiplyAdd(...). | |
#define | Macro_VVMA(T) |
A parameterized macro for declaring VectorVectorMultiplyAdd(...). | |
#define | Macro_VVCMA(T) |
A parameterized macro for declaring VectorVectorConjugateMultiplyAdd(...). | |
#define | Macro_MMMA(T) |
A parameterized macro for declaring MatrixMatrixMultiplyAdd(...). | |
Functions | |
template<class T> | |
bool | Are1DCompatible (const dataview_interface< T > &obj1, const dataview_interface< T > &obj2) |
Returns true if and only if both arguments are 1D compatible. | |
template<class T> | |
bool | Are1DCompatible (const dataview_interface< T > &obj1, const dataview_interface< T > &obj2, const dataview_interface< T > &obj3) |
Returns true if and only if all three arguments are 1D compatible. | |
template<class T> | |
bool | Are2DCompatible (const dataview_interface< T > &obj1, const dataview_interface< T > &obj2) |
Returns true if and only if both arguments are 2D compatible. | |
template<class T> | |
bool | Are2DCompatible (const dataview_interface< T > &obj1, const dataview_interface< T > &obj2, const dataview_interface< T > &obj3) |
Returns true if and only if all three arguments are 2D compatible. | |
template<class T> | |
bool | AreBLASCompatible (const dataview_interface< T > &obj1, const dataview_interface< T > &obj2) |
Returns true if and only if both arguments are 1D compatible OR both are 2D compatible. | |
template<class T> | |
bool | AreBLASCompatible (const dataview_interface< T > &obj1, const dataview_interface< T > &obj2, const dataview_interface< T > &obj3) |
Returns true if and only if all three arguments are 1D compatible OR all three are 2D compatible. | |
bool | ScalarVectorMultiply (const double &scalar, dataview_interface< double > &vec) |
Multiply a double vector by a double scalar (BLAS routine DSCAL()). | |
bool | ScalarVectorMultiply (const std::complex< double > &scalar, dataview_interface< std::complex< double > > &vec) |
Multiply a complex vector by a complex scalar (BLAS routine ZSCAL()). | |
bool | VectorCopy (dataview_interface< double > &dest, const dataview_interface< double > &src) |
Copy one double vector into another (BLAS routine DCOPY()). | |
bool | VectorCopy (dataview_interface< std::complex< double > > &dest, const dataview_interface< std::complex< double > > &src) |
Copy one complex vector into another (BLAS routine ZCOPY()). | |
bool | VectorScaleAdd (dataview_interface< double > &dest, const dataview_interface< double > &src, const double &scalar) |
Add a scalar double multiple of one double vector to another (BLAS routine DAXPY()). | |
bool | VectorScaleAdd (dataview_interface< std::complex< double > > &dest, const dataview_interface< std::complex< double > > &src, const std::complex< double > &scalar) |
Add a scalar complex multiple of one complex vector to another (BLAS routine ZAXPY()). | |
double | VectorVectorDot (const dataview_interface< double > &v1, const dataview_interface< double > &v2) |
Compute the dot product of two vectors of double (BLAS routine DDOT()). | |
std::complex< double > | VectorVectorDot (const dataview_interface< std::complex< double > > &v1, const dataview_interface< std::complex< double > > &v2) |
Compute the dot product of two vectors of complex (BLAS routine ZDOTU_SUB()). | |
std::complex< double > | VectorVectorConjugateDot (const dataview_interface< std::complex< double > > &conjv, const dataview_interface< std::complex< double > > ®v) |
Compute the conjugate dot product of two vectors of complex (BLAS routine ZDOTC_SUB()). | |
double | VectorNorm (const dataview_interface< double > &v) |
Compute the squared 2-norm of a vector of double (BLAS routine DNRM2()). | |
double | VectorNorm (const dataview_interface< std::complex< double > > &v) |
Compute the squared 2-norm of a vector of complex (BLAS routine DZNRM2()). | |
bool | ScalarMatrixMultiply (const double &scalar, dataview_interface< double > &mat) |
Multiply a double matrix by a double scalar (multiple calls to BLAS routine DSCAL()). | |
bool | ScalarMatrixMultiply (const std::complex< double > &scalar, dataview_interface< std::complex< double > > &mat) |
Multiply a complex matrix by a complex scalar (multiple calls to BLAS routine ZSCAL()). | |
bool | MatrixCopy (dataview_interface< double > &dest, const dataview_interface< double > &src) |
Copy one double matrix to another (multiple calls to BLAS routine DCOPY()). | |
bool | MatrixCopy (dataview_interface< std::complex< double > > &dest, const dataview_interface< std::complex< double > > &src) |
Copy one complex matrix to another (multiple calls to BLAS routine ZCOPY()). | |
bool | MatrixScaleAdd (dataview_interface< double > &dest, const dataview_interface< double > &src, const double &scalar) |
Add a scalar double multiple of one double matrix to another (multiple calls to BLAS routine DAXPY()). | |
bool | MatrixScaleAdd (dataview_interface< std::complex< double > > &dest, const dataview_interface< std::complex< double > > &src, const std::complex< double > &scalar) |
Add a scalar complex multiple of one complex matrix to another (multiple calls to BLAS routine ZAXPY()). | |
double | MatrixMatrixDot (const dataview_interface< double > &m1, const dataview_interface< double > &m2) |
Compute the dot product of two matrices of double (multiple calls to BLAS routine DDOT()). | |
std::complex< double > | MatrixMatrixDot (const dataview_interface< std::complex< double > > &m1, const dataview_interface< std::complex< double > > &m2) |
Compute the dot product of two matrices of complex (multiple calls to BLAS routine ZDOTC_SUB()). | |
std::complex< double > | MatrixMatrixConjugateDot (const dataview_interface< std::complex< double > > &m1, const dataview_interface< std::complex< double > > &m2) |
Compute the conjugate dot product of two matrices of complex (multiple calls to BLAS routine ZDOTC_SUB()). | |
double | MatrixNorm (const dataview_interface< double > &m) |
Compute the squared 2-norm of a matrix of double (multiple calls to BLAS routine DNRM2()). | |
double | MatrixNorm (const dataview_interface< std::complex< double > > &m) |
Compute the squared 2-norm of a matrix of complex (multiple calls to BLAS routine DZNRM2()). | |
bool | MatrixVectorMultiplyAdd (dataview_interface< double > &accumulator_v, const double &accumulator_scalar, const dataview_interface< double > &mat, const dataview_interface< double > &vec, const double &multiplication_scalar, bool VectorOnLeft) |
Multiply a double vector by a double matrix on either the left or the right, and add a double scalar multiple of the result to a double scalar multiple of another vector (BLAS routine DGEMV()). | |
bool | MatrixVectorMultiplyAdd (dataview_interface< std::complex< double > > &accumulator_v, const std::complex< double > &accumulator_scalar, const dataview_interface< std::complex< double > > &mat, const dataview_interface< std::complex< double > > &vec, const std::complex< double > &multiplication_scalar, bool VectorOnLeft) |
Multiply a complex vector by a complex matrix on either the left or the right, and add a complex scalar multiple of the result to a complex scalar multiple of another vector (BLAS routine ZGEMV()). | |
bool | VectorVectorMultiplyAdd (dataview_interface< double > &accumulator_m, const dataview_interface< double > &colvec, const dataview_interface< double > &rowvec, const double &scalar) |
Add a scalar double multiple of the outer product of two double vectors to another vector (BLAS routine DGER). | |
bool | VectorVectorMultiplyAdd (dataview_interface< std::complex< double > > &accumulator_m, const dataview_interface< std::complex< double > > &colvec, const dataview_interface< std::complex< double > > &rowvec, const std::complex< double > &scalar) |
Add a scalar complex multiple of the outer product of two complex vectors to another vector (BLAS routine ZGERU). | |
bool | VectorVectorConjugateMultiplyAdd (dataview_interface< std::complex< double > > &accumulator_m, const dataview_interface< std::complex< double > > &colvec, const dataview_interface< std::complex< double > > &rowvec, const std::complex< double > &scalar) |
Add a scalar complex multiple of the adjoint outer product of two complex vectors to another vector (BLAS routine ZGERC). | |
bool | MatrixMatrixMultiplyAdd (dataview_interface< double > &accumulator_m, const double &accumulator_scalar, const dataview_interface< double > &mat1, const dataview_interface< double > &mat2, const double &multiplication_scalar) |
Add a scalar double multiple of the product of two double matrices to another double matrix (BLAS routine DGEMM). | |
bool | MatrixMatrixMultiplyAdd (dataview_interface< std::complex< double > > &accumulator_m, const std::complex< double > &accumulator_scalar, const dataview_interface< std::complex< double > > &mat1, const dataview_interface< std::complex< double > > &mat2, const std::complex< double > &multiplication_scalar) |
Add a scalar complex multiple of the product of two complex matrices to another complex matrix (BLAS routine ZGEMM). |
We use BLAS to do basic dense linalg, when possible. The LinAlg library defines relatively slow, straightforward C/C++ algorithms, but BLAS is reliably optimized. However, BLAS only accepts certain data formats. There is no way to use BLAS on integers, quaternions, or arbitrary-precision numbers. BLAS also cannot deal with datasets that are nontrivial slices of other sets. Therefore, we need to:
The first task is accomplished by dataview_interface<T>::Is1DCompatible() and dataview_interface<T>::Is2DCompatible. Multiple objects can be tested for compatibility using the Are1DCompatible(), Are2DCompatible, and AreBLASCompatible() methods in this file. Note that AreBLASCompatible() returns TRUE either if (a) all its arguments are 1D compatible, or (b) all its arguments are 2D compatible.
The second task is accomplished by a set of methods for Level 1 BLAS:
And a set of templated methods for Level 2/3 BLAS:
Each of these routines checks to make sure that its arguments are compatible with BLAS, and that they are compatible with each other. It then calls the appropriate BLAS method.
Important Notes:
T
is actually expanded as an explicit type. Only the double
and std::complex<double>
versions are actually declared. If necessary, float
and std::complex<float>
could be added at a future time; no other types are available in BLAS.
|
Value: bool MatrixVectorMultiplyAdd( dataview_interface<T> &accumulator_v, const T& accumulator_scalar, \ const dataview_interface<T> &mat, const dataview_interface<T> &vec, \ const T& multiplication_scalar, bool VectorOnLeft )
|
|
Value: bool VectorVectorMultiplyAdd( dataview_interface<T> &accumulator_m, const dataview_interface<T> &colvec, \ const dataview_interface<T> &rowvec, const T& scalar )
|
|
Value: bool VectorVectorConjugateMultiplyAdd( dataview_interface<T> &accumulator_m, const dataview_interface<T> &colvec, \ const dataview_interface<T> &rowvec, const T& scalar )
|
|
Value: bool MatrixMatrixMultiplyAdd( dataview_interface<T> &accumulator_m, const T& accumulator_scalar, \ const dataview_interface<T> &mat1, const dataview_interface<T> &mat2, \ const T& multiplication_scalar )
|