marray::View< T, isConst, A > Class Template Reference

Array-Interface to an interval of memory. More...

#include <marray.hxx>

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

List of all members.

Public Types

typedef T value_type
typedef T ValueType
typedef marray_detail::IfBool
< isConst, const T *, T * >
::type 
pointer
typedef const T * const_pointer
typedef marray_detail::IfBool
< isConst, const T &, T & >
::type 
reference
typedef const T & const_reference
typedef Iterator< T, isConst, A > iterator
typedef Iterator< T, true, A > const_iterator
typedef std::reverse_iterator
< iterator
reverse_iterator
typedef std::reverse_iterator
< const_iterator
const_reverse_iterator
typedef ViewExpression< View
< T, isConst, A >, T > 
base
typedef A::template rebind
< value_type >::other 
allocator_type

Public Member Functions

 View (const allocator_type &=allocator_type())
 Empty constructor.
 View (pointer, const allocator_type &=allocator_type())
 Construct View from a scalar.
 View (const View< T, false, A > &)
 Construct View from a View on mutable data.
template<class ShapeIterator >
 View (ShapeIterator, ShapeIterator, pointer, const CoordinateOrder &=defaultOrder, const CoordinateOrder &=defaultOrder, const allocator_type &=allocator_type())
 Construct unstrided View.
template<class ShapeIterator , class StrideIterator >
 View (ShapeIterator, ShapeIterator, StrideIterator, pointer, const CoordinateOrder &, const allocator_type &=allocator_type())
 Construct strided View.
View< T, isConst, A > & operator= (const T &)
 Assignment.
View< T, isConst, A > & operator= (const View< T, true, A > &)
 Assignment.
View< T, isConst, A > & operator= (const View< T, false, A > &)
 Assignment.
template<class TLocal , bool isConstLocal, class ALocal >
View< T, isConst, A > & operator= (const View< TLocal, isConstLocal, ALocal > &)
 Assignment.
template<class E , class Te >
View< T, isConst, A > & operator= (const ViewExpression< E, Te > &)
void assign (const allocator_type &=allocator_type())
 Clear View.
template<class ShapeIterator >
void assign (ShapeIterator, ShapeIterator, pointer, const CoordinateOrder &=defaultOrder, const CoordinateOrder &=defaultOrder, const allocator_type &=allocator_type())
 Initialize unstrided View.
template<class ShapeIterator , class StrideIterator >
void assign (ShapeIterator, ShapeIterator, StrideIterator, pointer, const CoordinateOrder &, const allocator_type &=allocator_type())
 Initialize strided View.
const size_t dimension () const
 Get the dimension.
const size_t size () const
 Get the number of data items.
const size_t shape (const size_t) const
 Get the shape in one dimension.
const size_tshapeBegin () const
 Get a constant iterator to the beginning of the shape vector.
const size_tshapeEnd () const
 Get a constant iterator to the end of the shape vector.
const size_t strides (const size_t) const
 Get the strides in one dimension.
const size_tstridesBegin () const
 Get a constant iterator to the beginning of the strides vector.
const size_tstridesEnd () const
 Get a constant iterator to the end of the strides vector.
const CoordinateOrdercoordinateOrder () const
 Get the coordinate order used for scalar indexing and iterators.
const bool isSimple () const
 Determine whether the shape strides equal the strides of the View.
template<class TLocal , bool isConstLocal, class ALocal >
bool overlaps (const View< TLocal, isConstLocal, ALocal > &) const
 Check whether two Views overlap.
template<class U >
reference operator() (U)
 Reference data.
template<class U >
reference operator() (U) const
 Reference data.
reference operator() (const size_t, const size_t)
 Reference data in a 2-dimensional View by coordinates.
reference operator() (const size_t, const size_t) const
 Reference data in a 2-dimensional View by coordinates.
reference operator() (const size_t, const size_t, const size_t)
 Reference data in a 3-dimensional View by coordinates.
reference operator() (const size_t, const size_t, const size_t) const
 Reference data in a 3-dimensional View by coordinates.
reference operator() (const size_t, const size_t, const size_t, const size_t)
 Reference data in a 4-dimensional View by coordinates.
reference operator() (const size_t, const size_t, const size_t, const size_t) const
 Reference data in a 4-dimensional View by coordinates.
reference operator() (const size_t, const size_t, const size_t, const size_t, const size_t)
 Reference data in a 5-dimensional View by coordinates.
reference operator() (const size_t, const size_t, const size_t, const size_t, const size_t) const
 Reference data in a 5-dimensional View by coordinates.
reference operator() (const size_t, const size_t, const size_t, const size_t, const size_t, const size_t, const size_t, const size_t, const size_t, const size_t)
 Reference data in a 10-dimensional View by coordinates.
reference operator() (const size_t, const size_t, const size_t, const size_t, const size_t, const size_t, const size_t, const size_t, const size_t, const size_t) const
 Reference data in a 10-dimensional View by coordinates.
template<class BaseIterator , class ShapeIterator >
void view (BaseIterator, ShapeIterator, View< T, isConst, A > &) const
 Get a sub-view with the same coordinate order.
template<class BaseIterator , class ShapeIterator >
void view (BaseIterator, ShapeIterator, const CoordinateOrder &, View< T, isConst, A > &) const
 Get a sub-view.
template<class BaseIterator , class ShapeIterator >
View< T, isConst, A > view (BaseIterator, ShapeIterator) const
 Get a sub-view with the same coordinate order.
template<class BaseIterator , class ShapeIterator >
View< T, isConst, A > view (BaseIterator, ShapeIterator, const CoordinateOrder &) const
 Get a sub-view.
template<class BaseIterator , class ShapeIterator >
void constView (BaseIterator, ShapeIterator, View< T, true, A > &) const
 Get a sub-view to constant data with the same coordinate order.
template<class BaseIterator , class ShapeIterator >
void constView (BaseIterator, ShapeIterator, const CoordinateOrder &, View< T, true, A > &) const
 Get a sub-view to constant data.
template<class BaseIterator , class ShapeIterator >
View< T, true, A > constView (BaseIterator, ShapeIterator) const
 Get a sub-view to constant data with the same coordinate order.
template<class BaseIterator , class ShapeIterator >
View< T, true, A > constView (BaseIterator, ShapeIterator, const CoordinateOrder &) const
 Get a sub-view to constant data.
iterator begin ()
 Get an iterator to the beginning.
iterator end ()
 Get the end-iterator.
const_iterator begin () const
 Get an iterator to the beginning.
const_iterator end () const
 Get the end-iterator.
reverse_iterator rbegin ()
 Get a reserve iterator to the beginning.
reverse_iterator rend ()
 Get the reverse end-iterator.
const_reverse_iterator rbegin () const
 Get a reserve iterator to the beginning.
const_reverse_iterator rend () const
 Get the reverse end-iterator.
template<class ShapeIterator >
void reshape (ShapeIterator, ShapeIterator)
 Reshape the View.
template<class CoordinateIterator >
void permute (CoordinateIterator)
 Permute dimensions.
void transpose (const size_t, const size_t)
 Exchange two dimensions.
void transpose ()
 Reverse dimensions.
void shift (const int)
 Cycle shift dimensions.
void squeeze ()
 Remove singleton dimensions by setting their coordinates to zero.
template<class ShapeIterator >
View< T, isConst, A > reshapedView (ShapeIterator, ShapeIterator) const
 Get a reshaped View.
template<class CoordinateIterator >
View< T, isConst, A > permutedView (CoordinateIterator) const
 Get a View with permuted dimensions.
View< T, isConst, A > transposedView (const size_t, const size_t) const
 Get a View with two dimensions exchanged.
View< T, isConst, A > transposedView () const
 Get a View with dimensions reversed.
View< T, isConst, A > shiftedView (const int) const
 Get a View which dimensions cycle shifted.
View< T, isConst, A > boundView (const size_t, const size_t=0) const
 Get a View where one coordinate is bound to a value.
View< T, isConst, A > squeezedView () const
 Get a View where all singleton dimensions have been removed by setting their coordinates to zero.
template<class CoordinateIterator >
void coordinatesToIndex (CoordinateIterator, size_t &) const
 Compute the index that corresponds to a sequence of coordinates.
template<class CoordinateIterator >
void coordinatesToOffset (CoordinateIterator, size_t &) const
 Compute the offset that corresponds to a sequence of coordinates.
template<class CoordinateIterator >
void indexToCoordinates (size_t, CoordinateIterator) const
 Compute the coordinate sequence that corresponds to an index.
void indexToOffset (size_t, size_t &) const
 Compute the offset that corresponds to an index.
std::string asString (const StringStyle &=MatrixStyle) const
 Output as string.

Detailed Description

template<class T, bool isConst, class A>
class marray::View< T, isConst, A >

Array-Interface to an interval of memory.

A view makes a subset of memory look as if it was stored in an Marray. With the help of a view, data in a subset of memory can be accessed and manipulated conveniently. In contrast to arrays which allocate and de-allocate their own memory, views only reference memory that has been allocated by other means. Perhaps the simplest and most important use of views is to read and manipulate sub-arrays.

Notes on arithmetic operators of View:

Definition at line 201 of file marray.hxx.


Member Typedef Documentation

template<class T, bool isConst, class A>
typedef A::template rebind<value_type>::other marray::View< T, isConst, A >::allocator_type
template<class T, bool isConst, class A>
typedef ViewExpression<View<T, isConst, A>, T> marray::View< T, isConst, A >::base
template<class T, bool isConst, class A>
typedef Iterator<T, true, A> marray::View< T, isConst, A >::const_iterator
template<class T, bool isConst, class A>
typedef const T* marray::View< T, isConst, A >::const_pointer
template<class T, bool isConst, class A>
typedef const T& marray::View< T, isConst, A >::const_reference
template<class T, bool isConst, class A>
typedef std::reverse_iterator<const_iterator> marray::View< T, isConst, A >::const_reverse_iterator
template<class T, bool isConst, class A>
typedef Iterator<T, isConst, A> marray::View< T, isConst, A >::iterator
template<class T, bool isConst, class A>
typedef marray_detail::IfBool<isConst, const T*, T*>::type marray::View< T, isConst, A >::pointer
template<class T, bool isConst, class A>
typedef marray_detail::IfBool<isConst, const T&, T&>::type marray::View< T, isConst, A >::reference
template<class T, bool isConst, class A>
typedef std::reverse_iterator<iterator> marray::View< T, isConst, A >::reverse_iterator
template<class T, bool isConst, class A>
typedef T marray::View< T, isConst, A >::value_type
template<class T, bool isConst, class A>
typedef T marray::View< T, isConst, A >::ValueType

Constructor & Destructor Documentation

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

Empty constructor.

The empty constructor sets the data pointer to 0. It does not allocate memory for a scalar.

Parameters:
allocator Allocator.

Definition at line 923 of file marray.hxx.

template<class T , bool isConst, class A >
marray::View< T, isConst, A >::View ( pointer  data,
const allocator_type allocator = allocator_type() 
) [inline]

Construct View from a scalar.

Parameters:
data Pointer to data.
allocator Allocator.

Definition at line 954 of file marray.hxx.

template<class T, bool isConst, class A>
marray::View< T, isConst, A >::View ( const View< T, false, A > &  in  )  [inline]

Construct View from a View on mutable data.

Parameters:
in View on mutable data.

Definition at line 971 of file marray.hxx.

template<class T , bool isConst, class A >
template<class ShapeIterator >
marray::View< T, isConst, A >::View ( ShapeIterator  begin,
ShapeIterator  end,
pointer  data,
const CoordinateOrder externalCoordinateOrder = defaultOrder,
const CoordinateOrder internalCoordinateOrder = defaultOrder,
const allocator_type allocator = allocator_type() 
) [inline]

Construct unstrided View.

Parameters:
begin Iterator to the beginning of a sequence that defines the shape.
end Iterator to the end of this sequence.
data Pointer to data.
externalCoordinateOrder Flag specifying the order of coordinates based on which the strides are computed.
internalCoordinateOrder Flag specifying the order of coordinates used for scalar indexing and iterators.
allocator Allocator.

Definition at line 997 of file marray.hxx.

template<class T , bool isConst, class A >
template<class ShapeIterator , class StrideIterator >
marray::View< T, isConst, A >::View ( ShapeIterator  begin,
ShapeIterator  end,
StrideIterator  it,
pointer  data,
const CoordinateOrder internalCoordinateOrder,
const allocator_type allocator = allocator_type() 
) [inline]

Construct strided View.

Parameters:
begin Iterator to the beginning of a sequence that defines the shape.
end Iterator to the end of this sequence.
it Iterator to the beginning of a sequence that defines the strides.
data Pointer to data.
internalCoordinateOrder Flag specifying the order of coordinates used for scalar indexing and iterators.
allocator Allocator.

Definition at line 1028 of file marray.hxx.


Member Function Documentation

template<class T , bool isConst, class A >
template<class ShapeIterator , class StrideIterator >
void marray::View< T, isConst, A >::assign ( ShapeIterator  begin,
ShapeIterator  end,
StrideIterator  it,
pointer  data,
const CoordinateOrder internalCoordinateOrder,
const allocator_type allocator = allocator_type() 
) [inline]

Initialize strided View.

Parameters:
begin Iterator to the beginning of a sequence that defines the shape.
end Iterator to the end of this sequence.
it Iterator to the beginning of a sequence that defines the strides.
data Pointer to data.
internalCoordinateOrder Flag specifying the order of coordinates used for scalar indexing and iterators.
allocator Allocator.

Definition at line 1165 of file marray.hxx.

template<class T , bool isConst, class A >
template<class ShapeIterator >
void marray::View< T, isConst, A >::assign ( ShapeIterator  begin,
ShapeIterator  end,
pointer  data,
const CoordinateOrder externalCoordinateOrder = defaultOrder,
const CoordinateOrder internalCoordinateOrder = defaultOrder,
const allocator_type allocator = allocator_type() 
) [inline]

Initialize unstrided View.

Parameters:
begin Iterator to the beginning of a sequence that defines the shape.
end Iterator to the end of this sequence.
data Pointer to data.
externalCoordinateOrder Flag specifying the order of coordinates based on which the strides are computed.
internalCoordinateOrder Flag specifying the order of coordinates used for scalar indexing and iterators.
allocator Allocator.

Definition at line 1131 of file marray.hxx.

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

Clear View.

Leaves the View in the same state as if the empty constructor had been called.

See also:
View()

Reimplemented in marray::Marray< T, A >, marray::Marray< T >, and marray::Marray< ValueType >.

Definition at line 1106 of file marray.hxx.

Here is the caller graph for this function:

template<class T , bool isConst, class A >
std::string marray::View< T, isConst, A >::asString ( const StringStyle style = MatrixStyle  )  const [inline]

Output as string.

Definition at line 2961 of file marray.hxx.

template<class T , bool isConst, class A >
View< T, isConst, A >::const_iterator marray::View< T, isConst, A >::begin (  )  const [inline]

Get an iterator to the beginning.

Returns:
Iterator.
See also:
end()

Definition at line 2741 of file marray.hxx.

template<class T , bool isConst, class A >
View< T, isConst, A >::iterator marray::View< T, isConst, A >::begin (  )  [inline]

Get an iterator to the beginning.

Returns:
Iterator.
See also:
end()

Definition at line 2715 of file marray.hxx.

Here is the caller graph for this function:

template<class T , bool isConst, class A >
View< T, isConst, A > marray::View< T, isConst, A >::boundView ( const size_t  dimension,
const size_t  value = 0 
) const [inline]

Get a View where one coordinate is bound to a value.

Binds one coordinate to a certain value. This reduces the dimension by 1.

Parameters:
dimension Dimension of the coordinate to bind.
value Value to assign to the coordinate.
Returns:
The bound view.
See also:
squeeze(), squeezeView()

Definition at line 2375 of file marray.hxx.

template<class T, bool isConst, class A>
template<class BaseIterator , class ShapeIterator >
View< T, true, A > marray::View< T, isConst, A >::constView ( BaseIterator  bit,
ShapeIterator  sit,
const CoordinateOrder internalCoordinateOrder 
) const [inline]

Get a sub-view to constant data.

Parameters:
bit Iterator to the beginning of a coordinate sequence that determines the start position of the sub-view.
sit Iterator to the beginning of a sequence that determines the shape of the sub-view.
internalCoordinateOrder Flag to set the coordinate order for scalar indexing and iterators of the sub-view.
Returns:
Sub-View.

Definition at line 2161 of file marray.hxx.

template<class T, bool isConst, class A>
template<class BaseIterator , class ShapeIterator >
View< T, true, A > marray::View< T, isConst, A >::constView ( BaseIterator  bit,
ShapeIterator  sit 
) const [inline]

Get a sub-view to constant data with the same coordinate order.

Parameters:
bit Iterator to the beginning of a coordinate sequence that determines the start position of the sub-view.
sit Iterator to the beginning of a sequence that determines the shape of the sub-view.
Returns:
Sub-View.

Definition at line 2137 of file marray.hxx.

template<class T, bool isConst, class A>
template<class BaseIterator , class ShapeIterator >
void marray::View< T, isConst, A >::constView ( BaseIterator  bit,
ShapeIterator  sit,
const CoordinateOrder internalCoordinateOrder,
View< T, true, A > &  out 
) const [inline]

Get a sub-view to constant data.

Parameters:
bit Iterator to the beginning of a coordinate sequence that determines the start position of the sub-view.
sit Iterator to the beginning of a sequence that determines the shape of the sub-view.
internalCoordinateOrder Flag to set the coordinate order for scalar indexing and iterators of the sub-view.
out Sub-View (output).

Definition at line 2108 of file marray.hxx.

Here is the call graph for this function:

template<class T, bool isConst, class A>
template<class BaseIterator , class ShapeIterator >
void marray::View< T, isConst, A >::constView ( BaseIterator  bit,
ShapeIterator  sit,
View< T, true, A > &  out 
) const [inline]

Get a sub-view to constant data with the same coordinate order.

Parameters:
bit Iterator to the beginning of a coordinate sequence that determines the start position of the sub-view.
sit Iterator to the beginning of a sequence that determines the shape of the sub-view.
out Sub-View (output).

Definition at line 2085 of file marray.hxx.

template<class T , bool isConst, class A >
const CoordinateOrder & marray::View< T, isConst, A >::coordinateOrder (  )  const [inline]

Get the coordinate order used for scalar indexing and iterators.

Returns:
CoordinateOrder. enum: FirstMajorOrder, LastMajorOrder

Reimplemented from marray::ViewExpression< View< T, isConst, A >, T >.

Definition at line 1816 of file marray.hxx.

Here is the caller graph for this function:

template<class T , bool isConst, class A >
template<class CoordinateIterator >
void marray::View< T, isConst, A >::coordinatesToIndex ( CoordinateIterator  it,
size_t out 
) const [inline]

Compute the index that corresponds to a sequence of coordinates.

Parameters:
it An iterator to the beginning of the coordinate sequence.
out Index (output)
See also:
coordinatesToOffset(), indexToCoordinates(), and indexToOffset()

Definition at line 767 of file marray.hxx.

template<class T , bool isConst, class A >
template<class CoordinateIterator >
void marray::View< T, isConst, A >::coordinatesToOffset ( CoordinateIterator  it,
size_t out 
) const [inline]

Compute the offset that corresponds to a sequence of coordinates.

Parameters:
it An iterator to the beginning of the coordinate sequence.
out Index (output)
See also:
coordinatesToIndex(), indexToCoordinates(), and indexToOffset()

Definition at line 809 of file marray.hxx.

template<class T , bool isConst, class A >
const size_t marray::View< T, isConst, A >::dimension (  )  const [inline]

Get the dimension.

Not well-defined if the data pointer is 0.

Returns:
Dimension.

Reimplemented from marray::ViewExpression< View< T, isConst, A >, T >.

Definition at line 1712 of file marray.hxx.

Here is the caller graph for this function:

template<class T , bool isConst, class A >
View< T, isConst, A >::const_iterator marray::View< T, isConst, A >::end (  )  const [inline]

Get the end-iterator.

Returns:
Iterator.
See also:
begin()

Definition at line 2755 of file marray.hxx.

template<class T , bool isConst, class A >
View< T, isConst, A >::iterator marray::View< T, isConst, A >::end (  )  [inline]

Get the end-iterator.

Returns:
Iterator.
See also:
begin()

Definition at line 2728 of file marray.hxx.

Here is the caller graph for this function:

template<class T , bool isConst, class A >
template<class CoordinateIterator >
void marray::View< T, isConst, A >::indexToCoordinates ( size_t  index,
CoordinateIterator  outit 
) const [inline]

Compute the coordinate sequence that corresponds to an index.

Parameters:
index Index
outit An iterator into a container into which the coordinate sequence is to be written (output).
See also:
coordinatesToIndex(), coordinatesToOffset(), and indexToOffset()

Definition at line 833 of file marray.hxx.

Here is the caller graph for this function:

template<class T , bool isConst, class A >
void marray::View< T, isConst, A >::indexToOffset ( size_t  index,
size_t out 
) const [inline]

Compute the offset that corresponds to an index.

Parameters:
index Index.
out Offset (output).
See also:
coordinatesToIndex(), coordinatesToOffset(), and indexToCoordinates()

Definition at line 873 of file marray.hxx.

template<class T , bool isConst, class A >
const bool marray::View< T, isConst, A >::isSimple (  )  const [inline]

Determine whether the shape strides equal the strides of the View.

Returns:
bool.

Reimplemented from marray::ViewExpression< View< T, isConst, A >, T >.

Definition at line 1828 of file marray.hxx.

Here is the caller graph for this function:

template<class T , bool isConst, class A >
View< T, isConst, A >::reference marray::View< T, isConst, A >::operator() ( const size_t  c0,
const size_t  c1,
const size_t  c2,
const size_t  c3,
const size_t  c4,
const size_t  c5,
const size_t  c6,
const size_t  c7,
const size_t  c8,
const size_t  c9 
) const [inline]

Reference data in a 10-dimensional View by coordinates.

This function issues a runtime error if the View is not 5-dimensional.

Parameters:
c0 1st coordinate.
c1 2nd coordinate.
c2 3rd coordinate.
c3 4th coordinate.
c4 5th coordinate.
c5 6th coordinate.
c6 7th coordinate.
c7 8th coordinate.
c8 9th coordinate.
c9 10th coordinate.

Definition at line 1546 of file marray.hxx.

template<class T , bool isConst, class A >
View< T, isConst, A >::reference marray::View< T, isConst, A >::operator() ( const size_t  c0,
const size_t  c1,
const size_t  c2,
const size_t  c3,
const size_t  c4,
const size_t  c5,
const size_t  c6,
const size_t  c7,
const size_t  c8,
const size_t  c9 
) [inline]

Reference data in a 10-dimensional View by coordinates.

This function issues a runtime error if the View is not 5-dimensional.

Parameters:
c0 1st coordinate.
c1 2nd coordinate.
c2 3rd coordinate.
c3 4th coordinate.
c4 5th coordinate.
c5 6th coordinate.
c6 7th coordinate.
c7 8th coordinate.
c8 9th coordinate.
c9 10th coordinate.

Definition at line 1503 of file marray.hxx.

template<class T , bool isConst, class A >
View< T, isConst, A >::reference marray::View< T, isConst, A >::operator() ( const size_t  c0,
const size_t  c1,
const size_t  c2,
const size_t  c3,
const size_t  c4 
) const [inline]

Reference data in a 5-dimensional View by coordinates.

This function issues a runtime error if the View is not 5-dimensional.

Parameters:
c0 1st coordinate.
c1 2nd coordinate.
c2 3rd coordinate.
c3 4th coordinate.
c4 5th coordinate.

Reimplemented from marray::ViewExpression< View< T, isConst, A >, T >.

Definition at line 1467 of file marray.hxx.

template<class T , bool isConst, class A >
View< T, isConst, A >::reference marray::View< T, isConst, A >::operator() ( const size_t  c0,
const size_t  c1,
const size_t  c2,
const size_t  c3,
const size_t  c4 
) [inline]

Reference data in a 5-dimensional View by coordinates.

This function issues a runtime error if the View is not 5-dimensional.

Parameters:
c0 1st coordinate.
c1 2nd coordinate.
c2 3rd coordinate.
c3 4th coordinate.
c4 5th coordinate.

Definition at line 1437 of file marray.hxx.

template<class T , bool isConst, class A >
View< T, isConst, A >::reference marray::View< T, isConst, A >::operator() ( const size_t  c0,
const size_t  c1,
const size_t  c2,
const size_t  c3 
) const [inline]

Reference data in a 4-dimensional View by coordinates.

This function issues a runtime error if the View is not 4-dimensional.

Parameters:
c0 1st coordinate.
c1 2nd coordinate.
c2 3rd coordinate.
c3 4th coordinate.

Reimplemented from marray::ViewExpression< View< T, isConst, A >, T >.

Definition at line 1408 of file marray.hxx.

template<class T , bool isConst, class A >
View< T, isConst, A >::reference marray::View< T, isConst, A >::operator() ( const size_t  c0,
const size_t  c1,
const size_t  c2,
const size_t  c3 
) [inline]

Reference data in a 4-dimensional View by coordinates.

This function issues a runtime error if the View is not 4-dimensional.

Parameters:
c0 1st coordinate.
c1 2nd coordinate.
c2 3rd coordinate.
c3 4th coordinate.

Definition at line 1380 of file marray.hxx.

template<class T , bool isConst, class A >
View< T, isConst, A >::reference marray::View< T, isConst, A >::operator() ( const size_t  c0,
const size_t  c1,
const size_t  c2 
) const [inline]

Reference data in a 3-dimensional View by coordinates.

This function issues a runtime error if the View is not 3-dimensional.

Parameters:
c0 1st coordinate.
c1 2nd coordinate.
c2 3rd coordinate.

Reimplemented from marray::ViewExpression< View< T, isConst, A >, T >.

Definition at line 1354 of file marray.hxx.

template<class T , bool isConst, class A >
View< T, isConst, A >::reference marray::View< T, isConst, A >::operator() ( const size_t  c0,
const size_t  c1,
const size_t  c2 
) [inline]

Reference data in a 3-dimensional View by coordinates.

This function issues a runtime error if the View is not 3-dimensional.

Parameters:
c0 1st coordinate.
c1 2nd coordinate.
c2 3rd coordinate.

Definition at line 1329 of file marray.hxx.

template<class T , bool isConst, class A >
View< T, isConst, A >::reference marray::View< T, isConst, A >::operator() ( const size_t  c0,
const size_t  c1 
) const [inline]

Reference data in a 2-dimensional View by coordinates.

This function issues a runtime error if the View is not 2-dimensional.

Parameters:
c0 1st coordinate.
c1 2nd coordinate.

Reimplemented from marray::ViewExpression< View< T, isConst, A >, T >.

Definition at line 1306 of file marray.hxx.

template<class T , bool isConst, class A >
View< T, isConst, A >::reference marray::View< T, isConst, A >::operator() ( const size_t  c0,
const size_t  c1 
) [inline]

Reference data in a 2-dimensional View by coordinates.

This function issues a runtime error if the View is not 2-dimensional.

Parameters:
c0 1st coordinate.
c1 2nd coordinate.

Definition at line 1284 of file marray.hxx.

template<class T , bool isConst, class A >
template<class U >
View< T, isConst, A >::reference marray::View< T, isConst, A >::operator() ( u  )  const [inline]

Reference data.

Parameters:
u If u is an integer type, scalar indexing is performed. Otherwise, it is assumed that u is an iterator to the beginning of a coordinate sequence.
Returns:
Reference to the entry at u.

Definition at line 1264 of file marray.hxx.

template<class T , bool isConst, class A >
template<class U >
View< T, isConst, A >::reference marray::View< T, isConst, A >::operator() ( u  )  [inline]

Reference data.

Parameters:
u If u is an integer type, scalar indexing is performed. Otherwise, it is assumed that u is an iterator to the beginning of a coordinate sequence.
Returns:
Reference to the entry at u.

Definition at line 1246 of file marray.hxx.

template<class T , bool isConst, class A >
template<class E , class Te>
View< T, isConst, A > & marray::View< T, isConst, A >::operator= ( const ViewExpression< E, Te > &  expression  )  [inline]
template<class T , bool isConst, class A >
template<class TLocal , bool isConstLocal, class ALocal >
View< T, isConst, A > & marray::View< T, isConst, A >::operator= ( const View< TLocal, isConstLocal, ALocal > &  in  )  [inline]
template<class T, bool isConst, class A>
View< T, isConst, A > & marray::View< T, isConst, A >::operator= ( const View< T, false, A > &  in  )  [inline]

Assignment.

Definition at line 1891 of file marray.hxx.

template<class T, bool isConst, class A>
View< T, isConst, A > & marray::View< T, isConst, A >::operator= ( const View< T, true, A > &  in  )  [inline]

Assignment.

operator= (the assignment operator) has a non-trivial behavior. In most cases, it will work as most programmers will expect. Here's a complete description of the semantics of to.operator=(from) or equivalently, to = from.

Consider the following cases: (1) 'to' is mutable (isConst == false) (a) 'from' is mutable (isConst == false) (i) 'to' is initialized (data_ != 0) (ii) 'to' is un-initialized (data_ == 0) (b) 'from' is constant (isConst == true) (2) 'to' is constant (isConst == true)

(i) The operator attempts to copy the data under view 'b' to the memory under view 'a'. This works if both views have the same size, regardless of their dimension and shape. Equality of sizes is checked by an assertion.

(ii) Unless &a == &b (self-assignment), the operator copies the (data) pointer of view 'b' to view 'a', without copying the data itself. In addition, all the properties of view 'b' are copied to view 'a'.

(b) The operator attempts to copy the data under view 'b' to the memory under view 'a'. This works if both views have the same size, regardless of their dimension and shape. Equality of sizes is checked by an assertion. If 'a' is un-initialized the assertion fails (because the size of a will be zero). Unlike in (ii), the pointer is not copied in this case. Thus, a conversion from mutable to const is prevented.

(2) Unless &a == &b (self-assignment), the operator copies the (data) pointer of view 'b' to view 'a', without copying the data itself. In addition, all the properties of view 'b' are copied to view 'a'. Note that changing the data under a constant view would be counter-intuitive.

Definition at line 1876 of file marray.hxx.

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

Assignment.

Parameters:
value Value.

All entries are set to value.

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

Definition at line 1926 of file marray.hxx.

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

Check whether two Views overlap.

This function returns true if two memory intervals overlap: (1) the interval between the first and the last element of the object whose member function overlaps() is called. (2) the interval between the first and the last element of v.

Note that this not necessarily implies the existence of an element that is addressed by both v and the current object. v could for instance address all odd elements in a vector while the current object addresses all even elements.

Parameters:
v A view to compare with *this.
Returns:
bool.

Definition at line 2931 of file marray.hxx.

Here is the call graph for this function:

template<class T , bool isConst, class A >
template<class CoordinateIterator >
void marray::View< T, isConst, A >::permute ( CoordinateIterator  begin  )  [inline]

Permute dimensions.

Parameters:
begin Iterator to the beginning of a sequence which has to contain the integers 0, ..., dimension()-1 in any order. Otherwise, a runtime error is thrown.
See also:
permutedView(), transpose(), transposedView(), shift(), shiftedView()

Definition at line 2494 of file marray.hxx.

Here is the caller graph for this function:

template<class T , bool isConst, class A >
template<class CoordinateIterator >
View< T, isConst, A > marray::View< T, isConst, A >::permutedView ( CoordinateIterator  begin  )  const [inline]

Get a View with permuted dimensions.

Parameters:
begin Iterator to the beginning of a sequence which has to contain the integers 0, ..., dimension()-1 in any order. Otherwise, a runtime error is thrown.
Returns:
Permuted View.
See also:
permute(), transpose(), transposedView(), shift(), shiftedView()

Definition at line 2541 of file marray.hxx.

Here is the call graph for this function:

template<class T , bool isConst, class A >
View< T, isConst, A >::const_reverse_iterator marray::View< T, isConst, A >::rbegin (  )  const [inline]

Get a reserve iterator to the beginning.

Returns:
Iterator.
See also:
rend()

Definition at line 2792 of file marray.hxx.

Here is the call graph for this function:

template<class T , bool isConst, class A >
View< T, isConst, A >::reverse_iterator marray::View< T, isConst, A >::rbegin (  )  [inline]

Get a reserve iterator to the beginning.

Returns:
Iterator.
See also:
rend()

Definition at line 2768 of file marray.hxx.

Here is the call graph for this function:

template<class T , bool isConst, class A >
View< T, isConst, A >::const_reverse_iterator marray::View< T, isConst, A >::rend (  )  const [inline]

Get the reverse end-iterator.

Returns:
Iterator.
See also:
rbegin()

Definition at line 2804 of file marray.hxx.

Here is the call graph for this function:

template<class T , bool isConst, class A >
View< T, isConst, A >::reverse_iterator marray::View< T, isConst, A >::rend (  )  [inline]

Get the reverse end-iterator.

Returns:
Iterator.
See also:
rbegin()

Definition at line 2780 of file marray.hxx.

Here is the call graph for this function:

template<class T , bool isConst, class A >
template<class ShapeIterator >
void marray::View< T, isConst, A >::reshape ( ShapeIterator  begin,
ShapeIterator  end 
) [inline]

Reshape the View.

Two conditions have to be fulfilled in order for reshape to work:

  • The new and the old shape must have the same size.
  • The view must be simple, cf. isSimple().
Parameters:
begin Iterator to the beginning of a sequence that determines the new shape.
end Iterator to the end of that sequence.
See also:
reshapedView(), isSimple()

Definition at line 2276 of file marray.hxx.

Here is the caller graph for this function:

template<class T , bool isConst, class A >
template<class ShapeIterator >
View< T, isConst, A > marray::View< T, isConst, A >::reshapedView ( ShapeIterator  begin,
ShapeIterator  end 
) const [inline]

Get a reshaped View.

Two conditions have to be fulfilled:

  • The new and the old shape must have the same size.
  • The view must be simple, cf. isSimple().
Parameters:
begin Iterator to the beginning of a sequence that determines the new shape.
end Iterator to the end of that sequence.
See also:
reshape(), isSimple()

Definition at line 2308 of file marray.hxx.

Here is the call graph for this function:

template<class T , bool isConst, class A >
const size_t marray::View< T, isConst, A >::shape ( const size_t  dimension  )  const [inline]

Get the shape in one dimension.

Parameters:
dimension Dimension
Returns:
Shape in that dimension.

Reimplemented from marray::ViewExpression< View< T, isConst, A >, T >.

Definition at line 1726 of file marray.hxx.

Here is the caller graph for this function:

template<class T , bool isConst, class A >
const size_t * marray::View< T, isConst, A >::shapeBegin (  )  const [inline]

Get a constant iterator to the beginning of the shape vector.

Returns:
iterator.
See also:
shapeEnd()

Reimplemented from marray::ViewExpression< View< T, isConst, A >, T >.

Definition at line 1743 of file marray.hxx.

Here is the caller graph for this function:

template<class T , bool isConst, class A >
const size_t * marray::View< T, isConst, A >::shapeEnd (  )  const [inline]

Get a constant iterator to the end of the shape vector.

Returns:
iterator.
See also:
shapeBegin()

Reimplemented from marray::ViewExpression< View< T, isConst, A >, T >.

Definition at line 1757 of file marray.hxx.

Here is the caller graph for this function:

template<class T , bool isConst, class A >
void marray::View< T, isConst, A >::shift ( const int  n  )  [inline]

Cycle shift dimensions.

Parameters:
n Number of positions to shift
See also:
shiftedView(), permute(), permutedView(), transpose(), transposedView()

Definition at line 2666 of file marray.hxx.

Here is the caller graph for this function:

template<class T , bool isConst, class A >
View< T, isConst, A > marray::View< T, isConst, A >::shiftedView ( const int  n  )  const [inline]

Get a View which dimensions cycle shifted.

Parameters:
n Number of positions to shift
See also:
shift(), permute(), permutedView(), transpose(), transposedView()

Definition at line 2698 of file marray.hxx.

Here is the call graph for this function:

template<class T , bool isConst, class A >
const size_t marray::View< T, isConst, A >::size (  )  const [inline]

Get the number of data items.

Returns:
Size.

Reimplemented from marray::ViewExpression< View< T, isConst, A >, T >.

Definition at line 1699 of file marray.hxx.

Here is the caller graph for this function:

template<class T , bool isConst, class A >
void marray::View< T, isConst, A >::squeeze (  )  [inline]

Remove singleton dimensions by setting their coordinates to zero.

See also:
squeezedView(), boundView()

Definition at line 2415 of file marray.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T , bool isConst, class A >
View< T, isConst, A > marray::View< T, isConst, A >::squeezedView (  )  const [inline]

Get a View where all singleton dimensions have been removed by setting their coordinates to zero.

See also:
squeeze(), boundView()

Definition at line 2455 of file marray.hxx.

Here is the call graph for this function:

template<class T , bool isConst, class A >
const size_t marray::View< T, isConst, A >::strides ( const size_t  dimension  )  const [inline]

Get the strides in one dimension.

Parameters:
dimension Dimension
Returns:
Stride in that dimension.

Definition at line 1772 of file marray.hxx.

template<class T , bool isConst, class A >
const size_t * marray::View< T, isConst, A >::stridesBegin (  )  const [inline]

Get a constant iterator to the beginning of the strides vector.

Returns:
iterator.
See also:
stridesEnd()

Definition at line 1789 of file marray.hxx.

template<class T , bool isConst, class A >
const size_t * marray::View< T, isConst, A >::stridesEnd (  )  const [inline]

Get a constant iterator to the end of the strides vector.

Returns:
iterator.
See also:
stridesBegin()

Definition at line 1803 of file marray.hxx.

template<class T , bool isConst, class A >
void marray::View< T, isConst, A >::transpose (  )  [inline]

Reverse dimensions.

See also:
transposedView(), permute(), permutedView(), shift(), shiftedView()

Definition at line 2598 of file marray.hxx.

Here is the call graph for this function:

template<class T , bool isConst, class A >
void marray::View< T, isConst, A >::transpose ( const size_t  c1,
const size_t  c2 
) [inline]

Exchange two dimensions.

Parameters:
c1 Dimension
c2 Dimension
See also:
permute(), permutedView(), shift(), shiftedView()

Definition at line 2559 of file marray.hxx.

Here is the caller graph for this function:

template<class T , bool isConst, class A >
View< T, isConst, A > marray::View< T, isConst, A >::transposedView (  )  const [inline]

Get a View with dimensions reversed.

Returns:
View with dimensions reversed.
See also:
transpose(), permute(), permutedView(), shift(), shiftedView()

Definition at line 2650 of file marray.hxx.

Here is the call graph for this function:

template<class T , bool isConst, class A >
View< T, isConst, A > marray::View< T, isConst, A >::transposedView ( const size_t  c1,
const size_t  c2 
) const [inline]

Get a View with two dimensions exchanged.

Parameters:
c1 Dimension
c2 Dimension
Returns:
Transposed View.
See also:
transpose(), permute(), permutedView(), shift(), shiftedView()

Definition at line 2632 of file marray.hxx.

Here is the call graph for this function:

template<class T, bool isConst, class A>
template<class BaseIterator , class ShapeIterator >
View< T, isConst, A > marray::View< T, isConst, A >::view ( BaseIterator  bit,
ShapeIterator  sit,
const CoordinateOrder internalCoordinateOrder 
) const [inline]

Get a sub-view.

Parameters:
bit Iterator to the beginning of a coordinate sequence that determines the start position of the sub-view.
sit Iterator to the beginning of a sequence that determines the shape of the sub-view.
internalCoordinateOrder Flag to set the coordinate order for scalar indexing and iterators of the sub-view.
Returns:
Sub-View.

Definition at line 2061 of file marray.hxx.

template<class T, bool isConst, class A>
template<class BaseIterator , class ShapeIterator >
View< T, isConst, A > marray::View< T, isConst, A >::view ( BaseIterator  bit,
ShapeIterator  sit 
) const [inline]

Get a sub-view with the same coordinate order.

Parameters:
bit Iterator to the beginning of a coordinate sequence that determines the start position of the sub-view.
sit Iterator to the beginning of a sequence that determines the shape of the sub-view.
Returns:
Sub-View.

Definition at line 2037 of file marray.hxx.

template<class T, bool isConst, class A>
template<class BaseIterator , class ShapeIterator >
void marray::View< T, isConst, A >::view ( BaseIterator  bit,
ShapeIterator  sit,
const CoordinateOrder internalCoordinateOrder,
View< T, isConst, A > &  out 
) const [inline]

Get a sub-view.

Parameters:
bit Iterator to the beginning of a coordinate sequence that determines the start position of the sub-view.
sit Iterator to the beginning of a sequence that determines the shape of the sub-view.
internalCoordinateOrder Flag to set the coordinate order for scalar indexing and iterators of the sub-view.
out Sub-View (output).

Definition at line 2011 of file marray.hxx.

Here is the call graph for this function:

template<class T, bool isConst, class A>
template<class BaseIterator , class ShapeIterator >
void marray::View< T, isConst, A >::view ( BaseIterator  bit,
ShapeIterator  sit,
View< T, isConst, A > &  out 
) const [inline]

Get a sub-view with the same coordinate order.

Parameters:
bit Iterator to the beginning of a coordinate sequence that determines the start position of the sub-view.
sit Iterator to the beginning of a sequence that determines the shape of the sub-view.
out Sub-View (output).

Definition at line 1988 of file marray.hxx.

 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