[−][src]Struct mop_structs::matrix::dr_matrix::DrMatrix
Methods
impl<DS> DrMatrix<DS> where
DS: StDenseStoRef, [src]
DS: StDenseStoRef,
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
datamust 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]
ⓘImportant traits for DrMatrixRowIter<'a, T>
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]
DS: StDenseStoMut,
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]
ⓘImportant traits for DrMatrixRowIterMut<'a, T>
pub fn row_par_iter_mut(
&mut self
) -> ParallelIteratorWrapper<DrMatrixRowIterMut<DS::Item>>[src]
&mut self
) -> ParallelIteratorWrapper<DrMatrixRowIterMut<DS::Item>>
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]
&mut self,
smaller_idx: usize,
bigger_idx: usize
) -> [&mut [DS::Item]; 2]
pub fn value_mut(&mut self, row_idx: usize, col_idx: usize) -> &mut DS::Item[src]
impl<DS> DrMatrix<DS> where
DS: DynDenseStoRef, [src]
DS: DynDenseStoRef,
pub fn rows_capacity(&self) -> usize[src]
impl<DS> DrMatrix<DS> where
DS: DynDenseStoMut, [src]
DS: DynDenseStoMut,
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]
AD: DynDenseStoMut<Item = DS::Item>,
DS::Item: Copy,
pub fn extend_from_clone<AD>(&mut self, other: &DrMatrix<AD>) where
AD: DynDenseStoMut<Item = DS::Item>,
DS::Item: Clone, [src]
AD: DynDenseStoMut<Item = DS::Item>,
DS::Item: Clone,
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]
fn partial_cmp(&self, other: &DrMatrix<DS>) -> Option<Ordering>[src]
fn lt(&self, other: &DrMatrix<DS>) -> bool[src]
fn le(&self, other: &DrMatrix<DS>) -> bool[src]
fn gt(&self, other: &DrMatrix<DS>) -> bool[src]
fn ge(&self, other: &DrMatrix<DS>) -> bool[src]
impl<DS: Copy> Copy for DrMatrix<DS>[src]
impl<DS: Clone> Clone for DrMatrix<DS>[src]
fn clone(&self) -> 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<__HDS: Hasher>(&self, state: &mut __HDS)[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
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]
DS: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer, [src]
__S: Serializer,
impl<'de, DS> Deserialize<'de> for DrMatrix<DS> where
DS: Deserialize<'de>, [src]
DS: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
Auto Trait Implementations
Blanket Implementations
impl<T> From for T[src]
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
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>,
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>, [src]
T: Deserialize<'de>,