QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Base implementation for tridiagonal operator. More...
#include <tridiagonaloperator.hpp>
Classes | |
class | TimeSetter |
encapsulation of time-setting logic More... | |
Public Types | |
typedef Array | array_type |
Public Member Functions | |
TridiagonalOperator (Size size=0) | |
TridiagonalOperator (const Array &low, const Array &mid, const Array &high) | |
TridiagonalOperator (const TridiagonalOperator &)=default | |
TridiagonalOperator (TridiagonalOperator &&) noexcept | |
TridiagonalOperator & | operator= (const TridiagonalOperator &) |
TridiagonalOperator & | operator= (TridiagonalOperator &&) noexcept |
~TridiagonalOperator ()=default | |
Inspectors | |
Size | size () const |
bool | isTimeDependent () const |
const Array & | lowerDiagonal () const |
const Array & | diagonal () const |
const Array & | upperDiagonal () const |
Modifiers | |
void | setFirstRow (Real, Real) |
void | setMidRow (Size, Real, Real, Real) |
void | setMidRows (Real, Real, Real) |
void | setLastRow (Real, Real) |
void | setTime (Time t) |
Friends | |
TridiagonalOperator | operator+ (const TridiagonalOperator &) |
TridiagonalOperator | operator- (const TridiagonalOperator &) |
TridiagonalOperator | operator+ (const TridiagonalOperator &, const TridiagonalOperator &) |
TridiagonalOperator | operator- (const TridiagonalOperator &, const TridiagonalOperator &) |
TridiagonalOperator | operator* (Real, const TridiagonalOperator &) |
TridiagonalOperator | operator* (const TridiagonalOperator &, Real) |
TridiagonalOperator | operator/ (const TridiagonalOperator &, Real) |
Utilities | |
Size | n_ |
Array | diagonal_ |
Array | lowerDiagonal_ |
Array | upperDiagonal_ |
Array | temp_ |
ext::shared_ptr< TimeSetter > | timeSetter_ |
void | swap (TridiagonalOperator &) noexcept |
Operator interface | |
Array | applyTo (const Array &v) const |
apply operator to a given array More... | |
Array | solveFor (const Array &rhs) const |
solve linear system for a given right-hand side More... | |
void | solveFor (const Array &rhs, Array &result) const |
Array | SOR (const Array &rhs, Real tol) const |
solve linear system with SOR approach More... | |
static TridiagonalOperator | identity (Size size) |
identity instance More... | |
Base implementation for tridiagonal operator.
Definition at line 42 of file tridiagonaloperator.hpp.
typedef Array array_type |
Definition at line 58 of file tridiagonaloperator.hpp.
|
explicit |
TridiagonalOperator | ( | const Array & | low, |
const Array & | mid, | ||
const Array & | high | ||
) |
|
default |
|
noexcept |
|
default |
TridiagonalOperator & operator= | ( | const TridiagonalOperator & | from | ) |
|
noexcept |
apply operator to a given array
Definition at line 57 of file tridiagonaloperator.cpp.
solve linear system for a given right-hand side
Definition at line 79 of file tridiagonaloperator.cpp.
solve linear system for a given right-hand side without result Array allocation. The rhs and result parameters can be the same Array, in which case rhs will be changed
Definition at line 85 of file tridiagonaloperator.cpp.
solve linear system with SOR approach
Definition at line 111 of file tridiagonaloperator.cpp.
|
static |
identity instance
Definition at line 156 of file tridiagonaloperator.cpp.
Size size | ( | ) | const |
bool isTimeDependent | ( | ) | const |
Definition at line 90 of file tridiagonaloperator.hpp.
const Array & lowerDiagonal | ( | ) | const |
const Array & diagonal | ( | ) | const |
const Array & upperDiagonal | ( | ) | const |
void setTime | ( | Time | t | ) |
|
noexcept |
|
friend |
Definition at line 194 of file tridiagonaloperator.hpp.
|
friend |
Definition at line 199 of file tridiagonaloperator.hpp.
|
friend |
Definition at line 207 of file tridiagonaloperator.hpp.
|
friend |
Definition at line 216 of file tridiagonaloperator.hpp.
|
friend |
Definition at line 225 of file tridiagonaloperator.hpp.
|
friend |
Definition at line 234 of file tridiagonaloperator.hpp.
|
friend |
Definition at line 243 of file tridiagonaloperator.hpp.
|
protected |
Definition at line 115 of file tridiagonaloperator.hpp.
|
protected |
Definition at line 116 of file tridiagonaloperator.hpp.
|
protected |
Definition at line 116 of file tridiagonaloperator.hpp.
|
protected |
Definition at line 116 of file tridiagonaloperator.hpp.
|
mutableprotected |
Definition at line 117 of file tridiagonaloperator.hpp.
|
protected |
Definition at line 118 of file tridiagonaloperator.hpp.