Skip to content

Commit c4f61e7

Browse files
committed
Bug fixes
1 parent a02cf83 commit c4f61e7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pydmd/lando.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,15 @@ def compute_operator(self, X, Y, kernel_function, updating=False):
189189
y_0 = Y[:, ind_0][..., None]
190190
C = np.sqrt(kernel_function(x_0, x_0))
191191
self._sparse_dictionary = np.copy(x_0)
192+
parsing_inds = parsing_inds[1:]
192193

193194
# Initialize the online learning routine, if applicable.
194195
if self._online:
195196
self._cholesky = C
196197
self._P = np.ones((1, 1))
197198
self._weights = y_0 / (self._cholesky[0][0] ** 2)
198199

199-
for ind_t in parsing_inds[1:]:
200+
for ind_t in parsing_inds:
200201
# Grab the next corresponding pair of snapshots.
201202
x_t = X[:, ind_t][..., None]
202203
y_t = Y[:, ind_t][..., None]
@@ -297,17 +298,18 @@ def compute_linear_operator(
297298
)
298299

299300
@staticmethod
300-
def _update_cholesky(cholesky, s, k):
301+
def _update_cholesky(cholesky, s, kxx):
301302
"""
302303
Helper function that updates the cholesky factor given the current
303-
cholesky factor and the necessary quantities for updating.
304+
cholesky factor and the necessary quantities for updating. See the
305+
documentation of `_cholesky_step()` for more parameter information.
304306
"""
305307
cholesky = np.vstack(
306308
[
307309
np.hstack([cholesky, np.zeros((len(cholesky), 1))]),
308310
np.append(
309311
s.conj().T,
310-
max(0, np.abs(np.sqrt(k - np.sum(s**2)))),
312+
max(0, np.abs(np.sqrt(kxx - np.sum(s**2)))),
311313
),
312314
]
313315
)

0 commit comments

Comments
 (0)