[ VIGRA Homepage | Class Index | Function Index | File Index | Main Page ]

details MultiArray Class Template Reference VIGRA

Main MultiArray class containing the memory management. More...

#include "vigra/multi_array.hxx"

Inheritance diagram for MultiArray:

MultiArrayView< N, T >

Public Types

typedef A allocator_type
typedef MultiArrayView< N, T > view_type
typedef MultiArray< N, T > matrix_type
typedef view_type::value_type value_type
typedef view_type::pointer pointer
typedef view_type::const_pointer const_pointer
typedef view_type::reference reference
typedef view_type::const_reference const_reference
typedef view_type::size_type size_type
typedef view_type::difference_type difference_type
typedef detail::MultiIteratorChooser<
UnstridedArrayTag >::template
Traverser< N, T, T &, T
* >::type 
traverser
typedef detail::MultiIteratorChooser<
UnstridedArrayTag >::template
Traverser< N, T, T const &,
T const * >::type 
const_traverser
typedef T * iterator
typedef T * const_iterator

Public Methods

 MultiArray ()
 MultiArray (const difference_type &shape)
 MultiArray (const difference_type &shape, const_reference init)
 MultiArray (const difference_type &shape, const_pointer init)
 MultiArray (const MultiArray &rhs)
MultiArray & operator= (const MultiArray &rhs)
 ~MultiArray ()
void reshape (const difference_type &shape)
void reshape (const difference_type &shape, const_reference init)
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const

Protected Methods

void allocate (pointer &ptr, std::size_t s, const_reference init)
void allocate (pointer &ptr, std::size_t s, const_pointer init)
void deallocate (pointer &ptr, std::size_t s)

Protected Attributes

allocator_type m_alloc


Detailed Description


template<unsigned int N, class T, class A>
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.

#include "vigra/multi_array.hxx"

Namespace: vigra


Member Typedef Documentation


typedef A allocator_type

 

the allocator type used to allocate the memory


typedef T* const_iterator

 

sequential (random access) const iterator type


typedef view_type::const_pointer const_pointer

 

const pointer type

Reimplemented from MultiArrayView< N, T >.


typedef view_type::const_reference const_reference

 

const reference type (result of operator[] const)

Reimplemented from MultiArrayView< N, T >.


typedef detail::MultiIteratorChooser< UnstridedArrayTag>::template Traverser<N, T, T const &, T const *>::type const_traverser

 

traverser type to const data

Reimplemented from MultiArrayView< N, T >.


typedef view_type::difference_type difference_type

 

difference type (used for offsetting)

Reimplemented from MultiArrayView< N, T >.


typedef T* iterator

 

sequential (random access) iterator type


typedef MultiArray<N, T> matrix_type

 

the matrix type associated with this array.

Reimplemented from MultiArrayView< N, T >.


typedef view_type::pointer pointer

 

pointer type

Reimplemented from MultiArrayView< N, T >.


typedef view_type::reference reference

 

reference type (result of operator[])

Reimplemented from MultiArrayView< N, T >.


typedef view_type::size_type size_type

 

size type

Reimplemented from MultiArrayView< N, T >.


typedef detail::MultiIteratorChooser< UnstridedArrayTag>::template Traverser<N, T, T &, T *>::type traverser

 

traverser type

Reimplemented from MultiArrayView< N, T >.


typedef view_type::value_type value_type

 

the array's value type

Reimplemented from MultiArrayView< N, T >.


typedef MultiArrayView<N, T> view_type

 

the view type associated with this array.

Reimplemented from MultiArrayView< N, T >.


Constructor & Destructor Documentation


MultiArray  

 

default constructor


MultiArray const difference_type   shape

 

construct with given shape


MultiArray const difference_type   shape,
const_reference    init

 

construct from shape with an initial value


MultiArray const difference_type   shape,
const_pointer    init

 

construct from shape and copy values from the given array


MultiArray const MultiArray< N, T, A > &    rhs

 

copy constructor


~MultiArray  

 

destructor


Member Function Documentation


void allocate pointer   ptr,
std::size_t    s,
const_pointer    init
[protected]

 

allocate memory for s pixels, write its address into the given pointer and initialize the linearized pixels to the values of init.


void allocate pointer   ptr,
std::size_t    s,
const_reference    init
[protected]

 

allocate memory for s pixels, write its address into the given pointer and initialize the pixels with init.


const_iterator begin   const [inline]

 

sequential const iterator pointing to the first array element.


iterator begin   [inline]

 

sequential iterator pointing to the first array element.


void deallocate pointer   ptr,
std::size_t    s
[protected]

 

deallocate the memory (of length s) starting at the given address.


const_iterator end   const [inline]

 

sequential const iterator pointing beyond the last array element.


iterator end   [inline]

 

sequential iterator pointing beyond the last array element.


MultiArray< N, T, A > & operator= const MultiArray< N, T, A > &    rhs

 

assignment.
Note: this operation invalidates all dependent objects (array views and iterators)


void reshape const difference_type   shape,
const_reference    init

 

change the shape, allocate new memory and initialize it with the given value.
Note: this operation invalidates all dependent objects (array views and iterators)


void reshape const difference_type   shape [inline]

 

change the shape and allocate new memory.
Note: this operation invalidates all dependent objects (array views and iterators)


Member Data Documentation


allocator_type m_alloc [protected]

 

the allocator used to allocate the memory


The documentation for this class was generated from the following file:

© Ullrich Köthe (koethe@informatik.uni-hamburg.de)
Cognitive Systems Group, University of Hamburg, Germany

html generated using doxygen and Python
VIGRA 1.2.0 (7 Aug 2003)