marray::Marray< T, A > Class Template Reference

Runtime-flexible multi-dimensional array. More...

#include <marray.hxx>

Inheritance diagram for marray::Marray< T, A >:
Inheritance graph
[legend]
Collaboration diagram for marray::Marray< T, A >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef View< T, false, A > base
typedef base::value_type value_type
typedef base::pointer pointer
typedef base::const_pointer const_pointer
typedef base::reference reference
typedef base::const_reference const_reference
typedef base::iterator iterator
typedef base::reverse_iterator reverse_iterator
typedef base::const_iterator const_iterator
typedef
base::const_reverse_iterator 
const_reverse_iterator
typedef A::template rebind
< value_type >::other 
allocator_type

Public Member Functions

 Marray (const allocator_type &=allocator_type())
 Empty constructor.
 Marray (const T &, const CoordinateOrder &=defaultOrder, const allocator_type &=allocator_type())
 Construct 0-dimensional (scalar) array.
template<class ShapeIterator >
 Marray (ShapeIterator, ShapeIterator, const T &=T(), const CoordinateOrder &=defaultOrder, const allocator_type &=allocator_type())
 Construct Marray with initialization.
template<class ShapeIterator >
 Marray (const InitializationSkipping &, ShapeIterator, ShapeIterator, const CoordinateOrder &=defaultOrder, const allocator_type &=allocator_type())
 Construct Marray without initialization.
 Marray (const Marray< T, A > &)
 Copy from a Marray.
template<class E , class Te >
 Marray (const ViewExpression< E, Te > &, const allocator_type &=allocator_type())
 Construct Marray from ViewExpression.
template<class TLocal , bool isConstLocal, class ALocal >
 Marray (const View< TLocal, isConstLocal, ALocal > &)
 Copy from a View.
 ~Marray ()
 Destructor.
Marray< T, A > & operator= (const T &)
 Assignment.
Marray< T, A > & operator= (const Marray< T, A > &)
 Assignment.
template<class TLocal , bool isConstLocal, class ALocal >
Marray< T, A > & operator= (const View< TLocal, isConstLocal, ALocal > &)
 Assignment from View.
template<class E , class Te >
Marray< T, A > & operator= (const ViewExpression< E, Te > &)
void assign (const allocator_type &=allocator_type())
 Clear Marray.
template<class ShapeIterator >
void resize (ShapeIterator, ShapeIterator, const T &=T())
 Resize (existing entries are preserved, new entries are initialized).
template<class ShapeIterator >
void resize (const InitializationSkipping &, ShapeIterator, ShapeIterator)
 Resize (existing entries are preserved).

Detailed Description

template<class T, class A>
class marray::Marray< T, A >

Runtime-flexible multi-dimensional array.

Examples:

interpixel_boundary_segmentation.cxx, and one_to_one_matching.cxx.

Definition at line 547 of file marray.hxx.


Member Typedef Documentation

template<class T, class A>
typedef A::template rebind<value_type>::other marray::Marray< T, A >::allocator_type

Reimplemented from marray::View< T, false, A >.

Reimplemented in marray::Vector< T, A >, and marray::Matrix< T, A >.

Definition at line 561 of file marray.hxx.

template<class T, class A>
typedef View<T, false, A> marray::Marray< T, A >::base

Reimplemented from marray::View< T, false, A >.

Reimplemented in marray::Vector< T, A >, and marray::Matrix< T, A >.

Definition at line 551 of file marray.hxx.

template<class T, class A>
typedef base::const_iterator marray::Marray< T, A >::const_iterator

Reimplemented from marray::View< T, false, A >.

Reimplemented in marray::Vector< T, A >, and marray::Matrix< T, A >.

Definition at line 559 of file marray.hxx.

template<class T, class A>
typedef base::const_pointer marray::Marray< T, A >::const_pointer

Reimplemented from marray::View< T, false, A >.

Reimplemented in marray::Vector< T, A >, and marray::Matrix< T, A >.

Definition at line 554 of file marray.hxx.

template<class T, class A>
typedef base::const_reference marray::Marray< T, A >::const_reference

Reimplemented from marray::View< T, false, A >.

Reimplemented in marray::Vector< T, A >, and marray::Matrix< T, A >.

Definition at line 556 of file marray.hxx.

template<class T, class A>
typedef base::const_reverse_iterator marray::Marray< T, A >::const_reverse_iterator

Reimplemented from marray::View< T, false, A >.

Reimplemented in marray::Vector< T, A >, and marray::Matrix< T, A >.

Definition at line 560 of file marray.hxx.

template<class T, class A>
typedef base::iterator marray::Marray< T, A >::iterator

Reimplemented from marray::View< T, false, A >.

Reimplemented in marray::Vector< T, A >, and marray::Matrix< T, A >.

Definition at line 557 of file marray.hxx.

template<class T, class A>
typedef base::pointer marray::Marray< T, A >::pointer

Reimplemented from marray::View< T, false, A >.

Reimplemented in marray::Vector< T, A >, and marray::Matrix< T, A >.

Definition at line 553 of file marray.hxx.

template<class T, class A>
typedef base::reference marray::Marray< T, A >::reference

Reimplemented from marray::View< T, false, A >.

Reimplemented in marray::Vector< T, A >, and marray::Matrix< T, A >.

Definition at line 555 of file marray.hxx.

template<class T, class A>
typedef base::reverse_iterator marray::Marray< T, A >::reverse_iterator

Reimplemented from marray::View< T, false, A >.

Reimplemented in marray::Vector< T, A >, and marray::Matrix< T, A >.

Definition at line 558 of file marray.hxx.

template<class T, class A>
typedef base::value_type marray::Marray< T, A >::value_type

Reimplemented from marray::View< T, false, A >.

Reimplemented in marray::Vector< T, A >, and marray::Matrix< T, A >.

Definition at line 552 of file marray.hxx.


Constructor & Destructor Documentation

template<class T , class A >
marray::Marray< T, A >::Marray ( const allocator_type allocator = allocator_type()  )  [inline]

Empty constructor.

Parameters:
allocator Allocator.

Definition at line 3370 of file marray.hxx.

template<class T, class A >
marray::Marray< T, A >::Marray ( const T &  value,
const CoordinateOrder coordinateOrder = defaultOrder,
const allocator_type allocator = allocator_type() 
) [inline]

Construct 0-dimensional (scalar) array.

Parameters:
value Value of the single data item.
coordinateOrder Flag specifying whether FirstMajorOrder or LastMajorOrder is to be used. As the Marray can be resized after construction, the coordinate order has to be set even for a 0-dimensional Marray.
allocator Allocator.

Definition at line 3391 of file marray.hxx.

template<class T, class A >
template<class ShapeIterator >
marray::Marray< T, A >::Marray ( ShapeIterator  begin,
ShapeIterator  end,
const T &  value = T(),
const CoordinateOrder coordinateOrder = defaultOrder,
const allocator_type allocator = allocator_type() 
) [inline]

Construct Marray with initialization.

Parameters:
begin Iterator to the beginning of a sequence that determines the shape.
end Iterator to the end of that sequence.
value Value with which all entries are initialized.
coordinateOrder Flag specifying whether FirstMajorOrder or LastMajorOrder is to be used.
allocator Allocator.

Definition at line 3530 of file marray.hxx.

template<class T, class A >
template<class ShapeIterator >
marray::Marray< T, A >::Marray ( const InitializationSkipping is,
ShapeIterator  begin,
ShapeIterator  end,
const CoordinateOrder coordinateOrder = defaultOrder,
const allocator_type allocator = allocator_type() 
) [inline]

Construct Marray without initialization.

Parameters:
is Flag to be set to SkipInitialization.
begin Iterator to the beginning of a sequence that determines the shape.
end Iterator to the end of that sequence.
coordinateOrder Flag specifying whether FirstMajorOrder or LastMajorOrder is to be used.
allocator Allocator.

Definition at line 3563 of file marray.hxx.

template<class T, class A>
marray::Marray< T, A >::Marray ( const Marray< T, A > &  in  )  [inline]

Copy from a Marray.

Parameters:
in Marray (source).

Definition at line 3411 of file marray.hxx.

Here is the call graph for this function:

template<class T, class A >
template<class E , class Te >
marray::Marray< T, A >::Marray ( const ViewExpression< E, Te > &  expression,
const allocator_type allocator = allocator_type() 
) [inline]

Construct Marray from ViewExpression.

Parameters:
expression ViewExpression.
allocator Allocator.

Definition at line 3483 of file marray.hxx.

Here is the call graph for this function:

template<class T, class A >
template<class TLocal , bool isConstLocal, class ALocal >
marray::Marray< T, A >::Marray ( const View< TLocal, isConstLocal, ALocal > &  in  )  [inline]

Copy from a View.

Parameters:
in View (source).

Definition at line 3438 of file marray.hxx.

Here is the call graph for this function:

template<class T , class A >
marray::Marray< T, A >::~Marray (  )  [inline]

Destructor.

Definition at line 3616 of file marray.hxx.

Here is the call graph for this function:


Member Function Documentation

template<class T , class A >
void marray::Marray< T, A >::assign ( const allocator_type allocator = allocator_type()  )  [inline]

Clear Marray.

Leaves the Marray in the same state as if the empty constructor had been called. Previously allocated memory is de-allocated.

Parameters:
allocator Allocator.
See also:
Marray()

Reimplemented from marray::View< T, false, A >.

Definition at line 3351 of file marray.hxx.

Here is the caller graph for this function:

template<class T , class A >
template<class E , class Te>
Marray< T, A > & marray::Marray< T, A >::operator= ( const ViewExpression< E, Te > &  expression  )  [inline]

Reimplemented from marray::View< T, false, A >.

Reimplemented in marray::Vector< T, A >, and marray::Matrix< T, A >.

Definition at line 3780 of file marray.hxx.

Here is the call graph for this function:

template<class T , class A >
template<class TLocal , bool isConstLocal, class ALocal >
Marray< T, A > & marray::Marray< T, A >::operator= ( const View< TLocal, isConstLocal, ALocal > &  in  )  [inline]

Assignment from View.

This operator works as follows:

  • It always attempts to copy the data from 'in'.
  • If 'in' and *this have overlap, a copy of 'in' is made and assigned to *this.
  • If 'in' and *this have the same size, already allocated memory is re-used. Otherwise, the memory allocated for *this is freed, and new memory is allocated to take the copy of 'in'.
  • If 'in' is un-initialized, memory allocated for *this is freed.
Parameters:
in View (source).

Reimplemented from marray::View< T, false, A >.

Reimplemented in marray::Vector< T, A >, and marray::Matrix< T, A >.

Definition at line 3685 of file marray.hxx.

Here is the call graph for this function:

template<class T, class A>
Marray< T, A > & marray::Marray< T, A >::operator= ( const Marray< T, A > &  in  )  [inline]

Assignment.

This operator works as follows:

  • It always attempts to copy the data from 'in'.
  • If 'in' and *this have the same size, already allocated memory is re-used. Otherwise, the memory allocated for *this is freed, and new memory is allocated to take the copy of 'in'.
  • If 'in' is un-initialized, memory allocated for *this is freed.
Parameters:
in Marray (source).

Definition at line 3637 of file marray.hxx.

Here is the call graph for this function:

template<class T, class A >
Marray< T, A > & marray::Marray< T, A >::operator= ( const T &  value  )  [inline]

Assignment.

Parameters:
value Value.

All entries are set to value.

Reimplemented from marray::View< T, false, A >.

Reimplemented in marray::Vector< T, A >, and marray::Matrix< T, A >.

Definition at line 3765 of file marray.hxx.

template<class T, class A >
template<class ShapeIterator >
void marray::Marray< T, A >::resize ( const InitializationSkipping is,
ShapeIterator  begin,
ShapeIterator  end 
) [inline]

Resize (existing entries are preserved).

Parameters:
is Flag to be set to SkipInitialization.
begin Iterator to the beginning of a sequence that determines the new shape.
end Iterator to the end of that sequence.

Definition at line 3919 of file marray.hxx.

template<class T, class A >
template<class ShapeIterator >
void marray::Marray< T, A >::resize ( ShapeIterator  begin,
ShapeIterator  end,
const T &  value = T() 
) [inline]

Resize (existing entries are preserved, new entries are initialized).

Parameters:
begin Iterator to the beginning of a sequence that determines the new shape.
end Iterator to the end of that sequence.
value Initial value to be assigned to newly allocated entries.

Definition at line 3887 of file marray.hxx.

Here is the caller graph for this function:

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Mon Jun 17 16:31:10 2013 for OpenGM by  doxygen 1.6.3