Trait binpool::Matrix
[−]
[src]
pub trait Matrix: Sized + Default { type Scalar: Scalar; fn dim() -> [usize; 2]; fn get(&self, row: usize, col: usize) -> &Self::Scalar; fn set(&mut self, row: usize, col: usize, val: Self::Scalar); fn write_property<W: Write>(
&self,
property_id: u16,
w: &mut W
) -> Result<()> { ... } fn write_array<W: Write, A: Array<Item = Self>>(
property_id: u16,
arr: &A,
w: &mut W
) -> Result<()> { ... } fn read_property<R: Read>(
&mut self,
state: State<Bytes>,
ty: u16,
r: &mut R
) -> Result<()> { ... } fn read_array<R: Read, A: Array<Item = Self>>(
state: State<Bytes>,
ty: u16,
arr: &mut A,
r: &mut R
) -> Result<()> { ... } }
Implemented by matrix types.
Associated Types
Required Methods
fn dim() -> [usize; 2]
Returns dimensions.
fn get(&self, row: usize, col: usize) -> &Self::Scalar
Gets value.
fn set(&mut self, row: usize, col: usize, val: Self::Scalar)
Sets value.
Provided Methods
fn write_property<W: Write>(&self, property_id: u16, w: &mut W) -> Result<()>
Writes property.
fn write_array<W: Write, A: Array<Item = Self>>(
property_id: u16,
arr: &A,
w: &mut W
) -> Result<()>
property_id: u16,
arr: &A,
w: &mut W
) -> Result<()>
Writes array.
fn read_property<R: Read>(
&mut self,
state: State<Bytes>,
ty: u16,
r: &mut R
) -> Result<()>
&mut self,
state: State<Bytes>,
ty: u16,
r: &mut R
) -> Result<()>
Reads property.
fn read_array<R: Read, A: Array<Item = Self>>(
state: State<Bytes>,
ty: u16,
arr: &mut A,
r: &mut R
) -> Result<()>
state: State<Bytes>,
ty: u16,
arr: &mut A,
r: &mut R
) -> Result<()>
Reads array.
Implementors
impl<T: Scalar> Matrix for [[T; 2]; 2]
impl<T: Scalar> Matrix for [[T; 2]; 3]
impl<T: Scalar> Matrix for [[T; 2]; 4]
impl<T: Scalar> Matrix for [[T; 3]; 2]
impl<T: Scalar> Matrix for [[T; 3]; 3]
impl<T: Scalar> Matrix for [[T; 3]; 4]
impl<T: Scalar> Matrix for [[T; 4]; 2]
impl<T: Scalar> Matrix for [[T; 4]; 3]
impl<T: Scalar> Matrix for [[T; 4]; 4]