FdDouglas - 2023.2 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.2 English
#include "xf_fintech/fd_solver.hpp"
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,
    unsigned int DIM2_SIZE2
    >
void FdDouglas (
    DT A [A_SIZE],
    unsigned int Ar [A_SIZE],
    unsigned int Ac [A_SIZE],
    unsigned int Annz,
    DT A1 [M_SIZE][DIM2_SIZE1],
    DT A2 [M_SIZE][DIM2_SIZE2],
    DT X1 [M_SIZE][DIM2_SIZE1],
    DT X2 [M_SIZE][DIM2_SIZE2],
    DT b [M_SIZE],
    DT u0 [M_SIZE],
    unsigned int M1,
    unsigned int M2,
    unsigned int N,
    DT u [M_SIZE]
    )

Top level callable function to perform the Douglas ADI method.

This function creates the solver/stream wrapper objects and connects them up It also provides the extra connectivity for the non-streaming blocks

Parameters:

A Sparse matrix value
Ar Sparse matrix row
Ac Sparse matrix column
Annz Number of non-zeros in sparse matrix (how many elements of A/Ar/Ac are valid)
A1 Tridiagonal matrix stored as three vectors lower/main/upper
A2 Pentadiagonal matrix stored as five vectors lower/lower/main/upper/upper
X1 Tridiagonal matrix stored as three vectors lower/main/upper
X2 Pentadiagonal matrix stored as five vectors lower/lower/main/upper/upper
b Boundary condition vector
u0 Initial condition (payoff condition for a call option)
M1 Size of array [0..M1] in S direction
M2 Size of array [0..M2] in V direction
N Iteration count
u Calculated price grid