Enumerations
o2scl_cblas Namespace Reference

Namespace for O2scl CBLAS function templates. More...

Enumerations

enum  o2cblas_order { o2cblas_RowMajor =101, o2cblas_ColMajor =102 }
 Matrix order, either column-major or row-major.
 
enum  o2cblas_transpose { o2cblas_NoTrans =111, o2cblas_Trans =112, o2cblas_ConjTrans =113 }
 Transpose operations.
 
enum  o2cblas_uplo { o2cblas_Upper =121, o2cblas_Lower =122 }
 Upper- or lower-triangular.
 
enum  o2cblas_diag { o2cblas_NonUnit =131, o2cblas_Unit =132 }
 Unit or generic diagonal.
 
enum  o2cblas_side { o2cblas_Left =141, o2cblas_Right =142 }
 Left or right sided operation.
 

Detailed Description

These functions are only intended as a fallback for situations where an optimized BLAS is not available.

Level-1 BLAS functions

Some functionality which would otherwise appear here is already given in vector.h.

Level-2 BLAS functions

Currently only dgemv(), dtrmv(), and dtrsv() are implemented.

Level-3 BLAS functions

Currently only dgemm() and dtrsm() are implemented.

Helper BLAS functions

There are several basic BLAS functions which are helpful to operate on only a part of a vector or matrix to ensure that the linear algebra routines are flexible with the types that they can handle.

The subvector functions operate only one set of adjacent vector elements. For a vector defined by with

\[ {\vec x} = \left( \begin{array}{c} x_0 \\ x_1 \\ . \\ . \\ x_{\mathrm{ie}} \\ x_{\mathrm{ie}+1} \\ . \\ . \\ x_{\mathrm{N}-1} \\ x_{\mathrm{N}} \\ x_{\mathrm{N}+1} \\ . \\ . \end{array} \right) \]

the functions with suffix subvec operate only on elements from $ x_{\mathrm{ie}} $ to $ x_{\mathrm{N}-1} $ (inclusive).

The subcolumn functions operate only on a part of a column of a matrix. For a matrix defined by

\[ m = \left( \begin{array}{ccccccc} m_{0,0} & m_{0,1} & . & . & m_{0,\mathrm{ic}} & . & . \\ m_{1,0} & m_{1,1} & . & . & m_{1,\mathrm{ic}} & . & . \\ . & . & . & . & . & . & . \\ . & . & . & . & m_{\mathrm{ir},\mathrm{ic}} & . & . \\ . & . & . & . & m_{\mathrm{ir}+1,\mathrm{ic}} & . & . \\ . & . & . & . & . & . & . \\ . & . & . & . & . & . & . \\ . & . & . & . & m_{\mathrm{N}-1,\mathrm{ic}} & . & . \\ . & . & . & . & m_{\mathrm{N},\mathrm{ic}} & . & . \\ . & . & . & . & m_{\mathrm{N}+1,\mathrm{ic}} & . & . \\ . & . & . & . & . & . & . \\ \end{array} \right) \]

the functions with suffix subcol operate only on elements in the column from $ m_{\mathrm{ir},\mathrm{ic}} $ to $ m_{\mathrm{N}-1,\mathrm{ic}} $ inclusive.

The subrow functions operate only on a part of a row of a matrix. For a matrix defined by

\[ m = \left( \begin{array}{ccccccccccc} m_{0,0} & m_{0,1} & . & . & . & . & . & . & . & . & . \\ m_{1,0} & m_{1,1} & . & . & . & . & . & . & . & . & . \\ . & . & . & . & . & . & . & . & . & . & . \\ . & . & . & . & . & . & . & . & . & . & . \\ m_{\mathrm{ir},0} & . & . & m_{\mathrm{ir},\mathrm{ic}} & m_{\mathrm{ir},\mathrm{ic}+1} & . & . & m_{\mathrm{ir},\mathrm{N}-1} & m_{\mathrm{ir},\mathrm{N}} & m_{\mathrm{ir},\mathrm{N}+1} & . \\ . & . & . & . & . & . & . & . & . & . & . \\ \end{array} \right) \]

the functions with suffix subrow operate only on elements in the column from $ m_{\mathrm{ir},\mathrm{ic}} $ to $ m_{\mathrm{ir},\mathrm{N}-1} $ inclusive.

This namespace is documented inside src/linalg/cblas.h.

Function Documentation

◆ dasum()

template<class vec_t >
double o2scl_cblas::dasum ( const size_t  N,
const vec_t &  X 
)

If alpha is zero, this function returns and performs no computations.

Definition at line 111 of file cblas_base.h.

◆ dasum_subcol()

template<class mat_t >
double o2scl_cblas::dasum_subcol ( mat_t &  A,
const size_t  ir,
const size_t  ic,
const size_t  M 
)

Given the matrix A, define the vector x as the column with index ic. This function computes $ x= \alpha x $ for elements in the vectors x from row ir to row M-1 (inclusive). All other elements in x are not referenced.

Used in householder_transform_subcol().

Definition at line 1437 of file cblas_base.h.

◆ daxpy()

template<class vec_t , class vec2_t >
void o2scl_cblas::daxpy ( const double  alpha,
const size_t  N,
const vec_t &  X,
vec2_t &  Y 
)

If alpha is zero, this function returns and performs no computations.

Definition at line 125 of file cblas_base.h.

◆ daxpy_subcol()

template<class mat_t , class vec_t >
void o2scl_cblas::daxpy_subcol ( const double  alpha,
const size_t  M,
const mat_t &  X,
const size_t  ir,
const size_t  ic,
vec_t &  y 
)

Given the matrix X, define the vector x as the column with index ic. This function computes $ y=\alpha x+y $ for elements in the vectors x and y from row ir to row M-1 (inclusive). All other elements in x and y are not referenced.

Used in householder_hv_sub().

Definition at line 1265 of file cblas_base.h.

◆ daxpy_subrow()

template<class mat_t , class vec_t >
void o2scl_cblas::daxpy_subrow ( const double  alpha,
const size_t  N,
const mat_t &  X,
const size_t  ir,
const size_t  ic,
vec_t &  Y 
)

Given the matrix X, define the vector x as the row with index ir. This function computes $ y=\alpha x+y $ for elements in the vectors x from column ic to column N-1 (inclusive). All other elements in x and y are not referenced.

If ic is greater than N-1 then the error handler will be called if O2SCL_NO_RANGE_CHECK is not defined.

Used in householder_hv_sub().

Definition at line 1483 of file cblas_base.h.

◆ daxpy_subvec()

template<class vec_t , class vec2_t >
void o2scl_cblas::daxpy_subvec ( const double  alpha,
const size_t  N,
const vec_t &  X,
vec2_t &  Y,
const size_t  ie 
)

This function is used in householder_hv().

If alpha is identical with zero or N==ie, this function will perform no calculations and return without calling the error handler.

If ie is greater than N-1 then the error handler will be called if O2SCL_NO_RANGE_CHECK is not defined.

Definition at line 1103 of file cblas_base.h.

◆ ddot_subcol()

template<class mat_t , class vec_t >
double o2scl_cblas::ddot_subcol ( const size_t  M,
const mat_t &  X,
const size_t  ir,
const size_t  ic,
const vec_t &  y 
)

Given the matrix X, define the vector x as the column with index ic. This function computes $ r=x \cdot y $ for elements in the vectors x and y from row ir to row M-1 (inclusive). All other elements in x and y are not referenced.

Used in householder_hv_sub().

Definition at line 1307 of file cblas_base.h.

◆ ddot_subrow()

template<class mat_t , class vec_t >
double o2scl_cblas::ddot_subrow ( const size_t  N,
const mat_t &  X,
const size_t  ir,
const size_t  ic,
const vec_t &  Y 
)

Given the matrix X, define the vector x as the row with index ir. This function computes $ r=x \cdot y $ for elements in the vectors x from column ic to column N-1 (inclusive). All other elements in x and y are not referenced.

If ic is greater than N-1 then the error handler will be called if O2SCL_NO_RANGE_CHECK is not defined.

Used in householder_hv_sub().

Definition at line 1529 of file cblas_base.h.

◆ ddot_subvec()

template<class vec_t , class vec2_t >
double o2scl_cblas::ddot_subvec ( const size_t  N,
const vec_t &  X,
const vec2_t &  Y,
const size_t  ie 
)

This function is used in householder_hv().

If ie is greater than N-1 then the error handler will be called if O2SCL_NO_RANGE_CHECK is not defined.

Definition at line 1140 of file cblas_base.h.

◆ dgemm()

template<class mat_t >
void o2scl_cblas::dgemm ( const enum o2cblas_order  Order,
const enum o2cblas_transpose  TransA,
const enum o2cblas_transpose  TransB,
const size_t  M,
const size_t  N,
const size_t  K,
const double  alpha,
const mat_t &  A,
const mat_t &  B,
const double  beta,
mat_t &  C 
)

When both TransA and TransB are NoTrans, this function operates on the first M rows and K columns of matrix A, and the first K rows and N columns of matrix B to produce a matrix C with M rows and N columns.

This function works for all values of Order, TransA, and TransB.

Definition at line 604 of file cblas_base.h.

◆ dgemv()

template<class mat_t , class vec_t , class vec2_t >
void o2scl_cblas::dgemv ( const enum o2cblas_order  order,
const enum o2cblas_transpose  TransA,
const size_t  M,
const size_t  N,
const double  alpha,
const mat_t &  A,
const vec_t &  X,
const double  beta,
vec2_t &  Y 
)

If M or N is zero, or if alpha is zero and beta is one, this function performs no calculations and returns without calling the error handler.

Definition at line 245 of file cblas_base.h.

◆ dnrm2()

template<class vec_t >
double o2scl_cblas::dnrm2 ( const size_t  N,
const vec_t &  X 
)
Note
The suffix "2" on the function name indicates that this computes the "2-norm", not that the norm is squared.

If N is less than or equal to zero, this function returns zero without calling the error handler.

This function works only with vectors which hold double. For the norm of a general floating point vector, see vector_norm().

Definition at line 183 of file cblas_base.h.

◆ dnrm2_subcol()

template<class mat_t >
double o2scl_cblas::dnrm2_subcol ( const mat_t &  A,
const size_t  ir,
const size_t  ic,
const size_t  M 
)

Given the matrix A, define the vector x as the column with index ic. This function computes the norm of the part of x from row ir to row M-1 (inclusive). All other elements in x are not referenced.

if M is zero, then this function silently returns zero without calling the error handler.

This function is used in householder_transform_subcol().

Note
The suffix "2" on the function name indicates that this computes the "2-norm", not that the norm is squared.

Definition at line 1350 of file cblas_base.h.

◆ dnrm2_subrow()

template<class mat_t >
double o2scl_cblas::dnrm2_subrow ( const mat_t &  M,
const size_t  ir,
const size_t  ic,
const size_t  N 
)

Given the matrix X, define the vector x as the row with index ir. This function computes the norm of the part of x from column ic to column N-1 (inclusive). All other elements in x are not referenced.

Note
The suffix "2" on the function name indicates that this computes the "2-norm", not that the norm is squared.

Definition at line 1568 of file cblas_base.h.

◆ dnrm2_subvec()

template<class vec_t >
double o2scl_cblas::dnrm2_subvec ( const size_t  N,
const vec_t &  X,
const size_t  ie 
)

Used in householder_transform().

Note
The suffix "2" on the function name indicates that this computes the "2-norm", not that the norm is squared.

If ie is greater than N-1 then the error handler will be called if O2SCL_NO_RANGE_CHECK is not defined.

Definition at line 1181 of file cblas_base.h.

◆ dscal_subcol()

template<class mat_t >
void o2scl_cblas::dscal_subcol ( mat_t &  A,
const size_t  ir,
const size_t  ic,
const size_t  M,
const double  alpha 
)

Given the matrix A, define the vector x as the column with index ic. This function computes $ x= \alpha x $ for elements in the vectors x from row ir to row M-1 (inclusive). All other elements in x are not referenced.

Used in householder_transform_subcol().

Definition at line 1399 of file cblas_base.h.

◆ dscal_subrow()

template<class mat_t >
void o2scl_cblas::dscal_subrow ( mat_t &  A,
const size_t  ir,
const size_t  ic,
const size_t  N,
const double  alpha 
)

Given the matrix A, define the vector x as the row with index ir. This function computes $ x = \alpha x $ for elements in the vectors x from column ic to column N-1 (inclusive). All other elements in x and y are not referenced.

If ic is greater than N-1 then the error handler will be called if O2SCL_NO_RANGE_CHECK is not defined.

Definition at line 1611 of file cblas_base.h.

◆ dscal_subvec()

template<class vec_t >
void o2scl_cblas::dscal_subvec ( const double  alpha,
const size_t  N,
vec_t &  X,
const size_t  ie 
)

This function is used in householder_transform().

If ie is greater than N-1 then the error handler will be called if O2SCL_NO_RANGE_CHECK is not defined.

Definition at line 1226 of file cblas_base.h.

◆ dtrsm()

template<class mat_t >
void o2scl_cblas::dtrsm ( const enum o2cblas_order  Order,
const enum o2cblas_side  Side,
const enum o2cblas_uplo  Uplo,
const enum o2cblas_transpose  TransA,
const enum o2cblas_diag  Diag,
const size_t  M,
const size_t  N,
const double  alpha,
const mat_t &  A,
mat_t &  B 
)

This function works for all values of Order, Side, Uplo, TransA, and Diag . The variable Side is Left when A is on the left

This function operates on the first M rows and N columns of the matrix B. If Side is Left, then this function operates on the first M rows and M columns of A. If Side is Right, then this function operates on the first N rows and N columns of A.

Definition at line 815 of file cblas_base.h.

◆ dtrsv()

template<class mat_t , class vec_t >
void o2scl_cblas::dtrsv ( const enum o2cblas_order  order,
const enum o2cblas_uplo  Uplo,
const enum o2cblas_transpose  TransA,
const enum o2cblas_diag  Diag,
const size_t  M,
const size_t  N,
const mat_t &  A,
vec_t &  X 
)

If N is zero, this function does nothing and returns zero.

Definition at line 335 of file cblas_base.h.

◆ matrix_is_finite() [1/2]

template<class mat_t >
bool o2scl_cblas::matrix_is_finite ( mat_t &  data)

If n is zero, this will return true without throwing an exception.

Definition at line 99 of file cblas_base.h.

◆ matrix_is_finite() [2/2]

template<class mat_t >
bool o2scl_cblas::matrix_is_finite ( size_t  m,
size_t  n,
mat_t &  data 
)

If n is zero, this will return true without throwing an exception.

Definition at line 85 of file cblas_base.h.

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).