optimize: add doc comments for Location fields

This commit is contained in:
Dan Kortschak
2020-02-18 21:09:08 +10:30
committed by GitHub
parent 315a975e1d
commit ca302525a3

View File

@@ -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
}