Struct SymmetricDMat6

Source
pub struct SymmetricDMat6 {
    pub a: SymmetricDMat3,
    pub b: DMat3,
    pub d: SymmetricDMat3,
}
Expand description

The bottom left triangle (including the diagonal) of a symmetric 6x6 column-major matrix.

This is useful for storing a symmetric 6x6 matrix in a more compact form and performing some matrix operations more efficiently.

Some defining properties of symmetric matrices include:

  • The matrix is equal to its transpose.
  • The matrix has real eigenvalues.
  • The eigenvectors corresponding to the eigenvalues are orthogonal.
  • The matrix is always diagonalizable.

The sum and difference of two symmetric matrices is always symmetric. However, the product of two symmetric matrices is only symmetric if the matrices are commutable, meaning that AB = BA.

The 6x6 matrix is represented as:

[ A  BT ]
[ B  D  ]

Fields§

§a: SymmetricDMat3

The bottom left triangle of the top left 3x3 block of the matrix, including the diagonal.

§b: DMat3

The bottom left 3x3 block of the matrix.

§d: SymmetricDMat3

The bottom left triangle of the bottom right 3x3 block of the matrix, including the diagonal.

Implementations§

Source§

impl SymmetricDMat6

Source

pub const ZERO: Self

A symmetric 6x6 matrix with all elements set to 0.0.

Source

pub const IDENTITY: Self

A symmetric 6x6 identity matrix, where all diagonal elements are 1.0, and all off-diagonal elements are 0.0.

Source

pub const NAN: Self

All NaNs.

Source

pub const fn new(a: SymmetricDMat3, b: DMat3, d: SymmetricDMat3) -> Self

Creates a new symmetric 6x6 matrix from its bottom left triangle, including diagonal elements.

The matrix is represented as:

[ A  BT ]
[ B  D  ]
Source

pub fn from_outer_product(v1: DVec3, v2: DVec3) -> Self

Creates a new symmetric 6x6 matrix from the outer product [v1, v2] * [v1, v2]^T.

Source

pub fn is_finite(&self) -> bool

Returns true if, and only if, all elements are finite. If any element is either NaN or positive or negative infinity, this will return false.

Source

pub fn is_nan(&self) -> bool

Returns true if any elements are NaN.

Source

pub fn abs(&self) -> Self

Takes the absolute value of each element in self.

Source

pub fn mul_vec6(&self, rhs1: DVec3, rhs2: DVec3) -> (DVec3, DVec3)

Transforms a 6x1 vector that is split into two 3x1 vectors.

Source

pub fn ldlt_solve(&self, rhs1: DVec3, rhs2: DVec3) -> (DVec3, DVec3)

Solves self * [x1, x2] = [rhs1, rhs2] for x1 and x2 using the LDLT decomposition.

self must be a positive semidefinite matrix.

Source

pub fn add_symmetric_mat6(&self, rhs: &Self) -> Self

Adds two symmetric 6x6 matrices.

Source

pub fn sub_symmetric_mat6(&self, rhs: &Self) -> Self

Subtracts two symmetric 6x6 matrices.

Source

pub fn mul_scalar(&self, rhs: f64) -> Self

Multiplies a 6x6 matrix by a scalar.

Source

pub fn div_scalar(&self, rhs: f64) -> Self

Divides a 6x6 matrix by a scalar.

Source§

impl SymmetricDMat6

Source

pub fn as_symmetric_mat6(&self) -> SymmetricMat6

Returns the single precision version of self.

Trait Implementations§

Source§

impl Add<&&SymmetricDMat6> for &SymmetricDMat6

Source§

type Output = SymmetricDMat6

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Self) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<&SymmetricDMat6> for SymmetricDMat6

Source§

type Output = SymmetricDMat6

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Self) -> Self::Output

Performs the + operation. Read more
Source§

impl Add for &SymmetricDMat6

Source§

type Output = SymmetricDMat6

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl Add for SymmetricDMat6

Source§

type Output = SymmetricDMat6

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl AddAssign<&SymmetricDMat6> for SymmetricDMat6

Source§

fn add_assign(&mut self, rhs: &Self)

Performs the += operation. Read more
Source§

impl AddAssign for SymmetricDMat6

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl Clone for SymmetricDMat6

Source§

fn clone(&self) -> SymmetricDMat6

Returns a duplicate 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 Debug for SymmetricDMat6

Source§

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

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

impl Default for SymmetricDMat6

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for SymmetricDMat6

Source§

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

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

impl Div<&SymmetricDMat6> for &f64

Source§

type Output = SymmetricDMat6

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &SymmetricDMat6) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&SymmetricDMat6> for f64

Source§

type Output = SymmetricDMat6

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &SymmetricDMat6) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&f64> for &SymmetricDMat6

Source§

type Output = SymmetricDMat6

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &f64) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&f64> for SymmetricDMat6

Source§

type Output = SymmetricDMat6

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &f64) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<SymmetricDMat6> for &f64

Source§

type Output = SymmetricDMat6

The resulting type after applying the / operator.
Source§

fn div(self, rhs: SymmetricDMat6) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<SymmetricDMat6> for f64

Source§

type Output = SymmetricDMat6

The resulting type after applying the / operator.
Source§

fn div(self, rhs: SymmetricDMat6) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<f64> for &SymmetricDMat6

Source§

type Output = SymmetricDMat6

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f64) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<f64> for SymmetricDMat6

Source§

type Output = SymmetricDMat6

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f64) -> Self::Output

Performs the / operation. Read more
Source§

impl DivAssign<&f64> for SymmetricDMat6

Source§

fn div_assign(&mut self, rhs: &f64)

Performs the /= operation. Read more
Source§

impl DivAssign<f64> for SymmetricDMat6

Source§

fn div_assign(&mut self, rhs: f64)

Performs the /= operation. Read more
Source§

impl FromReflect for SymmetricDMat6

Source§

fn from_reflect(reflect: &dyn PartialReflect) -> Option<Self>

Constructs a concrete instance of Self from a reflected value.
Source§

fn take_from_reflect( reflect: Box<dyn PartialReflect>, ) -> Result<Self, Box<dyn PartialReflect>>

Attempts to downcast the given value to Self using, constructing the value using from_reflect if that fails. Read more
Source§

impl GetTypeRegistration for SymmetricDMat6

Source§

fn get_type_registration() -> TypeRegistration

Returns the default TypeRegistration for this type.
Source§

fn register_type_dependencies(registry: &mut TypeRegistry)

Registers other types needed by this type. Read more
Source§

impl Mul<&SymmetricDMat6> for &f64

Source§

type Output = SymmetricDMat6

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &SymmetricDMat6) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&SymmetricDMat6> for f64

Source§

type Output = SymmetricDMat6

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &SymmetricDMat6) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&f64> for &SymmetricDMat6

Source§

type Output = SymmetricDMat6

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &f64) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&f64> for SymmetricDMat6

Source§

type Output = SymmetricDMat6

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &f64) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<SymmetricDMat6> for &f64

Source§

type Output = SymmetricDMat6

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: SymmetricDMat6) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<SymmetricDMat6> for f64

Source§

type Output = SymmetricDMat6

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: SymmetricDMat6) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<f64> for &SymmetricDMat6

Source§

type Output = SymmetricDMat6

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f64) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<f64> for SymmetricDMat6

Source§

type Output = SymmetricDMat6

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f64) -> Self::Output

Performs the * operation. Read more
Source§

impl MulAssign<&f64> for SymmetricDMat6

Source§

fn mul_assign(&mut self, rhs: &f64)

Performs the *= operation. Read more
Source§

impl MulAssign<f64> for SymmetricDMat6

Source§

fn mul_assign(&mut self, rhs: f64)

Performs the *= operation. Read more
Source§

impl Neg for &SymmetricDMat6

Source§

type Output = SymmetricDMat6

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl Neg for SymmetricDMat6

Source§

type Output = SymmetricDMat6

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl PartialEq for SymmetricDMat6

Source§

fn eq(&self, other: &SymmetricDMat6) -> 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 PartialReflect for SymmetricDMat6

Source§

fn get_represented_type_info(&self) -> Option<&'static TypeInfo>

Returns the TypeInfo of the type represented by this value. Read more
Source§

fn try_apply(&mut self, value: &dyn PartialReflect) -> Result<(), ApplyError>

Tries to apply a reflected value to this value. Read more
Source§

fn reflect_kind(&self) -> ReflectKind

Returns a zero-sized enumeration of “kinds” of type. Read more
Source§

fn reflect_ref(&self) -> ReflectRef<'_>

Returns an immutable enumeration of “kinds” of type. Read more
Source§

fn reflect_mut(&mut self) -> ReflectMut<'_>

Returns a mutable enumeration of “kinds” of type. Read more
Source§

fn reflect_owned(self: Box<Self>) -> ReflectOwned

Returns an owned enumeration of “kinds” of type. Read more
Source§

fn try_into_reflect( self: Box<Self>, ) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>

Attempts to cast this type to a boxed, fully-reflected value.
Source§

fn try_as_reflect(&self) -> Option<&dyn Reflect>

Attempts to cast this type to a fully-reflected value.
Source§

fn try_as_reflect_mut(&mut self) -> Option<&mut dyn Reflect>

Attempts to cast this type to a mutable, fully-reflected value.
Source§

fn into_partial_reflect(self: Box<Self>) -> Box<dyn PartialReflect>

Casts this type to a boxed, reflected value. Read more
Source§

fn as_partial_reflect(&self) -> &dyn PartialReflect

Casts this type to a reflected value. Read more
Source§

fn as_partial_reflect_mut(&mut self) -> &mut dyn PartialReflect

Casts this type to a mutable, reflected value. Read more
Source§

fn reflect_partial_eq(&self, value: &dyn PartialReflect) -> Option<bool>

Returns a “partial equality” comparison result. Read more
Source§

fn reflect_clone(&self) -> Result<Box<dyn Reflect>, ReflectCloneError>

Attempts to clone Self using reflection. Read more
Source§

fn apply(&mut self, value: &(dyn PartialReflect + 'static))

Applies a reflected value to this value. Read more
Source§

fn to_dynamic(&self) -> Box<dyn PartialReflect>

Converts this reflected value into its dynamic representation based on its kind. Read more
Source§

fn reflect_clone_and_take<T>(&self) -> Result<T, ReflectCloneError>
where T: 'static, Self: Sized + TypePath,

For a type implementing PartialReflect, combines reflect_clone and take in a useful fashion, automatically constructing an appropriate ReflectCloneError if the downcast fails. Read more
Source§

fn reflect_hash(&self) -> Option<u64>

Returns a hash of the value (which includes the type). Read more
Source§

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

Debug formatter for the value. Read more
Source§

fn is_dynamic(&self) -> bool

Indicates whether or not this type is a dynamic type. Read more
Source§

impl Reflect for SymmetricDMat6

Source§

fn into_any(self: Box<Self>) -> Box<dyn Any>

Returns the value as a Box<dyn Any>. Read more
Source§

fn as_any(&self) -> &dyn Any

Returns the value as a &dyn Any. Read more
Source§

fn as_any_mut(&mut self) -> &mut dyn Any

Returns the value as a &mut dyn Any. Read more
Source§

fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>

Casts this type to a boxed, fully-reflected value.
Source§

fn as_reflect(&self) -> &dyn Reflect

Casts this type to a fully-reflected value.
Source§

fn as_reflect_mut(&mut self) -> &mut dyn Reflect

Casts this type to a mutable, fully-reflected value.
Source§

fn set(&mut self, value: Box<dyn Reflect>) -> Result<(), Box<dyn Reflect>>

Performs a type-checked assignment of a reflected value to this value. Read more
Source§

impl Struct for SymmetricDMat6

Source§

fn field(&self, name: &str) -> Option<&dyn PartialReflect>

Returns a reference to the value of the field named name as a &dyn PartialReflect.
Source§

fn field_mut(&mut self, name: &str) -> Option<&mut dyn PartialReflect>

Returns a mutable reference to the value of the field named name as a &mut dyn PartialReflect.
Source§

fn field_at(&self, index: usize) -> Option<&dyn PartialReflect>

Returns a reference to the value of the field with index index as a &dyn PartialReflect.
Source§

fn field_at_mut(&mut self, index: usize) -> Option<&mut dyn PartialReflect>

Returns a mutable reference to the value of the field with index index as a &mut dyn PartialReflect.
Source§

fn name_at(&self, index: usize) -> Option<&str>

Returns the name of the field with index index.
Source§

fn field_len(&self) -> usize

Returns the number of fields in the struct.
Source§

fn iter_fields(&self) -> FieldIter<'_>

Returns an iterator over the values of the reflectable fields for this struct.
Source§

fn to_dynamic_struct(&self) -> DynamicStruct

Creates a new DynamicStruct from this struct.
Source§

fn get_represented_struct_info(&self) -> Option<&'static StructInfo>

Will return None if TypeInfo is not available.
Source§

impl Sub<&&SymmetricDMat6> for &SymmetricDMat6

Source§

type Output = SymmetricDMat6

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Self) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<&SymmetricDMat6> for SymmetricDMat6

Source§

type Output = SymmetricDMat6

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Self) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub for &SymmetricDMat6

Source§

type Output = SymmetricDMat6

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub for SymmetricDMat6

Source§

type Output = SymmetricDMat6

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl SubAssign<&SymmetricDMat6> for SymmetricDMat6

Source§

fn sub_assign(&mut self, rhs: &Self)

Performs the -= operation. Read more
Source§

impl SubAssign for SymmetricDMat6

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl<'a> Sum<&'a SymmetricDMat6> for SymmetricDMat6

Source§

fn sum<I: Iterator<Item = &'a SymmetricDMat6>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl Sum for SymmetricDMat6

Source§

fn sum<I: Iterator<Item = SymmetricDMat6>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl TypePath for SymmetricDMat6

Source§

fn type_path() -> &'static str

Returns the fully qualified path of the underlying type. Read more
Source§

fn short_type_path() -> &'static str

Returns a short, pretty-print enabled path to the type. Read more
Source§

fn type_ident() -> Option<&'static str>

Returns the name of the type, or None if it is anonymous. Read more
Source§

fn crate_name() -> Option<&'static str>

Returns the name of the crate the type is in, or None if it is anonymous. Read more
Source§

fn module_path() -> Option<&'static str>

Returns the path to the module the type is in, or None if it is anonymous. Read more
Source§

impl Typed for SymmetricDMat6

Source§

fn type_info() -> &'static TypeInfo

Returns the compile-time info for the underlying type.
Source§

impl Copy for SymmetricDMat6

Source§

impl StructuralPartialEq for SymmetricDMat6

Auto Trait Implementations§

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
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Sync + Send>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DynamicTypePath for T
where T: TypePath,

Source§

impl<T> DynamicTyped for T
where T: Typed,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> GetField for S
where S: Struct,

Source§

fn get_field<T>(&self, name: &str) -> Option<&T>
where T: Reflect,

Returns a reference to the value of the field named name, downcast to T.
Source§

fn get_field_mut<T>(&mut self, name: &str) -> Option<&mut T>
where T: Reflect,

Returns a mutable reference to the value of the field named name, downcast to T.
Source§

impl<T> GetPath for T
where T: Reflect + ?Sized,

Source§

fn reflect_path<'p>( &self, path: impl ReflectPath<'p>, ) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>

Returns a reference to the value specified by path. Read more
Source§

fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>

Returns a mutable reference to the value specified by path. Read more
Source§

fn path<'p, T>( &self, path: impl ReflectPath<'p>, ) -> Result<&T, ReflectPathError<'p>>
where T: Reflect,

Returns a statically typed reference to the value specified by path. Read more
Source§

fn path_mut<'p, T>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut T, ReflectPathError<'p>>
where T: Reflect,

Returns a statically typed mutable reference to the value specified by path. Read more
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<A> Is for A
where A: Any,

Source§

fn is<T>() -> bool
where T: Any,

Checks if the current type “is” another type, using a TypeId equality comparison. This is most useful in the context of generic logic. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.
Source§

impl<T> TypeData for T
where T: 'static + Send + Sync + Clone,

Source§

fn clone_type_data(&self) -> Box<dyn TypeData>

Creates a type-erased clone of this value.
Source§

impl<T> Reflectable for T