From f4951f468ac7a85499d0d24738a4e0f907ca21a8 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Fri, 6 Jan 2017 00:20:54 +0100 Subject: Symmetric matrix --- bezier.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bezier.go b/bezier.go index 9bfb1f0..1add5c3 100644 --- a/bezier.go +++ b/bezier.go @@ -4,7 +4,7 @@ import "github.com/gonum/matrix/mat64" var mb = []float64{-1, 3, -3, 1, 3, -6, 3, 0, -3, 3, 0, 0, 1, 0, 0, 0} -func vector(x float64) []float64 { +func newVector(x float64) []float64 { v := make([]float64, 4) v[3] = 1 v[2] = x * v[3] @@ -14,7 +14,7 @@ func vector(x float64) []float64 { } func Vector(x float64) *mat64.Vector { - return mat64.NewVector(4, vector(x)) + return mat64.NewVector(4, newVector(x)) } func Matrix(m []float64) *mat64.Dense { @@ -29,7 +29,7 @@ func mult(U, V *mat64.Vector, Mb, Gb *mat64.Dense) float64 { m1 := new(mat64.Dense) m2 := new(mat64.Dense) m1.Mul(Mb, Gb) - m2.Mul(m1, Mb.T()) + m2.Mul(m1, Mb) return mat64.Inner(U, m2, V) } -- cgit v1.2.3