26#ifndef quantlib_tridiagonal_operator_hpp
27#define quantlib_tridiagonal_operator_hpp
155 "out of range in TridiagonalSystem::setMidRow");
164 for (
Size i=1; i<=
n_-2; i++) {
183 std::swap(n_, from.n_);
184 diagonal_.swap(from.diagonal_);
186 upperDiagonal_.swap(from.upperDiagonal_);
187 temp_.swap(from.temp_);
188 timeSetter_.swap(from.timeSetter_);
1-D array used in linear algebra.
1-D array used in linear algebra.
encapsulation of time-setting logic
virtual ~TimeSetter()=default
virtual void setTime(Time t, TridiagonalOperator &L) const =0
Base implementation for tridiagonal operator.
ext::shared_ptr< TimeSetter > timeSetter_
friend TridiagonalOperator operator-(const TridiagonalOperator &)
friend TridiagonalOperator operator+(const TridiagonalOperator &)
const Array & diagonal() const
Array solveFor(const Array &rhs) const
solve linear system for a given right-hand side
void swap(TridiagonalOperator &) noexcept
Array applyTo(const Array &v) const
apply operator to a given array
TridiagonalOperator(Size size=0)
Array SOR(const Array &rhs, Real tol) const
solve linear system with SOR approach
const Array & lowerDiagonal() const
bool isTimeDependent() const
void setLastRow(Real, Real)
void setMidRows(Real, Real, Real)
const Array & upperDiagonal() const
void setFirstRow(Real, Real)
static TridiagonalOperator identity(Size size)
identity instance
friend TridiagonalOperator operator*(Real, const TridiagonalOperator &)
TridiagonalOperator & operator=(const TridiagonalOperator &)
void setMidRow(Size, Real, Real, Real)
friend TridiagonalOperator operator/(const TridiagonalOperator &, Real)
TridiagonalOperator(const TridiagonalOperator &)=default
floating-point comparisons
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container
Quantity operator-(const Quantity &m1, const Quantity &m2)
Quantity operator*(const Quantity &m, Real x)
Quantity operator+(const Quantity &m1, const Quantity &m2)
void swap(Array &v, Array &w) noexcept
Real operator/(const Quantity &m1, const Quantity &m2)
ext::shared_ptr< BlackVolTermStructure > v
Maps shared_ptr to either the boost or std implementation.