public void FitDFP2() { double eps = 1e-5; double rEps = eps*10; double step = 3; double[] vector = {6,45,22}; double[] expVector = {0,0,0}; int itMax = 50; Parabola f = new Parabola(); int dim = f.Dimension; DFP alg = new DFP(dim, vector, f, step, eps, itMax); alg.FindMinimum(); Assert.IsTrue(Diff(expVector,alg.Minimum,dim)<rEps); }
public void FitDFP1() { double eps = 1e-5; double rEps = eps*10; double step = 1; int itMax=50; double[] vector = {0,0,0}; double[] expVector = {1,-2,3}; TestFunction f = new TestFunction(); int dim = f.Dimension; DFP alg = new DFP(dim, vector, f, step, eps, itMax); alg.FindMinimum(); Assert.IsTrue(Diff(expVector,alg.Minimum,dim)<rEps); }
public void FitDFP3() { double eps = 1e-5; double rEps = eps; int itMax = 200; double step=1; double[] vector = {6,-5}; double[] expVector = {1,1}; Banana f = new Banana(); int dim = f.Dimension; DFP alg = new DFP(dim,vector,f,step,eps,itMax); alg.FindMinimum(); Assert.IsTrue(Diff(expVector,alg.Minimum,dim)<rEps); }