opencv::hub_prelude

Trait SparseMatTraitConst

source
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§

Provided Methods§

source

fn flags(&self) -> i32

source

fn try_clone(&self) -> Result<SparseMat>

creates full copy of the matrix

source

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

source

fn copy_to_mat(&self, m: &mut impl MatTrait) -> Result<()>

converts sparse matrix to dense matrix.

source

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
source

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
source

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
source

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
source

fn assign_to(&self, m: &mut impl SparseMatTrait, typ: i32) -> Result<()>

§C++ default parameters
  • typ: -1
source

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
source

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)

source

fn elem_size1(&self) -> size_t

returns elemSize()/channels()

source

fn typ(&self) -> i32

returns type of sparse matrix elements

source

fn depth(&self) -> i32

returns the depth of sparse matrix elements

source

fn channels(&self) -> i32

returns the number of channels

source

fn size(&self) -> Result<*const i32>

returns the array of sizes, or NULL if the matrix is not allocated

source

fn size_1(&self, i: i32) -> Result<i32>

returns the size of i-th matrix dimension (or 0)

source

fn dims(&self) -> Result<i32>

returns the matrix dimensionality

source

fn nzcount(&self) -> Result<size_t>

returns the number of non-zero elements (=the number of hash table nodes)

source

fn hash(&self, i0: i32) -> Result<size_t>

computes the element hash value (1D case)

source

fn hash_1(&self, i0: i32, i1: i32) -> Result<size_t>

computes the element hash value (2D case)

source

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

computes the element hash value (3D case)

source

fn hash_3(&self, idx: &i32) -> Result<size_t>

computes the element hash value (nD case)

source

fn begin(&self) -> Result<SparseMatConstIterator>

returns the read-only sparse matrix iterator at the matrix beginning

source

fn end(&self) -> Result<SparseMatConstIterator>

returns the read-only sparse matrix iterator at the matrix end

source

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

Object Safety§

This trait is not object safe.

Implementors§