Skip to content

Commit

Permalink
d
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitri Rusin committed May 7, 2024
1 parent ac0b9b7 commit c72571d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/cpp/problem/test_dynamic_bin_val.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<ioh::problem::DynamicBinValPareto>(landscape)->weights);
}

for (int i = 0; i < number_of_timesteps; ++i) {
landscape->step();
}
Expand Down
11 changes: 11 additions & 0 deletions tests/cpp/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<double>& 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<int> &x, const std::vector<int> &y)
{
Expand Down
21 changes: 21 additions & 0 deletions workstory.md
Original file line number Diff line number Diff line change
@@ -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
```

0 comments on commit c72571d

Please sign in to comment.