File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -1351,17 +1351,25 @@ def _check_eig_constraints(self, eig_constraints):
13511351 msg = "Invalid eigenvalue constraint combination provided."
13521352 raise ValueError (msg )
13531353
1354- def _initialize_alpha (self ):
1354+ def _initialize_alpha (self , ** kwargs ):
13551355 """
13561356 Uses projected trapezoidal rule to approximate the eigenvalues of A in
13571357 z' = Az.
13581358 The computed eigenvalues will serve as our initial guess for alpha.
13591359
1360+ :param kwargs: Optionally provide the singular values (s) and right
1361+ singular vectors (V) of the snapshot data to compute the projection.
1362+ :type kwargs: numpy.ndarray
13601363 :return: Approximated eigenvalues of the matrix A.
13611364 :rtype: numpy.ndarray
13621365 """
1363- # Project the snapshot data onto the projection basis.
1364- ux = self ._proj_basis .conj ().T .dot (self .snapshots )
1366+ if "s" and "V" in kwargs :
1367+ # If the singular values and right singular vectors are provided,
1368+ # use them to compute the projection.
1369+ ux = np .diag (kwargs ["s" ]).dot (kwargs ["V" ])
1370+ else :
1371+ # Project the snapshot data onto the projection basis.
1372+ ux = self ._proj_basis .conj ().T .dot (self .snapshots )
13651373 ux1 = ux [:, :- 1 ]
13661374 ux2 = ux [:, 1 :]
13671375
You can’t perform that action at this time.
0 commit comments