public OneDWrapper(IGradientFunction func, GeneralMatrix pX, GeneralMatrix aX) { if (pX==null || aX==null) throw new ArgumentException("Previous x and alfaX may not be null"); _problemDimension = pX.RowDimension; _function = func; _previousX = new GeneralMatrix(pX.ArrayCopy); _alfaX = new GeneralMatrix(aX.ArrayCopy); }
public OneDWrapper(IGradientFunction func, GeneralMatrix pX, GeneralMatrix aX) { if (pX == null || aX == null) { throw new ArgumentException("Previous x and alfaX may not be null"); } _problemDimension = pX.RowDimension; _function = func; _previousX = new GeneralMatrix(pX.ArrayCopy); _alfaX = new GeneralMatrix(aX.ArrayCopy); }
public Optimizer(int dim, double[]initialPar, IGradientFunction f, double step, double epsilon, int itMax) { _f = f; _epsilon = epsilon; _itMax = itMax; _nDim = dim; _xCurrent = new double[_nDim]; _initial = new double[_nDim]; _step = step; //initiate the first value of alpha to some random value less than 100; Random rnd = new Random(); _alpha = rnd.NextDouble()*100; _hessian = new GeneralMatrix(_nDim,_nDim); for (int i=0; i<_nDim; i++) _initial[i] = initialPar[i]; }
public Optimizer(int dim, double[] initialPar, IGradientFunction f, double step, double epsilon, int itMax) { _f = f; _epsilon = epsilon; _itMax = itMax; _nDim = dim; _xCurrent = new double[_nDim]; _initial = new double[_nDim]; _step = step; //initiate the first value of alpha to some random value less than 100; Random rnd = new Random(); _alpha = rnd.NextDouble() * 100; _hessian = new GeneralMatrix(_nDim, _nDim); for (int i = 0; i < _nDim; i++) { _initial[i] = initialPar[i]; } }
public BFGS(int dim, double[] initialPar, IGradientFunction f, double step, double epsilon, int itMax) : base(dim, initialPar, f, step, epsilon, itMax) { }
public BFGS(int dim, double[]initialPar, IGradientFunction f, double step, double epsilon, int itMax) : base(dim, initialPar, f, step, epsilon, itMax) { }