Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MultiPathVariateGeneratorBase Class Referenceabstract

#include <qle/methods/multipathvariategenerator.hpp>

+ Inheritance diagram for MultiPathVariateGeneratorBase:
+ Collaboration diagram for MultiPathVariateGeneratorBase:

Public Member Functions

 MultiPathVariateGeneratorBase (const Size dimension, const Size timeSteps)
 
virtual ~MultiPathVariateGeneratorBase ()
 
virtual Sample< std::vector< Array > > next () const
 
virtual void reset ()=0
 

Protected Member Functions

virtual Sample< std::vector< Real > > nextSequence () const =0
 

Protected Attributes

Size dimension_
 
Size timeSteps_
 

Detailed Description

Definition at line 31 of file multipathvariategenerator.hpp.

Constructor & Destructor Documentation

◆ MultiPathVariateGeneratorBase()

MultiPathVariateGeneratorBase ( const Size  dimension,
const Size  timeSteps 
)

◆ ~MultiPathVariateGeneratorBase()

virtual ~MultiPathVariateGeneratorBase ( )
virtual

Definition at line 34 of file multipathvariategenerator.hpp.

34{}

Member Function Documentation

◆ next()

Sample< std::vector< Array > > next ( ) const
virtual

Reimplemented in MultiPathVariateGeneratorSobolBrownianBridgeBase.

Definition at line 30 of file multipathvariategenerator.cpp.

30 {
31
32 Sample<std::vector<Real>> sequence = nextSequence();
33 Sample<std::vector<Array>> result(std::vector<Array>(timeSteps_, Array(dimension_)), sequence.weight);
34
35 for (Size i = 0; i < timeSteps_; ++i) {
36 Size offset = i * dimension_;
37 std::copy(sequence.value.begin() + offset, sequence.value.begin() + offset + dimension_,
38 result.value[i].begin());
39 }
40
41 return result;
42}
virtual Sample< std::vector< Real > > nextSequence() const =0
+ Here is the call graph for this function:

◆ reset()

virtual void reset ( )
pure virtual

◆ nextSequence()

virtual Sample< std::vector< Real > > nextSequence ( ) const
protectedpure virtual

Member Data Documentation

◆ dimension_

Size dimension_
protected

Definition at line 41 of file multipathvariategenerator.hpp.

◆ timeSteps_

Size timeSteps_
protected

Definition at line 42 of file multipathvariategenerator.hpp.