Closed gtauzin closed 4 years ago
Thanks @gtauzin! Will review ASAP.
Putting it as WIP.
flagio
also needs to be refactored accordingly.
I propose a consistent design for the static and persistence version of save and load functions too.
@ulupo Please let me know what you think.
/azp run
Reference Issues/PRs
Fixes #27.
What does this implement/fix? Explain your changes.
Following on- and off-line discussions with @ulupo regarding the handling of zero values of the flag_matrix (#27), we have converged to the following solution implemented in this PR:
flagser
function is to be split into two functionsflagser_unweighted
andflagser_weighted
.flagser_unweighted
focuses on the computation of homology. The input adjacency_matrix handles0
s as follows: Diagonal elements are vertex weights with non-0
orTrue
values corresponding toTrue
values and0
orFalse
values corresponding toFalse
values. Off-diagonal,0
orFalse
values denote edge absence while non-0
orTrue
values denote edges presence.flagser_weighted
focuses on the computation of persistent homology. he input adjacency_matrix handles0
s as follows: If the matrix is a densenp.ndarray
, zero values denote zero-weighted edges. If the matrix is a sparsescipy.sparse
matrix, explicitly stored off-diagonal zeros and all diagonal zeros denote zero-weighted edges. Off-diagonal values that have not been explicitly stored are treated byscipy.sparse
as zeros but will be understood as infinitely-valued edges, i.e., edges absent from the filtration.flagser_weighted
now takes amax_edge_weight
argument. All edge weights greater than that value will be considered as infinitely-valued, i.e., absent from the filtration. Additionally, it sets the maximum death values of diagram points. This parameter default is the maximum value allowed by the adjacency_matrix dtype.saveflag
andload
flags are each split into two functions: aunweighted
and aweighted
function than handle zeros in a way that is consistent with theirflagser
counterpartsAdditionally,
flagser
functions code is now fully documented0
values).