toy_problem (function)
Stable function · Building and running
Tier: stable · Kind: function · Topic: Building and running
| Julia | Rust |
|---|---|
toy_problem | toy::toy_problem |
Julia
toy_problem(model::AbstractString)
toy_problem(model) -> ToyProblem
The toy problem a conformance case’s model names: toy:<problem> or
toy:<problem>/<variant> (toy-problems.md §2). Accepted only from the test
harness; a real run config names an .esm document.
Example (toy)
prob = toy_problem("toy:forced_decay")
@test prob.p == [2.0, 3.0]
@test prob.u0 == [1.0]
Rust
pub fn toy_problem<T: Scalar>(model: &str) -> Result<ToyProblem<T>, Error>
Builds the toy problem a case’s model: "toy:<problem>[/<variant>]" names.
Example (toy)
let prob = toy_problem::<f64>("toy:forced_decay").unwrap();
assert_eq!(prob.p, vec![2.0, 3.0]);
assert_eq!(prob.u0, vec![1.0]);