Linear Algebra¶
Linear algebra contents¶
Linear algebra introduction¶
O₂scl contains a small set of linear algebra routines but is also is designed to be used with Armadillo and/or Eigen, both of which are high performance C++ linear algebra libraries. In the case that O₂scl was compiled with support for either the Armadillo or Eigen libraries, some O₂scl template functions are overloaded with the respective Armadillo or Eigen versions.
The fallback O₂scl linear algebra routines offer a more
generic and flexible interface: they work for almost all vector and
matrix types. For matrix types using operator(,)
, the BLAS and
linear algebra routines routines are inside the o2scl_cblas
and
o2scl_linalg
namespaces. For matrix types using operator[][]
,
the BLAS and linear algebra routines are inside the
o2scl_cblas_bracket
and o2scl_linalg_bracket
namespaces.
The linear algebra classes and functions include:
Householder transformations,
src/linalg/householder.h
Householder solver,
src/linalg/hh.h
LU decomposition and solver,
src/linalg/lu.h
Cholesky decomposition,
src/linalg/cholesky.h
QR decomposition,
src/linalg/qr.h
QR solver,
src/linalg/qrpt.h
Solve tridiagonal systems,
src/linalg/tridiag.h
Givens rotations,
src/linalg/givens.h
Bidiagonalizations,
src/linalg/bidiag.h
Singular value decompositions,
src/linalg/svd.h
Singular value decompositions step,
src/linalg/svdstep.h
Lanczos diagonalization in lanczos which also can compute the eigenvalues of a tridiagonal matrix.
There is also a set of linear solvers for generic matrix and
vector types which descend from linear_solver .
These classes provide GSL-like solvers, but are generalized so
that they are compatible with vector and matrix types which allow
access through operator[]
.
Specializations for Armadillo and Eigen¶
Armadillo and Eigen linear solvers are wrapped to have a consistent
interface with the fallback O₂scl linear solvers. See
o2scl_linalg::linear_solver_arma
,
o2scl_linalg::linear_solver_eigen_houseQR
,
o2scl_linalg::linear_solver_eigen_colQR
,
o2scl_linalg::linear_solver_eigen_fullQR
,
o2scl_linalg::linear_solver_eigen_partLU
,
o2scl_linalg::linear_solver_eigen_fullLU
,
o2scl_linalg::linear_solver_eigen_LLT
, and
o2scl_linalg::linear_solver_eigen_LDLT
.
- Specializations for
o2scl_linalg::QR_decomp_unpack()
are … (see qr.h)
Linear algebra enums¶
-
enum o2scl_cblas::o2cblas_order¶
Matrix order, either column-major or row-major.
Values:
-
enumerator o2cblas_RowMajor¶
-
enumerator o2cblas_ColMajor¶
-
enumerator o2cblas_RowMajor¶
-
enum o2scl_cblas::o2cblas_transpose¶
Transpose operations.
Values:
-
enumerator o2cblas_NoTrans¶
-
enumerator o2cblas_Trans¶
-
enumerator o2cblas_ConjTrans¶
-
enumerator o2cblas_NoTrans¶
-
enum o2scl_cblas::o2cblas_uplo¶
Upper- or lower-triangular.
Values:
-
enumerator o2cblas_Upper¶
-
enumerator o2cblas_Lower¶
-
enumerator o2cblas_Upper¶