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,
impl<N> SdpMatrix2<N>where
N: SimdRealField + Copy,
Sourcepub fn new(m11: N, m12: N, m22: N) -> SdpMatrix2<N>
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.
Sourcepub fn from_sdp_matrix(
mat: Matrix<N, Const<2>, Const<2>, ArrayStorage<N, 2, 2>>,
) -> SdpMatrix2<N>
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.
Sourcepub fn zero() -> SdpMatrix2<N>
pub fn zero() -> SdpMatrix2<N>
Create a new SDP matrix filled with zeros.
Sourcepub fn diagonal(val: N) -> SdpMatrix2<N>
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.
Sourcepub fn add_diagonal(&mut self, elt: N) -> SdpMatrix2<N>
pub fn add_diagonal(&mut self, elt: N) -> SdpMatrix2<N>
Adds val
to the diagonal components of self
.
Sourcepub fn inverse_unchecked(&self) -> SdpMatrix2<N>
pub fn inverse_unchecked(&self) -> SdpMatrix2<N>
Compute the inverse of this SDP matrix without performing any inversibility check.
Sourcepub fn inverse_and_get_determinant_unchecked(&self) -> (SdpMatrix2<N>, N)
pub fn inverse_and_get_determinant_unchecked(&self) -> (SdpMatrix2<N>, N)
Compute the inverse of this SDP matrix without performing any inversibility check.
Sourcepub fn into_matrix(self) -> Matrix<N, Const<2>, Const<2>, ArrayStorage<N, 2, 2>>
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,
impl<N> Add for SdpMatrix2<N>where
N: SimdRealField + Copy,
Source§type Output = SdpMatrix2<N>
type Output = SdpMatrix2<N>
+
operator.Source§fn add(self, rhs: SdpMatrix2<N>) -> SdpMatrix2<N>
fn add(self, rhs: SdpMatrix2<N>) -> SdpMatrix2<N>
+
operation. Read moreSource§impl<N> Clone for SdpMatrix2<N>where
N: Clone,
impl<N> Clone for SdpMatrix2<N>where
N: Clone,
Source§fn clone(&self) -> SdpMatrix2<N>
fn clone(&self) -> SdpMatrix2<N>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<N> Debug for SdpMatrix2<N>where
N: Debug,
impl<N> Debug for SdpMatrix2<N>where
N: Debug,
Source§impl<N> Mul<Matrix<N, Const<2>, Const<1>, ArrayStorage<N, 2, 1>>> for SdpMatrix2<N>where
N: SimdRealField + Copy,
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>>
type Output = Matrix<N, Const<2>, Const<1>, ArrayStorage<N, 2, 1>>
*
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
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
*
operation. Read more