Skip to content

Commit

Permalink
hack NumpyVectorArray.axpy into using dger
Browse files Browse the repository at this point in the history
  • Loading branch information
sdrave committed Aug 24, 2023
1 parent 43d823d commit 87ac3e5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/pymor/vectorarrays/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ def axpy(self, alpha, x, ind, xind):
self._array = self._array.astype(dtype)

if type(alpha) is np.ndarray:
if len(B) == 1:
from scipy.linalg.blas import dger
a = self._array[ind]
if len(a) == 0:
return
dger(1., B.ravel(), alpha, a=a.T, overwrite_x=0, overwrite_y=0, overwrite_a=1)
return
alpha = alpha[:, np.newaxis]

if isinstance(alpha, Number):
Expand Down

0 comments on commit 87ac3e5

Please sign in to comment.