Skip to content

Commit

Permalink
[iosys] make usage of sv_U_V more idiomatic
Browse files Browse the repository at this point in the history
  • Loading branch information
sdrave committed Nov 23, 2016
1 parent 913fbcb commit 5dc3f8f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/pymor/discretizations/iosys.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ def sv_U_V(self, typ, me_solver=None):
of = self.gramian(typ, 'of', me_solver=me_solver)

U, sv, Vh = spla.svd(self.E.apply2(of, cf))
return sv, NumpyVectorSpace.make_array(U.T), NumpyVectorSpace.make_array(Vh)
return sv, U.T, Vh

@cached
def norm(self, name='H2', me_solver=None):
Expand Down
5 changes: 2 additions & 3 deletions src/pymor/reductors/bt.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from pymor.algorithms.gram_schmidt import gram_schmidt
from pymor.reductors.basic import reduce_generic_pg
from pymor.operators.constructions import VectorArrayOperator


def bt(discretization, r=None, tol=None, typ='lyap', me_solver=None, method='bfsr'):
Expand Down Expand Up @@ -85,8 +84,8 @@ def bt(discretization, r=None, tol=None, typ='lyap', me_solver=None, method='bfs
r_tol = np.argmax(bounds <= tol) + 1
r = r_tol if r is None else min([r, r_tol])

V = VectorArrayOperator(cf, space_id='STATE').apply(V[:r])
W = VectorArrayOperator(of, space_id='STATE').apply(U[:r])
V = cf.lincomb(V[:r])
W = of.lincomb(U[:r])

if method == 'sr':
alpha = 1 / np.sqrt(sv[:r])
Expand Down

0 comments on commit 5dc3f8f

Please sign in to comment.