#pragma once
#include "../arrow_debreu/CalibratorTwoCurrency.h"
#include "../../generic/Algorithm.h"
#include "../../2_dimensional/Gaussian2d.h"
#include "../../random_process/InterestRateTimeSliceProcess.h"
#include "../../random_process/FXTimeSliceProcess.h"
#include "UsesHullWhiteJ0.h"

//////////////////////////////////////////////////////////////////////////////////////
// This is a calibrator which calculates Arrow-Debreu prices,
// J0y and J0z are calculated in the general setting
//////////////////////////////////////////////////////////////////////////////////////
class HullWhiteCalibratorADGeneral : public TwoCurrencyArrowDebreuCalibrator, public UsesHullWhiteJ0
{

public:
	// Uncomment to put closed form J0 in place of general J0
				/*
	void calculate_next_J0z(
		TwoCurrencyArrowDebreuCalibrator& next_calibrator,
		const InterestRateTimeSliceProcess* dom_process, const FXTimeSliceProcess* fx_process, const InterestRateTimeSliceProcess* fgn_process,
		InterestRateTimeSliceProcess* next_dom_process, FXTimeSliceProcess* next_fx_process, InterestRateTimeSliceProcess* next_fgn_process,
		SliceProcessCorrelations3d const& next_increment) override;

	void calculate_next_J0y(
		TwoCurrencyArrowDebreuCalibrator& next_calibrator,
		const InterestRateTimeSliceProcess* dom_process, const FXTimeSliceProcess* fx_process, const InterestRateTimeSliceProcess* fgn_process,
		InterestRateTimeSliceProcess* next_dom_process, FXTimeSliceProcess* next_fx_process, InterestRateTimeSliceProcess* next_fgn_process,
		SliceProcessCorrelations3d const& next_increment) override;
			*/
	void calculate_next_spot_values(std::vector<std::unique_ptr<TimeSliceProcess>>& next_processes) override;

	static std::unique_ptr<HullWhiteCalibratorADGeneral> construct();

};
