Skip to content

Commit ad3ccbf

Browse files
change fromCoordinateList signature, fix failwith, fix boruvka and tests, fix reduces and kronecker
1 parent c0ba718 commit ad3ccbf

13 files changed

Lines changed: 2130 additions & 2218 deletions

File tree

‎QuadTree.Benchmark/BFS.fs‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,25 @@ type Benchmark() =
88

99
let mutable matrix = Unchecked.defaultof<Matrix.SparseMatrix<double>>
1010

11-
1211
[<Params("494_bus.mtx", "arc130.mtx")>]
1312
member val MatrixName = "" with get, set
1413

1514
[<GlobalSetup>]
1615
member this.LoadMatrix() =
17-
matrix <- readMtx (System.IO.Path.Combine(DIR_WITH_MATRICES, this.MatrixName)) false
16+
matrix <-
17+
match readMtx (System.IO.Path.Combine(DIR_WITH_MATRICES, this.MatrixName)) false with
18+
| Ok m -> m
19+
| Error _ -> Matrix.empty 0UL<Matrix.nrows> 0UL<Matrix.ncols>
1820

1921
[<Benchmark>]
2022
member this.BFS() =
21-
let startVertices =
23+
let startVerticesResult =
2224
Vector.CoordinateList((uint64 matrix.ncols) * 1UL<Vector.dataLength>, [ 0UL<Vector.index>, 1UL ])
2325
|> Vector.fromCoordinateList
2426

27+
let startVertices =
28+
match startVerticesResult with
29+
| Ok v -> v
30+
| Error _ -> Vector.empty ((uint64 matrix.ncols) * 1UL<Vector.dataLength>)
31+
2532
Graph.BFS.bfs_level matrix startVertices

‎QuadTree.Benchmark/SSSP.fs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ open QuadTree.Benchmarks.Utils
77
type Benchmark() =
88
let mutable matrix = Unchecked.defaultof<Matrix.SparseMatrix<double>>
99

10-
1110
[<Params("494_bus.mtx", "arc130.mtx")>]
1211
member val MatrixName = "" with get, set
1312

1413
[<GlobalSetup>]
1514
member this.LoadMatrix() =
16-
matrix <- readMtx (System.IO.Path.Combine(DIR_WITH_MATRICES, this.MatrixName)) false
15+
matrix <-
16+
match readMtx (System.IO.Path.Combine(DIR_WITH_MATRICES, this.MatrixName)) false with
17+
| Ok m -> m
18+
| Error _ -> Matrix.empty 0UL<Matrix.nrows> 0UL<Matrix.ncols>
1719

1820
[<Benchmark>]
1921
member this.SSSP() = Graph.SSSP.sssp matrix 0UL

‎QuadTree.Benchmark/Triangles.fs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ type Benchmark() =
1313

1414
[<GlobalSetup>]
1515
member this.LoadMatrix() =
16-
matrix <- readMtx (System.IO.Path.Combine(DIR_WITH_MATRICES, this.MatrixName)) false
16+
matrix <-
17+
match readMtx (System.IO.Path.Combine(DIR_WITH_MATRICES, this.MatrixName)) false with
18+
| Ok m -> m
19+
| Error _ -> Matrix.empty 0UL<Matrix.nrows> 0UL<Matrix.ncols>
1720

1821
[<Benchmark>]
1922
member this.TriangleCount() =

0 commit comments

Comments
 (0)