Skip to content

Commit

Permalink
remove -1-filling of arrays from lusol factor extraction code (#182)
Browse files Browse the repository at this point in the history
* remove -1-filling of arrays from lusol factor extraction code

* adjustments to deduplication criterion
  • Loading branch information
superwhiskers authored Sep 10, 2024
1 parent cd0da50 commit e4e7b9a
Showing 1 changed file with 2 additions and 4 deletions.
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);

// 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

0 comments on commit e4e7b9a

Please sign in to comment.