From cebf33e54a374bb55685360d32101b89ea121a02 Mon Sep 17 00:00:00 2001 From: Luiz Fernando Silva Date: Sat, 17 Aug 2024 16:41:24 -0300 Subject: [PATCH] Fixing unit tests build --- .../TestUtils/MersenneTwister+Geometria.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Tests/GeometriaAlgorithmsTests/TestUtils/MersenneTwister+Geometria.swift diff --git a/Tests/GeometriaAlgorithmsTests/TestUtils/MersenneTwister+Geometria.swift b/Tests/GeometriaAlgorithmsTests/TestUtils/MersenneTwister+Geometria.swift new file mode 100644 index 00000000..b00b0dda --- /dev/null +++ b/Tests/GeometriaAlgorithmsTests/TestUtils/MersenneTwister+Geometria.swift @@ -0,0 +1,15 @@ +import Geometria + +extension MersenneTwister { + func randomScalar(range: ClosedRange) -> Double { + var random = self + + return Double.random(in: range, using: &random) + } + + func randomVectors(count: Int, _ scalarGen: (MersenneTwister) -> Double) -> [Vector2D] { + return (0..