Version: dev

toy_problem (function)

Stable function · Building and running

Tier: stable · Kind: function · Topic: Building and running

JuliaRust
toy_problemtoy::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.

Source

Example (toy)

prob = toy_problem("toy:forced_decay")
@test prob.p == [2.0, 3.0]
@test prob.u0 == [1.0]

From docs/api/examples/julia/forward_and_gradient.jl

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.

Source · Rust docs

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]);

From docs/api/examples/rust/forward_and_gradient.rs