Bring the whole workspace into compliance with the repo's rustfmt config (edition 2024, max_width 100, use_small_heuristics = "Max"), which had drifted across many crates. Pure formatting — no logic changes; `cargo fmt --check` is now clean and `cargo build --workspace` is green.
16 lines
534 B
Rust
16 lines
534 B
Rust
use lawsynth_opt::{CoordinateConfig, ParameterBounds, coordinate_minimize};
|
|
|
|
#[test]
|
|
fn coordinate_search_clamps_initial_and_proposed_values_to_inclusive_bounds() {
|
|
let bounds = ParameterBounds::new(-1.0, 1.0).unwrap();
|
|
let result = coordinate_minimize(
|
|
&[10.0],
|
|
bounds,
|
|
CoordinateConfig { initial_step: 0.5, minimum_step: 1e-5, max_iterations: 100 },
|
|
|point| (point[0] - 4.0).powi(2),
|
|
)
|
|
.unwrap();
|
|
assert_eq!(result.parameters, vec![1.0]);
|
|
assert_eq!(result.objective, 9.0);
|
|
}
|