Skip to content
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

remove -1-filling of arrays from lusol factor extraction code #182

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions resolve/LinSolverDirectLUSOL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ namespace ReSolve

index_type* columns = L_->getColData(memory::HOST);
index_type* rows = L_->getRowData(memory::HOST);
std::fill_n(rows, current_nnz, -1);
real_type* values = L_->getValues(memory::HOST);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't elements of rows array be initialized to zero instead?

Copy link
Collaborator Author

@superwhiskers superwhiskers Aug 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That shouldn't be necessary regardless. Some testing I performed on the coo2csr/coo2coo implementations yielded no indication that it would be necessary


// build an inverse permutation array for p
Expand Down Expand Up @@ -296,7 +295,7 @@ namespace ReSolve
index_type insertion_offset = static_cast<index_type>(closest_position - rows);

// to my knowledge, lusol doesn't write duplicates at all. this is likely a bug
if (rows[insertion_offset] == row) {
if (rows[insertion_offset] == row && closest_position != &rows[destination_offset]) {
out::error() << "duplicate element found during LUSOL L factor extraction\n";
return nullptr;
}
Expand Down Expand Up @@ -342,7 +341,6 @@ namespace ReSolve

index_type* rows = U_->getRowData(memory::HOST);
index_type* columns = U_->getColData(memory::HOST);
std::fill_n(columns, current_nnz, -1);
real_type* values = U_->getValues(memory::HOST);

// build an inverse permutation array for q
Expand Down Expand Up @@ -381,7 +379,7 @@ namespace ReSolve
index_type insertion_offset = static_cast<index_type>(closest_position - columns);

// as said above, i'm pretty certain lusol doesn't write duplicates
if (columns[insertion_offset] == column) {
if (columns[insertion_offset] == column && closest_position != &columns[destination_offset]) {
out::error() << "duplicate element found during LUSOL U factor extraction\n";
return nullptr;
}
Expand Down
Loading