Skip to content

Commit

Permalink
Matrix library, example #12
Browse files Browse the repository at this point in the history
  • Loading branch information
tisnik committed Dec 23, 2019
1 parent 67ad435 commit e5512c7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lesson7/gonum/mat12.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() {
v := mat.NewVecDense(10, []float64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10})
fmt.Printf("Value:\n%v\n", mat.Formatted(v))
fmt.Printf("Length: %d\n", v.Len())
fmt.Printf("Capacity: %d\n", v.Cap())
dim1, dim2 := v.Dims()
fmt.Printf("Dimensions: %dx%d\n", dim1, dim2)
}

0 comments on commit e5512c7

Please sign in to comment.