pub struct MatrixAddress {
pub x: i64,
pub y: i64,
}Fields§
§x: i64§y: i64Trait Implementations§
Source§impl Addressable for MatrixAddress
impl Addressable for MatrixAddress
fn get_dimension_count() -> u32
fn new_from_value_vec(values: Vec<i64>) -> MatrixAddress
fn get_item_at_dimension_index(&self, dimension_index: u32) -> &i64
fn get_mut_item_at_dimension_index(&mut self, dimension_index: u32) -> &mut i64
fn add_in_place(&mut self, other: &Self)
fn subtract_in_place(&mut self, other: &Self)
fn scale_in_place(&mut self, scalar: f64)
fn abs_in_place(&mut self)
fn difference_in_place(&mut self, other: &Self)
fn add(&self, other: &Self) -> Self
fn subtract(&self, other: &Self) -> Self
fn difference(&self, other: &Self) -> Self
fn scale(&self, scalar: f64) -> Self
fn distance(&self, other: &Self) -> f64
Source§impl Clone for MatrixAddress
impl Clone for MatrixAddress
Source§fn clone(&self) -> MatrixAddress
fn clone(&self) -> MatrixAddress
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MatrixAddress
impl Debug for MatrixAddress
Source§impl Display for MatrixAddress
impl Display for MatrixAddress
Source§impl Hash for MatrixAddress
impl Hash for MatrixAddress
Source§impl Ord for MatrixAddress
impl Ord for MatrixAddress
Source§fn cmp(&self, other: &MatrixAddress) -> Ordering
fn cmp(&self, other: &MatrixAddress) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for MatrixAddress
impl PartialEq for MatrixAddress
Source§impl PartialOrd for MatrixAddress
impl PartialOrd for MatrixAddress
Source§impl<T> SparseTensor<T, MatrixAddress> for SparseMatrix<T>
impl<T> SparseTensor<T, MatrixAddress> for SparseMatrix<T>
Source§fn new(address_value_map: HashMap<MatrixAddress, T>) -> SparseMatrix<T>
fn new(address_value_map: HashMap<MatrixAddress, T>) -> SparseMatrix<T>
Creates a new instance of a sparse tensor given the address-value-map
Source§fn get(&self, address: &MatrixAddress) -> Option<&T>
fn get(&self, address: &MatrixAddress) -> Option<&T>
Attempts to retrieve a reference to the value at the address.
Returns None if the address is outside the given bound
fn get_mut(&mut self, address: &MatrixAddress) -> Option<&mut T>
Source§fn set(&mut self, address: &MatrixAddress, value: T) -> Option<T>
fn set(&mut self, address: &MatrixAddress, value: T) -> Option<T>
Attempts to reassign the value at the given index. Returns Err if the given address is out of bounds.
Source§fn iter(&self) -> Iter<'_, MatrixAddress, T>
fn iter(&self) -> Iter<'_, MatrixAddress, T>
Returns an Address-Value Iterator of all Address Value Pairs stored in the Sparse Tensor
Source§fn iter_mut(&mut self) -> IterMut<'_, MatrixAddress, T>
fn iter_mut(&mut self) -> IterMut<'_, MatrixAddress, T>
Returns a Mutable Address-Value Iterator of all Address Value Pairs stored in the Sparse Tensor
Source§impl<T> Tensor<T, MatrixAddress> for Matrix<T>
impl<T> Tensor<T, MatrixAddress> for Matrix<T>
Source§fn new<F>(
bounds: AddressBound<MatrixAddress>,
address_value_converter: F,
) -> Matrix<T>where
F: Fn(MatrixAddress) -> T,
fn new<F>(
bounds: AddressBound<MatrixAddress>,
address_value_converter: F,
) -> Matrix<T>where
F: Fn(MatrixAddress) -> T,
Creates a new instance of a tensor with the given inclusive bounds and an address value mapper closure
Source§fn get(&self, address: &MatrixAddress) -> Option<&T>
fn get(&self, address: &MatrixAddress) -> Option<&T>
Attempts to retrieve a reference to the value at the address.
Returns None if the address is outside the given bound
fn get_mut(&mut self, address: &MatrixAddress) -> Option<&mut T>
Source§fn set(&mut self, address: &MatrixAddress, value: T) -> Result<(), Error>
fn set(&mut self, address: &MatrixAddress, value: T) -> Result<(), Error>
Attempts to reassign the value at the given index. Returns Err if the given address is out of bounds.
Source§fn bounds(&self) -> &AddressBound<MatrixAddress>
fn bounds(&self) -> &AddressBound<MatrixAddress>
Returns a reference to the bounds of the tensor
Source§fn address_iterator<'a>(&'a self) -> AddressIterator<A> ⓘwhere
T: 'a,
fn address_iterator<'a>(&'a self) -> AddressIterator<A> ⓘwhere
T: 'a,
Returns an iterator who generates addresses in row-major order.
Can’t give an address who is out of bounds.
Source§fn transform<F, TNew, TENew>(&self, mapping_function: F) -> TENew
fn transform<F, TNew, TENew>(&self, mapping_function: F) -> TENew
Returns a new tensor, which is a copy of this tensor with the values mapped by the given function.
Source§fn transform_by_address<F, TNew, TENew>(&self, mapping_function: F) -> TENew
fn transform_by_address<F, TNew, TENew>(&self, mapping_function: F) -> TENew
Returns a new tensor, which is a copy of this tensor with the values mapped by the given function.
Source§fn transform_in_place<F>(&mut self, mapping_function: F)
fn transform_in_place<F>(&mut self, mapping_function: F)
Alters every value in the tensor by some mapping function.
Note: the mapping function must have the same input value and output value type.
Source§fn transform_by_address_in_place<F>(&mut self, mapping_function: F)
fn transform_by_address_in_place<F>(&mut self, mapping_function: F)
Alters every value in the tensor by some mapping function.
Note: the mapping function must have the same input value and output value type.
impl Copy for MatrixAddress
impl Eq for MatrixAddress
impl StructuralPartialEq for MatrixAddress
Auto Trait Implementations§
impl Freeze for MatrixAddress
impl RefUnwindSafe for MatrixAddress
impl Send for MatrixAddress
impl Sync for MatrixAddress
impl Unpin for MatrixAddress
impl UnwindSafe for MatrixAddress
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