From da1cd272b8b46f778a2ba5fbd51519a259800218 Mon Sep 17 00:00:00 2001 From: Axel Larsson <65452706+axla-io@users.noreply.github.com> Date: Mon, 24 Mar 2025 23:46:43 -0400 Subject: [PATCH] change temp stash --- include/sample_generator.hpp | 1 + src/sample_generator.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/sample_generator.hpp b/include/sample_generator.hpp index 118c297c..4c59c0cb 100644 --- a/include/sample_generator.hpp +++ b/include/sample_generator.hpp @@ -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 snapshot_options; Array snapshot_generators; diff --git a/src/sample_generator.cpp b/src/sample_generator.cpp index d58c0e68..66e02c84 100644 --- a/src/sample_generator.cpp +++ b/src/sample_generator.cpp @@ -68,6 +68,7 @@ SampleGenerator::SampleGenerator(MPI_Comm comm) // BasisGenerator options. update_right_SV = config.GetOption("basis/svd/update_right_sv", false); save_sv = config.GetOption("basis/svd/save_spectrum", false); + square_sv = config.GetOption("basis/svd/square_sv", true); } SampleGenerator::~SampleGenerator() @@ -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;