From fa4a073ed0f60358507cc045a22a04e6126e307d Mon Sep 17 00:00:00 2001 From: Mikael Vejdemo-Johansson Date: Fri, 23 Feb 2024 17:06:46 +0000 Subject: [PATCH] Some cleanup. --- .../scala/org/appliedtopology/tda4j/RingModule.scala | 4 ++-- .../org/appliedtopology/tda4j/VietorisRips.scala | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/scala/org/appliedtopology/tda4j/RingModule.scala b/src/main/scala/org/appliedtopology/tda4j/RingModule.scala index 590a0cf3..90a49df6 100644 --- a/src/main/scala/org/appliedtopology/tda4j/RingModule.scala +++ b/src/main/scala/org/appliedtopology/tda4j/RingModule.scala @@ -22,7 +22,7 @@ trait RingModule[T, R] { def -(rhs: T): T = minus(t, rhs) @targetName("scalarMultiplyRight") def <*(rhs: R): T = scale(rhs, t) - def unary_- = negate(t) + def unary_- : T = negate(t) } extension (r: R) { @@ -32,5 +32,5 @@ trait RingModule[T, R] { } object RingModule: - def apply[T,R](using rm: RingModule[T,R]) = rm + def apply[T,R](using rm: RingModule[T,R]) : RingModule[T,R] = rm diff --git a/src/main/scala/org/appliedtopology/tda4j/VietorisRips.scala b/src/main/scala/org/appliedtopology/tda4j/VietorisRips.scala index 72666036..ca117e61 100644 --- a/src/main/scala/org/appliedtopology/tda4j/VietorisRips.scala +++ b/src/main/scala/org/appliedtopology/tda4j/VietorisRips.scala @@ -17,9 +17,11 @@ import scala.util.chaining.* /** Convenience definition to allow us to choose a specific implementation. * * @return - * A function-like object with the signature `VietorisRips : - * (MetricSpace[VertexT], Double) => - * Seq[FilteredAbstractSimplex[VertexT,Double]]` + * A function-like object with the signature + * {{{ + * VietorisRips : (MetricSpace[VertexT], Double) => + * Seq[FilteredAbstractSimplex[VertexT,Double]] + * }}} */ class VietorisRips[VertexT](using ordering: Ordering[VertexT])( val metricSpace: FiniteMetricSpace[VertexT], @@ -324,7 +326,7 @@ object LazyVietorisRips { .map(_.toOuter) .map(spx => AbstractSimplex(spx)) .sorted - .to(LazyList) #::: ({ + .to(LazyList) #::: { val edgesLL: LazyList[WUnDiEdge[VertexT]] = edges .filter(edges.having(edge = _.weight < maxFiltrationValue)) @@ -344,7 +346,7 @@ object LazyVietorisRips { foldedState match { case FoldState(_, retLL, _) => retLL } - }) + } simplices } }