optimize: add doc comments for Location fields
MODIFY
optimize/minimize.go
optimize/minimize.go
@@ -35,9 +35,22 @@ type Task struct {
// Location represents a location in the optimization procedure.
type Location struct {
+ // X is the function input for the location.
X []float64
+ // F is the result of evaluating the function at X.
F float64
+ // Gradient holds the first-order partial derivatives
+ // of the function at X.
+ // The length of Gradient must match the length of X
+ // or be zero. If the capacity of Gradient is less
+ // than the length of X, a new slice will be allocated.
Gradient []float64
+ // Hessian holds the second-order partial derivatives
+ // of the function at X.
+ // The dimensions of Hessian must match the length of X
+ // or Hessian must be nil or empty. If Hessian is nil
+ // a new mat.SymDense will be allocated, if it is empty
+ // it will be resized to match the length of X.
Hessian *mat.SymDense
}

optimize: add doc comments for Location fields