Skip to content

Commit

Permalink
Matrix library, example #17
Browse files Browse the repository at this point in the history
  • Loading branch information
tisnik committed Dec 23, 2019
1 parent a2d84e4 commit c4c4567
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lesson7/gonum/mat17.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package main

import (
"fmt"
"gonum.org/v1/gonum/mat"
)

func main() {
v2 := mat.NewVecDense(5, []float64{1, 0, 2, 0, 3})
v := mat.NewVecDense(5, nil)

v.MulElemVec(v2, v2)

fmt.Printf("v2:\n%v\n\n", mat.Formatted(v2))
fmt.Printf("v:\n%v\n\n", mat.Formatted(v))
}

0 comments on commit c4c4567

Please sign in to comment.