rapier2d::math

Type Alias SdpMatrix

Source
pub type SdpMatrix<N> = SdpMatrix2<N>;
Expand description

A 2D symmetric-definite-positive matrix.

Aliased Type§

struct SdpMatrix<N> {
    pub m11: N,
    pub m12: N,
    pub m22: N,
}

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

Source§

impl<N> SdpMatrix2<N>
where N: SimdRealField + Copy,

Source

pub fn new(m11: N, m12: N, m22: N) -> SdpMatrix2<N>

A new SDP 2x2 matrix with the given components.

Because the matrix is symmetric, only the lower off-diagonal component is required.

Source

pub fn from_sdp_matrix( mat: Matrix<N, Const<2>, Const<2>, ArrayStorage<N, 2, 2>>, ) -> SdpMatrix2<N>

Build an SdpMatrix2 structure from a plain matrix, assuming it is SDP.

No check is performed to ensure mat is actually SDP.

Source

pub fn zero() -> SdpMatrix2<N>

Create a new SDP matrix filled with zeros.

Source

pub fn diagonal(val: N) -> SdpMatrix2<N>

Create a new SDP matrix with its diagonal filled with val, and its off-diagonal elements set to zero.

Source

pub fn add_diagonal(&mut self, elt: N) -> SdpMatrix2<N>

Adds val to the diagonal components of self.

Source

pub fn inverse_unchecked(&self) -> SdpMatrix2<N>

Compute the inverse of this SDP matrix without performing any inversibility check.

Source

pub fn inverse_and_get_determinant_unchecked(&self) -> (SdpMatrix2<N>, N)

Compute the inverse of this SDP matrix without performing any inversibility check.

Source

pub fn into_matrix(self) -> Matrix<N, Const<2>, Const<2>, ArrayStorage<N, 2, 2>>

Convert this SDP matrix to a regular matrix representation.

Trait Implementations

Source§

impl<N> Add for SdpMatrix2<N>
where N: SimdRealField + Copy,

Source§

type Output = SdpMatrix2<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: SdpMatrix2<N>) -> SdpMatrix2<N>

Performs the + operation. Read more
Source§

impl<N> Clone for SdpMatrix2<N>
where N: Clone,

Source§

fn clone(&self) -> SdpMatrix2<N>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<N> Debug for SdpMatrix2<N>
where N: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<N> Mul<Matrix<N, Const<2>, Const<1>, ArrayStorage<N, 2, 1>>> for SdpMatrix2<N>
where N: SimdRealField + Copy,

Source§

type Output = Matrix<N, Const<2>, Const<1>, ArrayStorage<N, 2, 1>>

The resulting type after applying the * operator.
Source§

fn mul( self, rhs: Matrix<N, Const<2>, Const<1>, ArrayStorage<N, 2, 1>>, ) -> <SdpMatrix2<N> as Mul<Matrix<N, Const<2>, Const<1>, ArrayStorage<N, 2, 1>>>>::Output

Performs the * operation. Read more
Source§

impl Mul<f32> for SdpMatrix2<f32>

Source§

type Output = SdpMatrix2<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f32) -> <SdpMatrix2<f32> as Mul<f32>>::Output

Performs the * operation. Read more
Source§

impl<N> PartialEq for SdpMatrix2<N>
where N: PartialEq,

Source§

fn eq(&self, other: &SdpMatrix2<N>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<N> Copy for SdpMatrix2<N>
where N: Copy,

Source§

impl<N> StructuralPartialEq for SdpMatrix2<N>