Scythe-1.0.3
Classes | Namespaces | Functions
ide.h File Reference

Definitions for inversion and decomposition functions that operate on Scythe's Matrix objects. More...

#include "scythestat/matrix.h"
#include "scythestat/error.h"
#include "scythestat/defs.h"
#include "scythestat/lapack.h"
#include "scythestat/stat.h"
#include <cmath>
#include <algorithm>
#include <complex>
Include dependency graph for ide.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  scythe::QRdecomp
 The result of a QR decomposition. More...
struct  scythe::SVD
 The result of a singular value decomposition. More...
struct  scythe::Eigen
 The result of an eigenvalue/vector decomposition. More...
struct  scythe::GeneralEigen

Namespaces

namespace  scythe
 

The Scythe library namespace.


Functions

template<matrix_order RO, matrix_style RS, typename T , matrix_order PO, matrix_style PS>
Matrix< T, RO, RS > scythe::cholesky (const Matrix< T, PO, PS > &A)
 Cholesky decomposition of a symmetric positive-definite matrix.
template<typename T , matrix_order O, matrix_style S>
Matrix< T, O, Concrete > scythe::cholesky (const Matrix< T, O, S > &A)
template<matrix_order RO, matrix_style RS, typename T , matrix_order PO1, matrix_style PS1, matrix_order PO2, matrix_style PS2, matrix_order PO3, matrix_style PS3>
Matrix< T, RO, RS > scythe::chol_solve (const Matrix< T, PO1, PS1 > &A, const Matrix< T, PO2, PS2 > &b, const Matrix< T, PO3, PS3 > &M)
 Solve $Ax=b$ for x via backward substitution, given a lower triangular matrix resulting from Cholesky decomposition.
template<typename T , matrix_order PO1, matrix_style PS1, matrix_order PO2, matrix_style PS2, matrix_order PO3, matrix_style PS3>
Matrix< T, PO1, Concrete > scythe::chol_solve (const Matrix< T, PO1, PS1 > &A, const Matrix< T, PO2, PS2 > &b, const Matrix< T, PO3, PS3 > &M)
template<matrix_order RO, matrix_style RS, typename T , matrix_order PO1, matrix_style PS1, matrix_order PO2, matrix_style PS2>
Matrix< T, RO, RS > scythe::chol_solve (const Matrix< T, PO1, PS1 > &A, const Matrix< T, PO2, PS2 > &b)
 Solve $Ax=b$ for x via backward substitution, using Cholesky decomposition.
template<typename T , matrix_order PO1, matrix_style PS1, matrix_order PO2, matrix_style PS2>
Matrix< T, PO1, Concrete > scythe::chol_solve (const Matrix< T, PO1, PS1 > &A, const Matrix< T, PO2, PS2 > &b)
template<matrix_order RO, matrix_style RS, typename T , matrix_order PO1, matrix_style PS1, matrix_order PO2, matrix_style PS2>
Matrix< T, RO, RS > scythe::invpd (const Matrix< T, PO1, PS1 > &A, const Matrix< T, PO2, PS2 > &M)
 Calculates the inverse of a symmetric positive definite matrix, given a lower triangular matrix resulting from Cholesky decomposition.
template<typename T , matrix_order PO1, matrix_style PS1, matrix_order PO2, matrix_style PS2>
Matrix< T, PO1, Concrete > scythe::invpd (const Matrix< T, PO1, PS1 > &A, const Matrix< T, PO2, PS2 > &M)
template<matrix_order RO, matrix_style RS, typename T , matrix_order PO, matrix_style PS>
Matrix< T, RO, RS > scythe::invpd (const Matrix< T, PO, PS > &A)
 Calculate the inverse of a symmetric positive definite matrix.
template<typename T , matrix_order O, matrix_style S>
Matrix< T, O, Concrete > scythe::invpd (const Matrix< T, O, S > &A)
template<matrix_order PO1, matrix_style PS1, typename T , matrix_order PO2, matrix_order PO3, matrix_order PO4>
void scythe::lu_decomp (Matrix< T, PO1, PS1 > A, Matrix< T, PO2, Concrete > &L, Matrix< T, PO3, Concrete > &U, Matrix< unsigned int, PO4, Concrete > &perm_vec)
 LU decomposition of a square matrix.
template<matrix_order RO, matrix_style RS, typename T , matrix_order PO1, matrix_style PS1, matrix_order PO2, matrix_style PS2, matrix_order PO3, matrix_style PS3, matrix_order PO4, matrix_style PS4, matrix_order PO5, matrix_style PS5>
Matrix< T, RO, RS > scythe::lu_solve (const Matrix< T, PO1, PS1 > &A, const Matrix< T, PO2, PS2 > &b, const Matrix< T, PO3, PS3 > &L, const Matrix< T, PO4, PS4 > &U, const Matrix< unsigned int, PO5, PS5 > &perm_vec)
 Solve $Ax=b$ for x via forward and backward substitution, given the results of a LU decomposition.
template<typename T , matrix_order PO1, matrix_style PS1, matrix_order PO2, matrix_style PS2, matrix_order PO3, matrix_style PS3, matrix_order PO4, matrix_style PS4, matrix_order PO5, matrix_style PS5>
Matrix< T, PO1, Concrete > scythe::lu_solve (const Matrix< T, PO1, PS1 > &A, const Matrix< T, PO2, PS2 > &b, const Matrix< T, PO3, PS3 > &L, const Matrix< T, PO4, PS4 > &U, const Matrix< unsigned int, PO5, PS5 > &perm_vec)
template<matrix_order RO, matrix_style RS, typename T , matrix_order PO1, matrix_style PS1, matrix_order PO2, matrix_style PS2>
Matrix< T, RO, RS > scythe::lu_solve (Matrix< T, PO1, PS1 > A, const Matrix< T, PO2, PS2 > &b)
 Solve $Ax=b$ for x via forward and backward substitution, using LU decomposition.
template<typename T , matrix_order PO1, matrix_style PS1, matrix_order PO2, matrix_style PS2>
Matrix< T, PO1, Concrete > scythe::lu_solve (Matrix< T, PO1, PS1 > A, const Matrix< T, PO2, PS2 > &b)
template<matrix_order RO, matrix_style RS, typename T , matrix_order PO1, matrix_style PS1, matrix_order PO2, matrix_style PS2, matrix_order PO3, matrix_style PS3, matrix_order PO4, matrix_style PS4>
Matrix< T, RO, RS > scythe::inv (const Matrix< T, PO1, PS1 > &A, const Matrix< T, PO2, PS2 > &L, const Matrix< T, PO3, PS3 > &U, const Matrix< unsigned int, PO4, PS4 > &perm_vec)
 Calculates the inverse of a non-singular square matrix, given an LU decomposition.
template<typename T , matrix_order PO1, matrix_style PS1, matrix_order PO2, matrix_style PS2, matrix_order PO3, matrix_style PS3, matrix_order PO4, matrix_style PS4>
Matrix< T, PO1, Concrete > scythe::inv (const Matrix< T, PO1, PS1 > &A, const Matrix< T, PO2, PS2 > &L, const Matrix< T, PO3, PS3 > &U, const Matrix< unsigned int, PO4, PS4 > &perm_vec)
template<matrix_order RO, matrix_style RS, typename T , matrix_order PO, matrix_style PS>
Matrix< T, RO, RS > scythe::inv (const Matrix< T, PO, PS > &A)
 Invert an arbitrary, non-singular, square matrix.
template<typename T , matrix_order O, matrix_style S>
Matrix< T, O, Concrete > scythe::inv (const Matrix< T, O, S > &A)
template<matrix_order RO, matrix_style RS, typename T , matrix_order PO1, matrix_style PS1, matrix_order PO2, matrix_style PS2>
Matrix< T, RO, RS > scythe::row_interchange (Matrix< T, PO1, PS1 > A, const Matrix< unsigned int, PO2, PS2 > &p)
 Interchange the rows of a Matrix according to a permutation vector.
template<typename T , matrix_order PO1, matrix_style PS1, matrix_order PO2, matrix_style PS2>
Matrix< T, PO1, Concrete > scythe::row_interchange (const Matrix< T, PO1, PS1 > &A, const Matrix< unsigned int, PO2, PS2 > &p)
template<typename T , matrix_order PO, matrix_style PS>
scythe::det (const Matrix< T, PO, PS > &A)
 Calculate the determinant of a square Matrix.
template<>
Matrix scythe::cholesky (const Matrix<> &A)
template<>
Matrix scythe::chol_solve (const Matrix<> &A, const Matrix<> &b, const Matrix<> &M)
template<>
Matrix scythe::chol_solve (const Matrix<> &A, const Matrix<> &b)
template<matrix_order PO2, matrix_order PO3, matrix_order PO4>
double scythe::lu_decomp_alg (Matrix<> &A, Matrix< double, PO2, Concrete > &L, Matrix< double, PO3, Concrete > &U, Matrix< unsigned int, PO4, Concrete > &perm_vec)
QRdecomp scythe::qr_decomp (const Matrix<> &A)
 QR decomposition of a matrix.
Matrix scythe::qr_solve (const Matrix<> &A, const Matrix<> &b, const QRdecomp &QR)
 Solve $Ax=b$ given a QR decomposition.
Matrix scythe::qr_solve (const Matrix<> &A, const Matrix<> &b)
 Solve $Ax=b$ using QR decomposition.
template<>
Matrix scythe::invpd (const Matrix<> &A)
template<>
Matrix scythe::invpd (const Matrix<> &A, const Matrix<> &M)
template<>
Matrix scythe::inv (const Matrix<> &A)
SVD scythe::svd (const Matrix<> &A, int nu=-1, int nv=-1)
 Calculates the singular value decomposition of a matrix, optionally computing the left and right singular vectors.
Eigen scythe::eigen (const Matrix<> &A, bool vectors=true)
 Calculates the eigenvalues and eigenvectors of a symmetric matrix.
GeneralEigen scythe::geneigen (const Matrix<> &A, bool vectors=true)

Detailed Description

Definitions for inversion and decomposition functions that operate on Scythe's Matrix objects.

This file provides a number of common inversion and decomposition routines that operate on Matrix objects. It also provides related functions for solving linear systems of equations and calculating the determinant of a Matrix.

Scythe will use LAPACK/BLAS routines to perform these operations on concrete column-major matrices of double-precision floating point numbers if LAPACK/BLAS is available and you compile your program with the SCYTHE_LAPACK flag enabled.

Note:
As is the case throughout the library, we provide both general and default template definitions of the Matrix-returning functions in this file, explicitly providing documentation for only the general template versions. As is also often the case, Doxygen does not always correctly add the default template definition to the function list below; there is always a default template definition available for every function.