#pragma once

#include "GaussianExpectationLib.h"

#include "../random_process/InterestRateTimeSliceProcess.h"
#include "../random_process/FXTimeSliceProcess.h"

//////////////////////////////////////////////////////////////////////////////////////
// Create spreads to value within a two currency model
//////////////////////////////////////////////////////////////////////////////////////
class SpreadFactory3d 
{
	static void calculate_spread(gelib::d_cube& spread, 
		const std::function<double(size_t, size_t)>& value_func,
		size_t fixed_dim1, size_t fixed_dim2, size_t varied_dim);

public:

	static void calculate_dom_fx_spread(gelib::d_cube& spread, double A, double B, const InterestRateTimeSliceProcess* dom_process, const FXTimeSliceProcess* fx_process, const InterestRateTimeSliceProcess* for_process);

	static void calculate_fgn_fx_spread(gelib::d_cube& spread, double A, double B, const InterestRateTimeSliceProcess* dom_process, const FXTimeSliceProcess* fx_process, const InterestRateTimeSliceProcess* for_process);

	static void calculate_dom_fgn_spread(gelib::d_cube& spread, double A, double B, const InterestRateTimeSliceProcess* dom_process, const FXTimeSliceProcess* fx_process, const InterestRateTimeSliceProcess* for_process);

};