@@ -7,8 +7,7 @@ open GraphBLAS.FSharp.Tests.Context
77open GraphBLAS.FSharp .Objects .ClVectorExtensions
88open GraphBLAS.FSharp .Objects
99
10- let private alpha = 0.85 f
11- let private accuracy = 0.00001 f
10+ let private accuracy = float32 Accuracy.low.absolute
1211
1312let prepareNaive ( matrix : float32 [,]) =
1413 let result = Array2D.copy matrix
@@ -23,7 +22,7 @@ let prepareNaive (matrix: float32 [,]) =
2322 ( fun r c v ->
2423 result.[ r, c] <-
2524 if v <> 0 f then
26- alpha / outDegrees.[ r]
25+ Backend.Algorithms.PageRank. alpha / outDegrees.[ r]
2726 else
2827 0 f)
2928 matrix
@@ -47,7 +46,10 @@ let pageRankNaive (matrix: float32 [,]) =
4746 Array.create rowCount ( 1 f / ( float32 rowCount))
4847
4948 let mutable error = accuracy + 1 f
50- let addConst = ( 1 f - alpha) / ( float32 rowCount)
49+
50+ let addConst =
51+ ( 1 f - Backend.Algorithms.PageRank.alpha)
52+ / ( float32 rowCount)
5153
5254 while ( error > accuracy) do
5355 for r in 0 .. rowCount - 1 do
@@ -109,7 +111,7 @@ let testFixtures (testContext: TestContext) =
109111
110112 for i in 0 .. actual.Length - 1 do
111113 Expect.isTrue
112- (( abs ( actual.[ i] - expected.[ i])) < accuracy )
114+ ( Utils.float32IsEqualLowAccuracy actual.[ i] expected.[ i])
113115 ( sprintf " Values should be equal. Expected %A , actual %A " expected.[ i] actual.[ i])
114116
115117 | _ -> failwith " Not implemented" ]
0 commit comments