-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Persistence matrix] Better additions in U for RU matrices in Z2 #1143
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the new function has a precondition, some GUDHI_CHECK checking that the argument is indeed larger than the current pivot could make sense at some point.
* | ||
* @param entry Entry to push back. | ||
*/ | ||
void push_back(const Entry& entry); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would have preferred a name like insert_pivot
or insert_max_entry
, but this is ok for now.
@@ -615,7 +615,7 @@ inline void Base_matrix<Master_matrix>::print() | |||
if constexpr (Master_matrix::Option_list::has_row_access) { | |||
std::cout << "Row Matrix:\n"; | |||
for (Index i = 0; i < nextInsertIndex_; ++i) { | |||
const auto& row = RA_opt::rows_[i]; | |||
const auto& row = (*RA_opt::rows_)[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm: this is a bugfix independent of the main goal of the PR, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I stumbled over it while testing the new strategy.
static_assert(!Master_matrix::Option_list::is_z2, | ||
"Multiplication with something else than the identity is not allowed with Z2 coefficients."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you know that the argument is not the identity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know, I just wanted to say that for Z2 add_to
should be used in all cases, as multiplying by 0 the column is likely an error and a bit costly to implement as U
is transposed.
Small optimization for the reduction of U in the RU decomposition. It does not make a big difference for small complexes, but divides by two the reduction time for big complexes.
The difference is mostly at line 851 of
RU_matrix.h
.