File tree Expand file tree Collapse file tree
tests/GraphBLAS-sharp.Tests/OperationsTests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ open GraphBLAS.FSharp
88module BFS =
99 let levelBFS ( matrix : Matrix < bool >) ( source : int ) : Vector < int > =
1010 let vertexCount = matrix.RowCount
11- let levels = DenseVector( Array.zeroCreate vertexCount, IntegerMonoid.plus )
11+ let levels = DenseVector( Array.zeroCreate vertexCount, IntegerMonoid.add )
1212
1313 let frontier = SparseVector( vertexCount, [ source, true ])
1414
Original file line number Diff line number Diff line change @@ -10,6 +10,6 @@ module SSSP =
1010 let distance = SparseVector( vertexCount, [ source, 0. ])
1111
1212 for _ in 1 .. vertexCount - 1 do
13- distance.[ Mask1D.none] <- ( distance .@ matrix) Mask1D.none FloatSemiring.minPlus
13+ distance.[ Mask1D.none] <- ( distance .@ matrix) Mask1D.none FloatSemiring.addMult
1414
1515 upcast distance
Original file line number Diff line number Diff line change 2121 <Compile Include =" Vector.fs" />
2222 <Compile Include =" Masks.fs" />
2323 <Compile Include =" Predefined/Float.fs" />
24- <Compile Include =" Predefined/Boolean.fs" />
2524 <Compile Include =" Predefined/Integer.fs" />
25+ <Compile Include =" Predefined/Boolean.fs" />
2626 <Compile Include =" Algorithms/BFS.fs" />
2727 <Compile Include =" Algorithms/SSSP.fs" />
2828 <Compile Include =" Algorithms/TriangleCounting.fs" />
2929 </ItemGroup >
3030 <Import Project =" ..\..\.paket\Paket.Restore.targets" />
31- </Project >
31+ </Project >
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ namespace GraphBLAS.FSharp.Predefined
33open GraphBLAS.FSharp
44
55module FloatMonoid =
6- let plus : Monoid < float > = {
6+ let add : Monoid < float > = {
77 Zero = 0.
88 Append = BinaryOp <@ ( + ) @>
99 }
@@ -14,12 +14,12 @@ module FloatMonoid =
1414 }
1515
1616module FloatSemiring =
17- let plusTimes : Semiring < float > = {
18- PlusMonoid = FloatMonoid.plus
17+ let addMult : Semiring < float > = {
18+ PlusMonoid = FloatMonoid.add
1919 Times = BinaryOp <@ ( * ) @>
2020 }
2121
22- let minPlus : Semiring < float > = {
22+ let minAdd : Semiring < float > = {
2323 PlusMonoid = FloatMonoid.min
2424 Times = BinaryOp <@ ( + ) @>
2525 }
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ namespace GraphBLAS.FSharp.Predefined
33open GraphBLAS.FSharp
44
55module IntegerMonoid =
6- let plus : Monoid < int > = {
6+ let add : Monoid < int > = {
77 Zero = 0
88 Append = BinaryOp <@ ( + ) @>
99 }
Original file line number Diff line number Diff line change @@ -88,10 +88,10 @@ module VxmTests =
8888 // тут просто размерности генерить и создавать пустые объекты
8989 fun m n k ->
9090 let emptyMatrix = Matrix.ZeroCreate( m, n, matrixBackend)
91- let emptyVector = Vector.Dense( Predefined.FloatMonoid.plus )
91+ let emptyVector = Vector.Dense( Predefined.FloatMonoid.add )
9292
9393 Expect.throwsT
94- ( fun () -> ( emptyVector .@ emptyMatrix) Mask1D.none Predefined.FloatSemiring.plusTimes |> ignore)
94+ ( fun () -> ( emptyVector .@ emptyMatrix) Mask1D.none Predefined.FloatSemiring.addMult |> ignore)
9595 ( sprintf " Argument has invalid dimension. Need %i , but given %i " k m )
9696
9797 testPropertyWithConfig config " Operation should have correct semantic" <|
You can’t perform that action at this time.
0 commit comments