AFF --- A container for numbers (array) by Friederich and Forbriger.
aff::LinearShape Class Reference

Shape for class aff::Series. More...

#include <linearshape.h>

Inheritance diagram for aff::LinearShape:

Public Types

typedef aff::util::SeriesStepper Tstepper
 stepper class for LinearShape (useid through Series by Iterator e.g.) More...
 

Public Member Functions

 LinearShape ()
 default constructor defines range of size 1 More...
 
 LinearShape (const Tsubscript &first, const Tsubscript &last, const Tsubscript &firstinrepr)
 constructor to use for full definition More...
 
const Tsubscriptfirst () const
 return first legal index More...
 
const Tsubscriptlast () const
 return last legal index More...
 
Tsubscript offset (const Tsubscript &i) const
 return offset in representation for indes i More...
 
const Tsizebase () const
 return base for access to representation More...
 
Tsize size () const
 by size we mean the size defined by the shape More...
 
Tsize memory_size () const
 return size of addressed memory More...
 
LinearShapeshrink (const Tdim &i, const Tsubscript &first, const Tsubscript &last)
 set index range [ first , last ] for dimension i (used by aff::util::Subarray) More...
 
LinearShapeshrink (const Tdim &i, const Tsubscript &last)
 set last index of dimension i to last (used by aff::util::Subarray) More...
 
void setindexrange (const Tsubscript &first, const Tsubscript last)
 set index range [ first , last ] More...
 
void setfirstindex (const Tsubscript &first)
 set first index to first More...
 
void setlastindex (const Tsubscript &last)
 set last index to last More...
 
void shift (const Tsubscript &i)
 shift effective index range by i More...
 

Static Public Attributes

static const Tdim Mmax_dimen =1
 the linear shape is used to address one-dimensional arrays More...
 

Private Attributes

Tsubscript Mfirst
 first valid index More...
 
Tsubscript Mlast
 last valid index More...
 
Tsize Mbase
 base for access to representation More...
 

Detailed Description

Shape for class aff::Series.

aff::Series needs its own shape class to provide an Array compatible interface to Iterator.

The shape ist defined by three parameters, which are first, last, and base. The index k of the corresponding series must be in (first, last). While the range acessed within the representation is (first-base, last-base). Thus the element k of the series will be found at index k-base in the representation.

The shape guarantees that the memory layout is dense. This means that the elements of a series can be accessed like a C-style array through a pointer to the first element of the series.

Since we do not need to handle multiple dimensions, we offer in-class reshaping functions.

Definition at line 78 of file linearshape.h.


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