pub struct SquaredAffine {
pub weight: f64,
pub coefs: Vec<(usize, f64)>,
pub constant: f64,
}Expand description
One w·(bᵀx + d)² term of a FactoredQuadratic.
coefs is b, ascending by variable index and free of stored zeros —
the same convention Quad2::linear keeps, because that is where it
comes from. It may be empty, which is a square of a constant: the
term is then w·d², contributes nothing to the gradient or the
Hessian, and is kept rather than folded so that the value is still
computed the way it was written.
Fields§
§weight: f64The constant the square is multiplied by, sign of the sum spine already folded in.
coefs: Vec<(usize, f64)>b, ascending by variable index.
constant: f64d.
Trait Implementations§
Source§impl Clone for SquaredAffine
impl Clone for SquaredAffine
Source§fn clone(&self) -> SquaredAffine
fn clone(&self) -> SquaredAffine
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SquaredAffine
impl Debug for SquaredAffine
Source§impl PartialEq for SquaredAffine
impl PartialEq for SquaredAffine
impl StructuralPartialEq for SquaredAffine
Auto Trait Implementations§
impl Freeze for SquaredAffine
impl RefUnwindSafe for SquaredAffine
impl Send for SquaredAffine
impl Sync for SquaredAffine
impl Unpin for SquaredAffine
impl UnsafeUnpin for SquaredAffine
impl UnwindSafe for SquaredAffine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T, U> Imply<T> for U
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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