Fixed code formatting
This commit is contained in:
parent
a64417870b
commit
82b8ac84a0
|
@ -207,8 +207,8 @@ impl<T: Scalar, const D: usize> Scale<T, D> {
|
||||||
#[inline]
|
#[inline]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub unsafe fn inverse_unchecked(&self) -> Scale<T, D>
|
pub unsafe fn inverse_unchecked(&self) -> Scale<T, D>
|
||||||
where
|
where
|
||||||
T: ClosedDiv + One,
|
T: ClosedDiv + One,
|
||||||
{
|
{
|
||||||
return self.vector.map(|e| T::one() / e).into();
|
return self.vector.map(|e| T::one() / e).into();
|
||||||
}
|
}
|
||||||
|
@ -230,16 +230,19 @@ impl<T: Scalar, const D: usize> Scale<T, D> {
|
||||||
#[inline]
|
#[inline]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn pseudo_inverse(&self) -> Scale<T, D>
|
pub fn pseudo_inverse(&self) -> Scale<T, D>
|
||||||
where
|
where
|
||||||
T: ClosedDiv + One + Zero,
|
T: ClosedDiv + One + Zero,
|
||||||
{
|
{
|
||||||
return self.vector.map(|e| {
|
return self
|
||||||
if e != T::zero() {
|
.vector
|
||||||
return T::one() / e;
|
.map(|e| {
|
||||||
} else {
|
if e != T::zero() {
|
||||||
return T::zero();
|
return T::one() / e;
|
||||||
}
|
} else {
|
||||||
}).into();
|
return T::zero();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.into();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Converts this Scale into its equivalent homogeneous transformation matrix.
|
/// Converts this Scale into its equivalent homogeneous transformation matrix.
|
||||||
|
@ -302,7 +305,7 @@ impl<T: Scalar, const D: usize> Scale<T, D> {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn try_inverse_mut(&mut self) -> bool
|
pub fn try_inverse_mut(&mut self) -> bool
|
||||||
where
|
where
|
||||||
T: ClosedDiv + One + Zero
|
T: ClosedDiv + One + Zero,
|
||||||
{
|
{
|
||||||
if let Some(v) = self.try_inverse() {
|
if let Some(v) = self.try_inverse() {
|
||||||
self.vector = v.vector;
|
self.vector = v.vector;
|
||||||
|
|
Loading…
Reference in New Issue