Skip to content

Commit 6e62399

Browse files
mattnsbinet
authored andcommitted
Fix usage of gonum
1 parent 3e31b95 commit 6e62399

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/Matrix_Operations.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,25 +108,25 @@
108108
],
109109
"source": [
110110
"// Add a and b.\n",
111-
"d := mat.NewDense(0, 0, nil)\n",
111+
"d := new(mat.Dense)\n",
112112
"d.Add(a, b)\n",
113113
"fd := mat.Formatted(d, mat.Prefix(\" \"))\n",
114114
"fmt.Printf(\"d = a + b = %0.4v\\n\\n\", fd)\n",
115115
"\n",
116116
"// Multiply a and c.\n",
117-
"f := mat.NewDense(0, 0, nil)\n",
117+
"f := new(mat.Dense)\n",
118118
"f.Mul(a, c)\n",
119119
"ff := mat.Formatted(f, mat.Prefix(\" \"))\n",
120120
"fmt.Printf(\"f = a c = %0.4v\\n\\n\", ff)\n",
121121
"\n",
122122
"// Raising a matrix to a power.\n",
123-
"g := mat.NewDense(0, 0, nil)\n",
123+
"g := new(mat.Dense)\n",
124124
"g.Pow(a, 5)\n",
125125
"fg := mat.Formatted(g, mat.Prefix(\" \"))\n",
126126
"fmt.Printf(\"g = a^5 = %0.4v\\n\\n\", fg)\n",
127127
"\n",
128128
"// Apply a function to each of the elements of a.\n",
129-
"h := mat.NewDense(0, 0, nil)\n",
129+
"h := new(mat.Dense)\n",
130130
"sqrt := func(_, _ int, v float64) float64 { return math.Sqrt(v) }\n",
131131
"h.Apply(sqrt, a)\n",
132132
"fh := mat.Formatted(h, mat.Prefix(\" \"))\n",

0 commit comments

Comments
 (0)