Skip to content

Commit

Permalink
Merge pull request #644 from mrava87/bug-omp
Browse files Browse the repository at this point in the history
bug: missing cols in callback of omp solver
  • Loading branch information
mrava87 authored Feb 12, 2025
2 parents 055694e + 6af0771 commit 8502e12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
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

0 comments on commit 8502e12

Please sign in to comment.