Skip to content

Commit

Permalink
Matrix library, example #19
Browse files Browse the repository at this point in the history
  • Loading branch information
tisnik committed Dec 23, 2019
1 parent 5a77cab commit 190c527
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lesson7/gonum/mat19.go
Original file line number Diff line number Diff line change
@@ -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))
}

0 comments on commit 190c527

Please sign in to comment.