pub trait Problem: Clone {
type Value: Clone;
const NAME: &'static str;
// Required methods
fn dims(&self) -> Vec<usize>;
fn evaluate(&self, config: &[usize]) -> Self::Value;
fn variant() -> Vec<(&'static str, &'static str)>;
// Provided methods
fn num_variables(&self) -> usize { ... }
fn problem_type() -> ProblemType { ... }
}Expand description
Minimal problem trait — a problem is a function from configuration to value.
This trait defines the interface for computational problems that can be solved by enumeration or reduction to other problems.
Required Associated Constants§
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn num_variables(&self) -> usize
fn num_variables(&self) -> usize
Number of variables (derived from dims).
Sourcefn problem_type() -> ProblemType
fn problem_type() -> ProblemType
Look up this problem’s catalog entry.
Returns the full [ProblemType] metadata from the catalog registry.
The default implementation uses Self::NAME to perform the lookup.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.