示例#1
0
文件: Analytics.cs 项目: koay9f/EnPI
        public string Formula()
        {
            string formula = "";
            int    offset  = Coefficients.GetLowerBound(0) - VariableNames.GetLowerBound(0);

            for (int i = Coefficients.GetLowerBound(0); i < Coefficients.GetUpperBound(0); i++)
            {
                formula += "(" + Coefficients[i].ToString("0.0000") + " * " + ExcelHelpers.CreateValidFormulaName(VariableNames[i - offset]) + ") + ";
                // formula += "(" + Coefficients[i].ToString() + " * " + ExcelHelpers.CreateValidFormulaName(VariableNames[i - offset]) + ") + ";
            }

            formula += Coefficients[Coefficients.GetUpperBound(0)].ToString("0.00");

            return(formula);
        }