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. | |
Functions | |
Level-1 BLAS functions | |
template<class vec_t > | |
double | dasum (const size_t N, const vec_t &X) |
Compute the absolute sum of vector elements. More... | |
template<class vec_t , class vec2_t > | |
void | daxpy (const double alpha, const size_t N, const vec_t &X, vec2_t &Y) |
Compute ![]() | |
template<class vec_t , class vec2_t > | |
double | ddot (const size_t N, const vec_t &X, const vec2_t &Y) |
Compute ![]() | |
template<class vec_t > | |
double | dnrm2 (const size_t N, const vec_t &X) |
Compute the norm of the vector X . More... | |
template<class vec_t > | |
void | dscal (const double alpha, const size_t N, vec_t &X) |
Compute ![]() | |
Level-2 BLAS functions | |
template<class mat_t , class vec_t , class vec2_t > | |
void | 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) |
Compute ![]() | |
template<class mat_t , class vec_t > | |
void | 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) |
Compute ![]() | |
template<class mat_t , class vec_t > | |
void | dtrmv (const enum o2cblas_order Order, const enum o2cblas_uplo Uplo, const enum o2cblas_transpose TransA, const enum o2cblas_diag Diag, const size_t N, const mat_t &A, vec_t &x) |
Compute ![]() A . | |
Level-3 BLAS functions | |
template<class mat_t > | |
void | 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) |
Compute ![]() | |
Helper BLAS functions - Subvectors | |
template<class vec_t , class vec2_t > | |
void | daxpy_subvec (const double alpha, const size_t N, const vec_t &X, vec2_t &Y, const size_t ie) |
Compute ![]() ie and ending with index N-1 . More... | |
template<class vec_t , class vec2_t > | |
double | ddot_subvec (const size_t N, const vec_t &X, const vec2_t &Y, const size_t ie) |
Compute ![]() ie and ending with index N-1 . More... | |
template<class vec_t > | |
double | dnrm2_subvec (const size_t N, const vec_t &X, const size_t ie) |
Compute the norm of the vector X beginning with index ie and ending with index N-1 . More... | |
template<class vec_t > | |
void | dscal_subvec (const double alpha, const size_t N, vec_t &X, const size_t ie) |
Compute ![]() ie and ending with index N-1 . More... | |
Helper BLAS functions - Subcolums of a matrix | |
template<class mat_t , class vec_t > | |
void | daxpy_subcol (const double alpha, const size_t M, const mat_t &X, const size_t ir, const size_t ic, vec_t &y) |
Compute ![]() | |
template<class mat_t , class vec_t > | |
double | ddot_subcol (const size_t M, const mat_t &X, const size_t ir, const size_t ic, const vec_t &y) |
Compute ![]() | |
template<class mat_t > | |
double | dnrm2_subcol (const mat_t &A, const size_t ir, const size_t ic, const size_t M) |
Compute the norm of a subcolumn of a matrix. More... | |
template<class mat_t > | |
void | dscal_subcol (mat_t &A, const size_t ir, const size_t ic, const size_t M, const double alpha) |
Compute ![]() | |
template<class mat_t > | |
double | dasum_subcol (mat_t &A, const size_t ir, const size_t ic, const size_t M) |
Compute ![]() | |
Helper BLAS functions - Subrows of a matrix | |
template<class mat_t , class vec_t > | |
void | daxpy_subrow (const double alpha, const size_t N, const mat_t &X, const size_t ir, const size_t ic, vec_t &Y) |
Compute ![]() | |
template<class mat_t , class vec_t > | |
double | ddot_subrow (const size_t N, const mat_t &X, const size_t ir, const size_t ic, const vec_t &Y) |
Compute ![]() | |
template<class mat_t > | |
double | dnrm2_subrow (const mat_t &M, const size_t ir, const size_t ic, const size_t N) |
Compute the norm of a subrow of a matrix. More... | |
template<class mat_t > | |
void | dscal_subrow (mat_t &A, const size_t ir, const size_t ic, const size_t N, const double alpha) |
Compute ![]() | |
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.
dcopy()
is given in vector_copy() except that the ordering is reversed (in vector_copy() the source preceeds the destination in the function argument list).dswap()
is given in vector_swap().idamax()
is given in vector_max_index().Level-2 BLAS functions
Currently only dgemv(), dtrmv(), and dtrsv() are implemented.
Level-3 BLAS functions
Currently only dgemm() is 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
the functions with suffix subvec
operate only on elements from to
(inclusive).
The subcolumn functions operate only on a part of a column of a matrix. For a matrix defined by
the functions with suffix subcol
operate only on elements in the column from to
inclusive.
The subrow functions operate only on a part of a row of a matrix. For a matrix defined by
the functions with suffix subrow
operate only on elements in the column from to
inclusive.
This namespace is documented inside src/linalg/cblas.h
.
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 84 of file cblas_base.h.
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 for elements in the vectors
x
from row ir
to row
(inclusive). All other elements in M-1
x
are not referenced.
Used in householder_transform_subcol().
Definition at line 1131 of file cblas_base.h.
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 98 of file cblas_base.h.
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 for elements in the vectors
x
and y
from row ir
to row
(inclusive). All other elements in M-1
x
and y
are not referenced.
Used in householder_hv_sub().
Definition at line 959 of file cblas_base.h.
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 for elements in the vectors
x
from column ic
to column
(inclusive). All other elements in N-1
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 1177 of file cblas_base.h.
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 797 of file cblas_base.h.
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 for elements in the vectors
x
and y
from row ir
to row
(inclusive). All other elements in M-1
x
and y
are not referenced.
Used in householder_hv_sub().
Definition at line 1001 of file cblas_base.h.
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 for elements in the vectors
x
from column ic
to column
(inclusive). All other elements in N-1
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 1223 of file cblas_base.h.
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 834 of file cblas_base.h.
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 218 of file cblas_base.h.
double o2scl_cblas::dnrm2 | ( | const size_t | N, |
const vec_t & | X | ||
) |
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 156 of file cblas_base.h.
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
(inclusive). All other elements in M-1
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().
Definition at line 1044 of file cblas_base.h.
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
(inclusive). All other elements in N-1
x
are not referenced.
Definition at line 1262 of file cblas_base.h.
double o2scl_cblas::dnrm2_subvec | ( | const size_t | N, |
const vec_t & | X, | ||
const size_t | ie | ||
) |
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 875 of file cblas_base.h.
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 for elements in the vectors
x
from row ir
to row
(inclusive). All other elements in M-1
x
are not referenced.
Used in householder_transform_subcol().
Definition at line 1093 of file cblas_base.h.
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 for elements in the vectors
x
from column ic
to column
(inclusive). All other elements in N-1
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 1305 of file cblas_base.h.
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 920 of file cblas_base.h.
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 308 of file cblas_base.h.
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).