From 7c18200ce189614df1f73163170f46283ab282ce Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Tue, 24 Dec 2019 09:34:00 +0100 Subject: [PATCH] Matrix library, example #21 --- lesson7/gonum/mat21.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lesson7/gonum/mat21.go diff --git a/lesson7/gonum/mat21.go b/lesson7/gonum/mat21.go new file mode 100644 index 0000000..4d08645 --- /dev/null +++ b/lesson7/gonum/mat21.go @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "gonum.org/v1/gonum/mat" +) + +func main() { + v := mat.NewSymDense(3, nil) + fmt.Printf("Value:\n%v\n\n", mat.Formatted(v)) + + cap1, cap2 := v.Caps() + fmt.Printf("Capacity: %dx%d\n", cap1, cap2) + + dim1, dim2 := v.Dims() + fmt.Printf("Dimensions: %dx%d\n", dim1, dim2) +}