dwavesystems / dwavesystems/dwave-optimization
Consider requiring two mutation method for all `DecisionNode`s
Open
enhancement
- Dominant language
- C++
- Stars
- 31
- Forks
- 36
- Avg merge
- 16h 55m
- Merged PRs (30d)
- 8
Description
We should consider requiring every decision to implement the following methods
```c++
class ArrayDecisionNode : public ArrayNode, public DecisionNode {
public:
// override the current state with a new one (specified as a flattened array).
void assign(State& state, std::span values) const = 0;
// override specific indices of the array
void set_values(State& state, std::span> values) const = 0;
};
```
the responsibility would be on the caller to ensure the given state/changes result in a valid state for the decision, but each implementation should `assert(...)` for correctness.
Contributor guide
Assessment
This issue has not been assessed yet.