#include "../ExcelDoNotEdit/excel_addin_utils.h"
#include "../Adapter.h"
#include "../../two_currency_model/hull_white/HullWhiteMFMTwoCurrency.h"
#include "../../two_currency_model/hull_white/HullWhiteCalibratorAD.h"
#include "../../two_currency_model/hull_white/HullWhiteAllGeneralCalibrator.h"
#include "../../two_currency_model/hull_white/HullWhiteCalibrator.h"

namespace HullWhiteModelTests
{
	using d_vector = excel_adapter::d_vector;
	using d_matrix = excel_adapter::d_matrix;


	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	//
	//  CALCULATE SPREADS WITH HULL WHITE METHOD AND NO ARROW DEBREU PRICES
	//
	//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	void HullWhiteModelGetGridpoints(d_matrix* output, int* gridpoints_per_slice, double* sd_spread, int* poly_order, d_vector* times, double* t1_discount_domestic, double* t1_discount_foreign, d_vector* accrual_factors_domestic, d_vector* accrual_factors_foreign, d_vector* forward_libors_domestic, d_vector* forward_libors_foreign, d_vector* C_xstarxstar, d_vector* C_ystarystar, d_vector* C_zstarzstar, d_vector* C_xstarystar, d_vector* C_xstarzstar, d_vector* C_ystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_variance, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* which_process);

	bool HullWhiteModelGetGridpointsCheck(XLOPER12* exception_output, int* gridpoints_per_slice, double* sd_spread, int* poly_order, d_vector* times, double* t1_discount_domestic, double* t1_discount_foreign, d_vector* accrual_factors_domestic, d_vector* accrual_factors_foreign, d_vector* forward_libors_domestic, d_vector* forward_libors_foreign, d_vector* C_xstarxstar, d_vector* C_ystarystar, d_vector* C_zstarzstar, d_vector* C_xstarystar, d_vector* C_xstarzstar, d_vector* C_ystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_variance, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* which_process);

	void HullWhiteModelGetOptionValue(double* output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* C_ystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* which_process, int* slice_index, double* strike);

	bool HullWhiteModelGetOptionValueCheck(XLOPER12* exception_output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* C_ystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* which_process, int* slice_index, double* strike);

	void HullWhiteModelGetOptionValueInverse(double* output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* C_ystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* which_process, int* slice_index, double* value);

	bool HullWhiteModelGetOptionValueInverseCheck(XLOPER12* exception_output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* C_ystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* which_process, int* slice_index, double* value);

	void HullWhiteModelGetJ0(d_matrix* output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* C_ystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* which_process);

	bool HullWhiteModelGetJ0Check(XLOPER12* exception_output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* C_ystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* which_process);

	void HullWhiteModelGetSpot(d_matrix* output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* Cystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* which_process);

	bool HullWhiteModelGetSpotCheck(XLOPER12* exception_output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* Cystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* which_process);

	void HullWhiteModelDomFXSpread(double* output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* C_ystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* slice_index, double* A, double* B);

	bool HullWhiteModelDomFXSpreadCheck(XLOPER12* exception_output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* C_ystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* slice_index, double* A, double* B);

	void HullWhiteModelFgnFXSpread(double* output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* C_ystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* slice_index, double* A, double* B);

	bool HullWhiteModelFgnFXSpreadCheck(XLOPER12* exception_output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* C_ystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* slice_index, double* A, double* B);

	void HullWhiteModelDomFgnSpread(double* output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* C_ystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* slice_index, double* A, double* B);

	bool HullWhiteModelDomFgnSpreadCheck(XLOPER12* exception_output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* C_ystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* slice_index, double* A, double* B);

	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	//
	// CALCULATE SPREADS WITH HULL WHITE METHOD AND ARROW DEBREU PRICES, J0 NOT GENERALISED
	//
	//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	void ADHullWhiteModelDomFXSpread(d_vector* output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* Cystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, d_vector* slice_indices, double* A, double* B);

	bool ADHullWhiteModelDomFXSpreadCheck(XLOPER12* exception_output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* Cystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, d_vector* slice_indices, double* A, double* B);

	void ADHullWhiteModelFgnFXSpread(d_vector* output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* Cystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, d_vector* slice_indices, double* A, double* B);

	bool ADHullWhiteModelFgnFXSpreadCheck(XLOPER12* exception_output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* Cystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, d_vector* slice_indices, double* A, double* B);

	void ADHullWhiteModelDomFgnSpread(d_vector* output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* Cystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, d_vector* slice_indices, double* A, double* B);

	bool ADHullWhiteModelDomFgnSpreadCheck(XLOPER12* exception_output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* Cystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, d_vector* slice_indices, double* A, double* B);


	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	//
	// CALCULATE SPREADS WITH HULL WHITE METHOD AND ARROW DEBREU PRICES, With general J0
	//
	//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	void ADGeneralHullWhiteModelDomFXSpread(d_vector* output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* Cystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, d_vector* slice_indices, double* A, double* B);

	bool ADGeneralHullWhiteModelDomFXSpreadCheck(XLOPER12* exception_output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* Cystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, d_vector* slice_indices, double* A, double* B);

	void ADGeneralHullWhiteModelFgnFXSpread(d_vector* output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* Cystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, d_vector* slice_indices, double* A, double* B);

	bool ADGeneralHullWhiteModelFgnFXSpreadCheck(XLOPER12* exception_output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* Cystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, d_vector* slice_indices, double* A, double* B);

	void ADGeneralHullWhiteModelDomFgnSpread(d_vector* output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* Cystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, d_vector* slice_indices, double* A, double* B);

	bool ADGeneralHullWhiteModelDomFgnSpreadCheck(XLOPER12* exception_output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* Cystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, d_vector* slice_indices, double* A, double* B);

	void ADGeneralHullWhiteModelGetJ0(d_matrix* output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* Cystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* which_process);

	bool ADGeneralHullWhiteModelGetJ0Check(XLOPER12* exception_output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* Cystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* which_process);

	void HullWhiteModelDomFXxyslice(d_matrix* output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* Cystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* slice_index, int* value_index, double* A, double* B);

	bool HullWhiteModelDomFXxysliceCheck(XLOPER12* exception_output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* Cystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* slice_index, int* value_index, double* A, double* B);


	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	//
	// Debugging functions
	//
	//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


	void HullWhiteModelValueOneArrowDebreu(double* output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* Cystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* slice_index, int* x, int* y, int* z);

	bool HullWhiteModelValueOneArrowDebreuCheck(XLOPER12* exception_output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* Cystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* slice_index, int* x, int* y, int* z);


	void ADHullWhiteModelGetArrowDebreu(d_matrix* output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* Cystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* slice_index);

	bool ADHullWhiteModelGetArrowDebreuCheck(XLOPER12* exception_output, int* gridsize, double* sd_spread, int* poly_order, d_vector* times, double* t1_df_dom, double* t1_df_fgn, d_vector* accrual_dom, d_vector* accrual_fgn, d_vector* fwd_libors_dom, d_vector* fwd_libors_fgn, d_vector* Cxstarxstar, d_vector* Cystarystar, d_vector* Czstarzstar, d_vector* Cxstarystar, d_vector* Cxstarzstar, d_vector* Cystarzstar, d_vector* y_larrow_mean, d_vector* y_larrow_var, double* spot_fx, d_matrix* mu_data, d_matrix* C_data, int* slice_index);


}

