Пример #1
0
// NewObjective returns the default objective structure
func NewObjective() *Objective {
	o := &Objective{
		Floats: NewFloat("Obj", true),
		//Abs:    status.NewAbs(math.Inf(-1), status.ObjAbsTol),
		Rel: status.NewRel(0, status.ObjRelTol),
	}
	return o
}
Пример #2
0
// 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
}
Пример #3
0
// 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
}