[−][src]Struct mop_structs::matrix::dr_matrix::DrMatrixRowConstructor
Constructs a new valid row in a easy and interactive manner.
This struct may panic when out of scope. Please see the Drop documentation in
the Trait Implementations section for more information.
#[derive(Debug, PartialEq)]
Methods
impl<'a, DS> DrMatrixRowConstructor<'a, DS> where
DS: DynDenseStoMut, [src]
DS: DynDenseStoMut,
pub fn clone_values_from_row(self, row: &[DS::Item]) -> Self where
DS::Item: Clone, [src]
DS::Item: Clone,
Clones all values of row into the current row.
Examples
use mop_structs::{ doc_tests::dr_matrix_empty_vec_array, matrix::dr_matrix::DrMatrixRef }; let mut a = dr_matrix_empty_vec_array(); a.row_constructor().copy_values_from_row(&[1, 2, 3, 4, 5]).commit(); assert_eq!(a.as_ref(), DrMatrixRef::new( [1, 5], &[1, 2, 3, 4, 5], ));
pub fn commit(self)[src]
Commits the row construction, modifying the internal structure.
Examples
use mop_structs::{ doc_tests::dr_matrix_empty_vec_array, matrix::dr_matrix::DrMatrixRef }; let mut a = dr_matrix_empty_vec_array(); a.row_constructor() .push_value(1) .push_value(2) .push_value(3) .push_value(4) .push_value(5) .commit(); assert_eq!(a.as_ref(), DrMatrixRef::new([1, 5], &[1, 2, 3, 4, 5]));
Assertions
- The number of inserted elements must be equal the number of columns of
Self.
use mop_structs::doc_tests::dr_matrix_empty_vec_array; let mut a = dr_matrix_empty_vec_array(); a.row_constructor().push_value(1).commit();
pub fn copy_values_from_row(self, row: &[DS::Item]) -> Self where
DS::Item: Copy, [src]
DS::Item: Copy,
Copies all values of row into the current row.
Examples
use mop_structs::{ doc_tests::dr_matrix_empty_vec_array, matrix::dr_matrix::DrMatrixRef }; let mut a = dr_matrix_empty_vec_array(); a.row_constructor().copy_values_from_row(&[1, 2, 3, 4, 5]).commit(); assert_eq!(a.as_ref(), DrMatrixRef::new( [1, 5], &[1, 2, 3, 4, 5], ));
pub fn push_value(self, value: DS::Item) -> Self[src]
Pushes a new value.
Examples
use mop_structs::{ doc_tests::{dr_matrix_empty_vec_array, dr_matrix_array}, }; let mut a = dr_matrix_empty_vec_array(); a.row_constructor() .push_value(1) .push_value(2) .push_value(3) .push_value(4) .push_value(5) .commit(); a.row_constructor() .push_value(6) .push_value(7) .push_value(8) .push_value(9) .push_value(10) .commit(); a.row_constructor() .push_value(11) .push_value(12) .push_value(13) .push_value(14) .push_value(15) .commit(); a.row_constructor() .push_value(16) .push_value(17) .push_value(18) .push_value(19) .push_value(20) .commit(); assert_eq!(a.as_ref(), dr_matrix_array().as_ref());
Trait Implementations
impl<'a, DS> Drop for DrMatrixRowConstructor<'a, DS>[src]
fn drop(&mut self)[src]
Some measures are taken to ensure a valid format and avoid unexpected runtime behavior.
Assertions
- Every single nonempty instance of
DrMatrixRowConstructormust end with a call to thecommitmethod.
use mop_structs::doc_tests::dr_matrix_empty_vec_array; let mut a = dr_matrix_empty_vec_array(); a.row_constructor().push_value(1).push_value(2).push_value(3).push_value(4);
impl<'a, DS: PartialEq> PartialEq<DrMatrixRowConstructor<'a, DS>> for DrMatrixRowConstructor<'a, DS>[src]
fn eq(&self, other: &DrMatrixRowConstructor<'a, DS>) -> bool[src]
fn ne(&self, other: &DrMatrixRowConstructor<'a, DS>) -> bool[src]
impl<'a, DS: Debug> Debug for DrMatrixRowConstructor<'a, DS>[src]
Auto Trait Implementations
impl<'a, DS> Send for DrMatrixRowConstructor<'a, DS> where
DS: Send,
DS: Send,
impl<'a, DS> Sync for DrMatrixRowConstructor<'a, DS> where
DS: Sync,
DS: Sync,
Blanket Implementations
impl<T> From for T[src]
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,