Trait cgmath::Array2
[−]
[src]
pub trait Array2<Column: Array1<Element> + 'static, Row: Array1<Element>, Element: Copy>: Index<usize, Output=Column> + IndexMut<usize, Output=Column> {
fn row(&self, r: usize) -> Row;
fn swap_rows(&mut self, a: usize, b: usize);
fn map<F>(&mut self, op: F) -> Self where F: FnMut(&Column) -> Column;
fn ptr<'a>(&'a self) -> &'a Element { ... }
fn mut_ptr<'a>(&'a mut self) -> &'a mut Element { ... }
fn swap_cols(&mut self, a: usize, b: usize) { ... }
fn replace_col(&mut self, c: usize, src: Column) -> Column { ... }
fn swap_elems(&mut self, a: (usize, usize), b: (usize, usize)) { ... }
}
A column-major array
Required Methods
fn row(&self, r: usize) -> Row
Get a row from this array by-value.
fn swap_rows(&mut self, a: usize, b: usize)
Swap two rows of this array.
fn map<F>(&mut self, op: F) -> Self where F: FnMut(&Column) -> Column
Apply a function to each column.
Provided Methods
fn ptr<'a>(&'a self) -> &'a Element
Get the pointer to the first element of the array.
fn mut_ptr<'a>(&'a mut self) -> &'a mut Element
Get a mutable pointer to the first element of the array.
fn swap_cols(&mut self, a: usize, b: usize)
Swap two columns of this array.
fn replace_col(&mut self, c: usize, src: Column) -> Column
Replace a column in the array.
fn swap_elems(&mut self, a: (usize, usize), b: (usize, usize))
Swap the values at index a
and b