#include "../ExcelDoNotEdit/excel_addin_utils.h"
#include "../utils/ParameterChecking.h"
#include "../../single_currency_model/MFMSingleCurrency.h"

namespace MFM_Model_tests
{
	using d_vector = gelib::d_vector;
	using d_matrix = gelib::d_matrix;

	void GetModelDFs(d_vector* output, double* mean_reversion_parameter, int* gridpoints_per_slice, double* sd_spread, double* discount_factor_T1, int* poly_order, d_vector* times, d_vector* forward_libors, d_vector* caplet_volatilities, d_vector* x_volatilities, d_vector* accrual_factors);

	bool GetModelDFsCheck(XLOPER12* exception_output, double* mean_reversion_parameter, int* gridpoints_per_slice, double* sd_spread, double* discount_factor_T1, int* poly_order, d_vector* times, d_vector* forward_libors, d_vector* caplet_volatilities, d_vector* x_volatilities, d_vector* accrual_factors);

	void GetModelxVariances(d_vector* output, double* mean_reversion_parameter, int* gridpoints_per_slice, double* sd_spread, double* discount_factor_T1, int* poly_order, d_vector* times, d_vector* forward_libors, d_vector* caplet_volatilities, d_vector* x_volatilities, d_vector* accrual_factors);

	bool GetModelxVariancesCheck(XLOPER12* exception_output, double* mean_reversion_parameter, int* gridpoints_per_slice, double* sd_spread, double* discount_factor_T1, int* poly_order, d_vector* times, d_vector* forward_libors, d_vector* caplet_volatilities, d_vector* x_volatilities, d_vector* accrual_factors);

	void GetModelGridpoints(d_matrix* output, double* mean_reversion_parameter, int* gridpoints_per_slice, double* sd_spread, double* discount_factor_T1, int* poly_order, d_vector* times, d_vector* forward_libors, d_vector* caplet_volatilities, d_vector* x_volatilities, d_vector* accrual_factors);

	bool GetModelGridpointsCheck(XLOPER12* exception_output, double* mean_reversion_parameter, int* gridpoints_per_slice, double* sd_spread, double* discount_factor_T1, int* poly_order, d_vector* times, d_vector* forward_libors, d_vector* caplet_volatilities, d_vector* x_volatilities, d_vector* accrual_factors);

	void GetModelConditionalMeans(d_matrix* output, double* mean_reversion_parameter, int* gridpoints_per_slice, double* sd_spread, double* discount_factor_T1, int* poly_order, d_vector* times, d_vector* forward_libors, d_vector* caplet_volatilities, d_vector* x_volatilities, d_vector* accrual_factors);

	bool GetModelConditionalMeansCheck(XLOPER12* exception_output, double* mean_reversion_parameter, int* gridpoints_per_slice, double* sd_spread, double* discount_factor_T1, int* poly_order, d_vector* times, d_vector* forward_libors, d_vector* caplet_volatilities, d_vector* x_volatilities, d_vector* accrual_factors);

	void GetDigitalCapletPrices(d_vector* output, double* mean_reversion_parameter, int* gridpoints_per_slice, double* sd_spread, double* discount_factor_T1, int* poly_order, d_vector* times, d_vector* forward_libors, d_vector* caplet_volatilities, d_vector* x_volatilities, d_vector* accrual_factors, double* k);

	bool GetDigitalCapletPricesCheck(XLOPER12* exception_output, double* mean_reversion_parameter, int* gridpoints_per_slice, double* sd_spread, double* discount_factor_T1, int* poly_order, d_vector* times, d_vector* forward_libors, d_vector* caplet_volatilities, d_vector* x_volatilities, d_vector* accrual_factors, double* k);

	void GetModelJ0s(d_matrix* output, double* mean_reversion_parameter, int* gridpoints_per_slice, double* sd_spread, double* discount_factor_T1, int* poly_order, d_vector* times, d_vector* forward_libors, d_vector* caplet_volatilities, d_vector* x_volatilities, d_vector* accrual_factors);

	bool GetModelJ0sCheck(XLOPER12* exception_output, double* mean_reversion_parameter, int* gridpoints_per_slice, double* sd_spread, double* discount_factor_T1, int* poly_order, d_vector* times, d_vector* forward_libors, d_vector* caplet_volatilities, d_vector* x_volatilities, d_vector* accrual_factors);

	void GetModelArrowDebreus(d_matrix* output, double* mean_reversion_parameter, int* gridpoints_per_slice, double* sd_spread, double* discount_factor_T1, int* poly_order, d_vector* times, d_vector* forward_libors, d_vector* caplet_volatilities, d_vector* x_volatilities, d_vector* accrual_factors);

	bool GetModelArrowDebreusCheck(XLOPER12* exception_output, double* mean_reversion_parameter, int* gridpoints_per_slice, double* sd_spread, double* discount_factor_T1, int* poly_order, d_vector* times, d_vector* forward_libors, d_vector* caplet_volatilities, d_vector* x_volatilities, d_vector* accrual_factors);

	void GetModelLibors(d_matrix* output, double* mean_reversion_parameter, int* gridpoints_per_slice, double* sd_spread, double* discount_factor_T1, int* poly_order, d_vector* times, d_vector* forward_libors, d_vector* caplet_volatilities, d_vector* x_volatilities, d_vector* accrual_factors);

	bool GetModelLiborsCheck(XLOPER12* exception_output, double* mean_reversion_parameter, int* gridpoints_per_slice, double* sd_spread, double* discount_factor_T1, int* poly_order, d_vector* times, d_vector* forward_libors, d_vector* caplet_volatilities, d_vector* x_volatilities, d_vector* accrual_factors);

	void GetInverseDigitalCapletPrice(double* output, double* mean_reversion_parameter, int* gridpoints_per_slice, double* sd_spread, double* discount_factor_T1, int* poly_order, d_vector* times, d_vector* forward_libors, d_vector* caplet_volatilities, d_vector* x_volatilities, d_vector* accrual_factors, int* which_slice, double* dcp);

	bool GetInverseDigitalCapletPriceCheck(XLOPER12* exception_output, double* mean_reversion_parameter, int* gridpoints_per_slice, double* sd_spread, double* discount_factor_T1, int* poly_order, d_vector* times, d_vector* forward_libors, d_vector* caplet_volatilities, d_vector* x_volatilities, d_vector* accrual_factors, int* which_slice, double* dcp);

	void CalculateCapletValue(double* output, double* mean_reversion_parameter, int* gridpoints_per_slice, double* sd_spread, double* discount_factor_T1, int* poly_order, d_vector* times, d_vector* forward_libors, d_vector* caplet_volatilities, d_vector* x_volatilities, d_vector* accrual_factors, int* which_slice, double* strike_price);

	bool CalculateCapletValueCheck(XLOPER12* exception_output, double* mean_reversion_parameter, int* gridpoints_per_slice, double* sd_spread, double* discount_factor_T1, int* poly_order, d_vector* times, d_vector* forward_libors, d_vector* caplet_volatilities, d_vector* x_volatilities, d_vector* accrual_factors, int* which_slice, double* strike_price);

}
