#[repr(C)]pub struct Matrix2<T> {
pub cols: Vec2<Vec2<T>>,
}
Expand description
2x2 matrix.
Fields§
§cols: Vec2<Vec2<T>>
Implementations§
Source§impl<T> Mat2<T>
impl<T> Mat2<T>
Sourcepub const ROW_COUNT: usize = 2usize
pub const ROW_COUNT: usize = 2usize
Convenience constant representing the number of rows for matrices of this type.
Sourcepub const COL_COUNT: usize = 2usize
pub const COL_COUNT: usize = 2usize
Convenience constant representing the number of columns for matrices of this type.
Sourcepub fn identity() -> Mat2<T>
pub fn identity() -> Mat2<T>
The identity matrix, which is also the default value for square matrices.
assert_eq!(Mat4::<f32>::default(), Mat4::<f32>::identity());
Sourcepub fn apply<F>(&mut self, f: F)
pub fn apply<F>(&mut self, f: F)
Applies the function f to each element of this matrix, in-place.
For an example, see the map()
method.
Sourcepub fn apply2<F, S>(&mut self, other: Mat2<S>, f: F)
pub fn apply2<F, S>(&mut self, other: Mat2<S>, f: F)
Applies the function f to each element of this matrix, in-place.
For an example, see the map2()
method.
Sourcepub fn numcast<D>(self) -> Option<Mat2<D>>
pub fn numcast<D>(self) -> Option<Mat2<D>>
Returns a memberwise-converted copy of this matrix, using NumCast
.
let m = Mat4::<f32>::identity();
let m: Mat4<i32> = m.numcast().unwrap();
assert_eq!(m, Mat4::identity());
Sourcepub fn broadcast_diagonal(val: T) -> Mat2<T>
pub fn broadcast_diagonal(val: T) -> Mat2<T>
Initializes a new matrix with elements of the diagonal set to val
and the other to zero.
In a way, this is the same as single-argument matrix constructors in GLSL and GLM.
assert_eq!(Mat4::broadcast_diagonal(0), Mat4::zero());
assert_eq!(Mat4::broadcast_diagonal(1), Mat4::identity());
assert_eq!(Mat4::broadcast_diagonal(2), Mat4::new(
2,0,0,0,
0,2,0,0,
0,0,2,0,
0,0,0,2,
));
Sourcepub fn with_diagonal(d: Vec2<T>) -> Mat2<T>
pub fn with_diagonal(d: Vec2<T>) -> Mat2<T>
Initializes a matrix by its diagonal, setting other elements to zero.
Sourcepub fn diagonal(self) -> Vec2<T>
pub fn diagonal(self) -> Vec2<T>
Gets the matrix’s diagonal into a vector.
assert_eq!(Mat4::<u32>::zero().diagonal(), Vec4::zero());
assert_eq!(Mat4::<u32>::identity().diagonal(), Vec4::one());
let mut m = Mat4::zero();
m[(0, 0)] = 1;
m[(1, 1)] = 2;
m[(2, 2)] = 3;
m[(3, 3)] = 4;
assert_eq!(m.diagonal(), Vec4::new(1, 2, 3, 4));
assert_eq!(m.diagonal(), Vec4::iota() + 1);
Sourcepub fn trace(self) -> Twhere
T: Add<Output = T>,
pub fn trace(self) -> Twhere
T: Add<Output = T>,
The sum of the diagonal’s elements.
assert_eq!(Mat4::<u32>::zero().trace(), 0);
assert_eq!(Mat4::<u32>::identity().trace(), 4);
Sourcepub fn mul_memberwise(self, m: Mat2<T>) -> Mat2<T>where
T: Mul<Output = T>,
pub fn mul_memberwise(self, m: Mat2<T>) -> Mat2<T>where
T: Mul<Output = T>,
Multiply elements of this matrix with another’s.
let m = Mat4::new(
0, 1, 2, 3,
1, 2, 3, 4,
2, 3, 4, 5,
3, 4, 5, 6,
);
let r = Mat4::new(
0, 1, 4, 9,
1, 4, 9, 16,
4, 9, 16, 25,
9, 16, 25, 36,
);
assert_eq!(m.mul_memberwise(m), r);
Source§impl<T> Mat2<T>
impl<T> Mat2<T>
Sourcepub fn map_cols<D, F>(self, f: F) -> Mat2<D>
pub fn map_cols<D, F>(self, f: F) -> Mat2<D>
Returns a column-wise-converted copy of this matrix, using the given conversion closure.
use vek::mat::repr_c::column_major::Mat4;
let m = Mat4::<f32>::new(
0.25, 1.25, 5.56, 8.66,
8.53, 2.92, 3.86, 9.36,
1.02, 0.28, 5.52, 6.06,
6.20, 7.01, 4.90, 5.26
);
let m = m.map_cols(|col| col.map(|x| x.round() as i32));
assert_eq!(m, Mat4::new(
0, 1, 6, 9,
9, 3, 4, 9,
1, 0, 6, 6,
6, 7, 5, 5
));
Sourcepub fn into_col_array(self) -> [T; 4]
pub fn into_col_array(self) -> [T; 4]
Converts this matrix into a fixed-size array of elements.
use vek::mat::repr_c::column_major::Mat4;
let m = Mat4::<u32>::new(
0, 1, 2, 3,
4, 5, 6, 7,
8, 9, 10, 11,
12, 13, 14, 15
);
let array = [
0, 4, 8, 12,
1, 5, 9, 13,
2, 6, 10, 14,
3, 7, 11, 15
];
assert_eq!(m.into_col_array(), array);
Sourcepub fn into_col_arrays(self) -> [[T; 2]; 2]
pub fn into_col_arrays(self) -> [[T; 2]; 2]
Converts this matrix into a fixed-size array of fixed-size arrays of elements.
use vek::mat::repr_c::column_major::Mat4;
let m = Mat4::<u32>::new(
0, 1, 2, 3,
4, 5, 6, 7,
8, 9, 10, 11,
12, 13, 14, 15
);
let array = [
[ 0, 4, 8, 12, ],
[ 1, 5, 9, 13, ],
[ 2, 6, 10, 14, ],
[ 3, 7, 11, 15, ],
];
assert_eq!(m.into_col_arrays(), array);
Sourcepub fn from_col_array(array: [T; 4]) -> Mat2<T>
pub fn from_col_array(array: [T; 4]) -> Mat2<T>
Converts a fixed-size array of elements into a matrix.
use vek::mat::repr_c::column_major::Mat4;
let m = Mat4::<u32>::new(
0, 1, 2, 3,
4, 5, 6, 7,
8, 9, 10, 11,
12, 13, 14, 15
);
let array = [
0, 4, 8, 12,
1, 5, 9, 13,
2, 6, 10, 14,
3, 7, 11, 15
];
assert_eq!(m, Mat4::from_col_array(array));
Sourcepub fn from_col_arrays(array: [[T; 2]; 2]) -> Mat2<T>
pub fn from_col_arrays(array: [[T; 2]; 2]) -> Mat2<T>
Converts a fixed-size array of fixed-size arrays of elements into a matrix.
use vek::mat::repr_c::column_major::Mat4;
let m = Mat4::<u32>::new(
0, 1, 2, 3,
4, 5, 6, 7,
8, 9, 10, 11,
12, 13, 14, 15
);
let array = [
[ 0, 4, 8, 12, ],
[ 1, 5, 9, 13, ],
[ 2, 6, 10, 14, ],
[ 3, 7, 11, 15, ],
];
assert_eq!(m, Mat4::from_col_arrays(array));
Sourcepub fn into_row_array(self) -> [T; 4]
pub fn into_row_array(self) -> [T; 4]
Converts this matrix into a fixed-size array of elements.
use vek::mat::repr_c::column_major::Mat4;
let m = Mat4::<u32>::new(
0, 1, 2, 3,
4, 5, 6, 7,
8, 9, 10, 11,
12, 13, 14, 15
);
let array = [
0, 1, 2, 3,
4, 5, 6, 7,
8, 9, 10, 11,
12, 13, 14, 15
];
assert_eq!(m.into_row_array(), array);
Sourcepub fn into_row_arrays(self) -> [[T; 2]; 2]
pub fn into_row_arrays(self) -> [[T; 2]; 2]
Converts this matrix into a fixed-size array of fixed-size arrays of elements.
use vek::mat::repr_c::column_major::Mat4;
let m = Mat4::<u32>::new(
0, 1, 2, 3,
4, 5, 6, 7,
8, 9, 10, 11,
12, 13, 14, 15
);
let array = [
[ 0, 1, 2, 3, ],
[ 4, 5, 6, 7, ],
[ 8, 9, 10, 11, ],
[ 12, 13, 14, 15, ],
];
assert_eq!(m.into_row_arrays(), array);
Sourcepub fn from_row_array(array: [T; 4]) -> Mat2<T>
pub fn from_row_array(array: [T; 4]) -> Mat2<T>
Converts a fixed-size array of elements into a matrix.
use vek::mat::repr_c::column_major::Mat4;
let m = Mat4::<u32>::new(
0, 1, 2, 3,
4, 5, 6, 7,
8, 9, 10, 11,
12, 13, 14, 15
);
let array = [
0, 1, 2, 3,
4, 5, 6, 7,
8, 9, 10, 11,
12, 13, 14, 15
];
assert_eq!(m, Mat4::from_row_array(array));
Sourcepub fn from_row_arrays(array: [[T; 2]; 2]) -> Mat2<T>
pub fn from_row_arrays(array: [[T; 2]; 2]) -> Mat2<T>
Converts a fixed-size array of fixed-size array of elements into a matrix.
use vek::mat::repr_c::column_major::Mat4;
let m = Mat4::<u32>::new(
0, 1, 2, 3,
4, 5, 6, 7,
8, 9, 10, 11,
12, 13, 14, 15
);
let array = [
[ 0, 1, 2, 3, ],
[ 4, 5, 6, 7, ],
[ 8, 9, 10, 11, ],
[ 12, 13, 14, 15, ],
];
assert_eq!(m, Mat4::from_row_arrays(array));
Sourcepub fn as_col_ptr(&self) -> *const T
pub fn as_col_ptr(&self) -> *const T
Gets a const pointer to this matrix’s elements.
§Panics
Panics if the matrix’s elements are not tightly packed in memory,
which may be the case for matrices in the repr_simd
module.
You may check this with the is_packed()
method.
Sourcepub fn as_mut_col_ptr(&mut self) -> *mut T
pub fn as_mut_col_ptr(&mut self) -> *mut T
Gets a mut pointer to this matrix’s elements.
§Panics
Panics if the matrix’s elements are not tightly packed in memory,
which may be the case for matrices in the repr_simd
module.
You may check this with the is_packed()
method.
Sourcepub fn as_col_slice(&self) -> &[T]
pub fn as_col_slice(&self) -> &[T]
View this matrix as an immutable slice.
§Panics
Panics if the matrix’s elements are not tightly packed in memory,
which may be the case for matrices in the repr_simd
module.
You may check this with the is_packed()
method.
Sourcepub fn as_mut_col_slice(&mut self) -> &mut [T]
pub fn as_mut_col_slice(&mut self) -> &mut [T]
View this matrix as a mutable slice.
§Panics
Panics if the matrix’s elements are not tightly packed in memory,
which may be the case for matrices in the repr_simd
module.
You may check this with the is_packed()
method.
Source§impl<T> Mat2<T>
impl<T> Mat2<T>
Sourcepub const GL_SHOULD_TRANSPOSE: bool = false
pub const GL_SHOULD_TRANSPOSE: bool = false
The transpose
parameter to pass to OpenGL glUniformMatrix*()
functions.
Sourcepub fn gl_should_transpose(&self) -> bool
pub fn gl_should_transpose(&self) -> bool
Gets the transpose
parameter to pass to OpenGL glUniformMatrix*()
functions.
The return value is a plain bool
which you may directly cast
to a GLboolean
.
This takes &self
to prevent surprises when changing the type
of matrix you plan to send.
Source§impl<T> Mat2<T>
impl<T> Mat2<T>
Sourcepub fn map<D, F>(self, f: F) -> Mat2<D>where
F: FnMut(T) -> D,
pub fn map<D, F>(self, f: F) -> Mat2<D>where
F: FnMut(T) -> D,
Returns an element-wise-converted copy of this matrix, using the given conversion closure.
use vek::mat::repr_c::row_major::Mat4;
let m = Mat4::<f32>::new(
0.25, 1.25, 5.56, 8.66,
8.53, 2.92, 3.86, 9.36,
1.02, 0.28, 5.52, 6.06,
6.20, 7.01, 4.90, 5.26
);
let m = m.map(|x| x.round() as i32);
assert_eq!(m, Mat4::new(
0, 1, 6, 9,
9, 3, 4, 9,
1, 0, 6, 6,
6, 7, 5, 5
));
Sourcepub fn as_<D>(self) -> Mat2<D>where
T: AsPrimitive<D>,
D: 'static + Copy,
pub fn as_<D>(self) -> Mat2<D>where
T: AsPrimitive<D>,
D: 'static + Copy,
Returns a memberwise-converted copy of this matrix, using AsPrimitive
.
§Examples
let v = Vec4::new(0_f32, 1., 2., 3.);
let i: Vec4<i32> = v.as_();
assert_eq!(i, Vec4::new(0, 1, 2, 3));
§Safety
In Rust versions before 1.45.0, some uses of the as
operator were not entirely safe.
In particular, it was undefined behavior if
a truncated floating point value could not fit in the target integer
type (#10184);
let x: u8 = (1.04E+17).as_(); // UB
Sourcepub fn map2<D, F, S>(self, other: Mat2<S>, f: F) -> Mat2<D>where
F: FnMut(T, S) -> D,
pub fn map2<D, F, S>(self, other: Mat2<S>, f: F) -> Mat2<D>where
F: FnMut(T, S) -> D,
Applies the function f to each element of two matrices, pairwise, and returns the result.
use vek::mat::repr_c::row_major::Mat4;
let a = Mat4::<f32>::new(
0.25, 1.25, 2.52, 2.99,
0.25, 1.25, 2.52, 2.99,
0.25, 1.25, 2.52, 2.99,
0.25, 1.25, 2.52, 2.99
);
let b = Mat4::<i32>::new(
0, 1, 0, 0,
1, 0, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1
);
let m = a.map2(b, |a, b| a.round() as i32 + b);
assert_eq!(m, Mat4::new(
0, 2, 3, 3,
1, 1, 3, 3,
0, 1, 4, 3,
0, 1, 3, 4
));
Sourcepub fn transposed(self) -> Mat2<T>
pub fn transposed(self) -> Mat2<T>
The matrix’s transpose.
let m = Mat2::new(
0, 1,
4, 5
);
let t = Mat2::new(
0, 4,
1, 5
);
assert_eq!(m.transposed(), t);
assert_eq!(m, m.transposed().transposed());
Sourcepub fn transpose(&mut self)
pub fn transpose(&mut self)
Transpose this matrix.
let mut m = Mat2::new(
0, 1,
4, 5
);
let t = Mat2::new(
0, 4,
1, 5
);
m.transpose();
assert_eq!(m, t);
Sourcepub fn determinant(self) -> T
pub fn determinant(self) -> T
Get this matrix’s determinant.
A matrix is invertible if its determinant is non-zero.
let (a,b,c,d) = (0,1,2,3);
let m = Mat2::new(a,b,c,d);
assert_eq!(m.determinant(), a*d - c*b);
Sourcepub fn rotate_z(&mut self, angle_radians: T)
pub fn rotate_z(&mut self, angle_radians: T)
Rotates this matrix around the Z axis (counter-clockwise rotation in 2D).
Sourcepub fn rotated_z(self, angle_radians: T) -> Mat2<T>
pub fn rotated_z(self, angle_radians: T) -> Mat2<T>
Rotates this matrix around the Z axis (counter-clockwise rotation in 2D).
Sourcepub fn rotation_z(angle_radians: T) -> Mat2<T>where
T: Real,
pub fn rotation_z(angle_radians: T) -> Mat2<T>where
T: Real,
Creates a matrix that rotates around the Z axis (counter-clockwise rotation in 2D).
Sourcepub fn scaling_2d<V>(v: V) -> Mat2<T>
pub fn scaling_2d<V>(v: V) -> Mat2<T>
Creates a 2D scaling matrix.
Sourcepub fn shearing_x(k: T) -> Mat2<T>
pub fn shearing_x(k: T) -> Mat2<T>
Creates a 2D shearing matrix along the X axis.
Sourcepub fn shearing_y(k: T) -> Mat2<T>
pub fn shearing_y(k: T) -> Mat2<T>
Creates a 2D shearing matrix along the Y axis.
Trait Implementations§
Source§impl<T> AbsDiffEq for Mat2<T>
impl<T> AbsDiffEq for Mat2<T>
Source§fn default_epsilon() -> <T as AbsDiffEq>::Epsilon
fn default_epsilon() -> <T as AbsDiffEq>::Epsilon
Source§fn abs_diff_eq(
&self,
other: &Mat2<T>,
epsilon: <Mat2<T> as AbsDiffEq>::Epsilon,
) -> bool
fn abs_diff_eq( &self, other: &Mat2<T>, epsilon: <Mat2<T> as AbsDiffEq>::Epsilon, ) -> bool
Source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
AbsDiffEq::abs_diff_eq
.Source§impl<T> AddAssign<T> for Mat2<T>
impl<T> AddAssign<T> for Mat2<T>
Source§fn add_assign(&mut self, rhs: T)
fn add_assign(&mut self, rhs: T)
+=
operation. Read moreSource§impl<T> AddAssign for Mat2<T>
impl<T> AddAssign for Mat2<T>
Source§fn add_assign(&mut self, rhs: Mat2<T>)
fn add_assign(&mut self, rhs: Mat2<T>)
+=
operation. Read moreSource§impl<T> Default for Mat2<T>
The default value for a square matrix is the identity.
impl<T> Default for Mat2<T>
The default value for a square matrix is the identity.
assert_eq!(Mat4::<f32>::default(), Mat4::<f32>::identity());
Source§impl<'de, T> Deserialize<'de> for Mat2<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Mat2<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Mat2<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Mat2<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl<T> Display for Mat2<T>where
T: Display,
Displays this matrix using the following format:
impl<T> Display for Mat2<T>where
T: Display,
Displays this matrix using the following format:
(i
being the number of rows and j
the number of columns)
( m00 ... m0j
... ... ...
mi0 ... mij )
Note that elements are not comma-separated. This format doesn’t depend on the matrix’s storage layout.
Source§impl<T> DivAssign<T> for Mat2<T>
impl<T> DivAssign<T> for Mat2<T>
Source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
/=
operation. Read moreSource§impl<T> DivAssign for Mat2<T>
impl<T> DivAssign for Mat2<T>
Source§fn div_assign(&mut self, rhs: Mat2<T>)
fn div_assign(&mut self, rhs: Mat2<T>)
/=
operation. Read moreSource§impl<S> FixedMatrix2<S> for Matrix2<S>where
S: Fixed,
impl<S> FixedMatrix2<S> for Matrix2<S>where
S: Fixed,
Source§impl<S, U, V> From<Mat2<S>> for Transform2<S, U, V>
impl<S, U, V> From<Mat2<S>> for Transform2<S, U, V>
Source§impl<T> Index<(usize, usize)> for Mat2<T>
Index this matrix in a layout-agnostic way with an (i, j)
(row index, column index) tuple.
impl<T> Index<(usize, usize)> for Mat2<T>
Index this matrix in a layout-agnostic way with an (i, j)
(row index, column index) tuple.
Matrices cannot be indexed by Vec2
s because that would be likely to cause confusion:
should x
be the row index (because it’s the first element) or the column index
(because it’s a horizontal position) ?
Source§impl<T> Mul<CubicBezier2<T>> for Mat2<T>
impl<T> Mul<CubicBezier2<T>> for Mat2<T>
Source§type Output = CubicBezier2<T>
type Output = CubicBezier2<T>
*
operator.Source§fn mul(self, rhs: CubicBezier2<T>) -> CubicBezier2<T>
fn mul(self, rhs: CubicBezier2<T>) -> CubicBezier2<T>
*
operation. Read moreSource§impl<T> Mul<Mat2<T>> for Mat2<T>
Multiplies a column-major matrix with a row-major matrix.
impl<T> Mul<Mat2<T>> for Mat2<T>
Multiplies a column-major matrix with a row-major matrix.
use vek::mat::row_major::Mat4 as Rows4;
use vek::mat::column_major::Mat4 as Cols4;
let m = Cols4::<u32>::new(
0, 1, 2, 3,
4, 5, 6, 7,
8, 9, 0, 1,
2, 3, 4, 5
);
let b = Rows4::from(m);
let r = Rows4::<u32>::new(
26, 32, 18, 24,
82, 104, 66, 88,
38, 56, 74, 92,
54, 68, 42, 56
);
assert_eq!(m * b, r);
assert_eq!(m * Rows4::<u32>::identity(), m.into());
assert_eq!(Cols4::<u32>::identity() * b, m.into());
Source§impl<T> Mul<Mat2<T>> for Vec2<T>
Multiplies a row vector with a column-major matrix, giving a row vector.
impl<T> Mul<Mat2<T>> for Vec2<T>
Multiplies a row vector with a column-major matrix, giving a row vector.
use vek::mat::column_major::Mat4;
use vek::vec::Vec4;
let m = Mat4::new(
0, 1, 2, 3,
4, 5, 6, 7,
8, 9, 0, 1,
2, 3, 4, 5
);
let v = Vec4::new(0, 1, 2, 3);
let r = Vec4::new(26, 32, 18, 24);
assert_eq!(v * m, r);
Source§impl<T> Mul<QuadraticBezier2<T>> for Mat2<T>
impl<T> Mul<QuadraticBezier2<T>> for Mat2<T>
Source§type Output = QuadraticBezier2<T>
type Output = QuadraticBezier2<T>
*
operator.Source§fn mul(self, rhs: QuadraticBezier2<T>) -> QuadraticBezier2<T>
fn mul(self, rhs: QuadraticBezier2<T>) -> QuadraticBezier2<T>
*
operation. Read moreSource§impl<T> Mul<Vec2<T>> for Mat2<T>
Multiplies a column-major matrix with a column vector, giving a column vector.
impl<T> Mul<Vec2<T>> for Mat2<T>
Multiplies a column-major matrix with a column vector, giving a column vector.
With SIMD vectors, this is the most efficient way.
use vek::mat::column_major::Mat4;
use vek::vec::Vec4;
let m = Mat4::new(
0, 1, 2, 3,
4, 5, 6, 7,
8, 9, 0, 1,
2, 3, 4, 5
);
let v = Vec4::new(0, 1, 2, 3);
let r = Vec4::new(14, 38, 12, 26);
assert_eq!(m * v, r);
Source§impl<T> Mul for Mat2<T>
Multiplies a column-major matrix with another.
impl<T> Mul for Mat2<T>
Multiplies a column-major matrix with another.
use vek::mat::column_major::Mat4;
let m = Mat4::<u32>::new(
0, 1, 2, 3,
4, 5, 6, 7,
8, 9, 0, 1,
2, 3, 4, 5
);
let r = Mat4::<u32>::new(
26, 32, 18, 24,
82, 104, 66, 88,
38, 56, 74, 92,
54, 68, 42, 56
);
assert_eq!(m * m, r);
assert_eq!(m, m * Mat4::<u32>::identity());
assert_eq!(m, Mat4::<u32>::identity() * m);
Source§impl<T> MulAssign<T> for Mat2<T>
impl<T> MulAssign<T> for Mat2<T>
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
*=
operation. Read moreSource§impl<T> MulAssign for Mat2<T>
impl<T> MulAssign for Mat2<T>
Source§fn mul_assign(&mut self, rhs: Mat2<T>)
fn mul_assign(&mut self, rhs: Mat2<T>)
*=
operation. Read moreSource§impl<T> RelativeEq for Mat2<T>
impl<T> RelativeEq for Mat2<T>
Source§fn default_max_relative() -> <T as AbsDiffEq>::Epsilon
fn default_max_relative() -> <T as AbsDiffEq>::Epsilon
Source§fn relative_eq(
&self,
other: &Mat2<T>,
epsilon: <T as AbsDiffEq>::Epsilon,
max_relative: <T as AbsDiffEq>::Epsilon,
) -> bool
fn relative_eq( &self, other: &Mat2<T>, epsilon: <T as AbsDiffEq>::Epsilon, max_relative: <T as AbsDiffEq>::Epsilon, ) -> bool
Source§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
RelativeEq::relative_eq
.Source§impl<T> RemAssign<T> for Mat2<T>
impl<T> RemAssign<T> for Mat2<T>
Source§fn rem_assign(&mut self, rhs: T)
fn rem_assign(&mut self, rhs: T)
%=
operation. Read moreSource§impl<T> RemAssign for Mat2<T>
impl<T> RemAssign for Mat2<T>
Source§fn rem_assign(&mut self, rhs: Mat2<T>)
fn rem_assign(&mut self, rhs: Mat2<T>)
%=
operation. Read moreSource§impl<T> Serialize for Mat2<T>where
T: Serialize,
impl<T> Serialize for Mat2<T>where
T: Serialize,
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl<T> SubAssign<T> for Mat2<T>
impl<T> SubAssign<T> for Mat2<T>
Source§fn sub_assign(&mut self, rhs: T)
fn sub_assign(&mut self, rhs: T)
-=
operation. Read moreSource§impl<T> SubAssign for Mat2<T>
impl<T> SubAssign for Mat2<T>
Source§fn sub_assign(&mut self, rhs: Mat2<T>)
fn sub_assign(&mut self, rhs: Mat2<T>)
-=
operation. Read moreSource§impl<T> UlpsEq for Mat2<T>
impl<T> UlpsEq for Mat2<T>
Source§fn default_max_ulps() -> u32
fn default_max_ulps() -> u32
impl<T> Copy for Mat2<T>where
T: Copy,
impl<T> Eq for Mat2<T>where
T: Eq,
impl<S: Ring> MultiplicativeMonoid for Matrix2<S>
impl<T> StructuralPartialEq for Mat2<T>
Auto Trait Implementations§
impl<T> Freeze for Mat2<T>where
T: Freeze,
impl<T> RefUnwindSafe for Mat2<T>where
T: RefUnwindSafe,
impl<T> Send for Mat2<T>where
T: Send,
impl<T> Sync for Mat2<T>where
T: Sync,
impl<T> Unpin for Mat2<T>where
T: Unpin,
impl<T> UnwindSafe for Mat2<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more