### A free/open-source library for quantitative finance

Classes | Public Types | Public Member Functions | Protected Attributes | Friends
TridiagonalOperator Class Reference
Finite-differences framework

Base implementation for tridiagonal operator. More...

`#include <ql/methods/finitedifferences/tridiagonaloperator.hpp>`

Inheritance diagram for TridiagonalOperator:
[legend]

List of all members.

## 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 Disposable< TridiagonalOperator > &)
TridiagonalOperator & | operator= (const Disposable< TridiagonalOperator > &)
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)
Utilities
void | swap (TridiagonalOperator &)

## Protected Attributes

Size | n_
Array | diagonal_
Array | lowerDiagonal_
Array | upperDiagonal_
Array | temp_
boost::shared_ptr< TimeSetter > | timeSetter_

## Friends

Disposable< TridiagonalOperator > | operator+ (const TridiagonalOperator &)
Disposable< TridiagonalOperator > | operator- (const TridiagonalOperator &)
Disposable< TridiagonalOperator > | operator+ (const TridiagonalOperator &, const TridiagonalOperator &)
Disposable< TridiagonalOperator > | operator- (const TridiagonalOperator &, const TridiagonalOperator &)
Disposable< TridiagonalOperator > | operator* (Real, const TridiagonalOperator &)
Disposable< TridiagonalOperator > | operator* (const TridiagonalOperator &, Real)
Disposable< TridiagonalOperator > | operator/ (const TridiagonalOperator &, Real)

## Operator interface

Disposable< Array > | applyTo (const Array &v) const
| apply operator to a given array
Disposable< Array > | solveFor (const Array &rhs) const
| solve linear system for a given right-hand side
void | solveFor (const Array &rhs, Array &result) const
Disposable< Array > | SOR (const Array &rhs, Real tol) const
| solve linear system with SOR approach
static Disposable < TridiagonalOperator > | identity (Size size)
| identity instance

## Detailed Description

Base implementation for tridiagonal operator.

Warning:
  to use real time-dependant algebra, you must overload the corresponding operators in the inheriting time-dependent class.

## Member Function Documentation

void solveFor | ( | const Array & | rhs,
|  | Array & | result
| ) |  | const

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