Ripser's own input file formats (ripser.cpp's read_point_cloud/read_lower_distance_matrix/ read_upper_distance_matrix/read_distance_matrix/read_binary) -- verified directly against github.com/Ripser/ripser's own source (see .claude/WORKLOG-io-module.md), not reconstructed from documentation: a wrong flat-index convention here would silently produce a plausible-looking wrong matrix rather than an error.
'''Not implemented''': --format sparse (a triplet edge list -- tda4j has no "only these edges are known, the rest are unknown rather than infinite" metric-space type, so this is a real, open design question, not an oversight -- see the worklog) and --format dipha (use Dipha.scala directly instead, which reads the exact same file DIPHA itself produces).
--format binary: no header at all, just raw little-endian IEEE-754 float32 values read until EOF, in the same flat lower-triangular order as readLowerDistanceMatrix -- Ripser's own value_t is typedef float value_t, NOT double (confirmed directly against ripser.cpp's own typedef), so every value narrows to 32 bits on write and widens back to Double on read; this is real precision loss, matching what real ripser --format binary output already has baked in, not something this reader introduces.
--format binary: no header at all, just raw little-endian IEEE-754 float32 values read until EOF, in the same flat lower-triangular order as readLowerDistanceMatrix -- Ripser's own value_t is typedef float value_t, NOT double (confirmed directly against ripser.cpp's own typedef), so every value narrows to 32 bits on write and widens back to Double on read; this is real precision loss, matching what real ripser --format binary output already has baked in, not something this reader introduces.
--format distance (Ripser's own default): a dense n x n matrix, one row per line, but ONLY the strictly lower triangle of each line is actually read (for (j = 0; j < i && s >> value; ++j)) -- so line i (0-indexed) must have at least i values, and anything at or past the diagonal is ignored outright, never cross-checked against the lower triangle.
--format distance (Ripser's own default): a dense n x n matrix, one row per line, but ONLY the strictly lower triangle of each line is actually read (for (j = 0; j < i && s >> value; ++j)) -- so line i (0-indexed) must have at least i values, and anything at or past the diagonal is ignored outright, never cross-checked against the lower triangle.
--format lower-distance: every value in the file (across line breaks; comma- or whitespace-separated) is one flat token stream: row i (i = 1 until n) contributes i entries d(i,0),...,d(i,i-1), rows concatenated in order -- confirmed against read_lower_distance_matrix/compressed_lower_distance_matrix's init_rows in ripser.cpp directly.
--format lower-distance: every value in the file (across line breaks; comma- or whitespace-separated) is one flat token stream: row i (i = 1 until n) contributes i entries d(i,0),...,d(i,i-1), rows concatenated in order -- confirmed against read_lower_distance_matrix/compressed_lower_distance_matrix's init_rows in ripser.cpp directly.
--format upper-distance: row i (i = 0 until n-1) contributes n-1-i entries d(i,i+1),...,d(i,n-1), rows concatenated -- confirmed against read_upper_distance_matrix/compressed_upper_distance_matrix's init_rows pointer arithmetic in ripser.cpp directly, traced term-by-term rather than assumed symmetric with the lower case (see .claude/WORKLOG-io-module.md).
--format upper-distance: row i (i = 0 until n-1) contributes n-1-i entries d(i,i+1),...,d(i,n-1), rows concatenated -- confirmed against read_upper_distance_matrix/compressed_upper_distance_matrix's init_rows pointer arithmetic in ripser.cpp directly, traced term-by-term rather than assumed symmetric with the lower case (see .claude/WORKLOG-io-module.md).