namespace internal¶
// structs template <typename DT> struct complex_num // classes template < typename DT, unsigned int M_SIZE, unsigned int LOG2_M_SIZE, unsigned int A_SIZE, unsigned int MEM_WIDTH, unsigned int DIM2_SIZE1 = 3, unsigned int DIM2_SIZE2 = 5 > class Solver template < typename DT, unsigned int MEM_WIDTH, unsigned int INDEX_WIDTH, unsigned int A_SIZE, unsigned int M_SIZE, unsigned int LOG2_M_SIZE, unsigned int DIM2_SIZE1 = 3, unsigned int DIM2_SIZE2 = 5 > class StreamWrapper
phi¶
#include "xf_fintech/cf_bsm.hpp"
template <typename DT> DT phi (DT xin)
Approximation to Normal CDF.
This is an implentation of the Abramowitz and Stegun approximation. Refer to https://en.wikipedia.org/wiki/Error_function under the Numerical Approximations section.
Parameters:
DT | Data Type used for this function |
xin | variable |
Returns:
Normal CDF of input variable
V2S¶
#include "xf_fintech/fd_solver.hpp"
unsigned int V2S ( const unsigned int index, const unsigned int m1, const unsigned int m2 )
Get V-inner index from an S ordered vector.
S2V¶
#include "xf_fintech/fd_solver.hpp"
unsigned int S2V ( const unsigned int index, const unsigned int m1, const unsigned int m2 )
Get S-inner index from an V ordered vector.
charFunc¶
#include "xf_fintech/hcf_engine.hpp"
template <typename DT> struct complex_num <DT> charFunc ( struct hcfEngineInputDataType <DT>* in, struct complex_num <DT> w )
function to calculate the characteristic function
Parameters:
in | A structure containing the kerenl model parameters |
w | complex representation of w |
Returns:
the calculated characterisic function value
pi1Integrand¶
#include "xf_fintech/hcf_engine.hpp"
template <typename DT> DT pi1Integrand ( struct hcfEngineInputDataType <DT>* in, DT w )
function to calculate the integrand for pi 1
Parameters:
in | A structure containing the kerenl model parameters |
w | the limit |
Returns:
the calculated integrand value
pi2Integrand¶
#include "xf_fintech/hcf_engine.hpp"
template <typename DT> DT pi2Integrand ( struct hcfEngineInputDataType <DT>* in, DT w )
function to calculate the integrand for pi 2
Parameters:
in | A structure containing the kerenl model parameters |
w | the limit |
Returns:
the calculated integrand value
integrateForPi1¶
#include "xf_fintech/hcf_engine.hpp"
template <typename DT> DT integrateForPi1 (struct hcfEngineInputDataType <DT>* in)
integration function pi 1
Parameters:
in | A structure containing the kerenl model parameters |
Returns:
the calculated value
integrateForPi2¶
#include "xf_fintech/hcf_engine.hpp"
template <typename DT> DT integrateForPi2 (struct hcfEngineInputDataType <DT>* in)
integration function pi 1
Parameters:
in | A structure containing the kerenl model parameters |
Returns:
the calculated value
sum¶
#include "xf_fintech/m76_engine.hpp"
template <typename DT> void sum ( DT* out, DT* in )
Summing loop for the individual BS solutions.
Parameters:
in | An array of the individual solutions |
out | The sum |
TargetDist¶
#include "xf_fintech/pop_mcmc.hpp"
template <typename DT> DT TargetDist ( DT x, DT temp_inv )
Calculates target distribution density for a given sample and temperature. Calculated density is raised to power of temperature of target chain.
Parameters:
DT | data type used in whole function (double by default) |
x |
|
temp_inv |
|
Returns:
Calculated density
GaussTransform¶
#include "xf_fintech/pop_mcmc.hpp"
template <typename DT> DT GaussTransform ( DT in, DT mu, DT sigma )
Calculates final transformation of Gaussian Sample.
Parameters:
DT | Data type used in whole function (double by default) |
in |
|
mu |
|
sigma |
|
Returns:
- Generated Sample
ProbEval¶
#include "xf_fintech/pop_mcmc.hpp"
template < typename DT, unsigned int NCHAINS > void ProbEval ( DT chain_in [NCHAINS], hls::stream <DT>& chain_out, DT gauss [NCHAINS], DT gauss_next [NCHAINS], xf::fintech::MT19937& uniformRNG, DT temp_inv [NCHAINS], DT sigma [NCHAINS] )
Probability evaluation function.
It Generates samples for all chains. Metropolis sampler is used in this function.
Fully pipelined for chains.
During Probability evaluation gauss sample for next sample is generated in parallel,
this allows to save half of the time for probability evaluation.
Part of the dataflow streaming region.
Parameters:
DT | data type used in whole function (double by default) |
NCHAINS | Number of chains |
chain_in |
|
gauss |
|
gauss_next |
|
chain_out |
|
uniformRNG |
|
temp_inv |
|
sigma |
|
ChainExchange¶
#include "xf_fintech/pop_mcmc.hpp"
template < typename DT, unsigned int NCHAINS > void ChainExchange ( hls::stream <DT>& chain_in, DT chain_out [NCHAINS], DT temp_inv [NCHAINS] )
Chain Exchange function.
Calculates exchange ratio and exchanges chains if needed.
Fully pipelined for chains.
Part of the dataflow streaming region.
Parameters:
DT | data type used in whole function (double by default) |
NCHAINS | Number of chains |
chain_in |
|
chain_out |
|
temp_inv |
|
SampleEval¶
#include "xf_fintech/pop_mcmc.hpp"
template < typename DT, unsigned int NCHAINS > void SampleEval ( DT chain [NCHAINS], DT chain_out [NCHAINS], DT gauss [NCHAINS], DT gauss_next [NCHAINS], xf::fintech::MT19937& uniformRNG, DT temp_inv [NCHAINS], DT sigma [NCHAINS] )
Wraping function for dataflow region. /n.
Parameters:
DT | data type used in whole function (double by default) |
NCHAINS | Number of chains |
chain |
|
gauss |
|
gauss_next |
|
chain_out |
|
uniformRNG |
|
temp_inv |
|
sigma |
|