SimplexIndexing

org.appliedtopology.tda4j.SimplexIndexing
See theSimplexIndexing companion class

Attributes

Companion
class
Experimental
true
Source
SimplexIndexing.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def binomial(n: Int, k: Int): Long

n choose k as a Long (an index can exceed Int long before n does: C(229, 5) > 5·10⁹), 0 when k < 0, n < 0 or k > n. Throws IllegalArgumentException when the coefficient does not fit in a Long (C(66, 33) is the largest central coefficient that does).

n choose k as a Long (an index can exceed Int long before n does: C(229, 5) > 5·10⁹), 0 when k < 0, n < 0 or k > n. Throws IllegalArgumentException when the coefficient does not fit in a Long (C(66, 33) is the largest central coefficient that does).

Exact integer arithmetic: the running value after step i is C(n - k + i, i), which only grows, so the coefficient overflows exactly when some step does. Each step divides out the common factor of the running value and i before multiplying, so a step overflows only if its own result does.

Attributes

Source
SimplexIndexing.scala
def binomialInt(n: Int, k: Int): Int

binomial as an Int, for enumerating every index 0 until C(n, k). Throws IllegalArgumentException when there are more than Int.MaxValue of them (such an enumeration cannot be held in a Range).

binomial as an Int, for enumerating every index 0 until C(n, k). Throws IllegalArgumentException when there are more than Int.MaxValue of them (such an enumeration cannot be held in a Range).

Attributes

Source
SimplexIndexing.scala
def colexCompare(x: Array[Int], y: Array[Int]): Int

colexOrdering on ascending vertex arrays.

colexOrdering on ascending vertex arrays.

Attributes

Source
SimplexIndexing.scala
def fitsLong(vertexCount: Int, size: Int): Boolean

Whether a SimplexIndexing(vertexCount) can index and decode every simplex with at most size vertices: its decoding looks up coefficients up to C(vertexCount + size, size), which must fit in a Long. Otherwise use WideSimplexIndexing.

Whether a SimplexIndexing(vertexCount) can index and decode every simplex with at most size vertices: its decoding looks up coefficients up to C(vertexCount + size, size), which must fit in a Long. Otherwise use WideSimplexIndexing.

Attributes

Source
SimplexIndexing.scala

Concrete fields

val colexOrdering: Ordering[Simplex[Int]]

The colexicographic order of vertex sets: the larger top vertex is the larger set, equal top vertices are compared by the next ones down. On sets of one size it is the order of the combinatorial index, so a tie-break by colexOrdering is the tie-break by index with no limit on the vertex count or the size (an index passes Long for 1,000 points at 8 vertices). Of two sets of different sizes whose top vertices agree, the shorter is smaller.

The colexicographic order of vertex sets: the larger top vertex is the larger set, equal top vertices are compared by the next ones down. On sets of one size it is the order of the combinatorial index, so a tie-break by colexOrdering is the tie-break by index with no limit on the vertex count or the size (an index passes Long for 1,000 points at 8 vertices). Of two sets of different sizes whose top vertices agree, the shorter is smaller.

Attributes

Source
SimplexIndexing.scala