Skip to content

Commit

Permalink
Some cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikael Vejdemo-Johansson committed Feb 23, 2024
1 parent 9ede311 commit fa4a073
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/main/scala/org/appliedtopology/tda4j/RingModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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

12 changes: 7 additions & 5 deletions src/main/scala/org/appliedtopology/tda4j/VietorisRips.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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))
Expand All @@ -344,7 +346,7 @@ object LazyVietorisRips {
foldedState match {
case FoldState(_, retLL, _) => retLL
}
})
}
simplices
}
}

0 comments on commit fa4a073

Please sign in to comment.