Skip to content

Commit

Permalink
make update_grades function public in bifiltration_data.h (#173)
Browse files Browse the repository at this point in the history
* make update_grades function public in bifiltration_data.h

* Update data_reader.cpp
  • Loading branch information
mlesnick committed Jul 25, 2023
1 parent cf834f4 commit 1db27d9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions interface/data_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ FileContent DataReader::read_bifiltration(std::ifstream& stream, Progress& progr
//Mike: I reorganized the code slightly so that the arguments of add_simplex are const references, which seems better, but that means any sorting should happen before.
std::sort(gradesOfApp.begin(), gradesOfApp.end());
std::sort(it->first.begin(), it->first.end());
data->bifiltration_data->update_grades(gradesOfApp);
data->bifiltration_data->add_simplex(it->first, gradesOfApp);
}
if (verbosity >= 10) {
Expand Down
15 changes: 9 additions & 6 deletions math/bifiltration_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@
Description: Stores a simplex of dimension hom_dim - 1, together
with the greatest lower bound of all grades of appearance of that simplex.
Struct: MidHighSimplexData s
Description: Stores a simplex s of dimension hom_dim or
hom_dim+1, together with the bigrades of appearance of s. Also can store the
column indices corresponding corresponding to copies of s, though this is only
column indices corresponding to copies of s, though this is only
used for simplices of dimension hom_dim. The reason for using a single data
structure to handle simplces of dimension hom_dim and hom_dim+1 is that for
multicritical filtrations, columns in the high matrix in an FIRep can correspond
Expand Down Expand Up @@ -116,6 +115,10 @@ struct MidHighSimplexData {
}
};





class BifiltrationData {
friend class FIRep;

Expand Down Expand Up @@ -196,6 +199,10 @@ class BifiltrationData {
//controls display of output, for debugging
const int verbosity;

//Sorts the grades of appearance in reverse lexicographic order
//and makes sure they are all incomparable
void update_grades(AppearanceGrades& grades);

//print bifiltration in the RIVET bifiltration input format
void print_bifiltration();

Expand Down Expand Up @@ -234,10 +241,6 @@ class BifiltrationData {
const AppearanceGrades& grades2,
unsigned mindist);

//Sorts the grades of appearance in reverse lexicographic order
//and makes sure they are all incomparable
void update_grades(AppearanceGrades& grades);

//total number of simplces of dimensions hom_dim and hom_dim+1,
//counting mutiplicity in grades of appearance.
//Used to avoid unnecessary resizing of arrays in firep constructor.
Expand Down

0 comments on commit 1db27d9

Please sign in to comment.