pub struct BlockData { /* private fields */ }Implementations§
Source§impl BlockData
impl BlockData
pub fn new(rows: usize, cols: usize, data: &[f64]) -> Self
pub fn from_data(data: DMatrix<f64>, dtype: BlockDataType) -> Self
pub fn from_element(nrows: usize, ncols: usize, scalar: f64) -> Self
pub fn from_scalar(scalar: f64) -> Self
pub fn from_row_slice(nrows: usize, ncols: usize, data: &[f64]) -> Self
pub fn from_bytes(byte_data: &[u8]) -> Self
pub fn scalar_sizeof(scalar: f64, block: &BlockData) -> Self
pub fn from_vector(data: &[f64]) -> Self
pub fn from_matrix(matrix_slice: &[&[f64]]) -> Self
pub fn zeros_sizeof(block: &BlockData) -> Self
pub fn ones_sizeof(block: &BlockData) -> Self
pub fn scalar_from_bool(value: bool) -> Self
pub fn fix_non_finite(&mut self)
pub fn slice(&mut self, r0: usize, c0: usize, rows: usize, cols: usize) -> Self
pub fn as_col_slice(&self) -> &[f64]
pub fn set(&mut self, index: usize, value: f64)
pub fn at(&self, index: usize) -> f64
pub fn ref_at(&self, index: usize) -> &f64
pub fn ref_at_mut(&mut self, index: usize) -> &mut f64
pub fn at_rc(&self, r: usize, c: usize) -> f64
pub fn get_type(&self) -> BlockDataType
pub fn set_type(&mut self, new_type: BlockDataType)
pub fn scalar(&self) -> f64
pub fn get_data(&self) -> &DMatrix<f64>
pub fn set_data(&mut self, data: DMatrix<f64>)
pub fn maybe_reset(&mut self, reset_signal: &BlockData)
pub fn compare(&self, other: &BlockData) -> BlockTypeRelationship
pub fn vector(&self) -> DMatrix<f64>
pub fn boolean(&self) -> Self
pub fn norm(&self) -> f64
pub fn vector_magnitude(&self) -> Self
pub fn vector_magnitude_rows(&self) -> Self
pub fn any(&self) -> bool
pub fn all(&self) -> bool
pub fn set_scalar(&mut self, new_scalar_value: f64)
pub fn set_bytes(&mut self, byte_data: &[u8])
pub fn set_scalar_bool(&mut self, value: bool)
pub fn nrows(&self) -> usize
pub fn ncols(&self) -> usize
pub fn size(&self) -> (usize, usize)
pub fn n_elements(&self) -> usize
pub fn same_size(&self, other: &BlockData) -> bool
pub fn inner_dims_same(&self, other: &BlockData) -> bool
pub fn component_mul(&self, other: &BlockData) -> Self
pub fn component_set(&mut self, condition: &BlockData, assign: &BlockData)
pub fn component_or(first: &BlockData, other: &BlockData) -> Self
pub fn component_and(first: &BlockData, other: &BlockData) -> Self
pub fn component_bitand(&self, rhs: &BlockData) -> Self
pub fn component_bitor(&self, rhs: &BlockData) -> Self
pub fn component_bitxor(&self, rhs: &BlockData) -> Self
pub fn component_lshift(&self, bits: i32) -> Self
pub fn component_rshift(&self, bits: i32) -> Self
pub fn component_bitnot(&self) -> Self
pub fn component_eq(first: &BlockData, other: &BlockData) -> Self
pub fn component_neq(first: &BlockData, other: &BlockData) -> Self
pub fn component_gt(first: &BlockData, other: &BlockData) -> Self
pub fn component_gte(first: &BlockData, other: &BlockData) -> Self
pub fn component_lt(first: &BlockData, other: &BlockData) -> Self
pub fn component_lte(first: &BlockData, other: &BlockData) -> Self
pub fn powf(&self, coefficient: &BlockData) -> Self
pub fn sign(&self) -> Self
pub fn abs(&self) -> Self
pub fn transpose(&self) -> Self
pub fn determinant(&self) -> Self
pub fn cross(&self, other: &BlockData) -> Self
pub fn dot(&self, other: &BlockData) -> Self
pub fn inverse(&self) -> Option<Self>
pub fn pseudo_inverse(&self, epsilon: f64) -> Option<Self>
pub fn to_bytes(&self) -> Vec<u8>
Sourcepub fn to_raw_bytes(&self) -> Vec<u8>
pub fn to_raw_bytes(&self) -> Vec<u8>
Returns a Vector of bytes representing the raw data
Sourcepub fn raw_string(&self) -> String
pub fn raw_string(&self) -> String
Return the raw data represented as a string
This will attempt to convert internal vector data to utf-8. This behaves the same as stringify for all data types other than byte arrays, which will attempt to convert to a string.
pub fn iter(&self) -> MatrixIter<'_, f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>
pub fn map<F: FnMut(f64) -> f64>(&self, f: F) -> Self
pub fn sum(&self) -> f64
pub fn mean(&self) -> f64
pub fn max(&self) -> f64
pub fn min(&self) -> f64
pub fn argmax(&self) -> f64
pub fn argmin(&self) -> f64
pub fn sorted(&self, ascending: bool) -> Self
pub fn median(&self) -> f64
pub fn sup(&self, other: &BlockData) -> Self
pub fn inf(&self, other: &BlockData) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn or(&self, other: &BlockData) -> Self
pub fn and(&self, other: &BlockData) -> Self
pub fn eq(&self, other: &BlockData) -> Self
pub fn neq(&self, other: &BlockData) -> Self
pub fn gt(&self, other: &BlockData) -> Self
pub fn gte(&self, other: &BlockData) -> Self
pub fn lt(&self, other: &BlockData) -> Self
pub fn lte(&self, other: &BlockData) -> Self
pub fn logical_not(&self) -> Self
pub fn ltz(&self) -> Self
pub fn ltez(&self) -> Self
pub fn gtz(&self) -> Self
pub fn gtez(&self) -> Self
pub fn eqz(&self) -> Self
Trait Implementations§
Source§impl AbsDiffEq for BlockData
impl AbsDiffEq for BlockData
Source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
The default tolerance to use when testing values that are close together. Read more
Source§fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
A test for equality that uses the absolute difference to compute the approximate
equality of two numbers.
Source§fn abs_diff_ne(&self, other: &Self, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Self, epsilon: Self::Epsilon) -> bool
The inverse of
AbsDiffEq::abs_diff_eq.Source§impl AddAssign<&BlockData> for BlockData
impl AddAssign<&BlockData> for BlockData
Source§fn add_assign(&mut self, rhs: &BlockData)
fn add_assign(&mut self, rhs: &BlockData)
Performs the
+= operation. Read moreSource§impl BlockDataRead for &BlockData
impl BlockDataRead for &BlockData
Source§impl BlockDataRead for BlockData
impl BlockDataRead for BlockData
Source§impl BlockDataWrite for &mut BlockData
impl BlockDataWrite for &mut BlockData
Source§fn set_scalar_value(&mut self, scalar: f64)
fn set_scalar_value(&mut self, scalar: f64)
Set a scalar value
Source§impl DivAssign<&BlockData> for BlockData
impl DivAssign<&BlockData> for BlockData
Source§fn div_assign(&mut self, rhs: &BlockData)
fn div_assign(&mut self, rhs: &BlockData)
Performs the
/= operation. Read moreSource§impl DivAssign<f64> for BlockData
impl DivAssign<f64> for BlockData
Source§fn div_assign(&mut self, rhs: f64)
fn div_assign(&mut self, rhs: f64)
Performs the
/= operation. Read moreSource§impl FromPass<ByteSliceSignal> for BlockData
impl FromPass<ByteSliceSignal> for BlockData
fn from_pass(pass: PassBy<'_, ByteSliceSignal>) -> Self
Source§impl<const NROWS: usize, const NCOLS: usize, T: Scalar> FromPass<Matrix<NROWS, NCOLS, T>> for BlockData
impl<const NROWS: usize, const NCOLS: usize, T: Scalar> FromPass<Matrix<NROWS, NCOLS, T>> for BlockData
Source§impl MulAssign<&BlockData> for BlockData
impl MulAssign<&BlockData> for BlockData
Source§fn mul_assign(&mut self, rhs: &BlockData)
fn mul_assign(&mut self, rhs: &BlockData)
Performs the
*= operation. Read moreSource§impl RelativeEq for BlockData
impl RelativeEq for BlockData
Source§fn default_max_relative() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
Source§fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_eq( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
A test for equality that uses a relative comparison if the values are far apart.
Source§fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_ne( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
The inverse of
RelativeEq::relative_eq.Source§impl SubAssign<&BlockData> for BlockData
impl SubAssign<&BlockData> for BlockData
Source§fn sub_assign(&mut self, rhs: &BlockData)
fn sub_assign(&mut self, rhs: &BlockData)
Performs the
-= operation. Read moreSource§impl<const NROWS: usize, const NCOLS: usize> ToPass<Matrix<NROWS, NCOLS, bool>> for BlockData
impl<const NROWS: usize, const NCOLS: usize> ToPass<Matrix<NROWS, NCOLS, bool>> for BlockData
impl StructuralPartialEq for BlockData
Auto Trait Implementations§
impl Freeze for BlockData
impl RefUnwindSafe for BlockData
impl Send for BlockData
impl Sync for BlockData
impl Unpin for BlockData
impl UnsafeUnpin for BlockData
impl UnwindSafe for BlockData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.