#include "xf_fintech/lmm_engine.hpp"
template < typename DT, typename PT, unsigned MAX_TENORS, unsigned NF, unsigned UN = 5, unsigned PCA_NCU = 2 > void lmmEngine ( unsigned noTenors, unsigned noPaths, hls::stream <DT>& rho, DT presentFc [MAX_TENORS], hls::stream <DT>& sigma, PT pricer [UN][1], ap_uint <32> seeds [UN], DT* outputPrice )
Prepares and runs a Monte-Carlo simulation and pricing for the LIBOR Market Model framework from a given correlation and volatility matrix.
Parameters:
DT | The data type of the internal simulation. |
PT | The class name for the LMM pricer. |
NF | Number of factors to use in the internal LMM Monte-Carlo simulation. |
UN | Unroll number for path generators and pricers. It will determine the parallelism level of the simulation. |
PCA_NCU | Unroll number for the dimensionality reduction of the correlation matrix stage. |
noTenors | Number of tenors to simulate. It must be <= MAX_TENORS |
noPaths | Number of MonteCarlo paths to generate. It will determine the accuracy of the final price. |
rho | Stream with generated correlation matrix between tenors. |
presentFc | Current LIBOR rates for this tenor structure. |
sigma | Stream with lower triangular calibrated volatilities matrix. |
pricer | UN instances of the selected path pricer. Must be of PT class and implement the correct MC path pricer method interface. |
seeds | Seeds for the RNGs in the simulation. There are UN RNGs in total. |
outputPrice | Calculated LMM MonteCarlo price with the selected pricer. |