Main MultiArray
class containing the memory management.
More...
#include <vigra/multi_array.hxx>
|
allocator_type const & | allocator () const |
|
template<class U > |
MultiArray & | init (const U &init) |
|
| MultiArray () |
|
| MultiArray (allocator_type const &alloc) |
|
| MultiArray (const difference_type &shape, allocator_type const &alloc=allocator_type()) |
|
| MultiArray (const difference_type &shape, const_pointer init, allocator_type const &alloc=allocator_type()) |
|
| MultiArray (const difference_type &shape, const_reference init, allocator_type const &alloc=allocator_type()) |
|
| MultiArray (const difference_type &shape, MultiArrayInitializationTag init, allocator_type const &alloc=allocator_type()) |
|
| MultiArray (const MultiArray &rhs) |
|
template<class U , class StrideTag > |
| MultiArray (const MultiArrayView< N, U, StrideTag > &rhs, allocator_type const &alloc=allocator_type()) |
|
| MultiArray (difference_type_1 length, allocator_type const &alloc=allocator_type()) |
|
| MultiArray (difference_type_1 width, difference_type_1 height, allocator_type const &alloc=allocator_type()) |
|
template<class Expression > |
| MultiArray (multi_math::MultiMathOperand< Expression > const &rhs, allocator_type const &alloc=allocator_type()) |
|
template<class U , class StrideTag > |
MultiArray & | operator*= (const MultiArrayView< N, U, StrideTag > &rhs) |
|
MultiArray & | operator*= (const T &rhs) |
|
template<class Expression > |
MultiArray & | operator*= (multi_math::MultiMathOperand< Expression > const &rhs) |
|
template<class U , class StrideTag > |
MultiArray & | operator+= (const MultiArrayView< N, U, StrideTag > &rhs) |
|
MultiArray & | operator+= (const T &rhs) |
|
template<class Expression > |
MultiArray & | operator+= (multi_math::MultiMathOperand< Expression > const &rhs) |
|
template<class U , class StrideTag > |
MultiArray & | operator-= (const MultiArrayView< N, U, StrideTag > &rhs) |
|
MultiArray & | operator-= (const T &rhs) |
|
template<class Expression > |
MultiArray & | operator-= (multi_math::MultiMathOperand< Expression > const &rhs) |
|
template<class U , class StrideTag > |
MultiArray & | operator/= (const MultiArrayView< N, U, StrideTag > &rhs) |
|
MultiArray & | operator/= (const T &rhs) |
|
template<class Expression > |
MultiArray & | operator/= (multi_math::MultiMathOperand< Expression > const &rhs) |
|
MultiArray & | operator= (const MultiArray &rhs) |
|
template<class U , class StrideTag > |
MultiArray & | operator= (const MultiArrayView< N, U, StrideTag > &rhs) |
|
template<class Expression > |
MultiArray & | operator= (multi_math::MultiMathOperand< Expression > const &rhs) |
|
MultiArray & | operator= (value_type const &v) |
|
void | reshape (const difference_type &shape) |
|
void | reshape (const difference_type &shape, const_reference init) |
|
void | swap (MultiArray &other) |
|
| ~MultiArray () |
|
Detailed Description
template<unsigned int N, class T, class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
class vigra::MultiArray< N, T, A >
Main MultiArray
class containing the memory management.
This class inherits the interface of MultiArrayView, and implements the memory ownership. MultiArray's are always unstrided, striding them creates a MultiArrayView.
The template parameters are as follows
N: the array dimension
T: the type of the array elements
A: the
allocator used
for internal storage management
(default: std::allocator<T>)
allocator_type const & allocator() const
Definition multi_array.hxx:2912
#include <vigra/multi_array.hxx>
Namespace: vigra
- Examples
- boundarytensor.cxx, composite.cxx, convert.cxx, dissolve.cxx, edge.cxx, graph_agglomerative_clustering.cxx, imageExportInfo_tutorial.cxx, imageIO_tutorial.cxx, invert.cxx, invert_tutorial.cxx, mirror_tutorial.cxx, palette.cxx, resize.cxx, smooth.cxx, smooth_convolve.cxx, smooth_explicitly.cxx, subimage.cxx, subimage_tutorial.cxx, total_variation.cxx, transpose.cxx, transpose_image_tutorial.cxx, voronoi.cxx, and watershed.cxx.
◆ view_type
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
MultiArrayView<N, typename vigra::detail::ResolveMultiband<T>::type, typename vigra::detail::ResolveMultiband<T>::Stride> view_type |
the view type associated with this array.
◆ allocator_type
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
the allocator type used to allocate the memory
◆ matrix_type
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
the matrix type associated with this array.
◆ value_type
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
◆ pointer
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
◆ const_pointer
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
◆ reference
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
reference type (result of operator[])
◆ const_reference
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
const reference type (result of operator[] const)
◆ size_type
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
◆ difference_type
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
difference type (used for multi-dimensional offsets and indices)
◆ difference_type_1
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
difference and index type for a single dimension
◆ traverser
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
◆ const_traverser
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
traverser type to const data
◆ iterator
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
sequential (random access) iterator type sequential (random access) const iterator type sequential (random access) iterator type
◆ const_iterator
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
sequential (random access) const iterator type
◆ MultiArray() [1/11]
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
◆ MultiArray() [2/11]
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
construct with given allocator
◆ MultiArray() [3/11]
template<unsigned int N, class T , class A >
construct with given length
Use only for 1-dimensional arrays (N==1
).
◆ MultiArray() [4/11]
template<unsigned int N, class T , class A >
construct with given width and height
Use only for 2-dimensional arrays (N==2
).
◆ MultiArray() [5/11]
template<unsigned int N, class T , class A >
construct with given shape
◆ MultiArray() [6/11]
template<unsigned int N, class T , class A >
construct from shape with an initial value
◆ MultiArray() [7/11]
template<unsigned int N, class T , class A >
construct from shape and initialize with a linear sequence in scan order (i.e. first pixel gets value 0, second on gets value 1 and so on).
◆ MultiArray() [8/11]
template<unsigned int N, class T , class A >
construct from shape and copy values from the given array
◆ MultiArray() [9/11]
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
◆ MultiArray() [10/11]
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
template<class Expression >
constructor from an array expression
◆ MultiArray() [11/11]
template<unsigned int N, class T , class A >
template<class U , class StrideTag >
◆ ~MultiArray()
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
◆ allocate() [1/3]
template<unsigned int N, class T , class A >
allocate memory for s pixels, write its address into the given pointer and initialize the pixels with init.
◆ allocate() [2/3]
template<unsigned int N, class T , class A >
template<class U >
allocate memory for s pixels, write its address into the given pointer and initialize the linearized pixels to the values of init.
◆ allocate() [3/3]
template<unsigned int N, class T , class A >
template<class U , class StrideTag >
allocate memory, write its address into the given pointer and initialize it by copying the data from the given MultiArrayView.
◆ deallocate()
template<unsigned int N, class T , class A >
deallocate the memory (of length s) starting at the given address.
◆ operator=() [1/4]
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
assignment.
If the size of rhs is the same as the left-hand side arrays's old size, only the data are copied. Otherwise, new storage is allocated, which invalidates all objects (array views, iterators) depending on the lhs array.
◆ operator=() [2/4]
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
template<class U , class StrideTag >
assignment from arbitrary MultiArrayView.
If the size of rhs is the same as the left-hand side arrays's old size, only the data are copied. Otherwise, new storage is allocated, which invalidates all objects (array views, iterators) depending on the lhs array.
◆ operator=() [3/4]
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
assignment from scalar.
Equivalent to MultiArray::init(v).
◆ operator+=() [1/3]
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
template<class U , class StrideTag >
Add-assignment from arbitrary MultiArrayView. Fails with PreconditionViolation
exception when the shapes do not match. If the left array has no data (hasData() is false), this function is equivalent to a normal assignment (i.e. an empty array is interpreted as a zero-array of appropriate size).
◆ operator-=() [1/3]
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
template<class U , class StrideTag >
Subtract-assignment from arbitrary MultiArrayView. Fails with PreconditionViolation
exception when the shapes do not match. If the left array has no data (hasData() is false), this function is equivalent to an assignment of the negated rhs (i.e. an empty array is interpreted as a zero-array of appropriate size).
◆ operator*=() [1/3]
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
template<class U , class StrideTag >
Multiply-assignment from arbitrary MultiArrayView. Fails with PreconditionViolation
exception when the shapes do not match. If the left array has no data (hasData() is false), this function is equivalent to reshape(rhs.shape()) with zero initialisation (i.e. an empty array is interpreted as a zero-array of appropriate size).
◆ operator/=() [1/3]
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
template<class U , class StrideTag >
Divide-assignment from arbitrary MultiArrayView. Fails with PreconditionViolation
exception when the shapes do not match. If the left array has no data (hasData() is false), this function is equivalent to reshape(rhs.shape()) with zero initialisation (i.e. an empty array is interpreted as a zero-array of appropriate size).
◆ operator+=() [2/3]
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
Add-assignment of a scalar.
◆ operator-=() [2/3]
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
Subtract-assignment of a scalar.
◆ operator*=() [2/3]
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
Multiply-assignment of a scalar.
◆ operator/=() [2/3]
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
Divide-assignment of a scalar.
◆ operator=() [4/4]
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
template<class Expression >
MultiArray & operator= |
( |
multi_math::MultiMathOperand< Expression > const & | rhs | ) |
|
Assignment of an array expression. Fails with PreconditionViolation
exception when the shapes do not match.
◆ operator+=() [3/3]
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
template<class Expression >
MultiArray & operator+= |
( |
multi_math::MultiMathOperand< Expression > const & | rhs | ) |
|
Add-assignment of an array expression. Fails with PreconditionViolation
exception when the shapes do not match.
◆ operator-=() [3/3]
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
template<class Expression >
MultiArray & operator-= |
( |
multi_math::MultiMathOperand< Expression > const & | rhs | ) |
|
Subtract-assignment of an array expression. Fails with PreconditionViolation
exception when the shapes do not match.
◆ operator*=() [3/3]
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
template<class Expression >
MultiArray & operator*= |
( |
multi_math::MultiMathOperand< Expression > const & | rhs | ) |
|
Multiply-assignment of an array expression. Fails with PreconditionViolation
exception when the shapes do not match.
◆ operator/=() [3/3]
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
template<class Expression >
MultiArray & operator/= |
( |
multi_math::MultiMathOperand< Expression > const & | rhs | ) |
|
Divide-assignment of an array expression. Fails with PreconditionViolation
exception when the shapes do not match.
◆ init()
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
template<class U >
init elements with a constant
◆ reshape() [1/2]
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
Allocate new memory with the given shape and initialize with zeros.
Note: this operation invalidates all dependent objects (array views and iterators)
◆ reshape() [2/2]
template<unsigned int N, class T , class A >
Allocate new memory with the given shape and initialize it with the given value.
Note: this operation invalidates all dependent objects (array views and iterators)
◆ swap()
template<unsigned int N, class T , class A >
Swap the contents with another MultiArray. This is fast, because no data are copied, but only pointers and shapes swapped. Note: this operation invalidates all dependent objects (array views and iterators)
◆ allocator()
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
sequential iterator pointing to the first array element. sequential iterator pointing beyond the last array element. sequential const iterator pointing to the first array element. sequential const iterator pointing beyond the last array element. get the allocator.
◆ m_alloc
template<unsigned int N, class T , class A = std::allocator<typename detail::ResolveMultiband<T>::type>>
the allocator used to allocate the memory
The documentation for this class was generated from the following files: