QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Matrix used in linear algebra. More...
#include <matrix.hpp>
Related Functions | |
(Note that these are not member functions.) | |
Matrix | operator+ (const Matrix &, const Matrix &) |
Matrix | operator+ (const Matrix &, Matrix &&) |
Matrix | operator+ (Matrix &&, const Matrix &) |
Matrix | operator+ (Matrix &&, Matrix &&) |
Matrix | operator- (const Matrix &) |
Matrix | operator- (Matrix &&) |
Matrix | operator- (const Matrix &, const Matrix &) |
Matrix | operator- (const Matrix &, Matrix &&) |
Matrix | operator- (Matrix &&, const Matrix &) |
Matrix | operator- (Matrix &&, Matrix &&) |
Matrix | operator* (const Matrix &, Real) |
Matrix | operator* (Matrix &&, Real) |
Matrix | operator* (Real, const Matrix &) |
Matrix | operator* (Real, Matrix &&) |
Matrix | operator/ (const Matrix &, Real) |
Matrix | operator/ (Matrix &&, Real) |
Array | operator* (const Array &, const Matrix &) |
Array | operator* (const Matrix &, const Array &) |
Matrix | operator* (const Matrix &, const Matrix &) |
Matrix | transpose (const Matrix &) |
Matrix | outerProduct (const Array &v1, const Array &v2) |
template<class Iterator1 , class Iterator2 > | |
Matrix | outerProduct (Iterator1 v1begin, Iterator1 v1end, Iterator2 v2begin, Iterator2 v2end) |
void | swap (Matrix &, Matrix &) noexcept |
std::ostream & | operator<< (std::ostream &, const Matrix &) |
Matrix | inverse (const Matrix &m) |
Real | determinant (const Matrix &m) |
Matrix | CholeskyDecomposition (const Matrix &m, bool flexible=false) |
Matrix | pseudoSqrt (const Matrix &, SalvagingAlgorithm::Type=SalvagingAlgorithm::None) |
Returns the pseudo square root of a real symmetric matrix. More... | |
Matrix | rankReducedSqrt (const Matrix &, Size maxRank, Real componentRetainedPercentage, SalvagingAlgorithm::Type) |
Returns the rank-reduced pseudo square root of a real symmetric matrix. More... | |
Algebraic operators | |
typedef Real * | iterator |
typedef const Real * | const_iterator |
typedef std::reverse_iterator< iterator > | reverse_iterator |
typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
typedef Real * | row_iterator |
typedef const Real * | const_row_iterator |
typedef std::reverse_iterator< row_iterator > | reverse_row_iterator |
typedef std::reverse_iterator< const_row_iterator > | const_reverse_row_iterator |
typedef step_iterator< iterator > | column_iterator |
typedef step_iterator< const_iterator > | const_column_iterator |
typedef std::reverse_iterator< column_iterator > | reverse_column_iterator |
typedef std::reverse_iterator< const_column_iterator > | const_reverse_column_iterator |
const Matrix & | operator+= (const Matrix &) |
const Matrix & | operator-= (const Matrix &) |
const Matrix & | operator*= (Real) |
const Matrix & | operator/= (Real) |
Utilities | |
std::unique_ptr< Real[]> | data_ |
Size | rows_ = 0 |
Size | columns_ = 0 |
void | swap (Matrix &) noexcept |
Matrix used in linear algebra.
This class implements the concept of Matrix as used in linear algebra. As such, it is not meant to be used as a container.
Definition at line 41 of file matrix.hpp.
Definition at line 81 of file matrix.hpp.
typedef const Real* const_iterator |
Definition at line 82 of file matrix.hpp.
typedef std::reverse_iterator<iterator> reverse_iterator |
Definition at line 83 of file matrix.hpp.
typedef std::reverse_iterator<const_iterator> const_reverse_iterator |
Definition at line 84 of file matrix.hpp.
typedef Real* row_iterator |
Definition at line 85 of file matrix.hpp.
typedef const Real* const_row_iterator |
Definition at line 86 of file matrix.hpp.
typedef std::reverse_iterator<row_iterator> reverse_row_iterator |
Definition at line 87 of file matrix.hpp.
typedef std::reverse_iterator<const_row_iterator> const_reverse_row_iterator |
Definition at line 89 of file matrix.hpp.
typedef step_iterator<iterator> column_iterator |
Definition at line 90 of file matrix.hpp.
Definition at line 91 of file matrix.hpp.
typedef std::reverse_iterator<column_iterator> reverse_column_iterator |
Definition at line 93 of file matrix.hpp.
typedef std::reverse_iterator<const_column_iterator> const_reverse_column_iterator |
Definition at line 95 of file matrix.hpp.
Matrix | ( | ) |
creates a null matrix
Definition at line 222 of file matrix.hpp.
creates a matrix with the given dimensions
Definition at line 224 of file matrix.hpp.
creates the matrix and fills it with value
Definition at line 228 of file matrix.hpp.
creates the matrix and fills it with data from a range.
Definition at line 235 of file matrix.hpp.
|
default |
Definition at line 282 of file matrix.hpp.
Definition at line 297 of file matrix.hpp.
Matrix::const_iterator begin | ( | ) | const |
Matrix::iterator begin | ( | ) |
Definition at line 331 of file matrix.hpp.
Matrix::const_iterator end | ( | ) | const |
Matrix::iterator end | ( | ) |
Definition at line 339 of file matrix.hpp.
Matrix::const_reverse_iterator rbegin | ( | ) | const |
Matrix::reverse_iterator rbegin | ( | ) |
Matrix::const_reverse_iterator rend | ( | ) | const |
Matrix::reverse_iterator rend | ( | ) |
Matrix::const_row_iterator row_begin | ( | Size | i | ) | const |
Matrix::row_iterator row_begin | ( | Size | i | ) |
Definition at line 369 of file matrix.hpp.
Matrix::const_row_iterator row_end | ( | Size | i | ) | const |
Matrix::row_iterator row_end | ( | Size | i | ) |
Definition at line 387 of file matrix.hpp.
Matrix::const_reverse_row_iterator row_rbegin | ( | Size | i | ) | const |
Matrix::reverse_row_iterator row_rbegin | ( | Size | i | ) |
Matrix::const_reverse_row_iterator row_rend | ( | Size | i | ) | const |
Matrix::reverse_row_iterator row_rend | ( | Size | i | ) |
Matrix::const_column_iterator column_begin | ( | Size | i | ) | const |
Matrix::column_iterator column_begin | ( | Size | i | ) |
Definition at line 424 of file matrix.hpp.
Matrix::const_column_iterator column_end | ( | Size | i | ) | const |
Matrix::column_iterator column_end | ( | Size | i | ) |
Definition at line 443 of file matrix.hpp.
Matrix::const_reverse_column_iterator column_rbegin | ( | Size | i | ) | const |
Matrix::reverse_column_iterator column_rbegin | ( | Size | i | ) |
Matrix::const_reverse_column_iterator column_rend | ( | Size | i | ) | const |
Matrix::reverse_column_iterator column_rend | ( | Size | i | ) |
Matrix::const_row_iterator operator[] | ( | Size | i | ) | const |
Matrix::const_row_iterator at | ( | Size | i | ) | const |
Matrix::row_iterator operator[] | ( | Size | i | ) |
Matrix::row_iterator at | ( | Size | i | ) |
Array diagonal | ( | ) | const |
Definition at line 492 of file matrix.hpp.
Size rows | ( | ) | const |
Size columns | ( | ) | const |
bool empty | ( | ) | const |
Size size1 | ( | ) | const |
Size size2 | ( | ) | const |
|
noexcept |
Definition at line 558 of file matrix.hpp.
Definition at line 575 of file matrix.hpp.
Definition at line 614 of file matrix.hpp.
Definition at line 631 of file matrix.hpp.
Definition at line 642 of file matrix.hpp.
Definition at line 653 of file matrix.hpp.
|
related |
Definition at line 732 of file matrix.hpp.
|
related |
|
related |
Returns the pseudo square root of a real symmetric matrix.
Given a matrix \( M \), the result \( S \) is defined as the matrix such that \( S S^T = M. \) If the matrix is not positive semi definite, it can return an approximation of the pseudo square root using a (user selected) salvaging algorithm.
For more information see: R. Rebonato and P. Jäckel, The most general methodology to create a valid correlation matrix for risk management and option pricing purposes, The Journal of Risk, 2(2), Winter 1999/2000. http://www.rebonato.com/correlationmatrix.pdf
Revised and extended in "Monte Carlo Methods in Finance", by Peter Jäckel, Chapter 6.
Definition at line 347 of file pseudosqrt.cpp.
|
related |
Returns the rank-reduced pseudo square root of a real symmetric matrix.
The result matrix has rank<=maxRank. If maxRank>=size, then the specified percentage of eigenvalues out of the eigenvalues' sum is retained.
If the input matrix is not positive semi definite, it can return an approximation of the pseudo square root using a (user selected) salvaging algorithm.
Definition at line 427 of file pseudosqrt.cpp.
|
private |
Definition at line 148 of file matrix.hpp.
|
private |
Definition at line 149 of file matrix.hpp.
|
private |
Definition at line 149 of file matrix.hpp.