Skip to content

Commit

Permalink
Merge pull request #624 from mrava87/bug-lssolvers
Browse files Browse the repository at this point in the history
bug: ensure array shape consistency in leastsquares solvers
  • Loading branch information
mrava87 authored Nov 25, 2024
2 parents 2d749a2 + 2102533 commit 8d9def3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pylops/optimization/cls_leastsquares.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def run(
xinv = cg(
self.Op_normal,
self.y_normal,
self.ncp.zeros(self.Op_normal.shape[1], dtype=self.Op_normal.dtype),
x0=self.ncp.zeros(self.Op_normal.shape[1], dtype=self.Op_normal.dtype),
**kwargs_solver,
)[0]
istop = None
Expand Down Expand Up @@ -594,7 +594,7 @@ def run(
xinv, istop, itn, r1norm, r2norm = cgls(
self.RegOp,
self.datatot,
self.ncp.zeros(self.RegOp.shape[1], dtype=self.RegOp.dtype),
x0=self.ncp.zeros(self.RegOp.shape[1], dtype=self.RegOp.dtype),
**kwargs_solver,
)[0:5]
else:
Expand Down Expand Up @@ -816,7 +816,7 @@ def run(
pinv, istop, itn, r1norm, r2norm = cgls(
self.POp,
self.y,
self.ncp.zeros(self.POp.shape[1], dtype=self.POp.dtype),
x0=self.ncp.zeros(self.POp.shape[1], dtype=self.POp.dtype),
**kwargs_solver,
)[0:5]
# force it 1d as we decorate this method with disable_ndarray_multiplication
Expand Down

0 comments on commit 8d9def3

Please sign in to comment.