From 190c52726928f2467a4b38ec874bb36e3c667ecd Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Mon, 23 Dec 2019 10:11:02 +0100 Subject: [PATCH] Matrix library, example #19 --- lesson7/gonum/mat19.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lesson7/gonum/mat19.go diff --git a/lesson7/gonum/mat19.go b/lesson7/gonum/mat19.go new file mode 100644 index 0000000..58831c7 --- /dev/null +++ b/lesson7/gonum/mat19.go @@ -0,0 +1,15 @@ +package main + +import ( + "fmt" + "gonum.org/v1/gonum/mat" +) + +func main() { + m := mat.NewDense(3, 3, []float64{0, -1, 0, 1, 0, 0, 0, 0, 1}) + v3 := mat.NewVecDense(3, []float64{2, 3, 4}) + v := mat.NewVecDense(3, nil) + v.MulVec(m, v3) + + fmt.Printf("v:\n%v\n\n", mat.Formatted(v)) +}