We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de1e6ea commit 3fbefa7Copy full SHA for 3fbefa7
QSharpMathUtils/src/Matrices/Constructors.qs
@@ -2,14 +2,17 @@ namespace Matrices.Constructors {
2
import Std.Diagnostics.*;
3
import Std.Arrays.*;
4
import Std.Convert.*;
5
+ import Std.Math.*;
6
+
7
import Matrices.Properties.*;
8
import Matrices.Identity.*;
9
import Matrices.Multiply.*;
10
import Categories.Monoid.*;
-
- newtype Matrix = Double[][];
11
12
function MonoidReduceMatrix(n : Int) : (Double[][][] -> Double[][]) {
13
+ let mul : Int -> Int -> Int = x -> y -> x * y;
14
15
16
let validate : Double[][] -> Double[][] = M -> IsSquareArray(M) and Shape(M) == (n, n) ? M | fail $"Must be square array with height / width of {n}";
17
MonoidReduceValidate(IdentityMatrix(n), MatMulD, validate)
18
}
0 commit comments