1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! The swappable trust-region subproblem seam of the Powell DFO family.
//!
//! Every solver in the family minimizes the shared [`QuadraticModel`] over a
//! trust region `‖d‖ ≤ Δ`, but each intersects that ball with its own feasible
//! region: nothing for NEWUOA, a box for BOBYQA, linear constraints for LINCOA.
//! [`TrustRegionSubproblem`] captures exactly that one degree of freedom — the
//! model core, the `H` update, and the driver loop are otherwise identical.
//!
//! The associated [`Region`](TrustRegionSubproblem::Region) type carries the
//! per-solver feasibility data (`()`, a shifted box, …) rather than a shared
//! constraint supertrait, keeping the box / linear / unconstrained cases
//! distinct — consistent with basin's constraint design (`.claude/rules/`).
use QuadraticModel;
use crateScalar;
/// The outcome of one trust-region subproblem solve.
///
/// Shared by every [`TrustRegionSubproblem`] implementation (NEWUOA's TRSAPP,
/// BOBYQA's TRSBOX, …) so the driver consumes a uniform result regardless of
/// which subproblem produced the step.
pub
/// A strategy that approximately minimizes the model over a trust region
/// intersected with a feasible [`Region`](Self::Region).
///
/// NEWUOA supplies TRSAPP (`Region = ()`), BOBYQA supplies TRSBOX
/// (`Region` = the shifted box), LINCOA a projected-Krylov solver. The
/// implementor is a lightweight strategy value; the model is borrowed.
pub