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

bug: missing cols in callback of omp solver #644

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pylops/optimization/cls_sparsity.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ def run(
else False
)
x, cols = self.step(x, cols, showstep)
self.callback(x)
self.callback(x, cols)
return x, cols

def finalize(
Expand Down
5 changes: 3 additions & 2 deletions pylops/optimization/sparsity.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ def omp(
and every N3 steps in between where N1, N2, N3 are the
three element of the list.
callback : :obj:`callable`, optional
Function with signature (``callback(x)``) to call after each iteration
where ``x`` is the current model vector
Function with signature (``callback(x, cols)``) to call after each iteration
where ``x`` contains the non-zero model coefficient and ``cols`` are the
indices where the current model vector is non-zero

Returns
-------
Expand Down