#include "xf_fintech/mc_simulation.hpp"
template < typename DT, typename RNG, typename PathGeneratorT, typename PathPricerT, typename RNGSeqT, int UN, int VariateNum, int SampNum > DT mcSimulation ( ap_uint <16> timeSteps, ap_uint <27> maxSamples, ap_uint <27> requiredSamples, DT requiredTolerance, PathGeneratorT pathGenInst [UN][1], PathPricerT pathPriInst [UN][1], RNGSeqT rngSeqInst [UN][1] )
Monte Carlo Framework implementation.
Parameters:
DT | supported data type including double and float data type, which decides the precision of result, default double-precision data type. |
RNG | random number generator type. |
PathGeneratorT | path generator type which simulates the dynamics of the asset price. |
PathPricerT | path pricer type which calcualtes the option price based on asset price. |
RNGSeqT | random number sequence generator type. |
UN | number of Monte Carlo Module in parallel, which affects the latency and resources utilization. |
VariateNum | number of variate. |
SampNum | the total samples are divided into several steps, SampNum is the number for each step. |
timeSteps | number of the steps for each path. |
maxSamples | the maximum sample number. When reaching it, the simulation will stop. |
requiredTolerance | the tolerance required. If requiredSamples is not set, when reaching the required tolerance, simulation will stop. |
requiredSamples | the samples number required. When reaching the required number, simulation will stop. |
pathGenInst | instance of path generator. |
pathPriInst | instance of path pricer. |
rngSeqInst | instance of random number sequence. |