From 2991013e84ff8992b5ac36bd0794582fdb3f2cde Mon Sep 17 00:00:00 2001 From: Mikael Vejdemo-Johansson Date: Tue, 22 Oct 2024 16:48:39 +0200 Subject: [PATCH] Commented out but included timing experiments to measure capabilities of alpha complex implementation. --- .../tda4j/AlphaComplexSpec.scala | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/src/test/scala/org/appliedtopology/tda4j/AlphaComplexSpec.scala b/src/test/scala/org/appliedtopology/tda4j/AlphaComplexSpec.scala index e111f282..d6160307 100644 --- a/src/test/scala/org/appliedtopology/tda4j/AlphaComplexSpec.scala +++ b/src/test/scala/org/appliedtopology/tda4j/AlphaComplexSpec.scala @@ -23,5 +23,61 @@ class AlphaComplexSpec extends org.specs2.mutable.Specification with ScalaCheck it0 must containTheSameElementsAs(ref0) } } +/* + "Timing experiments" >> { + def timing(points : Array[Array[Double]]) = { + val alpha = AlphaShapes(points) + val ref0 : Seq[Simplex[Int]] = alpha.metricSpace.elements.toSeq.map(Simplex(_)) + val it0 : Seq[Simplex[Int]] = alpha.iterateDimension(0).toSeq + + val ref1 : Iterator[Simplex[Int]] = alpha.iterateDimension(1) + val ref2 : Iterator[Simplex[Int]] = alpha.iterateDimension(2) + + ref1.tapEach(_ => ()) + ref2.tapEach(_ => ()) + + it0 must containTheSameElementsAs(ref0) + } + "50 points 2 dimensions" >> { + forAll(matrixGen[Double](Gen.double, Gen.const(2), Gen.const(50)))(timing) + } + "100 points 2 dimensions" >> { + forAll(matrixGen[Double](Gen.double, Gen.const(2), Gen.const(100)))(timing) + } + "500 points 2 dimensions" >> { + forAll(matrixGen[Double](Gen.double, Gen.const(2), Gen.const(500)))(timing) + } + + "50 points 3 dimensions" >> { + forAll(matrixGen[Double](Gen.double, Gen.const(3), Gen.const(50)))(timing) + } + "100 points 3 dimensions" >> { + forAll(matrixGen[Double](Gen.double, Gen.const(3), Gen.const(100)))(timing) + } + "500 points 3 dimensions" >> { + forAll(matrixGen[Double](Gen.double, Gen.const(3), Gen.const(500)))(timing) + } + + "50 points 5 dimensions" >> { + forAll(matrixGen[Double](Gen.double, Gen.const(5), Gen.const(50)))(timing) + } + "100 points 5 dimensions" >> { + forAll(matrixGen[Double](Gen.double, Gen.const(5), Gen.const(100)))(timing) + } + "500 points 5 dimensions" >> { + forAll(matrixGen[Double](Gen.double, Gen.const(5), Gen.const(500)))(timing) + } + + "50 points 10 dimensions" >> { + forAll(matrixGen[Double](Gen.double, Gen.const(10), Gen.const(50)))(timing) + } + "100 points 10 dimensions" >> { + forAll(matrixGen[Double](Gen.double, Gen.const(10), Gen.const(100)))(timing) + } + "500 points 10 dimensions" >> { + forAll(matrixGen[Double](Gen.double, Gen.const(10), Gen.const(500)))(timing) + } + } + */ }