public double Evaluate()
        {
            IRR_PARAMS par = Compute();

            if (par == null)
            {
                return(-1);
            }
            return(CashFlow_IRR_Annual(par.revenue,
                                       par.rate, par.period));
        }
        public double Evaluate()
        {
            if (comp == null)
            {
                return(-1);
            }
            IRR_PARAMS par = comp();

            return(CashFlow_IRR_Annual(par.revenue,
                                       par.rate, par.period));
        }
        static void TestFPTemplate()
        {
            IRRComputationEngine2 n = new IRRComputationEngine2();

            double[] ns = { 10, 12, 13, 14, 20 };
            n.comp = () =>
            {
                IRR_PARAMS par = new IRR_PARAMS();
                par.revenue = ns.ToList();
                par.rate    = 10;
                par.period  = 5;
                return(par);
            };
            double r = n.Evaluate();

            Console.WriteLine(r);
            Console.Read();
        }