C#,数值计算——NRf1(UniVarRealValueFun)的计算方法与源程序

1 文本格式

using System;

namespace Legalsoft.Truffer
{
    public class NRf1 : UniVarRealValueFun
    {
        public RealValueFun y1;
        public RealValueFun y2;
        public NRf2 f2;


        public NRf1(RealValueFun y1, RealValueFun y2, RealValueFun z1, RealValueFun z2)
        {
            this.y1 = y1;
            this.y2 = y2;
            this.f2 = new NRf2(z1, z2);
        }

        public double funk(double x)
        {
            f2.f3.xsav = x;
            return GaussianWeights.qgaus(f2, y1.funk(new double[] { x }), y2.funk(new double[] { x }));
        }
    }
}
 

2 代码格式

using System;

namespace Legalsoft.Truffer
{
    public class NRf1 : UniVarRealValueFun
    {
        public RealValueFun y1;
        public RealValueFun y2;
        public NRf2 f2;


        public NRf1(RealValueFun y1, RealValueFun y2, RealValueFun z1, RealValueFun z2)
        {
            this.y1 = y1;
            this.y2 = y2;
            this.f2 = new NRf2(z1, z2);
        }

        public double funk(double x)
        {
            f2.f3.xsav = x;
            return GaussianWeights.qgaus(f2, y1.funk(new double[] { x }), y2.funk(new double[] { x }));
        }
    }
}

你可能感兴趣的:(C#数值计算,Numerical,Recipes,c#,开发语言,算法,数值计算)