UnitSignedUnionFind

org.appliedtopology.tda4j.UnitSignedUnionFind
open class UnitSignedUnionFind(size: Int)

SignedUnionFind with every orientation a sign ±1, kept in bytes: exact whenever every flip is ±1, as in the cubical dual, where a flip is a product of boundary coefficients ±1. The field never enters; the caller maps a sign to its field once, when it writes a representative. Integers map to any field by a ring homomorphism, so this gives the same coefficients as the field arithmetic, and none of its boxing.

Attributes

Experimental
true
Source
SignedUnionFind.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def find(i: Int): Int

The root of i's component. Compresses the path, composing signs so they stay relative to the root.

The root of i's component. Compresses the path, composing signs so they stay relative to the root.

Attributes

Source
SignedUnionFind.scala
def foreachMember(root: Int)(f: (Int, Int) => Unit): Unit

f(member, sign relative to root) for every element merged (directly or not) into root, root included, in the order of SignedUnionFind.members. Exact for a root that is still a root, or was merged away.

f(member, sign relative to root) for every element merged (directly or not) into root, root included, in the order of SignedUnionFind.members. Exact for a root that is still a root, or was merged away.

Attributes

Source
SignedUnionFind.scala
def orientation(i: Int): Int

The sign of i relative to the root of its component (1 for the root itself).

The sign of i relative to the root of its component (1 for the root itself).

Attributes

Source
SignedUnionFind.scala
def sizeOf(root: Int): Int

The number of elements of the component of root root: what foreachMember(root) visits.

The number of elements of the component of root root: what foreachMember(root) visits.

Attributes

Source
SignedUnionFind.scala
def union(young: Int, old: Int, flip: Int): Unit

Merges root young into root old, multiplying every sign in young's component by flip (±1).

Merges root young into root old, multiplying every sign in young's component by flip (±1).

Attributes

Source
SignedUnionFind.scala