Skip to content

Commit 8502e12

Browse files
authored
Merge pull request #644 from mrava87/bug-omp
bug: missing cols in callback of omp solver
2 parents 055694e + 6af0771 commit 8502e12

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pylops/optimization/cls_sparsity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ def run(
914914
else False
915915
)
916916
x, cols = self.step(x, cols, showstep)
917-
self.callback(x)
917+
self.callback(x, cols)
918918
return x, cols
919919

920920
def finalize(

pylops/optimization/sparsity.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,9 @@ def omp(
166166
and every N3 steps in between where N1, N2, N3 are the
167167
three element of the list.
168168
callback : :obj:`callable`, optional
169-
Function with signature (``callback(x)``) to call after each iteration
170-
where ``x`` is the current model vector
169+
Function with signature (``callback(x, cols)``) to call after each iteration
170+
where ``x`` contains the non-zero model coefficient and ``cols`` are the
171+
indices where the current model vector is non-zero
171172
172173
Returns
173174
-------

0 commit comments

Comments
 (0)