From 57e95e90f712462b6f5c6a4158fa032ae7603bc2 Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Mon, 27 Dec 2021 10:13:07 +0100 Subject: [PATCH] Small cleanup in SD::BatchOptimizer --- .../differentiation/sd/symengine_optimizer.h | 17 ++++++++--------- .../differentiation/sd/symengine_optimizer.cc | 9 +++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/deal.II/differentiation/sd/symengine_optimizer.h b/include/deal.II/differentiation/sd/symengine_optimizer.h index 89e203c647..3b12911033 100644 --- a/include/deal.II/differentiation/sd/symengine_optimizer.h +++ b/include/deal.II/differentiation/sd/symengine_optimizer.h @@ -1477,16 +1477,15 @@ namespace Differentiation OptimizationFlags::optimize_all); /** - * Copy constructor + * Copy constructor. * - * The @p copy_initialized flag, which is set to true by default, - * determines whether or not all of the optimized data is copied over from - * the @p other optimizer instance. Only with the flag set to false - * is it possible to re-optimize the data stored in this class with a - * different optimization scheme. - */ - BatchOptimizer(const BatchOptimizer &other/*, - const bool copy_initialized = true*/); + * @note The optimized data and results from previous substitutions + * executed by the @p other optimizer instance are not copied over. + * It is therefore necessary to re-optimize the data stored in + * this class, and it is possible to do so with a different optimization + * scheme. + */ + BatchOptimizer(const BatchOptimizer &other); /** * Move constructor. diff --git a/source/differentiation/sd/symengine_optimizer.cc b/source/differentiation/sd/symengine_optimizer.cc index db0c0840bb..db797da9af 100644 --- a/source/differentiation/sd/symengine_optimizer.cc +++ b/source/differentiation/sd/symengine_optimizer.cc @@ -63,6 +63,7 @@ namespace Differentiation , dependent_variables_output(0) , map_dep_expr_vec_entry(other.map_dep_expr_vec_entry) , ready_for_value_extraction(false) + , has_been_serialized(false) {} @@ -215,7 +216,7 @@ namespace Differentiation template SD::types::symbol_vector - BatchOptimizer::get_independent_symbols(void) const + BatchOptimizer::get_independent_symbols() const { return Utilities::extract_symbols(independent_variables_symbols); } @@ -224,7 +225,7 @@ namespace Differentiation template std::size_t - BatchOptimizer::n_independent_variables(void) const + BatchOptimizer::n_independent_variables() const { return independent_variables_symbols.size(); } @@ -271,7 +272,7 @@ namespace Differentiation template const SD::types::symbol_vector & - BatchOptimizer::get_dependent_functions(void) const + BatchOptimizer::get_dependent_functions() const { return dependent_variables_functions; } @@ -280,7 +281,7 @@ namespace Differentiation template std::size_t - BatchOptimizer::n_dependent_variables(void) const + BatchOptimizer::n_dependent_variables() const { if (has_been_serialized == false) { -- 2.39.5