From 70945e64a32a7af95a2a9db23e82ffd58e9c512f Mon Sep 17 00:00:00 2001 From: Michael Tupek Date: Thu, 19 Mar 2026 13:58:48 -0700 Subject: [PATCH 1/2] Allow some backwards compatability. --- src/gretl/data_store.cpp | 6 ++++++ src/gretl/data_store.hpp | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/gretl/data_store.cpp b/src/gretl/data_store.cpp index bfbaaaf..497dd0f 100644 --- a/src/gretl/data_store.cpp +++ b/src/gretl/data_store.cpp @@ -7,11 +7,17 @@ #include #include "data_store.hpp" #include "state.hpp" +#include "wang_checkpoint_strategy.hpp" #include #include namespace gretl { +DataStore::DataStore(size_t checkpoint_budget) + : DataStore(std::make_unique(checkpoint_budget)) +{ +} + DataStore::DataStore(std::unique_ptr strategy) : checkpointStrategy_(std::move(strategy)) { currentStep_ = 0; diff --git a/src/gretl/data_store.hpp b/src/gretl/data_store.hpp index 9e9955f..5f27bf0 100644 --- a/src/gretl/data_store.hpp +++ b/src/gretl/data_store.hpp @@ -55,6 +55,9 @@ struct defaultInitializeZeroDual { /// checkpointing state information, and its backpropagated sensitivities class DataStore { public: + /// @brief Backward-compat constructor using a Wang checkpoint budget. + explicit DataStore(size_t checkpoint_budget); + /// @brief Constructor requiring a checkpoint strategy. /// @param strategy a checkpoint strategy implementation (e.g., WangCheckpointStrategy, /// StrummWaltherCheckpointStrategy) From 0d867b28a90bd127947c50f72e3ca687105b87e3 Mon Sep 17 00:00:00 2001 From: Michael Tupek Date: Thu, 19 Mar 2026 14:20:38 -0700 Subject: [PATCH 2/2] Style. --- src/gretl/data_store.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gretl/data_store.cpp b/src/gretl/data_store.cpp index 497dd0f..679092f 100644 --- a/src/gretl/data_store.cpp +++ b/src/gretl/data_store.cpp @@ -13,8 +13,7 @@ namespace gretl { -DataStore::DataStore(size_t checkpoint_budget) - : DataStore(std::make_unique(checkpoint_budget)) +DataStore::DataStore(size_t checkpoint_budget) : DataStore(std::make_unique(checkpoint_budget)) { }