pub trait SparseMatTraitConst {
Show 27 methods
// Required method
fn as_raw_SparseMat(&self) -> *const c_void;
// Provided methods
fn flags(&self) -> i32 { ... }
fn try_clone(&self) -> Result<SparseMat> { ... }
fn copy_to(&self, m: &mut impl SparseMatTrait) -> Result<()> { ... }
fn copy_to_mat(&self, m: &mut impl MatTrait) -> Result<()> { ... }
fn convert_to(
&self,
m: &mut impl SparseMatTrait,
rtype: i32,
alpha: f64,
) -> Result<()> { ... }
fn convert_to_def(
&self,
m: &mut impl SparseMatTrait,
rtype: i32,
) -> Result<()> { ... }
fn convert_to_1(
&self,
m: &mut impl MatTrait,
rtype: i32,
alpha: f64,
beta: f64,
) -> Result<()> { ... }
fn convert_to_def_1(&self, m: &mut impl MatTrait, rtype: i32) -> Result<()> { ... }
fn assign_to(&self, m: &mut impl SparseMatTrait, typ: i32) -> Result<()> { ... }
fn assign_to_def(&self, m: &mut impl SparseMatTrait) -> Result<()> { ... }
fn elem_size(&self) -> size_t { ... }
fn elem_size1(&self) -> size_t { ... }
fn typ(&self) -> i32 { ... }
fn depth(&self) -> i32 { ... }
fn channels(&self) -> i32 { ... }
fn size(&self) -> Result<*const i32> { ... }
fn size_1(&self, i: i32) -> Result<i32> { ... }
fn dims(&self) -> Result<i32> { ... }
fn nzcount(&self) -> Result<size_t> { ... }
fn hash(&self, i0: i32) -> Result<size_t> { ... }
fn hash_1(&self, i0: i32, i1: i32) -> Result<size_t> { ... }
fn hash_2(&self, i0: i32, i1: i32, i2: i32) -> Result<size_t> { ... }
fn hash_3(&self, idx: &i32) -> Result<size_t> { ... }
fn begin(&self) -> Result<SparseMatConstIterator> { ... }
fn end(&self) -> Result<SparseMatConstIterator> { ... }
fn node(&self, nidx: size_t) -> Result<SparseMat_Node> { ... }
}
Expand description
Constant methods for core::SparseMat
Required Methods§
fn as_raw_SparseMat(&self) -> *const c_void
Provided Methods§
fn flags(&self) -> i32
Sourcefn copy_to(&self, m: &mut impl SparseMatTrait) -> Result<()>
fn copy_to(&self, m: &mut impl SparseMatTrait) -> Result<()>
copies all the data to the destination matrix. All the previous content of m is erased
Sourcefn copy_to_mat(&self, m: &mut impl MatTrait) -> Result<()>
fn copy_to_mat(&self, m: &mut impl MatTrait) -> Result<()>
converts sparse matrix to dense matrix.
Sourcefn convert_to(
&self,
m: &mut impl SparseMatTrait,
rtype: i32,
alpha: f64,
) -> Result<()>
fn convert_to( &self, m: &mut impl SparseMatTrait, rtype: i32, alpha: f64, ) -> Result<()>
multiplies all the matrix elements by the specified scale factor alpha and converts the results to the specified data type
§C++ default parameters
- alpha: 1
Sourcefn convert_to_def(&self, m: &mut impl SparseMatTrait, rtype: i32) -> Result<()>
fn convert_to_def(&self, m: &mut impl SparseMatTrait, rtype: i32) -> Result<()>
multiplies all the matrix elements by the specified scale factor alpha and converts the results to the specified data type
§Note
This alternative version of SparseMatTraitConst::convert_to function uses the following default values for its arguments:
- alpha: 1
Sourcefn convert_to_1(
&self,
m: &mut impl MatTrait,
rtype: i32,
alpha: f64,
beta: f64,
) -> Result<()>
fn convert_to_1( &self, m: &mut impl MatTrait, rtype: i32, alpha: f64, beta: f64, ) -> Result<()>
converts sparse matrix to dense n-dim matrix with optional type conversion and scaling.
§Parameters
- m:[out] - output matrix; if it does not have a proper size or type before the operation, it is reallocated
- rtype: - desired output matrix type or, rather, the depth since the number of channels are the same as the input has; if rtype is negative, the output matrix will have the same type as the input.
- alpha: - optional scale factor
- beta: - optional delta added to the scaled values
§C++ default parameters
- alpha: 1
- beta: 0
Sourcefn convert_to_def_1(&self, m: &mut impl MatTrait, rtype: i32) -> Result<()>
fn convert_to_def_1(&self, m: &mut impl MatTrait, rtype: i32) -> Result<()>
converts sparse matrix to dense n-dim matrix with optional type conversion and scaling.
§Parameters
- m:[out] - output matrix; if it does not have a proper size or type before the operation, it is reallocated
- rtype: - desired output matrix type or, rather, the depth since the number of channels are the same as the input has; if rtype is negative, the output matrix will have the same type as the input.
- alpha: - optional scale factor
- beta: - optional delta added to the scaled values
§Note
This alternative version of SparseMatTraitConst::convert_to function uses the following default values for its arguments:
- alpha: 1
- beta: 0
Sourcefn assign_to(&self, m: &mut impl SparseMatTrait, typ: i32) -> Result<()>
fn assign_to(&self, m: &mut impl SparseMatTrait, typ: i32) -> Result<()>
§C++ default parameters
- typ: -1
Sourcefn assign_to_def(&self, m: &mut impl SparseMatTrait) -> Result<()>
fn assign_to_def(&self, m: &mut impl SparseMatTrait) -> Result<()>
§Note
This alternative version of SparseMatTraitConst::assign_to function uses the following default values for its arguments:
- typ: -1
Sourcefn elem_size(&self) -> size_t
fn elem_size(&self) -> size_t
returns the size of each element in bytes (not including the overhead - the space occupied by SparseMat::Node elements)
Sourcefn elem_size1(&self) -> size_t
fn elem_size1(&self) -> size_t
returns elemSize()/channels()
Sourcefn size(&self) -> Result<*const i32>
fn size(&self) -> Result<*const i32>
returns the array of sizes, or NULL if the matrix is not allocated
Sourcefn nzcount(&self) -> Result<size_t>
fn nzcount(&self) -> Result<size_t>
returns the number of non-zero elements (=the number of hash table nodes)
Sourcefn hash_2(&self, i0: i32, i1: i32, i2: i32) -> Result<size_t>
fn hash_2(&self, i0: i32, i1: i32, i2: i32) -> Result<size_t>
computes the element hash value (3D case)
Sourcefn begin(&self) -> Result<SparseMatConstIterator>
fn begin(&self) -> Result<SparseMatConstIterator>
returns the read-only sparse matrix iterator at the matrix beginning
Sourcefn end(&self) -> Result<SparseMatConstIterator>
fn end(&self) -> Result<SparseMatConstIterator>
returns the read-only sparse matrix iterator at the matrix end
fn node(&self, nidx: size_t) -> Result<SparseMat_Node>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.