[][src]Struct mop_structs::matrix::dr_matrix::DrMatrix

pub struct DrMatrix<DS> { /* fields omitted */ }

Methods

impl<DS> DrMatrix<DS> where
    DS: StDenseStoRef
[src]

pub fn new(shape: [usize; 2], data: DS) -> Self[src]

Creates a new DrMatrix from raw parameters.

Arguments

  • shape - An array containing the number of rows and columns.
  • data - The matrix data.

Examples

use mop_structs::matrix::dr_matrix::DrMatrixArray;
let _ = DrMatrixArray::new([2, 4], [1, 2, 3, 4, 5, 6, 7, 8]);

Assertions

  • The length of data must be equal the number of rows times the number of columns.
use mop_structs::matrix::dr_matrix::DrMatrixRef;
let _ = DrMatrixRef::new([2, 4], &[1, 2, 3]);

pub fn new_unchecked(shape: [usize; 2], data: DS) -> Self[src]

A faster and unsafe version of new.

pub fn as_ref(&self) -> DrMatrixRef<DS::Item>[src]

Converts the inner storage to a generic immutable slice storage.

Examples

use mop_structs::{
    doc_tests::dr_matrix_array,
    matrix::dr_matrix::DrMatrixRef
};
assert_eq!(
    dr_matrix_array().as_ref(),
    DrMatrixRef::new(
        [4, 5],
        &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
    )
);

pub fn data(&self) -> &[DS::Item][src]

pub fn row(&self, idx: usize) -> &[DS::Item][src]

Important traits for DrMatrixRowIter<'a, T>
pub fn row_iter(&self) -> DrMatrixRowIter<DS::Item>[src]

pub fn row_par_iter(&self) -> ParallelIteratorWrapper<DrMatrixRowIter<DS::Item>>[src]

pub fn value(&self, row_idx: usize, col_idx: usize) -> &DS::Item[src]

impl<DS> DrMatrix<DS> where
    DS: StDenseStoMut
[src]

pub fn data_mut(&mut self) -> &mut [DS::Item][src]

pub fn row_mut(&mut self, idx: usize) -> &mut [DS::Item][src]

Important traits for DrMatrixRowIterMut<'a, T>
pub fn row_iter_mut(&mut self) -> DrMatrixRowIterMut<DS::Item>[src]

pub fn row_par_iter_mut(
    &mut self
) -> ParallelIteratorWrapper<DrMatrixRowIterMut<DS::Item>>
[src]

pub fn swap(&mut self, a: [usize; 2], b: [usize; 2])[src]

pub fn two_rows_mut(
    &mut self,
    smaller_idx: usize,
    bigger_idx: usize
) -> [&mut [DS::Item]; 2]
[src]

pub fn value_mut(&mut self, row_idx: usize, col_idx: usize) -> &mut DS::Item[src]

impl<DS> DrMatrix<DS> where
    DS: DynDenseStoRef
[src]

pub fn rows_capacity(&self) -> usize[src]

impl<DS> DrMatrix<DS> where
    DS: DynDenseStoMut
[src]

pub fn clear(&mut self)[src]

pub fn extend<AD>(&mut self, other: &DrMatrix<AD>) where
    AD: DynDenseStoMut<Item = DS::Item>,
    DS::Item: Copy
[src]

pub fn extend_from_clone<AD>(&mut self, other: &DrMatrix<AD>) where
    AD: DynDenseStoMut<Item = DS::Item>,
    DS::Item: Clone
[src]

pub fn row_constructor(&mut self) -> DrMatrixRowConstructor<DS>[src]

pub fn truncate(&mut self, until_row_idx: usize)[src]

Trait Implementations

impl<DS> Matrix for DrMatrix<DS>[src]

impl<DS: PartialOrd> PartialOrd<DrMatrix<DS>> for DrMatrix<DS>[src]

impl<DS: Copy> Copy for DrMatrix<DS>[src]

impl<DS: Clone> Clone for DrMatrix<DS>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<DS: PartialEq> PartialEq<DrMatrix<DS>> for DrMatrix<DS>[src]

impl<DS: Default> Default for DrMatrix<DS>[src]

impl<DS: Hash> Hash for DrMatrix<DS>[src]

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

Feeds a slice of this type into the given [Hasher]. Read more

impl<DS: Debug> Debug for DrMatrix<DS>[src]

impl<DS> Serialize for DrMatrix<DS> where
    DS: Serialize
[src]

impl<'de, DS> Deserialize<'de> for DrMatrix<DS> where
    DS: Deserialize<'de>, 
[src]

Auto Trait Implementations

impl<DS> Send for DrMatrix<DS> where
    DS: Send

impl<DS> Sync for DrMatrix<DS> where
    DS: Sync

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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