QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
ConvexMonotoneImpl< I1, I2 > Class Template Reference

#include <convexmonotoneinterpolation.hpp>

+ Inheritance diagram for ConvexMonotoneImpl< I1, I2 >:
+ Collaboration diagram for ConvexMonotoneImpl< I1, I2 >:

Public Types

enum  SectionType { EverywhereConstant , ConstantGradient , QuadraticMinimum , QuadraticMaximum }
 

Public Member Functions

 ConvexMonotoneImpl (const I1 &xBegin, const I1 &xEnd, const I2 &yBegin, Real quadraticity, Real monotonicity, bool forcePositive, bool constantLastPeriod, const helper_map &preExistingHelpers)
 
void update () override
 
Real value (Real x) const override
 
Real primitive (Real x) const override
 
Real derivative (Real) const override
 
Real secondDerivative (Real) const override
 
helper_map getExistingHelpers ()
 
- Public Member Functions inherited from Interpolation::templateImpl< I1, I2 >
 templateImpl (const I1 &xBegin, const I1 &xEnd, const I2 &yBegin, const int requiredPoints=2)
 
Real xMin () const override
 
Real xMax () const override
 
std::vector< RealxValues () const override
 
std::vector< RealyValues () const override
 
bool isInRange (Real x) const override
 
- Public Member Functions inherited from Interpolation::Impl
virtual ~Impl ()=default
 
virtual void update ()=0
 
virtual Real xMin () const =0
 
virtual Real xMax () const =0
 
virtual std::vector< RealxValues () const =0
 
virtual std::vector< RealyValues () const =0
 
virtual bool isInRange (Real) const =0
 
virtual Real value (Real) const =0
 
virtual Real primitive (Real) const =0
 
virtual Real derivative (Real) const =0
 
virtual Real secondDerivative (Real) const =0
 

Private Types

typedef std::map< Real, ext::shared_ptr< SectionHelper > > helper_map
 

Private Attributes

helper_map sectionHelpers_
 
helper_map preSectionHelpers_
 
ext::shared_ptr< SectionHelperextrapolationHelper_
 
bool forcePositive_
 
bool constantLastPeriod_
 
Real quadraticity_
 
Real monotonicity_
 
Size length_
 

Additional Inherited Members

- Protected Member Functions inherited from Interpolation::templateImpl< I1, I2 >
Size locate (Real x) const
 
- Protected Attributes inherited from Interpolation::templateImpl< I1, I2 >
I1 xBegin_
 
I1 xEnd_
 
I2 yBegin_
 

Detailed Description

template<class I1, class I2>
class QuantLib::detail::ConvexMonotoneImpl< I1, I2 >

Definition at line 174 of file convexmonotoneinterpolation.hpp.

Member Typedef Documentation

◆ helper_map

typedef std::map<Real, ext::shared_ptr<SectionHelper> > helper_map
private

Definition at line 176 of file convexmonotoneinterpolation.hpp.

Member Enumeration Documentation

◆ SectionType

Enumerator
EverywhereConstant 
ConstantGradient 
QuadraticMinimum 
QuadraticMaximum 

Definition at line 178 of file convexmonotoneinterpolation.hpp.

Constructor & Destructor Documentation

◆ ConvexMonotoneImpl()

ConvexMonotoneImpl ( const I1 &  xBegin,
const I1 &  xEnd,
const I2 &  yBegin,
Real  quadraticity,
Real  monotonicity,
bool  forcePositive,
bool  constantLastPeriod,
const helper_map preExistingHelpers 
)

Definition at line 185 of file convexmonotoneinterpolation.hpp.

Member Function Documentation

◆ update()

void update
overridevirtual

Implements Interpolation::Impl.

Definition at line 588 of file convexmonotoneinterpolation.hpp.

◆ value()

Real value ( Real  x) const
overridevirtual

Implements Interpolation::Impl.

Definition at line 833 of file convexmonotoneinterpolation.hpp.

◆ primitive()

Real primitive ( Real  x) const
overridevirtual

Implements Interpolation::Impl.

Definition at line 842 of file convexmonotoneinterpolation.hpp.

◆ derivative()

Real derivative ( Real  ) const
overridevirtual

Implements Interpolation::Impl.

Definition at line 216 of file convexmonotoneinterpolation.hpp.

◆ secondDerivative()

Real secondDerivative ( Real  ) const
overridevirtual

Implements Interpolation::Impl.

Definition at line 219 of file convexmonotoneinterpolation.hpp.

◆ getExistingHelpers()

helper_map getExistingHelpers ( )

Definition at line 224 of file convexmonotoneinterpolation.hpp.

Member Data Documentation

◆ sectionHelpers_

helper_map sectionHelpers_
private

Definition at line 231 of file convexmonotoneinterpolation.hpp.

◆ preSectionHelpers_

helper_map preSectionHelpers_
private

Definition at line 232 of file convexmonotoneinterpolation.hpp.

◆ extrapolationHelper_

ext::shared_ptr<SectionHelper> extrapolationHelper_
private

Definition at line 233 of file convexmonotoneinterpolation.hpp.

◆ forcePositive_

bool forcePositive_
private

Definition at line 234 of file convexmonotoneinterpolation.hpp.

◆ constantLastPeriod_

bool constantLastPeriod_
private

Definition at line 234 of file convexmonotoneinterpolation.hpp.

◆ quadraticity_

Real quadraticity_
private

Definition at line 235 of file convexmonotoneinterpolation.hpp.

◆ monotonicity_

Real monotonicity_
private

Definition at line 236 of file convexmonotoneinterpolation.hpp.

◆ length_

Size length_
private

Definition at line 237 of file convexmonotoneinterpolation.hpp.