STK++ 0.9.13
|
Interface base class for homogeneous 1D containers. More...
#include <STK_ITContainer1D.h>
Public Types | |
enum | { size_ = hidden::Traits<Derived>::size_ } |
typedef hidden::Traits< Derived >::Type | Type |
typedef hidden::Traits< Derived >::TypeConst | TypeConst |
typedef hidden::Traits< Derived >::RowRange | RowRange |
typedef hidden::Traits< Derived >::ColRange | ColRange |
typedef hidden::Traits< Derived >::Row | Row |
typedef hidden::Traits< Derived >::Col | Col |
typedef hidden::Traits< Derived >::SubVector | SubVector |
typedef hidden::Traits< Derived >::Iterator | Iterator |
typedef hidden::Traits< Derived >::ConstIterator | ConstIterator |
typedef hidden::Traits< Derived >::ReverseIterator | ReverseIterator |
typedef hidden::Traits< Derived >::ConstReverseIterator | ConstReverseIterator |
Public Member Functions | |
RowRange const & | range () const |
int | begin () const |
int | end () const |
int | size () const |
int | lastIdx () const |
Iterator | beginIterator () |
Iterator | endIterator () |
ConstIterator | beginConstIterator () const |
ConstIterator | endConstIterator () const |
ReverseIterator | rbeginIterator () |
ReverseIterator | rendIterator () |
ConstReverseIterator | rbeginConstIterator () const |
ConstReverseIterator | rendConstIterator () const |
bool | empty () const |
Is there some data ? | |
Type & | elt (int i) |
TypeConst | elt (int i) const |
Type & | operator[] (int i) |
TypeConst | operator[] (int i) const |
Type & | at (int i) |
TypeConst | at (int i) const |
SubVector | sub (Range const &I) const |
Access to many elements. | |
Type & | front () |
TypeConst | front () const |
Type & | back () |
TypeConst | back () const |
void | shift (int beg) |
Derived & | resize (Range const &I=RowRange()) |
![]() | |
Derived & | asDerived () |
static cast : return a reference of this with a cast to the derived class. | |
Derived const & | asDerived () const |
static cast : return a const reference of this with a cast to the derived class. | |
Derived * | asPtrDerived () |
static cast : return a ptr on a Derived of this with a cast to the derived class. | |
Derived const * | asPtrDerived () const |
static cast : return a ptr on a constant Derived of this with a cast to the derived class. | |
Derived * | clone () const |
create a leaf using the copy constructor of the Derived class. | |
Derived * | clone (bool isRef) const |
create a leaf using the copy constructor of the Derived class and a flag determining if the clone is a reference or not. | |
Protected Member Functions | |
ITContainer1D () | |
Default constructor. | |
ITContainer1D (RowRange const &I) | |
constructor with a specified range. | |
~ITContainer1D () | |
destructor. | |
void | exchange (ITContainer1D &T) |
exchange this container with T | |
void | setRange (RowRange const &I=RowRange()) |
Set range of the rows of the container. | |
void | incRange (int n=1) |
increment the range of the container (can be negative). | |
void | incFirst (int n=1) |
increment the beginning of the container (can be negative). | |
void | decFirst (int n=1) |
decrement the beginning of the container. | |
void | incLast (int n=1) |
increment the end of the container (can be negative). | |
void | decLast (int n=1) |
decrement the end of the container. | |
![]() | |
IRecursiveTemplate () | |
constructor. | |
~IRecursiveTemplate () | |
destructor. | |
Private Attributes | |
RowRange | range_ |
range of the array. | |
Interface base class for homogeneous 1D containers.
The ITContainer1D class is the template base class for all homogeneous one-dimensional containers containing element of type Type
where Type is not necessarily a scalar. It assumes that the derived class cannot be part of an expression and is not constant, so that it can be #- shifted, #- resized #- accessed in modification.
Implement the curious recursive template paradigm: the template parameter c Derived is the name of the class that implements ITContainer1D
. For example template<class Type> class Derived: public ITContainer1D< Derived<Type> > {...}
The pseudo virtual function defined in this interface and to be implemented by derived classes have the following definitions
It is required that all these methods have to be implemented in Derived classes.
Definition at line 75 of file STK_ITContainer1D.h.
typedef hidden::Traits<Derived>::Col STK::ITContainer1D< Derived >::Col |
Definition at line 90 of file STK_ITContainer1D.h.
typedef hidden::Traits<Derived>::ColRange STK::ITContainer1D< Derived >::ColRange |
Definition at line 87 of file STK_ITContainer1D.h.
typedef hidden::Traits<Derived>::ConstIterator STK::ITContainer1D< Derived >::ConstIterator |
Definition at line 95 of file STK_ITContainer1D.h.
typedef hidden::Traits<Derived>::ConstReverseIterator STK::ITContainer1D< Derived >::ConstReverseIterator |
Definition at line 97 of file STK_ITContainer1D.h.
typedef hidden::Traits<Derived>::Iterator STK::ITContainer1D< Derived >::Iterator |
Definition at line 94 of file STK_ITContainer1D.h.
typedef hidden::Traits<Derived>::ReverseIterator STK::ITContainer1D< Derived >::ReverseIterator |
Definition at line 96 of file STK_ITContainer1D.h.
typedef hidden::Traits<Derived>::Row STK::ITContainer1D< Derived >::Row |
Definition at line 89 of file STK_ITContainer1D.h.
typedef hidden::Traits<Derived>::RowRange STK::ITContainer1D< Derived >::RowRange |
Definition at line 86 of file STK_ITContainer1D.h.
typedef hidden::Traits<Derived>::SubVector STK::ITContainer1D< Derived >::SubVector |
Definition at line 91 of file STK_ITContainer1D.h.
typedef hidden::Traits<Derived>::Type STK::ITContainer1D< Derived >::Type |
Definition at line 83 of file STK_ITContainer1D.h.
typedef hidden::Traits<Derived>::TypeConst STK::ITContainer1D< Derived >::TypeConst |
Definition at line 84 of file STK_ITContainer1D.h.
Enumerator | |
---|---|
size_ |
Definition at line 78 of file STK_ITContainer1D.h.
|
inlineprotected |
|
inlineprotected |
constructor with a specified range.
I | : the range of the container |
Definition at line 105 of file STK_ITContainer1D.h.
|
inlineprotected |
|
inline |
i | index of the element |
Definition at line 194 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::at(), STK::ITContainer1D< Derived >::begin(), STK::ITContainer1D< Derived >::elt(), STK::ITContainer1D< Derived >::end(), and STKOUT_OF_RANGE_1ARG.
Referenced by STK::ITContainer1D< Derived >::at(), STK::ITContainer1D< Derived >::at(), STK::MultiLaw::JointProbability< RowVector, Law >::atLaw(), and STK::MultiLaw::JointProbability< RowVector, Law >::atLaw().
|
inline |
i | index of the element |
Definition at line 203 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::at(), STK::ITContainer1D< Derived >::begin(), STK::ITContainer1D< Derived >::elt(), STK::ITContainer1D< Derived >::end(), and STKOUT_OF_RANGE_1ARG.
|
inline |
Definition at line 231 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::elt(), and STK::ITContainer1D< Derived >::lastIdx().
Referenced by STK::Variable< Type_ >::push_back(), and STK::DataFrame::pushBackVariable().
|
inline |
Definition at line 233 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::elt(), and STK::ITContainer1D< Derived >::lastIdx().
|
inline |
Definition at line 113 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::range_.
Referenced by STK::ITContainer1D< Derived >::at(), STK::ITContainer1D< Derived >::at(), STK::ITContainer1D< Derived >::beginConstIterator(), STK::ITContainer1D< Derived >::beginIterator(), STK::ITContainer1D< Derived >::elt(), STK::ITContainer1D< Derived >::elt(), STK::ITContainer1D< Derived >::front(), STK::ITContainer1D< Derived >::front(), STK::ITContainer1D< Derived >::operator[](), STK::ITContainer1D< Derived >::operator[](), and STK::ITContainer1D< Derived >::sub().
|
inline |
Definition at line 128 of file STK_ITContainer1D.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), and STK::ITContainer1D< Derived >::begin().
Referenced by STK::KernelHandler::addKernel(), STK::KernelHandler::getKernel(), STK::KernelHandler::isHandled(), and STK::ITContainer1D< Derived >::rendConstIterator().
|
inline |
Definition at line 123 of file STK_ITContainer1D.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), and STK::ITContainer1D< Derived >::begin().
Referenced by STK::KernelHandler::addKernel(), STK::KernelHandler::removeKernel(), STK::ITContainer1D< Derived >::rendIterator(), and STK::KernelHandler::~KernelHandler().
|
inlineprotected |
decrement the beginning of the container.
n | decrement to apply to the beginning of the range |
Definition at line 267 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::range_.
|
inlineprotected |
decrement the end of the container.
n | decrement to apply to the end of the range |
Definition at line 275 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::range_.
|
inline |
i | index of the element to get |
Definition at line 150 of file STK_ITContainer1D.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), STK::ITContainer1D< Derived >::begin(), STK::ITContainer1D< Derived >::elt(), STK::ITContainer1D< Derived >::end(), and STKOUT_OF_RANGE_1ARG.
Referenced by STK::ITContainer1D< Derived >::at(), STK::ITContainer1D< Derived >::at(), STK::ITContainer1D< Derived >::back(), STK::ITContainer1D< Derived >::back(), STK::DataFrame::elt(), STK::DataFrame::elt(), STK::ITContainer1D< Derived >::elt(), STK::ITContainer1D< Derived >::elt(), STK::ITContainer1D< Derived >::front(), STK::ITContainer1D< Derived >::front(), STK::ITContainer1D< Derived >::operator[](), and STK::ITContainer1D< Derived >::operator[]().
|
inline |
i | index of the element to get |
Definition at line 161 of file STK_ITContainer1D.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), STK::ITContainer1D< Derived >::begin(), STK::ITContainer1D< Derived >::elt(), STK::ITContainer1D< Derived >::end(), and STKOUT_OF_RANGE_1ARG.
|
inline |
Is there some data ?
true
if the container is empty, false
otherwise Definition at line 145 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::range_.
Referenced by STK::DataFrame::empty().
|
inline |
Definition at line 115 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::range_.
Referenced by STK::ITContainer1D< Derived >::at(), STK::ITContainer1D< Derived >::at(), STK::ITContainer1D< Derived >::elt(), STK::ITContainer1D< Derived >::elt(), STK::ITContainer1D< Derived >::endConstIterator(), STK::ITContainer1D< Derived >::operator[](), STK::ITContainer1D< Derived >::operator[](), and STK::ITContainer1D< Derived >::sub().
|
inline |
Definition at line 130 of file STK_ITContainer1D.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), and STK::ITContainer1D< Derived >::end().
Referenced by STK::KernelHandler::addKernel(), STK::KernelHandler::getKernel(), STK::KernelHandler::isHandled(), and STK::ITContainer1D< Derived >::rbeginConstIterator().
|
inline |
Definition at line 125 of file STK_ITContainer1D.h.
Referenced by STK::KernelHandler::addKernel(), STK::ITContainer1D< Derived >::rbeginIterator(), STK::KernelHandler::removeKernel(), and STK::KernelHandler::~KernelHandler().
|
inlineprotected |
exchange this container with T
T | the container to exchange with T |
Definition at line 251 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::range_.
|
inline |
Definition at line 227 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::begin(), and STK::ITContainer1D< Derived >::elt().
|
inline |
Definition at line 229 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::begin(), and STK::ITContainer1D< Derived >::elt().
|
inlineprotected |
increment the beginning of the container (can be negative).
n | increment to apply to the beginning of the range |
Definition at line 263 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::range_.
|
inlineprotected |
increment the end of the container (can be negative).
n | increment to apply to the end of the range |
Definition at line 271 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::range_.
|
inlineprotected |
increment the range of the container (can be negative).
n | increment to apply to the range |
Definition at line 259 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::range_.
|
inline |
Definition at line 120 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::range_.
Referenced by STK::ITContainer1D< Derived >::back(), STK::ITContainer1D< Derived >::back(), and STK::ISparseArray1D< Derived >::lastIdxRows().
|
inline |
i | index of the element to get |
Definition at line 172 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::begin(), STK::ITContainer1D< Derived >::elt(), STK::ITContainer1D< Derived >::end(), and STKOUT_OF_RANGE_1ARG.
|
inline |
i | index of the element to get |
Definition at line 183 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::begin(), STK::ITContainer1D< Derived >::elt(), STK::ITContainer1D< Derived >::end(), and STKOUT_OF_RANGE_1ARG.
|
inline |
Definition at line 111 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::range_.
Referenced by STK::List1D< Type_ >::operator=().
|
inline |
Definition at line 138 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::endConstIterator().
|
inline |
Definition at line 133 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::endIterator().
|
inline |
Definition at line 140 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::beginConstIterator().
|
inline |
Definition at line 135 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::beginIterator().
|
inline |
I | the range of the container |
Definition at line 244 of file STK_ITContainer1D.h.
References STK::IRecursiveTemplate< Derived >::asDerived().
Referenced by STK::DataFrame::operator=(), STK::Array1D< Type_, Size_ >::operator=(), STK::SArray1D< Type_, Size_, NzMax_ >::operator=(), STK::MultiLaw::JointProbability< RowVector, Law >::resize(), STK::Variable< Type_ >::resize1D(), and STK::Stat::Multivariate< Array, WColVector, Type >::run().
|
inlineprotected |
Set range of the rows of the container.
I | the range to set (default empty) |
Definition at line 255 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::range_.
Referenced by STK::DataFrame::clear().
|
inline |
beg | the index of the first column to set |
Definition at line 236 of file STK_ITContainer1D.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), and STK::ITContainer1D< Derived >::range_.
Referenced by STK::Variable< Type_ >::shift(), STK::DataFrame::shift(), and STK::Variable< Type_ >::shift1D().
|
inline |
Definition at line 117 of file STK_ITContainer1D.h.
References STK::ITContainer1D< Derived >::range_.
|
inline |
Access to many elements.
I | the range of the elements |
Definition at line 215 of file STK_ITContainer1D.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), STK::ITContainer1D< Derived >::begin(), STK::ITContainer1D< Derived >::end(), STKOUT_OF_RANGE_1ARG, and STK::ITContainer1D< Derived >::sub().
Referenced by STK::ITContainer1D< Derived >::sub().
|
private |
range of the array.
Definition at line 279 of file STK_ITContainer1D.h.
Referenced by STK::ITContainer1D< Derived >::begin(), STK::ITContainer1D< Derived >::decFirst(), STK::ITContainer1D< Derived >::decLast(), STK::ITContainer1D< Derived >::empty(), STK::ITContainer1D< Derived >::end(), STK::ITContainer1D< Derived >::exchange(), STK::ITContainer1D< Derived >::incFirst(), STK::ITContainer1D< Derived >::incLast(), STK::ITContainer1D< Derived >::incRange(), STK::ITContainer1D< Derived >::lastIdx(), STK::ITContainer1D< Derived >::range(), STK::ITContainer1D< Derived >::setRange(), STK::ITContainer1D< Derived >::shift(), and STK::ITContainer1D< Derived >::size().