-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEquation.h
34 lines (29 loc) · 955 Bytes
/
Equation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef __EQUATION_H__
#define __EQUATION_H__
#include "Vector.h"
#include "BSDEConfiguration.h"
class Equation
{
public:
Equation() = default;
Equation(const BSDEConfiguration& config);
virtual float f_tf(float t, const Vector<float>& x, float y, const Vector<float>& z) const = 0;
virtual float f_tf_diff_y(float y) const = 0;
virtual float g_tf(float t, const Vector<float>& x) const = 0;
virtual bool XSample() = 0;
virtual bool DwSample() = 0;
const std::vector<std::vector<Vector<float>>>& GetXSample() const;
const std::vector<std::vector<Vector<float>>>& GetDwSample() const;
protected:
size_t dim;
float total_time;
size_t num_sample;
size_t num_time_interval;
float delta_t;
float sqrt_delta_t;
//float y_init;
// size is the number of time intervals
std::vector<std::vector<Vector<float>>> x_sample;
std::vector<std::vector<Vector<float>>> dw_sample;
};
#endif