Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/sample_generator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class SampleGenerator
int max_num_snapshots = 100;
bool save_sv = false;
bool update_right_SV = false;
bool square_sv = true;
const bool incremental = false;
Array<CAROM::Options*> snapshot_options;
Array<CAROM::BasisGenerator*> snapshot_generators;
Expand Down
4 changes: 3 additions & 1 deletion src/sample_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ SampleGenerator::SampleGenerator(MPI_Comm comm)
// BasisGenerator options.
update_right_SV = config.GetOption<bool>("basis/svd/update_right_sv", false);
save_sv = config.GetOption<bool>("basis/svd/save_spectrum", false);
square_sv = config.GetOption<bool>("basis/svd/square_sv", true);
}

SampleGenerator::~SampleGenerator()
Expand Down Expand Up @@ -573,7 +574,8 @@ void SampleGenerator::SaveSV(CAROM::BasisGenerator *basis_generator, const std::
for (int d = 0; d < rom_sv->dim(); d++)
{
if (d == ref_num_basis) coverage = total;
total += rom_sv->item(d);
const double s = rom_sv->item(d);
total += square_sv ? s * s : s;
}
if (rom_sv->dim() == ref_num_basis) coverage = total;
coverage /= total;
Expand Down
Loading