Skip to main content

Subproblem

Struct Subproblem 

Source
pub struct Subproblem<'a> { /* private fields */ }
Expand description

The trust-region subproblem at one outer iteration, in scaled coordinates.

Holds the column-scaled Jacobian J̃ and scaled gradient g̃; a solver returns a scaled step δ̃ with ‖δ̃‖ ≤ Δ.

Implementations§

Source§

impl<'a> Subproblem<'a>

Source

pub fn new(jacobian: MatRef<'a, f64>, gradient: MatRef<'a, f64>) -> Self

Build a subproblem view over the scaled Jacobian and scaled gradient.

Source

pub fn n_params(&self) -> usize

Number of free parameters p.

Source

pub fn gradient(&self) -> MatRef<'_, f64>

The scaled gradient g̃ (p×1).

Source

pub fn jacobian(&self) -> MatRef<'_, f64>

The column-scaled Jacobian J̃ (m×p). Dense methods (dogleg) form the Gauss–Newton system from it; Krylov methods should prefer hvec.

Source

pub fn jvec(&self, v: MatRef<'_, f64>) -> Mat<f64>

Matrix-free product J̃·v (m×1) — never forms J̃ᵀJ̃.

Source

pub fn jtvec(&self, u: MatRef<'_, f64>) -> Mat<f64>

Matrix-free product J̃ᵀ·u (p×1).

Source

pub fn hvec(&self, v: MatRef<'_, f64>) -> Mat<f64>

Hessian–vector product H·v = J̃ᵀ(J̃·v) (p×1) without forming H.

Source

pub fn predicted_reduction(&self, s: MatRef<'_, f64>) -> f64

Predicted reduction of ½‖r‖² for a scaled step δ̃: −g̃ᵀδ̃ − ½‖J̃δ̃‖² (positive for a descent step).

Auto Trait Implementations§

§

impl<'a> Freeze for Subproblem<'a>

§

impl<'a> RefUnwindSafe for Subproblem<'a>

§

impl<'a> Send for Subproblem<'a>

§

impl<'a> Sync for Subproblem<'a>

§

impl<'a> Unpin for Subproblem<'a>

§

impl<'a> UnsafeUnpin for Subproblem<'a>

§

impl<'a> UnwindSafe for Subproblem<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> DistributionExt for T
where T: ?Sized,

§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V