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

fix sellp read #374

Merged
merged 1 commit into from
Oct 29, 2019
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
12 changes: 6 additions & 6 deletions core/matrix/sellp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,19 @@ size_type calculate_total_cols(const matrix_data<ValueType, IndexType> &data,
IndexType current_slice = 0;
size_type total_cols = 0;
for (const auto &elem : data.nonzeros) {
if (elem.row != current_row) {
current_row = elem.row;
slice_lengths[current_slice] =
max(slice_lengths[current_slice], nonzeros_per_row);
nonzeros_per_row = 0;
}
if (elem.row / slice_size != current_slice) {
slice_lengths[current_slice] =
stride_factor *
ceildiv(slice_lengths[current_slice], stride_factor);
total_cols += slice_lengths[current_slice];
current_slice = elem.row / slice_size;
}
if (elem.row != current_row) {
current_row = elem.row;
slice_lengths[current_slice] =
max(slice_lengths[current_slice], nonzeros_per_row);
nonzeros_per_row = 0;
}
nonzeros_per_row += (elem.value != zero<ValueType>());
}
slice_lengths[current_slice] =
Expand Down