Skip to main content

Matrix

Struct Matrix 

Source
#[repr(C)]
pub struct Matrix<T, const ROW: usize, const COL: usize> { pub columns: Vector<Vector<T, ROW>, COL>, }
Expand description

ROW rows, COL columns.

Can be indexed matrix[row][col]

Fields§

§columns: Vector<Vector<T, ROW>, COL>

Implementations§

Source§

impl<T, const ROW: usize> Matrix<T, ROW, 1>

Source

pub const fn from_vector(vector: Vector<T, ROW>) -> Matrix<T, ROW, 1>

From a Mx1 vector

Source§

impl<T, const ROW: usize, const COL: usize> Matrix<T, ROW, COL>

Source

pub fn from_fn<F>(column_then_row: F) -> Matrix<T, ROW, COL>
where F: FnMut(Vector<i32, 2>) -> T,

Create a matrix from a fn((columns,row))

Source

pub fn from_col_fn<F>(column_then_row: F) -> Matrix<T, ROW, COL>
where F: FnMut(usize, usize) -> T,

Source

pub fn from_row_fn<F>(row_then_column: F) -> Matrix<T, ROW, COL>
where F: FnMut(usize, usize) -> T,

Source

pub const fn from_col( columns: Vector<Vector<T, ROW>, COL>, ) -> Matrix<T, ROW, COL>

Source

pub fn from_col_array(columns: [[T; ROW]; COL]) -> Matrix<T, ROW, COL>

Source

pub fn from_row(rows: Vector<Vector<T, COL>, ROW>) -> Matrix<T, ROW, COL>
where T: Copy,

Source

pub fn from_row_array(rows: [[T; COL]; ROW]) -> Matrix<T, ROW, COL>
where T: Copy,

Source

pub fn col(&self) -> Vector<Vector<T, ROW>, COL>
where T: Copy,

Source

pub fn row(&self) -> Vector<Vector<T, COL>, ROW>
where T: Copy,

Source

pub fn iter_col(&self) -> impl Iterator<Item = Vector<T, ROW>>
where Vector<Vector<T, ROW>, COL>: Copy, T: Copy,

Source

pub fn iter_row(&self) -> impl Iterator<Item = Vector<T, COL>>
where Vector<Vector<T, ROW>, COL>: Copy, T: Copy,

Source

pub fn transpose(&self) -> Matrix<T, COL, ROW>
where T: Copy,

Transpose the matrix

use hexga_math::prelude::*;

assert_eq!(
    Mat2::from_col(vector2(vec2(1., 2.), vec2(3., 4.))).transpose(),
    Mat2::from_col(vector2(vec2(1., 3.), vec2(2., 4.)))
);

assert_eq!(
    Mat::<3,2>::from_col(vector2(vec3(1., 2., 3.), vec3(4., 5., 6.))).transpose(),
    Mat::<2,3>::from_col(vector3(vec2(1., 4.), vec2(2., 5.), vec2(3., 6.)))
);
Source§

impl<T> Matrix<T, 2, 2>
where Matrix<T, 2, 2>: Copy + Mul<Vector<T, 2>, Output = Vector<T, 2>>, Vector<T, 2>: Into<Vector<T, 1>>,

Source

pub fn transform_relative(self, relative: Vector<T, 1>) -> Vector<T, 1>
where T: Zero,

Source

pub fn transform_position(self, position: Vector<T, 1>) -> Vector<T, 1>
where T: One,

Source§

impl<T> Matrix<T, 3, 3>
where Matrix<T, 3, 3>: Copy + Mul<Vector<T, 3>, Output = Vector<T, 3>>, Vector<T, 3>: Into<Vector<T, 2>>,

Source

pub fn transform_relative(self, relative: Vector<T, 2>) -> Vector<T, 2>
where T: Zero,

Source

pub fn transform_position(self, position: Vector<T, 2>) -> Vector<T, 2>
where T: One,

Source§

impl<T> Matrix<T, 4, 4>
where Matrix<T, 4, 4>: Copy + Mul<Vector<T, 4>, Output = Vector<T, 4>>, Vector<T, 4>: Into<Vector<T, 3>>,

Source

pub fn transform_relative(self, relative: Vector<T, 3>) -> Vector<T, 3>
where T: Zero,

Source

pub fn transform_position(self, position: Vector<T, 3>) -> Vector<T, 3>
where T: One,

Source§

impl<T, const N: usize> Matrix<T, N, N>
where Matrix<T, N, N>: Copy + Mul<Vector<T, N>, Output = Vector<T, N>>,

Source

pub fn transform(self, value: Vector<T, N>) -> Vector<T, N>

The last value/component is 0 if it is a relative/vector/delta, 1 if it is fixed/point/position in math terms.

Source§

impl<T, const N: usize> Matrix<T, N, N>
where T: One + Zero + Copy,

Source

pub const IDENTITY: Matrix<T, N, N> = Self::ONE

Same as One

Source§

impl<T, const N: usize> Matrix<T, N, N>
where T: Float,

Source

pub fn inverse(self) -> Option<Matrix<T, N, N>>

Inverse the matrix, or return None if the matrix is singular.

use hexga_math::prelude::*;

assert_eq!(Mat2::IDENTITY.inverse(), Some(Mat2::IDENTITY));

// Non inversible matrix
let mut m2 = Mat2::IDENTITY;
m2.set_y(vec2(0., 0.));
assert_eq!(m2.inverse(), None);

let m2 = Mat2::from_col(vector2(vec2(1., 3.), vec2(2., 4.)));
let m2_inv = m2.inverse().unwrap();

assert_eq!(m2 * m2_inv, Mat2::IDENTITY);
Source§

impl<T> Matrix<T, 0, 0>
where T: NumberArithmetic + One,

Source

pub fn det(&self) -> T

Source§

impl<T> Matrix<T, 1, 1>
where T: NumberArithmetic + One,

Source

pub fn det(&self) -> T

Source§

impl<T> Matrix<T, 2, 2>
where T: NumberArithmetic + One,

Source

pub fn det(&self) -> T

Source§

impl<T> Matrix<T, 3, 3>
where T: NumberArithmetic + One,

Source

pub fn det(&self) -> T

Source§

impl<T> Matrix<T, 4, 4>
where T: NumberArithmetic + One,

Source

pub fn det(&self) -> T

Source§

impl<T, const N: usize> Matrix<T, N, N>
where Matrix<T, N, N>: HaveZ<Vector<T, N>> + Zero, T: Float,

the rotation code is mainly based on glam code

Source

pub fn from_rotation_axis( axis: Vector<T, 3>, angle: AngleOf<T>, ) -> Matrix<T, N, N>

Source

pub fn from_rotation_x(angle: AngleOf<T>) -> Matrix<T, N, N>

Source

pub fn from_rotation_y(angle: AngleOf<T>) -> Matrix<T, N, N>

Source§

impl<T, const N: usize> Matrix<T, N, N>
where Matrix<T, N, N>: HaveY<Vector<T, N>> + Zero, T: Float,

Source

pub fn from_rotation_z(angle: AngleOf<T>) -> Matrix<T, N, N>

Source§

impl<T, const N: usize> Matrix<T, N, N>
where Matrix<T, N, N>: HaveZ<Vector<T, N>> + One, T: Copy + Zero + One,

Source

pub fn from_scale(scale: Vector<T, N>) -> Matrix<T, N, N>

Put an One for the last component

Source

pub fn from_translation(translation: Vector<T, N>) -> Matrix<T, N, N>
where T: Zero + AddAssign,

Put an Zero for the last component

Methods from Deref<Target = Vector<Vector<T, ROW>, COL>>§

Source

pub fn have_x(&self) -> bool

Source

pub fn have_y(&self) -> bool

Source

pub fn have_z(&self) -> bool

Source

pub fn have_w(&self) -> bool

Source

pub fn iter(&self) -> impl Iterator<Item = &T>

Source

pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut T>

Source

pub fn normalize(&mut self) -> &mut Vector<T, N>

Source

pub fn set_angle(&mut self, angle: AngleOf<T>) -> &mut Vector<T, N>
where Vector<T, N>: HaveY<T>,

set the angle of the (x, y) axis

Source

pub fn set_length(&mut self, length: T)

Source

pub fn move_to(&mut self, target: Vector<T, N>, speed: T) -> bool
where T: PartialOrd, Vector<T, N>: AddAssign,

return a bool to know if the point reached the destination

Trait Implementations§

Source§

impl<T, const ROW: usize, const COL: usize> Add for Matrix<T, ROW, COL>
where Vector<Vector<T, ROW>, COL>: Add<Output = Vector<Vector<T, ROW>, COL>>,

Source§

type Output = Matrix<T, ROW, COL>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Matrix<T, ROW, COL>) -> <Matrix<T, ROW, COL> as Add>::Output

Performs the + operation. Read more
Source§

impl<T, const ROW: usize, const COL: usize> AddAssign for Matrix<T, ROW, COL>
where Matrix<T, ROW, COL>: Add<Output = Matrix<T, ROW, COL>> + Copy,

Source§

fn add_assign(&mut self, rhs: Matrix<T, ROW, COL>)

Performs the += operation. Read more
Source§

impl<T, const ROW: usize, const COL: usize> Binary for Matrix<T, ROW, COL>
where T: Binary,

Source§

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

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

impl<T, const ROW: usize, const COL: usize> Clone for Matrix<T, ROW, COL>
where T: Clone,

Source§

fn clone(&self) -> Matrix<T, ROW, COL>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T, const ROW: usize, const COL: usize> Copy for Matrix<T, ROW, COL>
where T: Copy,

Source§

impl<T, const ROW: usize, const COL: usize> Debug for Matrix<T, ROW, COL>
where T: Debug,

Source§

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

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

impl<T, const ROW: usize, const COL: usize> Default for Matrix<T, ROW, COL>
where Vector<Vector<T, ROW>, COL>: Default,

Source§

fn default() -> Matrix<T, ROW, COL>

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

impl<T, const ROW: usize, const COL: usize> Deref for Matrix<T, ROW, COL>

Source§

type Target = Vector<Vector<T, ROW>, COL>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<Matrix<T, ROW, COL> as Deref>::Target

Dereferences the value.
Source§

impl<T, const ROW: usize, const COL: usize> DerefMut for Matrix<T, ROW, COL>

Source§

fn deref_mut(&mut self) -> &mut <Matrix<T, ROW, COL> as Deref>::Target

Mutably dereferences the value.
Source§

impl<'de, T, const ROW: usize, const COL: usize> Deserialize<'de> for Matrix<T, ROW, COL>
where T: Deserialize<'de>,

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Matrix<T, ROW, COL>, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<T, const ROW: usize, const COL: usize> Display for Matrix<T, ROW, COL>
where T: Display,

Source§

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

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

impl<T, const ROW: usize, const COL: usize> Div<T> for Matrix<T, ROW, COL>
where T: Copy + Div,

Source§

type Output = Matrix<<T as Div>::Output, ROW, COL>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: T) -> <Matrix<T, ROW, COL> as Div<T>>::Output

Performs the / operation. Read more
Source§

impl<T, const ROW: usize, const COL: usize> DivAssign<T> for Matrix<T, ROW, COL>
where T: Copy + Div<Output = T>,

Source§

fn div_assign(&mut self, rhs: T)

Performs the /= operation. Read more
Source§

impl<T, const ROW: usize, const COL: usize> Eq for Matrix<T, ROW, COL>
where T: Eq,

Source§

impl<T, const ROW: usize> From<Matrix<T, ROW, 1>> for Vector<T, ROW>
where Vector<T, ROW>: Default,

Source§

fn from(value: Matrix<T, ROW, 1>) -> Vector<T, ROW>

Converts to this type from the input type.
Source§

impl<T, const ROW: usize> From<Vector<T, ROW>> for Matrix<T, ROW, 1>

Source§

fn from(value: Vector<T, ROW>) -> Matrix<T, ROW, 1>

Converts to this type from the input type.
Source§

impl<T, const N: usize> Half for Matrix<T, N, N>
where T: Half + Zero + Copy,

Source§

const HALF: Matrix<T, N, N>

Source§

fn is_half(self) -> bool
where Self: PartialEq,

Source§

fn is_non_half(self) -> bool
where Self: PartialEq,

Source§

impl<T, const ROW: usize, const COL: usize> Hash for Matrix<T, ROW, COL>
where T: Hash,

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T> HaveW<Vector<T, 4>> for Matrix<T, 4, 4>

Source§

fn iter_xyzw<'a>(&'a self) -> impl Iterator<Item = &'a Vector<T, 4>>
where Vector<T, 4>: 'a,

Source§

fn iter_xyzw_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut Vector<T, 4>>
where Vector<T, 4>: 'a,

Source§

const W_INDEX: usize = W_INDEX

Source§

impl<T> HaveX<Vector<T, 1>> for Matrix<T, 1, 1>

Source§

fn iter_x<'a>(&'a self) -> impl Iterator<Item = &'a Vector<T, 1>>
where Vector<T, 1>: 'a,

Source§

fn iter_x_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut Vector<T, 1>>
where Vector<T, 1>: 'a,

Source§

const X_INDEX: usize = X_INDEX

Source§

impl<T> HaveX<Vector<T, 2>> for Matrix<T, 2, 2>

Source§

fn iter_x<'a>(&'a self) -> impl Iterator<Item = &'a Vector<T, 2>>
where Vector<T, 2>: 'a,

Source§

fn iter_x_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut Vector<T, 2>>
where Vector<T, 2>: 'a,

Source§

const X_INDEX: usize = X_INDEX

Source§

impl<T> HaveX<Vector<T, 3>> for Matrix<T, 3, 3>

Source§

fn iter_x<'a>(&'a self) -> impl Iterator<Item = &'a Vector<T, 3>>
where Vector<T, 3>: 'a,

Source§

fn iter_x_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut Vector<T, 3>>
where Vector<T, 3>: 'a,

Source§

const X_INDEX: usize = X_INDEX

Source§

impl<T> HaveX<Vector<T, 4>> for Matrix<T, 4, 4>

Source§

fn iter_x<'a>(&'a self) -> impl Iterator<Item = &'a Vector<T, 4>>
where Vector<T, 4>: 'a,

Source§

fn iter_x_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut Vector<T, 4>>
where Vector<T, 4>: 'a,

Source§

const X_INDEX: usize = X_INDEX

Source§

impl<T> HaveY<Vector<T, 2>> for Matrix<T, 2, 2>

Source§

fn iter_xy<'a>(&'a self) -> impl Iterator<Item = &'a Vector<T, 2>>
where Vector<T, 2>: 'a,

Source§

fn iter_xy_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut Vector<T, 2>>
where Vector<T, 2>: 'a,

Source§

const Y_INDEX: usize = Y_INDEX

Source§

impl<T> HaveY<Vector<T, 3>> for Matrix<T, 3, 3>

Source§

fn iter_xy<'a>(&'a self) -> impl Iterator<Item = &'a Vector<T, 3>>
where Vector<T, 3>: 'a,

Source§

fn iter_xy_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut Vector<T, 3>>
where Vector<T, 3>: 'a,

Source§

const Y_INDEX: usize = Y_INDEX

Source§

impl<T> HaveY<Vector<T, 4>> for Matrix<T, 4, 4>

Source§

fn iter_xy<'a>(&'a self) -> impl Iterator<Item = &'a Vector<T, 4>>
where Vector<T, 4>: 'a,

Source§

fn iter_xy_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut Vector<T, 4>>
where Vector<T, 4>: 'a,

Source§

const Y_INDEX: usize = Y_INDEX

Source§

impl<T> HaveZ<Vector<T, 3>> for Matrix<T, 3, 3>

Source§

fn iter_xyz<'a>(&'a self) -> impl Iterator<Item = &'a Vector<T, 3>>
where Vector<T, 3>: 'a,

Source§

fn iter_xyz_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut Vector<T, 3>>
where Vector<T, 3>: 'a,

Source§

const Z_INDEX: usize = Z_INDEX

Source§

impl<T> HaveZ<Vector<T, 4>> for Matrix<T, 4, 4>

Source§

fn iter_xyz<'a>(&'a self) -> impl Iterator<Item = &'a Vector<T, 4>>
where Vector<T, 4>: 'a,

Source§

fn iter_xyz_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut Vector<T, 4>>
where Vector<T, 4>: 'a,

Source§

const Z_INDEX: usize = Z_INDEX

Source§

impl<T, const ROW: usize, const COL: usize> IoLoad for Matrix<T, ROW, COL>
where T: IoLoad,

Source§

fn load_own_extensions() -> impl Iterator<Item = &'static str>

Dedicated file extension to load the value. ex png, jpeg for image Read more
Source§

fn load_from_bytes_with_own_extension( data: &[u8], path: &str, extension: &str, ) -> Result<Self, IoError>

Source§

fn load_from_bytes_with_own_extension_pathless( data: &[u8], extension: &str, ) -> Result<Self, IoErrorKind>

Source§

const CAN_BE_LOADED_FROM_TEXT: bool = false

Source§

fn load_from_str_with_own_extension( data: &str, path: &str, extension: &str, ) -> Result<Self, IoError>

Source§

fn load_from_str_with_own_extension_pathless( data: &str, extension: &str, ) -> Result<Self, IoErrorKind>

Source§

fn can_open_own_extension(extension: &str) -> bool

Don’t include the markup language extension like json or ron
Source§

fn load_extensions() -> impl Iterator<Item = &'static str>

Also include the markup language extension like json or ron
Source§

fn can_open_extension(extension: &str) -> bool

Also include the markup language extension like json or ron
Source§

fn load_from<Fs>(path: &str, fs: &mut Fs) -> Result<Self, IoError>
where Fs: IoFsRead,

Source§

fn load_from_with_extension<Fs>( path: &str, extension: &str, fs: &mut Fs, ) -> Result<Self, IoError>
where Fs: IoFsRead,

Source§

fn load_from_reader<R>(r: R, path: &str) -> Result<Self, IoError>
where R: Read,

Support bytes and str
Source§

fn load_from_bytes(data: &[u8], path: &str) -> Result<Self, IoError>

Support bytes and str
Source§

fn load_from_bytes_with_extension( data: &[u8], path: &str, extension: &str, ) -> Result<Self, IoError>

Support bytes and str
Source§

impl<T, const ROW: usize, const COL: usize> IoSave for Matrix<T, ROW, COL>
where T: IoSave,

Source§

fn save_own_extensions() -> impl Iterator<Item = &'static str>

Dedicated file extension to save the value. ex png, jpeg for image Read more
Source§

fn save_to_with_own_extension<W, Fs>( &self, path: &str, extension: &str, w: W, fs: &mut Fs, ) -> Result<(), IoError>
where W: Write, Fs: IoFsWrite,

Source§

fn save_to_with_own_extension_pathless<W, Fs>( &self, extension: &str, w: W, fs: &mut Fs, ) -> Result<(), IoErrorKind>
where W: Write, Fs: IoFsWrite,

Source§

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

When saving, if the extension is missing, the file will use this extension by default
Source§

fn can_save_own_extension(extension: &str) -> bool

Don’t include the markup language extension like json or ron
Source§

fn save_extensions() -> impl Iterator<Item = &'static str>

Also include the markup language extension like json or ron
Source§

fn can_save_extension(extension: &str) -> bool

Also include the markup language extension like json or ron
Source§

fn save_to<Fs>(&self, path: &str, fs: &mut Fs) -> Result<(), IoError>
where Fs: IoFsWrite,

Source§

fn save_to_with_extension<Fs>( &self, path: &str, extension: &str, fs: &mut Fs, ) -> Result<(), IoError>
where Fs: IoFsWrite,

Source§

fn save_with_reader<W, Fs>( &self, path: &str, w: W, fs: &mut Fs, ) -> Result<(), IoError>
where W: Write, Fs: IoFsWrite,

Source§

fn save_with_reader_and_extension<W, Fs>( &self, path: &str, extension: &str, w: W, fs: &mut Fs, ) -> Result<(), IoError>
where W: Write, Fs: IoFsWrite,

Source§

impl<T, const ROW: usize, const COL: usize> LowerExp for Matrix<T, ROW, COL>
where T: LowerExp,

Source§

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

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

impl<T, const ROW: usize, const COL: usize> LowerHex for Matrix<T, ROW, COL>
where T: LowerHex,

Source§

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

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

impl<T, const ROW: usize, const COL: usize> MaxValue for Matrix<T, ROW, COL>
where T: MaxValue + Copy,

Source§

const MAX: Matrix<T, ROW, COL>

Source§

fn is_max_value(&self) -> bool
where Self: PartialEq,

Source§

fn is_non_max_value(&self) -> bool
where Self: PartialEq,

Source§

impl<T, const ROW: usize, const COL: usize> MinValue for Matrix<T, ROW, COL>
where T: MinValue + Copy,

Source§

const MIN: Matrix<T, ROW, COL>

Source§

fn is_min_value(&self) -> bool
where Self: PartialEq,

Source§

fn is_not_min_value(&self) -> bool
where Self: PartialEq,

Source§

impl<T, const N: usize> MinusOne for Matrix<T, N, N>
where T: MinusOne + Zero + Copy,

Source§

const MINUS_ONE: Matrix<T, N, N>

Source§

fn minus_one() -> Self
where Self: Sized,

Source§

fn set_minus_one(&mut self) -> &mut Self

Source§

fn is_minus_one(self) -> bool
where Self: PartialEq + Copy,

Source§

fn is_non_minus_one(self) -> bool
where Self: PartialEq + Copy,

Source§

impl<T, const ROW: usize, const COL: usize, const COL2: usize> Mul<Matrix<T, COL, COL2>> for Matrix<T, ROW, COL>

use hexga_math::prelude::*;

let m1  = Mat2P::from_col((point2(7, 6), point2(5, 3)).into());
let m2  = Mat2P::from_col((point2(2, 5), point2(1, 1)).into());
let m3  = Mat2P::from_col((point2(39, 27), point2(12, 9)).into());

assert_eq!(m1 * m2, m3);


let m1 = Matrix::<i32,2,3>::from_col(vector3(vector2(1, 4), vector2(2, 5), vector2(3, 6)));
let m2 = Matrix::<i32,3,2>::from_col(vector2(vector3(7, 9, 11), vector3(8, 10, 12)));
let m3 = Matrix::<i32,2,2>::from_col(vector2(vector2(1*7+2*9+3*11, 4*7+5*9+6*11), vector2(1*8+2*10+3*12, 4*8+5*10+6*12)));

assert_eq!(m1 * m2, m3);
Source§

type Output = Matrix<T, ROW, COL2>

The resulting type after applying the * operator.
Source§

fn mul( self, rhs: Matrix<T, COL, COL2>, ) -> <Matrix<T, ROW, COL> as Mul<Matrix<T, COL, COL2>>>::Output

Performs the * operation. Read more
Source§

impl<T, const ROW: usize, const COL: usize> Mul<T> for Matrix<T, ROW, COL>
where T: Copy + Mul,

Source§

type Output = Matrix<<T as Mul>::Output, ROW, COL>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: T) -> <Matrix<T, ROW, COL> as Mul<T>>::Output

Performs the * operation. Read more
Source§

impl<T, const ROW: usize, const COL: usize> Mul<Vector<T, COL>> for Matrix<T, ROW, COL>
where T: NumberArithmetic, Matrix<T, ROW, COL>: Mul<Matrix<T, COL, 1>, Output = Matrix<T, ROW, 1>>, Vector<T, COL>: From<Matrix<T, ROW, 1>>,

Source§

type Output = Vector<T, COL>

The resulting type after applying the * operator.
Source§

fn mul( self, rhs: Vector<T, COL>, ) -> <Matrix<T, ROW, COL> as Mul<Vector<T, COL>>>::Output

Performs the * operation. Read more
Source§

impl<T, const COL: usize> MulAssign for Matrix<T, COL, COL>
where Matrix<T, COL, COL>: Mul<Output = Matrix<T, COL, COL>> + Copy,

Source§

fn mul_assign(&mut self, rhs: Matrix<T, COL, COL>)

Performs the *= operation. Read more
Source§

impl<T, const ROW: usize, const COL: usize> MulAssign<T> for Matrix<T, ROW, COL>
where T: Copy + Mul<Output = T>,

Source§

fn mul_assign(&mut self, rhs: T)

Performs the *= operation. Read more
Source§

impl<T, const ROW: usize, const COL: usize> NaNValue for Matrix<T, ROW, COL>
where T: NaNValue + Copy,

Source§

const NAN: Matrix<T, ROW, COL>

Source§

fn is_nan(&self) -> bool
where Self: PartialEq,

Source§

fn is_not_nan(&self) -> bool
where Self: PartialEq,

Source§

impl<T, const ROW: usize, const COL: usize> Octal for Matrix<T, ROW, COL>
where T: Octal,

Source§

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

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

impl<T, const N: usize> One for Matrix<T, N, N>
where T: One + Zero + Copy,

Source§

const ONE: Matrix<T, N, N>

The neutral element of the multiplication such that x * X::ONE = x
Source§

fn one() -> Self
where Self: Sized,

Source§

fn set_one(&mut self) -> &mut Self

Source§

fn is_one(&self) -> bool
where Self: PartialEq,

Source§

fn is_non_one(&self) -> bool
where Self: PartialEq,

Source§

impl<T, const ROW: usize, const COL: usize> Ord for Matrix<T, ROW, COL>
where T: Ord,

Source§

fn cmp(&self, other: &Matrix<T, ROW, COL>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl<T, const ROW: usize, const COL: usize> PartialEq for Matrix<T, ROW, COL>
where T: PartialEq,

Source§

fn eq(&self, other: &Matrix<T, ROW, COL>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<T, const ROW: usize, const COL: usize> PartialOrd for Matrix<T, ROW, COL>
where T: PartialOrd,

Source§

fn partial_cmp(&self, other: &Matrix<T, ROW, COL>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T, const ROW: usize, const COL: usize> Pointer for Matrix<T, ROW, COL>
where T: Pointer,

Source§

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

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

impl<T, const N: usize> Position<T, N> for Matrix<T, N, N>
where T: Copy,

Source§

fn pos(&self) -> Vector<T, N>

Source§

fn set_pos(&mut self, pos: Vector<T, N>) -> &mut Matrix<T, N, N>

Source§

fn x(&self) -> T
where Vector<T, N>: HaveX<T>,

Source§

fn y(&self) -> T
where Vector<T, N>: HaveY<T>,

Source§

fn z(&self) -> T
where Vector<T, N>: HaveZ<T>,

Source§

fn w(&self) -> T
where Vector<T, N>: HaveW<T>,

Source§

fn set_x(&mut self, x: T) -> &mut Self
where Vector<T, N>: HaveX<T>,

Source§

fn set_y(&mut self, y: T) -> &mut Self
where Vector<T, N>: HaveY<T>,

Source§

fn set_z(&mut self, z: T) -> &mut Self
where Vector<T, N>: HaveZ<T>,

Source§

fn set_w(&mut self, w: T) -> &mut Self
where Vector<T, N>: HaveW<T>,

Source§

fn with_pos(self, pos: Vector<T, N>) -> Self
where Self: Sized,

Source§

fn with_x(self, x: T) -> Self
where Vector<T, N>: HaveX<T>, Self: Sized,

Source§

fn with_y(self, y: T) -> Self
where Vector<T, N>: HaveY<T>, Self: Sized,

Source§

fn with_z(self, z: T) -> Self
where Vector<T, N>: HaveZ<T>, Self: Sized,

Source§

fn with_w(self, w: T) -> Self
where Vector<T, N>: HaveW<T>, Self: Sized,

Source§

fn move_by(&mut self, v: impl Into<Vector<T, N>>) -> &mut Self
where Vector<T, N>: Add<Output = Vector<T, N>>,

Source§

fn move_neg_by(&mut self, v: impl Into<Vector<T, N>>) -> &mut Self
where Vector<T, N>: Sub<Output = Vector<T, N>>,

Source§

fn move_x(&mut self, x: T) -> &mut Self
where Vector<T, N>: HaveX<T> + Zero + Add<Output = Vector<T, N>>,

Source§

fn move_y(&mut self, y: T) -> &mut Self
where Vector<T, N>: HaveY<T> + Zero + Add<Output = Vector<T, N>>,

Source§

fn move_z(&mut self, z: T) -> &mut Self
where Vector<T, N>: HaveZ<T> + Zero + Add<Output = Vector<T, N>>,

Source§

fn move_w(&mut self, w: T) -> &mut Self
where Vector<T, N>: HaveW<T> + Zero + Add<Output = Vector<T, N>>,

Source§

fn move_neg_x(&mut self, x: T) -> &mut Self
where Vector<T, N>: HaveX<T> + Zero + Add<Output = Vector<T, N>>, T: Neg<Output = T>,

Source§

fn move_neg_y(&mut self, y: T) -> &mut Self
where Vector<T, N>: HaveY<T> + Zero + Add<Output = Vector<T, N>>, T: Neg<Output = T>,

Source§

fn move_neg_z(&mut self, z: T) -> &mut Self
where Vector<T, N>: HaveZ<T> + Zero + Add<Output = Vector<T, N>>, T: Neg<Output = T>,

Source§

fn move_neg_w(&mut self, w: T) -> &mut Self
where Vector<T, N>: HaveW<T> + Zero + Add<Output = Vector<T, N>>, T: Neg<Output = T>,

Source§

fn moved_by(self, v: impl Into<Vector<T, N>>) -> Self
where Vector<T, N>: Add<Output = Vector<T, N>>, Self: Sized,

Source§

fn moved_neg_by(self, v: impl Into<Vector<T, N>>) -> Self
where Vector<T, N>: Sub<Output = Vector<T, N>>, Self: Sized,

Source§

fn moved_x(self, x: T) -> Self
where Vector<T, N>: HaveX<T> + Zero + Add<Output = Vector<T, N>>, Self: Sized,

Source§

fn moved_y(self, y: T) -> Self
where Vector<T, N>: HaveY<T> + Zero + Add<Output = Vector<T, N>>, Self: Sized,

Source§

fn moved_z(self, z: T) -> Self
where Vector<T, N>: HaveZ<T> + Zero + Add<Output = Vector<T, N>>, Self: Sized,

Source§

fn moved_w(self, w: T) -> Self
where Vector<T, N>: HaveW<T> + Zero + Add<Output = Vector<T, N>>, Self: Sized,

Source§

fn moved_neg_x(self, x: T) -> Self
where Vector<T, N>: HaveX<T> + Zero + Add<Output = Vector<T, N>>, T: Neg<Output = T>, Self: Sized,

Source§

fn moved_neg_y(self, y: T) -> Self
where Vector<T, N>: HaveY<T> + Zero + Add<Output = Vector<T, N>>, T: Neg<Output = T>, Self: Sized,

Source§

fn moved_neg_z(self, z: T) -> Self
where Vector<T, N>: HaveZ<T> + Zero + Add<Output = Vector<T, N>>, T: Neg<Output = T>, Self: Sized,

Source§

fn moved_neg_w(self, w: T) -> Self
where Vector<T, N>: HaveW<T> + Zero + Add<Output = Vector<T, N>>, T: Neg<Output = T>, Self: Sized,

Source§

impl<T, const N: usize> Position<Vector<T, N>, N> for Matrix<T, N, N>
where T: Copy,

Source§

fn pos(&self) -> Vector<Vector<T, N>, N>

Source§

fn set_pos(&mut self, pos: Vector<Vector<T, N>, N>) -> &mut Matrix<T, N, N>

Source§

fn x(&self) -> T
where Vector<T, N>: HaveX<T>,

Source§

fn y(&self) -> T
where Vector<T, N>: HaveY<T>,

Source§

fn z(&self) -> T
where Vector<T, N>: HaveZ<T>,

Source§

fn w(&self) -> T
where Vector<T, N>: HaveW<T>,

Source§

fn set_x(&mut self, x: T) -> &mut Self
where Vector<T, N>: HaveX<T>,

Source§

fn set_y(&mut self, y: T) -> &mut Self
where Vector<T, N>: HaveY<T>,

Source§

fn set_z(&mut self, z: T) -> &mut Self
where Vector<T, N>: HaveZ<T>,

Source§

fn set_w(&mut self, w: T) -> &mut Self
where Vector<T, N>: HaveW<T>,

Source§

fn with_pos(self, pos: Vector<T, N>) -> Self
where Self: Sized,

Source§

fn with_x(self, x: T) -> Self
where Vector<T, N>: HaveX<T>, Self: Sized,

Source§

fn with_y(self, y: T) -> Self
where Vector<T, N>: HaveY<T>, Self: Sized,

Source§

fn with_z(self, z: T) -> Self
where Vector<T, N>: HaveZ<T>, Self: Sized,

Source§

fn with_w(self, w: T) -> Self
where Vector<T, N>: HaveW<T>, Self: Sized,

Source§

fn move_by(&mut self, v: impl Into<Vector<T, N>>) -> &mut Self
where Vector<T, N>: Add<Output = Vector<T, N>>,

Source§

fn move_neg_by(&mut self, v: impl Into<Vector<T, N>>) -> &mut Self
where Vector<T, N>: Sub<Output = Vector<T, N>>,

Source§

fn move_x(&mut self, x: T) -> &mut Self
where Vector<T, N>: HaveX<T> + Zero + Add<Output = Vector<T, N>>,

Source§

fn move_y(&mut self, y: T) -> &mut Self
where Vector<T, N>: HaveY<T> + Zero + Add<Output = Vector<T, N>>,

Source§

fn move_z(&mut self, z: T) -> &mut Self
where Vector<T, N>: HaveZ<T> + Zero + Add<Output = Vector<T, N>>,

Source§

fn move_w(&mut self, w: T) -> &mut Self
where Vector<T, N>: HaveW<T> + Zero + Add<Output = Vector<T, N>>,

Source§

fn move_neg_x(&mut self, x: T) -> &mut Self
where Vector<T, N>: HaveX<T> + Zero + Add<Output = Vector<T, N>>, T: Neg<Output = T>,

Source§

fn move_neg_y(&mut self, y: T) -> &mut Self
where Vector<T, N>: HaveY<T> + Zero + Add<Output = Vector<T, N>>, T: Neg<Output = T>,

Source§

fn move_neg_z(&mut self, z: T) -> &mut Self
where Vector<T, N>: HaveZ<T> + Zero + Add<Output = Vector<T, N>>, T: Neg<Output = T>,

Source§

fn move_neg_w(&mut self, w: T) -> &mut Self
where Vector<T, N>: HaveW<T> + Zero + Add<Output = Vector<T, N>>, T: Neg<Output = T>,

Source§

fn moved_by(self, v: impl Into<Vector<T, N>>) -> Self
where Vector<T, N>: Add<Output = Vector<T, N>>, Self: Sized,

Source§

fn moved_neg_by(self, v: impl Into<Vector<T, N>>) -> Self
where Vector<T, N>: Sub<Output = Vector<T, N>>, Self: Sized,

Source§

fn moved_x(self, x: T) -> Self
where Vector<T, N>: HaveX<T> + Zero + Add<Output = Vector<T, N>>, Self: Sized,

Source§

fn moved_y(self, y: T) -> Self
where Vector<T, N>: HaveY<T> + Zero + Add<Output = Vector<T, N>>, Self: Sized,

Source§

fn moved_z(self, z: T) -> Self
where Vector<T, N>: HaveZ<T> + Zero + Add<Output = Vector<T, N>>, Self: Sized,

Source§

fn moved_w(self, w: T) -> Self
where Vector<T, N>: HaveW<T> + Zero + Add<Output = Vector<T, N>>, Self: Sized,

Source§

fn moved_neg_x(self, x: T) -> Self
where Vector<T, N>: HaveX<T> + Zero + Add<Output = Vector<T, N>>, T: Neg<Output = T>, Self: Sized,

Source§

fn moved_neg_y(self, y: T) -> Self
where Vector<T, N>: HaveY<T> + Zero + Add<Output = Vector<T, N>>, T: Neg<Output = T>, Self: Sized,

Source§

fn moved_neg_z(self, z: T) -> Self
where Vector<T, N>: HaveZ<T> + Zero + Add<Output = Vector<T, N>>, T: Neg<Output = T>, Self: Sized,

Source§

fn moved_neg_w(self, w: T) -> Self
where Vector<T, N>: HaveW<T> + Zero + Add<Output = Vector<T, N>>, T: Neg<Output = T>, Self: Sized,

Source§

impl<T, const COL: usize> Product for Matrix<T, COL, COL>
where Matrix<T, COL, COL>: One + Mul<Output = Matrix<T, COL, COL>>,

Source§

fn product<I>(iter: I) -> Matrix<T, COL, COL>
where I: Iterator<Item = Matrix<T, COL, COL>>,

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl<T, const N: usize> RotationX<T> for Matrix<T, N, N>
where Matrix<T, N, N>: HaveZ<Vector<T, N>> + Zero + Mul<Output = Matrix<T, N, N>>, T: Float,

Source§

fn rotate_x(&mut self, angle: AngleOf<T>) -> &mut Matrix<T, N, N>

Source§

fn rot_x(&mut self, angle: AngleOf<T>) -> &mut Self

Source§

fn rotated_x(self, angle: AngleOf<T>) -> Self
where Self: Sized,

Source§

impl<T, const N: usize> RotationY<T> for Matrix<T, N, N>
where Matrix<T, N, N>: HaveZ<Vector<T, N>> + Zero + Mul<Output = Matrix<T, N, N>>, T: Float,

Source§

fn rotate_y(&mut self, angle: AngleOf<T>) -> &mut Matrix<T, N, N>

Source§

fn rot_y(&mut self, angle: AngleOf<T>) -> &mut Self

Source§

fn rotated_y(self, angle: AngleOf<T>) -> Self
where Self: Sized,

Source§

impl<T, const N: usize> RotationZ<T> for Matrix<T, N, N>
where Matrix<T, N, N>: HaveY<Vector<T, N>> + Zero + Mul<Output = Matrix<T, N, N>>, T: Float,

Source§

fn rotate_z(&mut self, angle: AngleOf<T>) -> &mut Matrix<T, N, N>

Source§

fn rot_z(&mut self, angle: AngleOf<T>) -> &mut Self

Source§

fn rotated_z(self, angle: AngleOf<T>) -> Self
where Self: Sized,

Source§

impl<T, const ROW: usize, const COL: usize> Serialize for Matrix<T, ROW, COL>
where T: Serialize,

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<T, const ROW: usize, const COL: usize> StructuralPartialEq for Matrix<T, ROW, COL>
where T: PartialEq,

Source§

impl<T, const ROW: usize, const COL: usize> Sub for Matrix<T, ROW, COL>
where Vector<Vector<T, ROW>, COL>: Sub<Output = Vector<Vector<T, ROW>, COL>>,

Source§

type Output = Matrix<T, ROW, COL>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Matrix<T, ROW, COL>) -> <Matrix<T, ROW, COL> as Sub>::Output

Performs the - operation. Read more
Source§

impl<T, const ROW: usize, const COL: usize> SubAssign for Matrix<T, ROW, COL>
where Matrix<T, ROW, COL>: Sub<Output = Matrix<T, ROW, COL>> + Copy,

Source§

fn sub_assign(&mut self, rhs: Matrix<T, ROW, COL>)

Performs the -= operation. Read more
Source§

impl<T, const ROW: usize, const COL: usize> Sum for Matrix<T, ROW, COL>
where Matrix<T, ROW, COL>: Zero + Add<Output = Matrix<T, ROW, COL>>,

Source§

fn sum<I>(iter: I) -> Matrix<T, ROW, COL>
where I: Iterator<Item = Matrix<T, ROW, COL>>,

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

impl<T, const ROW: usize, const COL: usize> UpperExp for Matrix<T, ROW, COL>
where T: UpperExp,

Source§

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

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

impl<T, const ROW: usize, const COL: usize> UpperHex for Matrix<T, ROW, COL>
where T: UpperHex,

Source§

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

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

impl<T, const ROW: usize, const COL: usize> Zero for Matrix<T, ROW, COL>
where Vector<Vector<T, ROW>, COL>: Zero,

Source§

const ZERO: Matrix<T, ROW, COL>

The absorbing element of the multiplication such that x * X::ZERO = X::ZERO
Source§

fn zero() -> Self

Source§

fn set_zero(&mut self) -> &mut Self

Source§

fn is_zero(&self) -> bool
where Self: PartialEq,

Source§

fn is_non_zero(&self) -> bool
where Self: PartialEq,

Auto Trait Implementations§

§

impl<T, const ROW: usize, const COL: usize> Freeze for Matrix<T, ROW, COL>
where Vector<Vector<T, ROW>, COL>: Freeze,

§

impl<T, const ROW: usize, const COL: usize> RefUnwindSafe for Matrix<T, ROW, COL>
where Vector<Vector<T, ROW>, COL>: RefUnwindSafe,

§

impl<T, const ROW: usize, const COL: usize> Send for Matrix<T, ROW, COL>
where Vector<Vector<T, ROW>, COL>: Send,

§

impl<T, const ROW: usize, const COL: usize> Sync for Matrix<T, ROW, COL>
where Vector<Vector<T, ROW>, COL>: Sync,

§

impl<T, const ROW: usize, const COL: usize> Unpin for Matrix<T, ROW, COL>
where Vector<Vector<T, ROW>, COL>: Unpin,

§

impl<T, const ROW: usize, const COL: usize> UnsafeUnpin for Matrix<T, ROW, COL>
where Vector<Vector<T, ROW>, COL>: UnsafeUnpin,

§

impl<T, const ROW: usize, const COL: usize> UnwindSafe for Matrix<T, ROW, COL>
where Vector<Vector<T, ROW>, COL>: UnwindSafe,

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<Src, Dest> CastFrom<Dest> for Src
where Dest: CastInto<Src>,

Source§

fn cast_from(value: Dest) -> Src

Source§

impl<Src, Dest> CastRangeFrom<Dest> for Src
where Dest: CastRangeInto<Src>,

Source§

fn cast_range_from(value: Dest) -> Src

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> Decrease for T
where T: One + Sub<Output = T> + SubAssign + Copy,

Source§

fn decrease(&mut self)

The decrement x-- operator
Source§

fn decrease_checked(&mut self) -> Result<(), ()>

The increment x-- operator
Source§

fn can_decrease(&self) -> bool

Do the current value have a predecessor. Read more
Source§

fn predecessor(self) -> Self

Return the predecessor self - 1
Source§

fn predecessor_checked(&mut self) -> Result<Self, ()>

Return the predecessor self - 1
Source§

fn have_predecessor(self) -> bool

Do the current value have a predecessor. Read more
Source§

impl<T> DefaultExtension for T
where T: Default + PartialEq,

Source§

impl<T> DefaultIsTripleUnderscore for T
where T: Default,

Source§

fn ___() -> T

The Self::default() method. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Increase for T
where T: One + Add<Output = T> + AddAssign + Copy,

Source§

fn increase(&mut self)

The increment x++ operator
Source§

fn increase_checked(&mut self) -> Result<(), ()>

The increment x++ operator
Source§

fn can_increase(&self) -> bool

Do the current value have a successor. Read more
Source§

fn successor(self) -> Self

Return the successor self + 1
Source§

fn successor_checked(&mut self) -> Result<Self, ()>

Return the successor self + 1
Source§

fn have_successor(self) -> bool

Do the current value have a successor. 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<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> Lerpable for T
where T: Add<Output = T> + Mul<f32, Output = T>,

Source§

fn lerp_unchecked(self, dest: T, coef: f32) -> T

Not restricted between [0..1]
Source§

fn lerp(self, dest: Self, coef: f32) -> Self

Restricted between [0..1]
Source§

impl<T> LoadToDisk for T
where T: IoLoad + ?Sized,

Source§

impl<T> PartialOrdExtension for T
where T: PartialOrd,

Source§

fn max_partial(self, other: Self) -> Self
where Self: Sized,

Source§

fn min_partial(self, other: Self) -> Self
where Self: Sized,

Source§

fn clamp_partial(self, min: Self, max: Self) -> Self
where Self: Sized,

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PositiveOrNegative for T
where T: Zero + PartialOrd,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> SaveToDisk for T
where T: IoSave + ?Sized,

Source§

fn save_to_disk(&self, path: &str) -> Result<(), IoError>

Source§

impl<T> SplatCoord1 for T
where T: Copy,

Source§

fn splat1(self) -> Vector<Self, 1>

Source§

impl<T> SplatCoord2 for T
where T: Copy,

Source§

fn splat2(self) -> Vector<Self, 2>

Source§

impl<T> SplatCoord3 for T
where T: Copy,

Source§

fn splat3(self) -> Vector<Self, 3>

Source§

impl<T> SplatCoord4 for T
where T: Copy,

Source§

fn splat4(self) -> Vector<Self, 4>

Source§

impl<T> Three for T
where T: One + Add<Output = T>,

Source§

fn three() -> T

There will be a constant THREE later when const trait will be stable
Source§

fn is_three(&self) -> bool
where Self: PartialEq,

Source§

fn is_non_three(&self) -> bool
where Self: PartialEq,

Source§

impl<T> ToDebug for T
where T: Debug,

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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> Two for T
where T: One + Add<Output = T>,

Source§

fn two() -> T

There will be a constant TWO later when const trait will be stable
Source§

fn is_two(&self) -> bool
where Self: PartialEq,

Source§

fn is_non_two(&self) -> bool
where Self: PartialEq,

Source§

impl<T> UnitArithmetic for T
where T: Add<Output = T> + AddAssign + Sum + Sub<Output = T> + Copy + SubAssign + Zero,