Skip to content

Commit

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

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

func main() {
m1 := mat.NewDense(3, 4, nil)
m2 := mat.NewDense(3, 4, []float64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12})

fmt.Println(" *** m1 ***")
fmt.Println(mat.Formatted(m1))
fmt.Println()

fmt.Println(" *** m2 ***")
fmt.Println(mat.Formatted(m2))
fmt.Println()

m3 := m2.T()

fmt.Println(" *** m3 ***")
fmt.Println(mat.Formatted(m3))
fmt.Println()
}

0 comments on commit 4ddace9

Please sign in to comment.