WitnessMetricSpace

org.appliedtopology.tda4j.streams.WitnessMetricSpace
class WitnessMetricSpace(val geometry: WitnessGeometry, val nu: Int = ...) extends FiniteMetricSpace[Int]

The lazy witness complex's own 1-skeleton (De Silva & Carlsson 2004; JavaPlex's LazyWitnessStream), reified as a FiniteMetricSpace[Int] over LOCAL landmark indices so it slots directly into RipserCofaceSimplexStream unchanged (LazyWitnessSimplexStream below) -- the lazy witness complex IS, by definition, the flag/clique complex of this weighted graph (JavaPlex's own LazyWitnessStream derives from FlagComplexStream for exactly this reason), so distance(a,b) here doubles as both the edge filtration value AND (via the inherited MaximumDistanceFiltrationValue "max pairwise distance" formula) every higher simplex's filtration value too -- no filtrationValueOverride needed anywhere.

'''Not a real metric''': distance can be zero for two distinct landmarks (whenever some witness sees both within its own m_nu threshold) and need not obey the triangle inequality. NEVER hand this to JVPTree, SparseMetricSpace, RecursiveStackVietorisRipsSimplexStream, or anything in the alpha package -- only to EnumeratingCofaceSimplexStream/RipserCofaceSimplexStream's own combinatorial (not spatial) candidate generation, which assumes neither property.

nu (JavaPlex's own name) selects the per-witness threshold m_nu: 0 means no threshold (m = 0 everywhere -- the strictest/smallest complex), 1 the nearest-landmark distance, 2 (JavaPlex's own default) the 2nd-nearest. Capped at [0, 2], matching JavaPlex's own verifyLessThan(nu, 3) -- beyond nu = 2 the per-witness clamp stops being a no-op for every landmark pair, an unstudied regime this class deliberately doesn't offer (see .claude/WORKLOG-witness-complex.md).

Attributes

Experimental
true
Graph
Supertypes
trait FiniteMetricSpace[Int]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def contains(x: Int): Boolean
def distance(x: Int, y: Int): Double

Distance in the metric space. Takes two indices and returns a non-negative real number.

Distance in the metric space. Takes two indices and returns a non-negative real number.

Value parameters

x

Index of first point

y

Index of second point

Attributes

Returns

Distance between x and y

def elements: Iterable[Int]

Access to all points in the metric space. Implemented by eg scala.collections.Range for simple Int-indexed spaces, but this definition gives more space for different underlying possible representations.

Access to all points in the metric space. Implemented by eg scala.collections.Range for simple Int-indexed spaces, but this definition gives more space for different underlying possible representations.

Attributes

Returns

Iterable that returns all points in the metric space

def size: Int

Number of points represented by this metric space.

Number of points represented by this metric space.

Attributes

Concrete fields

val nu: Int

Inherited fields

lazy val minimumEnclosingRadius: Double

Beyond this radius, the Vietoris-Rips complex is a cone and will have no further homological structure. See e.g. the Ripser paper, page 412.

Beyond this radius, the Vietoris-Rips complex is a cone and will have no further homological structure. See e.g. the Ripser paper, page 412.

Attributes

Inherited from:
FiniteMetricSpace