Skip to content

Commit

Permalink
Refactor window rdim/ef in local_tw
Browse files Browse the repository at this point in the history
  • Loading branch information
ckendrick committed Apr 25, 2024
1 parent 5ce9d42 commit 833e1d9
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions examples/dmd/local_tw_csv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,26 +533,33 @@ int main(int argc, char *argv[])

for (int window = 0; window < numWindows; ++window)
{
if (rdim != -1 || use_rdim_windows)
if (window_list.size() > 0)
{
if (use_rdim_windows) {
rdim = window_list[window];
} else {
ef = window_list[window];
}
}

if (rdim != -1)
{
int window_rdim = use_rdim_windows ? window_list[window] : rdim;
if (myid == 0)
{
cout << "Creating DMD model #" << window << " with rdim: " << window_rdim <<
cout << "Creating DMD model #" << window << " with rdim: " << rdim <<
endl;
}
CAROM_VERIFY(window_rdim <= windowNumSamples);
dmd[window]->train(window_rdim);
CAROM_VERIFY(rdim <= windowNumSamples);
dmd[window]->train(rdim);
}
else if (ef != -1 || window_list.size() > 0)
else if (ef != -1)
{
double window_ef = window_list.size() > 0 ? window_list[window] : ef;
if (myid == 0)
{
cout << "Creating DMD model #" << window << " with energy fraction: "
<< window_ef << endl;
<< ef << endl;
}
dmd[window]->train(window_ef);
dmd[window]->train(ef);
}
dmd[window]->save(outputPath + "/window" + to_string(window));
if (myid == 0)
Expand Down

0 comments on commit 833e1d9

Please sign in to comment.