diff --git a/tests/cpp/problem/test_dynamic_bin_val.cpp b/tests/cpp/problem/test_dynamic_bin_val.cpp index 820ef7a5..81c4d603 100644 --- a/tests/cpp/problem/test_dynamic_bin_val.cpp +++ b/tests/cpp/problem/test_dynamic_bin_val.cpp @@ -43,6 +43,11 @@ TEST_F(BaseTest, test_dynamic_bin_val_operator_call) int n_variables = x.size(); auto landscape = problem_factory.create(problem_id, instance, n_variables); + if (problem_id == 10'003) + { + print_vector(std::dynamic_pointer_cast(landscape)->weights); + } + for (int i = 0; i < number_of_timesteps; ++i) { landscape->step(); } diff --git a/tests/cpp/utils.hpp b/tests/cpp/utils.hpp index 2004c9fa..bed6c21b 100644 --- a/tests/cpp/utils.hpp +++ b/tests/cpp/utils.hpp @@ -8,6 +8,17 @@ #include "ioh/common/log.hpp" #include "ioh/common/file.hpp" +// Function to print the contents of a vector of doubles +inline void print_vector(const std::vector& weights) { + std::cout << "Vector contents: ["; + for (size_t i = 0; i < weights.size(); ++i) { + std::cout << weights[i]; + if (i != weights.size() - 1) { + std::cout << ", "; + } + } + std::cout << "]" << std::endl; +} inline void expect_vector_eq(const std::vector &x, const std::vector &y) { diff --git a/workstory.md b/workstory.md new file mode 100644 index 00000000..2af9da6d --- /dev/null +++ b/workstory.md @@ -0,0 +1,21 @@ + + + + + +```sh +pip install -e . && python -m unittest +cmake --build . --target test_ioh && ./tests/test_ioh + +rm -rf build +mkdir build +cd build +cmake .. + +cmake --build . --target test_dynamic_bin_val && ./tests/test_dynamic_bin_val +``` + +```sh +git restore --source other-branch --worktree -- path/to/your/file +git restore --source workstory --worktree -- workstory.md +```