Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
CompositeVectorQuote< Function > Class Template Reference

#include <qle/quotes/compositevectorquote.hpp>

+ Inheritance diagram for CompositeVectorQuote< Function >:
+ Collaboration diagram for CompositeVectorQuote< Function >:

Public Member Functions

 CompositeVectorQuote (std::vector< Handle< Quote > > q, Function f)
 
Real value () const override
 
bool isValid () const override
 
void update () override
 

Protected Attributes

std::vector< Handle< Quote > > q_
 
Function f_
 

Detailed Description

template<typename Function>
class QuantExt::CompositeVectorQuote< Function >

Definition at line 32 of file compositevectorquote.hpp.

Constructor & Destructor Documentation

◆ CompositeVectorQuote()

CompositeVectorQuote ( std::vector< Handle< Quote > >  q,
Function  f 
)

Definition at line 34 of file compositevectorquote.hpp.

34 : q_(std::move(q)), f_(f) {
35 for (auto const& q : q_)
36 registerWith(q);
37 }
std::vector< Handle< Quote > > q_

Member Function Documentation

◆ value()

Real value ( ) const
override

Definition at line 38 of file compositevectorquote.hpp.

38 {
39 std::vector<Real> v(q_.size());
40 std::transform(q_.begin(), q_.end(), v.begin(), [](const Handle<Quote>& q) { return q->value(); });
41 return f_(v);
42 }

◆ isValid()

bool isValid ( ) const
override

Definition at line 43 of file compositevectorquote.hpp.

43 {
44 return std::all_of(q_.begin(), q_.end(), [](const Handle<Quote>& q) { return q->isValid(); });
45 }

◆ update()

void update ( )
override

Definition at line 46 of file compositevectorquote.hpp.

46{ notifyObservers(); }

Member Data Documentation

◆ q_

std::vector<Handle<Quote> > q_
protected

Definition at line 49 of file compositevectorquote.hpp.

◆ f_

Function f_
protected

Definition at line 50 of file compositevectorquote.hpp.