示例#1
0
        private static void WriteIndex(StreamWriter file)
        {
            var xNumArray = ParametersFactory.MakeXNumArray();
            int xNumNum   = xNumArray.GetLength(0);

            file.Write(",");
            for (int j = 0; j < xNumNum; j++)
            {
                file.Write(xNumArray[j] + ",");
            }
            file.WriteLine();
        }
示例#2
0
        private static void WriteIndex(StreamWriter file, Types.OptionType optionType)
        {
            var parameters = ParametersFactory.Original(optionType);
            var xArray     = ParametersFactory.MakeXArray(parameters);
            int xNum       = xArray.GetLength(0);

            file.Write(",");
            for (int j = 0; j < xNum; j++)
            {
                file.Write(xArray[j] + ",");
            }
            file.WriteLine();
        }
示例#3
0
        private static void WriteError(StreamWriter file, Types.OptionType optionType, Types.MethodType methodType)
        {
            var parameters = ParametersFactory.ForVerification(optionType);
            var xNumArray  = ParametersFactory.MakeXNumArray();
            int xNumNum    = xNumArray.GetLength(0);

            file.Write(",");
            for (int j = 0; j < xNumNum; j++)
            {
                var makePVArray   = new MakePVArrayOneAsset();
                var analyticArray =
                    makePVArray.Analytic(parameters[j], optionType);
                var fDMArray =
                    makePVArray.FDM(parameters[j], optionType, methodType);
                double error = CalculateErrorOneAsset.MaxAbsolute(fDMArray, analyticArray);

                file.Write(error + ",");
            }
            file.WriteLine();
        }
示例#4
0
        private static void WriteError(StreamWriter file, Types.OptionType optionType, Types.MethodType methodType)
        {
            var parameters = ParametersFactory.Original(optionType);
            var xArray     = ParametersFactory.MakeXArray(parameters);
            int xNum       = xArray.GetLength(0);
            var errorArray = new double[xNum];

            file.Write(",");
            for (int j = 0; j < xNum; j++)
            {
                var makePVArray   = new MakePVArrayOneAsset();
                var analyticArray =
                    makePVArray.Analytic(parameters, optionType);
                var fDMArray =
                    makePVArray.FDM(parameters, optionType, methodType);

                errorArray[j] = CalculateErrorOneAsset.AbsoluteArray(fDMArray, analyticArray)[j];

                file.Write(errorArray[j] + ",");
            }
            file.WriteLine();
        }