Skip to content

Commit

Permalink
Matrix library, example #18
Browse files Browse the repository at this point in the history
  • Loading branch information
tisnik committed Dec 23, 2019
1 parent c4c4567 commit 5a77cab
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lesson7/gonum/mat18.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{1, 0, 0, 0, 1, 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 5a77cab

Please sign in to comment.