diff --git a/diff/fd/hessian_test.go b/diff/fd/hessian_test.go index af1b13905..04c21f8d2 100644 --- a/diff/fd/hessian_test.go +++ b/diff/fd/hessian_test.go @@ -63,7 +63,7 @@ func TestHessian(t *testing.T) { 2, 5, -3, 1, -3, 6, }), - b: mat.NewVector(3, []float64{3, -2, -1}), + b: mat.NewVecDense(3, []float64{3, -2, -1}), c: 5, }, x: []float64{-1.6, -3, 2}, diff --git a/diff/fd/simplefunctions_test.go b/diff/fd/simplefunctions_test.go index 2a7c77a65..1c1dd42e9 100644 --- a/diff/fd/simplefunctions_test.go +++ b/diff/fd/simplefunctions_test.go @@ -57,20 +57,20 @@ func (l LinearFunc) Hess(dst mat.MutableSymmetric, x []float64) { // QuadFunc is a quadratic function returning 0.5*x'*a*x + b*x + c. type QuadFunc struct { a *mat.SymDense - b *mat.Vector + b *mat.VecDense c float64 } func (q QuadFunc) Func(x []float64) float64 { - v := mat.NewVector(len(x), x) - var tmp mat.Vector + v := mat.NewVecDense(len(x), x) + var tmp mat.VecDense tmp.MulVec(q.a, v) return 0.5*mat.Dot(&tmp, v) + mat.Dot(q.b, v) + q.c } func (q QuadFunc) Grad(grad, x []float64) { - var tmp mat.Vector - v := mat.NewVector(len(x), x) + var tmp mat.VecDense + v := mat.NewVecDense(len(x), x) tmp.MulVec(q.a, v) for i := range grad { grad[i] = tmp.At(i, 0) + q.b.At(i, 0)