AFF --- A container for numbers (array) by Friederich and Forbriger.
aff::util::Subarray< C > Class Template Reference

Create subarrays. More...

#include <subarray.h>

Public Types

typedef C Tarray
 Type of array to be handled. More...
 
typedef C Tcontainer
 Type of array to be handled. More...
 
typedef Tarray::Tconst_value Tconst_value
 Type of const element. More...
 
typedef Tarray::Tconst_reference Tconst_reference
 Type of reference to const element. More...
 
typedef Tarray::Tconst_pointer Tconst_pointer
 Type of pointer to const element. More...
 
typedef Tarray::Tshape Tshape
 Type of shape to be used. More...
 
typedef Tarray::Trepresentation Trepresentation
 Type of reference to be used. More...
 

Public Member Functions

 Subarray (const Tarray &array)
 Constructor takes a reference to an array. More...
 
Subarrayoperator() ()
 use full range of this dimension More...
 
Subarrayoperator() (const Tsubscript &last)
 set last index of this dimension More...
 
Subarrayoperator() (const Tsubscript &first, const Tsubscript &last)
 set first and last index of this dimension More...
 
Subarrayoperator= (Tconst_reference value)
 provide value assignment to a subarray More...
 
Tarray array () const
 return an array More...
 
 operator Tarray () const
 convert to array More...
 

Private Member Functions

void check_dim () const
 check dimensions More...
 

Private Attributes

Tshape Mshape
 Shape to process. More...
 
Trepresentation Mrepresentation
 Representation to use. More...
 
Tdim Mdim
 Dimension to specify. More...
 

Detailed Description

template<class C>
class aff::util::Subarray< C >

Create subarrays.

This class helps you to create a subarray from an existing array. Use this through the function aff::subarray.

Examples can be found in tests/helpertest.cc

Todo:
The class may also work for aff::Series objects, if their shape offers appropriate functionality. This is left to a future revision.
Todo:
The constructor copys the shape twice. That's inefficient.
Examples:
tests/helpertest.cc.

Definition at line 72 of file subarray.h.


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