pub trait SparseMatTrait: SparseMatTraitConst {
Show 21 methods // Required method fn as_raw_mut_SparseMat(&mut self) -> *mut c_void; // Provided methods fn set_flags(&mut self, val: i32) { ... } fn hdr(&mut self) -> SparseMat_Hdr { ... } fn set_hdr(&mut self, val: &mut SparseMat_Hdr) { ... } fn create(&mut self, dims: i32, _sizes: &i32, _type: i32) -> Result<()> { ... } fn clear(&mut self) -> Result<()> { ... } fn addref(&mut self) -> Result<()> { ... } fn release(&mut self) -> Result<()> { ... } fn ptr( &mut self, i0: i32, create_missing: bool, hashval: &mut size_t ) -> Result<*mut u8> { ... } fn ptr_1( &mut self, i0: i32, i1: i32, create_missing: bool, hashval: &mut size_t ) -> Result<*mut u8> { ... } fn ptr_2( &mut self, i0: i32, i1: i32, i2: i32, create_missing: bool, hashval: &mut size_t ) -> Result<*mut u8> { ... } fn ptr_3( &mut self, idx: &i32, create_missing: bool, hashval: &mut size_t ) -> Result<*mut u8> { ... } fn erase(&mut self, i0: i32, i1: i32, hashval: &mut size_t) -> Result<()> { ... } fn erase_1( &mut self, i0: i32, i1: i32, i2: i32, hashval: &mut size_t ) -> Result<()> { ... } fn erase_2(&mut self, idx: &i32, hashval: &mut size_t) -> Result<()> { ... } fn begin_mut(&mut self) -> Result<SparseMatIterator> { ... } fn end_mut(&mut self) -> Result<SparseMatIterator> { ... } fn node_1(&mut self, nidx: size_t) -> Result<SparseMat_Node> { ... } fn new_node(&mut self, idx: &i32, hashval: size_t) -> Result<*mut u8> { ... } fn remove_node( &mut self, hidx: size_t, nidx: size_t, previdx: size_t ) -> Result<()> { ... } fn resize_hash_tab(&mut self, newsize: size_t) -> Result<()> { ... }
}
Expand description

Mutable methods for core::SparseMat

Required Methods§

Provided Methods§

source

fn set_flags(&mut self, val: i32)

source

fn hdr(&mut self) -> SparseMat_Hdr

source

fn set_hdr(&mut self, val: &mut SparseMat_Hdr)

source

fn create(&mut self, dims: i32, _sizes: &i32, _type: i32) -> Result<()>

reallocates sparse matrix.

If the matrix already had the proper size and type, it is simply cleared with clear(), otherwise, the old matrix is released (using release()) and the new one is allocated.

source

fn clear(&mut self) -> Result<()>

sets all the sparse matrix elements to 0, which means clearing the hash table.

source

fn addref(&mut self) -> Result<()>

manually increments the reference counter to the header.

source

fn release(&mut self) -> Result<()>

source

fn ptr( &mut self, i0: i32, create_missing: bool, hashval: &mut size_t ) -> Result<*mut u8>

specialized variants for 1D, 2D, 3D cases and the generic_type one for n-D case. return pointer to the matrix element. - if the element is there (it’s non-zero), the pointer to it is returned - if it’s not there and createMissing=false, NULL pointer is returned - if it’s not there and createMissing=true, then the new element is created and initialized with 0. Pointer to it is returned - if the optional hashval pointer is not NULL, the element hash value is not computed, but *hashval is taken instead.

returns pointer to the specified element (1D case)

C++ default parameters
  • hashval: 0
source

fn ptr_1( &mut self, i0: i32, i1: i32, create_missing: bool, hashval: &mut size_t ) -> Result<*mut u8>

returns pointer to the specified element (2D case)

C++ default parameters
  • hashval: 0
source

fn ptr_2( &mut self, i0: i32, i1: i32, i2: i32, create_missing: bool, hashval: &mut size_t ) -> Result<*mut u8>

returns pointer to the specified element (3D case)

C++ default parameters
  • hashval: 0
source

fn ptr_3( &mut self, idx: &i32, create_missing: bool, hashval: &mut size_t ) -> Result<*mut u8>

returns pointer to the specified element (nD case)

C++ default parameters
  • hashval: 0
source

fn erase(&mut self, i0: i32, i1: i32, hashval: &mut size_t) -> Result<()>

erases the specified element (2D case)

C++ default parameters
  • hashval: 0
source

fn erase_1(&mut self, i0: i32, i1: i32, i2: i32, hashval: &mut size_t) -> Result<()>

erases the specified element (3D case)

C++ default parameters
  • hashval: 0
source

fn erase_2(&mut self, idx: &i32, hashval: &mut size_t) -> Result<()>

erases the specified element (nD case)

C++ default parameters
  • hashval: 0
source

fn begin_mut(&mut self) -> Result<SparseMatIterator>

return the sparse matrix iterator pointing to the first sparse matrix element

returns the sparse matrix iterator at the matrix beginning

source

fn end_mut(&mut self) -> Result<SparseMatIterator>

return the sparse matrix iterator pointing to the element following the last sparse matrix element

returns the sparse matrix iterator at the matrix end

source

fn node_1(&mut self, nidx: size_t) -> Result<SparseMat_Node>

/////////// some internal-use methods ///////////////

source

fn new_node(&mut self, idx: &i32, hashval: size_t) -> Result<*mut u8>

source

fn remove_node( &mut self, hidx: size_t, nidx: size_t, previdx: size_t ) -> Result<()>

source

fn resize_hash_tab(&mut self, newsize: size_t) -> Result<()>

Implementors§