Initial commit of functions from github.com/btracey/optimize

Fixed.

On Oct 12, 2014, at 8:52 AM, Vladimír Chalupecký <notifications@github.com> wrote:

> In minimize.go:
> 
> > +		if funcStat.IsFunctionGradient {
> > +			stats.FunctionGradientEvals++
> > +		}
> > +		if funcStat.IsGradient {
> > +			stats.FunctionEvals++
> > +			stats.FunctionGradientEvals++
> > +		}
> > +	}
> > +	if iterType == MajorIteration {
> > +		stats.MajorIterations++
> > +	}
> > +	if location.F < optLoc.F {
> > +		copyLocation(optLoc, location)
> > +	}
> > +	stats.Runtime = time.Since(startTime)
> > +	stats.GradientNorm = floats.Norm(location.Gradient, 2) / math.Sqrt(float64(len(location.Gradient)))
> If a grad-free method is used, isn't len(location.Gradient) equal to 0?
> 
> —
> Reply to this email directly or view it on GitHub.
>