Skip to content

Commit b68a2b6

Browse files
committed
Fix vxm test mask
1 parent a12d7df commit b68a2b6

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

tests/GraphBLAS-sharp.Tests/OperationsTests/VxmTests.fs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ module VxmTests =
7979
let stdSemiring = Predefined.FloatSemiring.addMult
8080
ptestList "Float vector-matrix multiplication tests" (
8181
List.collect (fun case ->
82+
// добавить возможность пропускать некоторые случаи
8283
let matrixBackend =
8384
match case.MatrixCase with
8485
| MatrixType.CSR -> CSR
@@ -94,21 +95,26 @@ module VxmTests =
9495
| VectorType.Sparse -> (fun length -> Vector.ZeroSparse(length))
9596
| _ -> failwith "Not Implemented"
9697

98+
let mask : Mask1D =
99+
match case.MaskCase with
100+
| MaskType.None -> failwith "Not Implemented"
101+
| _ -> failwith "Not Implemented"
102+
97103
[
98104
testPropertyWithConfig config "Dimensional mismatch should raise an exception" <|
99105
fun matrixRowCount matrixColumnCount vectorSize ->
100106
let emptyMatrix = Matrix.ZeroCreate(matrixRowCount, matrixColumnCount, matrixBackend)
101107
let emptyVector = zeroVectorConstructor vectorSize
102108

103109
Expect.throwsT<System.ArgumentException>
104-
(fun () -> (emptyVector @. emptyMatrix) Mask1D.none stdSemiring |> ignore)
105-
(sprintf "1x%i @ %ix%i" vectorSize matrixRowCount matrixColumnCount)
110+
(fun () -> (emptyVector @. emptyMatrix) mask stdSemiring |> ignore)
111+
(sprintf "1x%i @ %ix%i\n case:\n %A" vectorSize matrixRowCount matrixColumnCount case)
106112

107113
testPropertyWithConfig config "Operation should have correct semantic" <|
108114
fun (denseMatrix: float[,]) (denseVector: float[]) ->
109115
let matrix = Matrix.Build(denseMatrix, 0., matrixBackend)
110116
let vector = vectorConstructor denseVector
111-
let result = (vector @. matrix) Mask1D.none stdSemiring
117+
let result = (vector @. matrix) mask stdSemiring
112118
let a = LinearAlgebra.DenseMatrix.ofArray2 denseMatrix
113119
let b = LinearAlgebra.DenseVector.ofArray denseVector
114120
let c = b * a
@@ -120,7 +126,7 @@ module VxmTests =
120126
Expect.all
121127
elementWiseDifference
122128
(fun diff -> abs diff < Accuracy.medium.absolute)
123-
(sprintf "%A @ %A = %A" vector matrix result)
129+
(sprintf "%A @ %A = %A\n case:\n %A" vector matrix result case)
124130

125131
ptestPropertyWithConfig config "Explicit zeroes after operation should be dropped" <|
126132
fun a b -> a + b = b + a

0 commit comments

Comments
 (0)