Struct parry3d::utils::SdpMatrix2
source · [−]pub struct SdpMatrix2<N> {
pub m11: N,
pub m12: N,
pub m22: N,
}
Expand description
A 2x2 symmetric-definite-positive matrix.
Fields
m11: N
The component at the first row and first column of this matrix.
m12: N
The component at the first row and second column of this matrix.
m22: N
The component at the second row and second column of this matrix.
Implementations
sourceimpl<N: SimdRealField + Copy> SdpMatrix2<N>
impl<N: SimdRealField + Copy> SdpMatrix2<N>
sourcepub fn new(m11: N, m12: N, m22: N) -> Self
pub fn new(m11: N, m12: N, m22: N) -> Self
A new SDP 2x2 matrix with the given components.
Because the matrix is symmetric, only the lower off-diagonal component is required.
sourcepub fn from_sdp_matrix(mat: Matrix2<N>) -> Self
pub fn from_sdp_matrix(mat: Matrix2<N>) -> Self
Build an SdpMatrix2
structure from a plain matrix, assuming it is SDP.
No check is performed to ensure mat
is actually SDP.
sourcepub fn diagonal(val: N) -> Self
pub fn diagonal(val: N) -> Self
Create a new SDP matrix with its diagonal filled with val
, and its off-diagonal elements set to zero.
sourcepub fn add_diagonal(&mut self, elt: N) -> Self
pub fn add_diagonal(&mut self, elt: N) -> Self
Adds val
to the diagonal components of self
.
sourcepub fn inverse_unchecked(&self) -> Self
pub fn inverse_unchecked(&self) -> Self
Compute the inverse of this SDP matrix without performing any inversibility check.
sourcepub fn into_matrix(self) -> Matrix2<N>
pub fn into_matrix(self) -> Matrix2<N>
Convert this SDP matrix to a regular matrix representation.
Trait Implementations
sourceimpl<N: SimdRealField + Copy> Add<SdpMatrix2<N>> for SdpMatrix2<N>
impl<N: SimdRealField + Copy> Add<SdpMatrix2<N>> for SdpMatrix2<N>
type Output = SdpMatrix2<N>
type Output = SdpMatrix2<N>
The resulting type after applying the +
operator.
sourcefn add(self, rhs: SdpMatrix2<N>) -> Self
fn add(self, rhs: SdpMatrix2<N>) -> Self
Performs the +
operation. Read more
sourceimpl<N: Clone> Clone for SdpMatrix2<N>
impl<N: Clone> Clone for SdpMatrix2<N>
sourcefn clone(&self) -> SdpMatrix2<N>
fn clone(&self) -> SdpMatrix2<N>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<N: Debug> Debug for SdpMatrix2<N>
impl<N: Debug> Debug for SdpMatrix2<N>
sourceimpl<N: SimdRealField + Copy> Mul<Matrix<N, Const<2_usize>, Const<1_usize>, ArrayStorage<N, 2_usize, 1_usize>>> for SdpMatrix2<N>
impl<N: SimdRealField + Copy> Mul<Matrix<N, Const<2_usize>, Const<1_usize>, ArrayStorage<N, 2_usize, 1_usize>>> for SdpMatrix2<N>
sourceimpl Mul<f32> for SdpMatrix2<Real>
impl Mul<f32> for SdpMatrix2<Real>
sourceimpl<N: PartialEq> PartialEq<SdpMatrix2<N>> for SdpMatrix2<N>
impl<N: PartialEq> PartialEq<SdpMatrix2<N>> for SdpMatrix2<N>
sourcefn eq(&self, other: &SdpMatrix2<N>) -> bool
fn eq(&self, other: &SdpMatrix2<N>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &SdpMatrix2<N>) -> bool
fn ne(&self, other: &SdpMatrix2<N>) -> bool
This method tests for !=
.
impl<N: Copy> Copy for SdpMatrix2<N>
impl<N> StructuralPartialEq for SdpMatrix2<N>
Auto Trait Implementations
impl<N> RefUnwindSafe for SdpMatrix2<N> where
N: RefUnwindSafe,
impl<N> Send for SdpMatrix2<N> where
N: Send,
impl<N> Sync for SdpMatrix2<N> where
N: Sync,
impl<N> Unpin for SdpMatrix2<N> where
N: Unpin,
impl<N> UnwindSafe for SdpMatrix2<N> where
N: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
sourceimpl<T> DowncastSync for T where
T: Any + Send + Sync,
impl<T> DowncastSync for T where
T: Any + Send + Sync,
sourceimpl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
sourcefn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
sourcefn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
sourcefn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
sourcefn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more