// Disp defaults to off, init value defaults to zero // Defaults to NaN so that we evaluate at the initial point // unless set otherwise // TODO: Make a Reset() function // TODO: Add in other defaults func NewGradient() *Gradient { g := &Gradient{ Floats: NewFloat("Grad", true), Abs: status.NewAbs(status.DefaultGradAbsTol, status.GradAbsTol), Rel: status.NewRel(0, status.GradRelTol), } return g }
// NewObjective returns the default objective structure func NewObjective() *Objective { o := &Objective{ delta: math.NaN(), Float: NewFloat("Obj", true), Abs: status.NewAbs(math.Inf(-1), status.ObjAbsTol), Rel: status.NewRel(0, status.ObjRelTol), } return o }
func NewBoundedStep() *BoundedStep { b := &BoundedStep{ Float: NewFloat("step", false), Abs: status.NewAbs(status.DefaultStepAbsTol, status.StepAbsTol), lb: 0, ub: math.Inf(1), } b.SetInit(1) return b }