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

var tmp mat64.Dense, then &tmp  in L162 in the Mul parameter.