Phat

org.appliedtopology.tda4j.Phat
object Phat

PHAT's boundary-matrix formats, with the conventions of phat/boundary_matrix.h (load_ascii, save_ascii, load_binary, save_binary): a matrix over Z/2 whose columns are numbered from 0, each with a dimension and the sorted row indices of its nonzero entries.

  • ASCII: one column per line, the dimension first and then the row indices, separated by whitespace; empty lines and lines starting with # are skipped.
  • Binary: an Int64 column count, then for each column its dimension (Int64), its number of entries N (Int64) and the N row indices (Int64). PHAT writes the machine's byte order; this reader and writer use little-endian, which is the byte order of x86 and ARM machines.

PHAT reads a matrix whose columns are in filtration order, so a face's row comes before the column of its coface: fromStream builds that matrix from a stream, sorting its cells by the stream's filtrationOrdering.

Attributes

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

Members list

Type members

Classlikes

final case class Matrix(dimensions: IndexedSeq[Int], columns: IndexedSeq[IndexedSeq[Long]])

A boundary matrix over Z/2: column j has dimension dimensions(j) and the nonzero rows columns(j), increasing.

A boundary matrix over Z/2: column j has dimension dimensions(j) and the nonzero rows columns(j), increasing.

Attributes

Source
Phat.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def formatAscii(matrix: Matrix): String

The text of matrix in PHAT's ASCII format.

The text of matrix in PHAT's ASCII format.

Attributes

Source
Phat.scala
def formatBinary(matrix: Matrix): Array[Byte]

The bytes of matrix in PHAT's binary format (little-endian).

The bytes of matrix in PHAT's binary format (little-endian).

Attributes

Source
Phat.scala
def fromCells[CellT](cells: Iterable[CellT]): Matrix

The boundary matrix over Z/2 of cells, which must be listed in filtration order with every face of a cell listed before it: column j is cell j, its rows the positions of the faces in the boundary.

The boundary matrix over Z/2 of cells, which must be listed in filtration order with every face of a cell listed before it: column j is cell j, its rows the positions of the faces in the boundary.

Attributes

Source
Phat.scala
def fromStream[CellT](stream: CellStream[CellT, Double]): Matrix

The boundary matrix over Z/2 of the cells of stream in filtration order (by filtration value, then dimension, so a face comes before its cofaces; ties are broken by the stream's filtrationOrdering): column j is cell j, its rows the positions of the faces in the boundary.

The boundary matrix over Z/2 of the cells of stream in filtration order (by filtration value, then dimension, so a face comes before its cofaces; ties are broken by the stream's filtrationOrdering): column j is cell j, its rows the positions of the faces in the boundary.

Attributes

Source
Phat.scala
def parseAscii(text: String, origin: String = ...): Matrix

formatAscii read back. Entries are sorted, as PHAT sorts them when it loads a file.

formatAscii read back. Entries are sorted, as PHAT sorts them when it loads a file.

Attributes

Source
Phat.scala
def parseBinary(bytes: Array[Byte], origin: String = ...): Matrix

formatBinary read back; the entries are taken as stored, not sorted (PHAT does not sort them either).

formatBinary read back; the entries are taken as stored, not sorted (PHAT does not sort them either).

Attributes

Source
Phat.scala
def readAscii(path: String): Matrix

Attributes

Source
Phat.scala
def readBinary(path: String): Matrix

Attributes

Source
Phat.scala
def writeAscii(path: String, matrix: Matrix): Unit

Attributes

Source
Phat.scala
def writeBinary(path: String, matrix: Matrix): Unit

Attributes

Source
Phat.scala