matlab::data::SparseArray<T>
Templated C++ class to access data in MATLAB sparse arrays
Description
Use SparseArray objects to work with sparse MATLAB® arrays. To create a SparseArray, call createSparseArray in
the ArrayFactory class.
Class Details
|
Namespace: | matlab::data |
|
Base class: | matlab::data::Array |
|
Include: | SparseArray.hpp |
Template Parameters
|
| Type of element referred to, specified as:
|
Constructors
Copy Constructors
SparseArray(const SparseArray<T>& rhs)
SparseArray(const Array& rhs)
Creates a shared data copy of a SparseArray
object.
|
|
Value to copy. |
|
|
Value specified as |
|
Type of input |
Copy Assignment Operators
SparseArray& operator=(const SparseArray<T>&
rhs)
SparseArray& operator=(const Array& rhs)
Assigns a shared data copy to a SparseArray
object.
|
|
Value to copy. |
|
|
Value specified as |
|
|
Updated instance. |
|
Type of input |
Move Constructors
SparseArray(SparseArray&& rhs)
SparseArray(Array&& rhs)
Moves contents of a SparseArray object to a new
instance.
|
|
Value to move. |
|
|
Value specified as |
|
Type of input |
Move Assignment Operators
SparseArray& operator=(SparseArray<T>&&
rhs)
SparseArray& operator=(Array&& rhs)
Assigns the input to this SparseArray
object.
|
|
Value to move. |
|
|
Value specified as |
|
|
Updated instance. |
|
Type of input |
Iterators
Begin Iterators
iterator begin()
const_iterator begin() const
const_iterator cbegin() const
|
|
Iterator to beginning of array, specified as
|
|
|
Iterator, specified as
|
None
End Iterators
iterator end()
const_iterator end() const
const_iterator cend() const
|
|
Iterator to end of array, specified as
|
|
|
Iterator, specified as
|
None
Member Functions
getNumberOfNonZeroElements
size_t getNumberOfNonZeroElements() const
Returns the number of nonzero elements in the array.
|
|
Number of nonzero elements in array. |
None
getIndex
SparseIndex getIndex(const TypedIterator<T>& it)
SparseIndex getIndex(const TypedIterator<T const>& it)
Returns the row-column coordinates of the nonzero entry that the iterator is pointing to.
|
|
Iterator pointing to current entry in sparse matrix. |
|
|
|
|
Row-column coordinates of nonzero entry that
iterator points to. |
None