From: Jean-Paul Pelteret Date: Mon, 27 Dec 2021 09:13:07 +0000 (+0100) Subject: Small cleanup in SD::BatchOptimizer X-Git-Tag: v9.4.0-rc1~701^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13139%2Fhead;p=dealii.git Small cleanup in SD::BatchOptimizer --- 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) {