|
STK++ 1.0
|
Interface base class for homogeneous 1D containers. More...
#include <STK_ITContainer1D.h>

Public Member Functions | |
| virtual | ~ITContainer1D () |
| Virtual destructor. | |
| Integer const & | first () const |
| Index of the first element. | |
| Integer const & | last () const |
| Index of the last element. | |
| Integer const & | size () const |
| Number of elements. | |
| Range const & | range () const |
| range of the container | |
| TYPE & | elt (Integer const &pos) |
| Access to one element. | |
| TYPE const & | elt (Integer const &pos) const |
| Access to one element. | |
| TContainer1D | elt (Range const &I) const |
| Access to many elements. | |
| TYPE & | operator[] (Integer const &pos) |
| Operator [] : access to one element. | |
| TYPE const & | operator[] (Integer const &pos) const |
| Operator [] : access to one element const. | |
| TContainer1D | operator[] (Range const &I) const |
| Operator [] : access to many elements. | |
| void | swap (Integer const &pos1, Integer const &pos2) |
Swap two elements of the container using default constructor of the class TYPE. | |
| TYPE & | at (Integer const &pos) |
| STL compatibility : return the element number pos. | |
| TYPE const & | at (Integer const &pos) const |
| STL compatibility : return the element number pos (const). | |
| TYPE & | front () |
| STL compatibility : return the first element. | |
| TYPE const & | front () const |
| STL compatibility : return the first element (const). | |
| TYPE & | back () |
| STL compatibility : return the last element. | |
| TYPE const & | back () const |
| STL compatibility : return the last element (const). | |
| void | push_back (TYPE const &v) |
| STL compatibility : append an element v. | |
| void | push_front (TYPE const &v) |
| STL compatibility : push front an element. | |
| void | insert (Range const &I, TYPE const &v) |
| STL compatibility : insert n elements v in the range I. | |
Protected Member Functions | |
| ITContainer1D (Range const &I=Range()) | |
| Default constructor. | |
| ITContainer1D (const ITContainer1D &T) | |
| Copy constructor. | |
| void | setRange (Range const &I=Range()) |
| Set range of the rows of the container. | |
| void | incRange (Integer const &inc=1) |
| increment the range of the container (can be negative). | |
| void | incFirst (Integer const &inc=1) |
| increment the beginning of the container (can be negative). | |
| void | decFirst (Integer const &inc=1) |
| decrement the beginning of the container. | |
| void | incLast (Integer const &inc=1) |
| increment the end of the container (can be negative). | |
| void | decLast (Integer const &inc=1) |
| decrement the end of the container. | |
Protected Attributes | |
| Range | range_ |
| Range of the container. | |
Interface base class for homogeneous 1D containers.
The ITContainer1D class is the templated base class for all homogeneous one-dimensional containers containing element of type TYPE.
Implement the curious recursive template paradigm : the template parameter TContainer1D is the name of the class that implements ITContainer1D. For example template<class TYPE> class TContainer1D : public ITContainer1D<TYPE, TContainer1D<TYPE> > {...}
The pseudo virtual function defined in this interface have the following definition:
TYPE& elt(Integer const& pos); TYPE const& elt(Integer const& pos) const; TContainer1D elt(Range const& I) const;
All these methods have to be implemented in the TContainer1D class.
Definition at line 77 of file STK_ITContainer1D.h.
| STK::ITContainer1D< TYPE, TContainer1D >::ITContainer1D | ( | Range const & | I = Range() | ) | [inline, protected] |
Default constructor.
| I | : the range of the container |
Definition at line 84 of file STK_ITContainer1D.h.
: IContainerBase<TContainer1D>(IContainerBase<TContainer1D>::_1D_) , range_(I) { this->ranges_.push_back(&range_);}
| STK::ITContainer1D< TYPE, TContainer1D >::ITContainer1D | ( | const ITContainer1D< TYPE, TContainer1D > & | T | ) | [inline, protected] |
Copy constructor.
| T | the container to copy |
Definition at line 92 of file STK_ITContainer1D.h.
: IContainerBase<TContainer1D>(IContainerBase<TContainer1D>::_1D_) , range_(T.range_) { this->ranges_.push_back(&range_);}
| virtual STK::ITContainer1D< TYPE, TContainer1D >::~ITContainer1D | ( | ) | [inline, virtual] |
| Integer const& STK::ITContainer1D< TYPE, TContainer1D >::first | ( | ) | const [inline, virtual] |
Index of the first element.
Implements STK::IContainer1D.
Definition at line 104 of file STK_ITContainer1D.h.
Referenced by STK::applySort(), STK::ITContainer1D< TYPE, List1D< TYPE > >::at(), STK::ReadWriteCsv::colIndex(), STK::BSplineCoefficients::computeCoefficients(), STK::BSplineCoefficients::computeKnots(), STK::dist(), STK::dot(), STK::dotHouse(), STK::ExportToCsv::ExportToCsv(), STK::ReadWriteCsv::first(), STK::ReadWriteCsv::firstVe(), STK::IArray2D< Integer, Array2D< Integer > >::freeCol(), STK::ITContainer1D< TYPE, List1D< TYPE > >::front(), STK::heapSort(), STK::house(), STK::IArray1DBase< Range, Range, Array1D< Range > >::IArray1DBase(), STK::ReadWriteCsv::largestNumberOfRows(), STK::ReadWriteCsv::lastVe(), STK::ReadWriteCsv::lookupVariableIndex(), STK::Stat::mean(), STK::normInf(), STK::normTwo(), STK::normTwo2(), STK::ReadWriteCsv::operator+=(), STK::operator<<(), STK::Array1D< Real >::operator=(), STK::ArrayHo< Real >::operator=(), STK::MatrixUpperTriangular::operator=(), STK::MatrixLowerTriangular::operator=(), STK::DataFrame::operator=(), STK::ArrayHo< TYPE >::operator=(), STK::Array1D< Variable< String > >::operator=(), STK::ITContainer1D< TYPE, List1D< TYPE > >::push_front(), STK::ITContainer2D< Real, ArrayHo< Real >, Array1D< Real >, MatrixUpperTriangular >::pushBackCol(), STK::DataFrame::pushBackDataFrame(), STK::Law::ITUnivariate< Real >::rand1D(), STK::RandBase::RandBase(), STK::RandBase::randDiscreteUnif(), STK::RandBase::randExp(), STK::RandBase::randGauss(), STK::RandBase::randUnif(), STK::IArray2D< Integer, Array2D< Integer > >::shiftCol(), STK::Funct::stirlingCoefficients(), STK::sum(), STK::ITContainer1D< TYPE, List1D< TYPE > >::swap(), STK::Stat::Univariate< YTYPE, TContainer1D >::Univariate(), STK::Stat::variance(), STK::Stat::varianceWithFixedMean(), STK::weightedDist(), STK::weightedDot(), STK::weightedNormInf(), STK::weightedNormTwo(), STK::weightedNormTwo2(), STK::weightedSum(), and STK::ReadWriteCsv::write().
{ return range_.first();}
| Integer const& STK::ITContainer1D< TYPE, TContainer1D >::last | ( | ) | const [inline, virtual] |
Index of the last element.
Implements STK::IContainer1D.
Definition at line 109 of file STK_ITContainer1D.h.
Referenced by STK::applySort(), STK::ITContainer1D< TYPE, List1D< TYPE > >::at(), STK::ITContainer1D< TYPE, List1D< TYPE > >::back(), STK::ReadWriteCsv::colIndex(), STK::BSplineCoefficients::computeCoefficients(), STK::BSplineCoefficients::computeKnots(), STK::EigenvaluesSymmetric::diagonalize(), STK::dist(), STK::dot(), STK::dotHouse(), STK::ExportToCsv::ExportToCsv(), STK::ReadWriteCsv::firstVe(), STK::heapSort(), STK::house(), STK::IArray1DBase< Range, Range, Array1D< Range > >::IArray1DBase(), STK::IArray2D< Integer, Array2D< Integer > >::insertRows(), STK::ReadWriteCsv::largestNumberOfRows(), STK::ReadWriteCsv::last(), STK::ReadWriteCsv::lastVe(), STK::ReadWriteCsv::lookupVariableIndex(), STK::Stat::mean(), STK::normInf(), STK::normTwo(), STK::normTwo2(), STK::ReadWriteCsv::operator+=(), STK::operator<<(), STK::Array1D< Real >::operator=(), STK::ArrayHo< Real >::operator=(), STK::DataFrame::operator=(), STK::ArrayHo< TYPE >::operator=(), STK::Array1D< Variable< String > >::operator=(), STK::ITContainer1D< TYPE, List1D< TYPE > >::push_back(), STK::ITContainer2D< Real, ArrayHo< Real >, Array1D< Real >, MatrixUpperTriangular >::pushBackCol(), STK::DataFrame::pushBackDataFrame(), STK::Law::ITUnivariate< Real >::rand1D(), STK::RandBase::RandBase(), STK::RandBase::randDiscreteUnif(), STK::RandBase::randExp(), STK::RandBase::randGauss(), STK::RandBase::randUnif(), STK::sum(), STK::ITContainer1D< TYPE, List1D< TYPE > >::swap(), STK::Stat::Univariate< YTYPE, TContainer1D >::Univariate(), STK::Stat::variance(), STK::Stat::varianceWithFixedMean(), STK::weightedDist(), STK::weightedDot(), STK::weightedNormInf(), STK::weightedNormTwo(), STK::weightedNormTwo2(), STK::weightedSum(), and STK::ReadWriteCsv::write().
{ return range_.last();}
| Integer const& STK::ITContainer1D< TYPE, TContainer1D >::size | ( | ) | const [inline, virtual] |
Number of elements.
Implements STK::IContainer1D.
Definition at line 114 of file STK_ITContainer1D.h.
Referenced by STK::Svd::compU(), STK::heapSort(), STK::Law::MultivariateNormal< Container1D >::logLikelihood(), STK::Law::MultivariateNormal< Container1D >::lpdf(), STK::Stat::mean(), STK::Array1D< Real >::operator=(), STK::ArrayHo< Real >::operator=(), STK::ArrayHo< TYPE >::operator=(), STK::Array1D< Variable< String > >::operator=(), STK::RandBase::RandBase(), STK::Stat::Univariate< Real, TContainer1D >::setData(), STK::ReadWriteCsv::size(), STK::Funct::stirlingCoefficients(), STK::Category::toolCount(), STK::Stat::variance(), and STK::Stat::varianceWithFixedMean().
{ return range_.size();}
| Range const& STK::ITContainer1D< TYPE, TContainer1D >::range | ( | ) | const [inline, virtual] |
range of the container
Implements STK::IContainer1D.
Definition at line 119 of file STK_ITContainer1D.h.
Referenced by STK::applySort(), STK::ArrayHo< Real >::ArrayHo(), STK::ArrayHo< TYPE >::ArrayHo(), STK::Stat::center(), STK::Stat::covariance(), STK::Stat::covarianceWithFixedMean(), STK::heapSort(), STK::IArray1DBase< Range, Range, Array1D< Range > >::IArray1DBase(), STK::Qr::insertCol(), STK::RecursiveArray1D< Integer, Array1D< Integer > >::insertElt(), STK::ArrayHo< Real >::insertElt(), STK::ArrayHo< TYPE >::insertElt(), STK::Law::MultivariateNormal< Container1D >::lpdf(), STK::Stat::mean(), STK::mult(), STK::multLefTranspose(), STK::multLeftTranspose(), STK::Array1D< Real >::operator=(), STK::ArrayHo< Real >::operator=(), STK::ArrayHo< TYPE >::operator=(), STK::Array1D< Variable< String > >::operator=(), STK::Law::MultivariateNormal< Container1D >::pdf(), STK::Qr::pushBackCol(), STK::ITContainer2D< Real, ArrayHo< Real >, Array1D< Real >, MatrixUpperTriangular >::pushBackCol(), STK::Law::MultivariateNormal< Container1D >::rand(), STK::EigenvaluesSymmetric::run(), STK::Stat::Univariate< Real, TContainer1D >::setData(), STK::BSplineCoefficients::setData(), STK::Stat::standardize(), STK::IArray1DBase< Range, Range, Array1D< Range > >::swap(), STK::Stat::variance(), STK::Stat::varianceWithFixedMean(), STK::weightedDist(), STK::weightedDot(), STK::weightedNormInf(), STK::weightedNormTwo(), STK::weightedNormTwo2(), and STK::weightedSum().
{ return range_;}
| TYPE& STK::ITContainer1D< TYPE, TContainer1D >::elt | ( | Integer const & | pos | ) | [inline] |
Access to one element.
| pos | position of the element |
Reimplemented in STK::ArrayHo< Real >, STK::Array1D< Real >, STK::DataFrame, STK::Variable< TYPE >, STK::Array1D< TYPE >, STK::ArrayHo< TYPE >, STK::List1D< TYPE >, STK::Variable< String >, STK::Array1D< std::string >, STK::Array1D< Range >, STK::Array1D< Integer >, STK::Array1D< Variable< String > >, STK::List1D< Tool >, and STK::List1D< IVariable * >.
Definition at line 125 of file STK_ITContainer1D.h.
Referenced by STK::ITContainer1D< TYPE, List1D< TYPE > >::swap().
{ return this->asLeaf().elt(pos);}
| TYPE const& STK::ITContainer1D< TYPE, TContainer1D >::elt | ( | Integer const & | pos | ) | const [inline] |
Access to one element.
| pos | position of the element |
Reimplemented in STK::ArrayHo< Real >, STK::Array1D< Real >, STK::DataFrame, STK::Variable< TYPE >, STK::Array1D< TYPE >, STK::ArrayHo< TYPE >, STK::List1D< TYPE >, STK::Variable< String >, STK::Array1D< std::string >, STK::Array1D< Range >, STK::Array1D< Integer >, STK::Array1D< Variable< String > >, STK::List1D< Tool >, and STK::List1D< IVariable * >.
Definition at line 132 of file STK_ITContainer1D.h.
{ return this->asLeaf().elt(pos);}
| TContainer1D STK::ITContainer1D< TYPE, TContainer1D >::elt | ( | Range const & | I | ) | const [inline] |
Access to many elements.
| I | the range of the elements |
Reimplemented in STK::ArrayHo< Real >, STK::Array1D< Real >, STK::Variable< TYPE >, STK::Array1D< TYPE >, STK::ArrayHo< TYPE >, STK::List1D< TYPE >, STK::Variable< String >, STK::Array1D< std::string >, STK::Array1D< Range >, STK::Array1D< Integer >, STK::Array1D< Variable< String > >, STK::List1D< Tool >, and STK::List1D< IVariable * >.
Definition at line 139 of file STK_ITContainer1D.h.
{ return this->asLeaf().elt(I);}
| TYPE& STK::ITContainer1D< TYPE, TContainer1D >::operator[] | ( | Integer const & | pos | ) | [inline] |
Operator [] : access to one element.
| pos | position of the element |
Definition at line 146 of file STK_ITContainer1D.h.
{ return this->asLeaf().elt(pos);}
| TYPE const& STK::ITContainer1D< TYPE, TContainer1D >::operator[] | ( | Integer const & | pos | ) | const [inline] |
Operator [] : access to one element const.
| pos | position of the element |
Definition at line 153 of file STK_ITContainer1D.h.
{ return this->asLeaf().elt(pos);}
| TContainer1D STK::ITContainer1D< TYPE, TContainer1D >::operator[] | ( | Range const & | I | ) | const [inline] |
Operator [] : access to many elements.
| I | the range of the elements |
Definition at line 160 of file STK_ITContainer1D.h.
{ return this->asLeaf().elt(I);}
| void STK::ITContainer1D< TYPE, TContainer1D >::swap | ( | Integer const & | pos1, |
| Integer const & | pos2 | ||
| ) | [inline] |
Swap two elements of the container using default constructor of the class TYPE.
| pos1 | position of the first element |
| pos2 | position of the second element |
Reimplemented in STK::IArray1DBase< TYPE, PTRELT, TArray1D >, STK::List1D< TYPE >, STK::IArray1DBase< TYPE, TYPE *, ArrayHo< TYPE > >, STK::IArray1DBase< TYPE, TYPE, Array1D< TYPE > >, STK::IArray1DBase< Real, Real *, ArrayHo< Real > >, STK::IArray1DBase< TYPE, TYPE, Container1D >, STK::IArray1DBase< String, String, Variable< String > >, STK::IArray1DBase< Real, Real, Array1D< Real > >, STK::IArray1DBase< std::string, std::string, Array1D< std::string > >, STK::IArray1DBase< TYPE, TYPE, Variable< TYPE > >, STK::IArray1DBase< Variable< String >, Variable< String >, Array1D< Variable< String > > >, STK::IArray1DBase< Integer, Integer, Array1D< Integer > >, STK::IArray1DBase< Range, Range, Array1D< Range > >, STK::List1D< Tool >, and STK::List1D< IVariable * >.
Definition at line 168 of file STK_ITContainer1D.h.
{
#ifdef STK_BOUNDS_CHECK
// check indices
if (pos1<this->first())
{ throw std::out_of_range("ITContainer1D::swap(pos1, pos2) "
"pos1<this->first()");
}
if (pos1>this->last())
{ throw std::out_of_range("ITContainer1D::swap(pos1, pos2) "
"pos1>this->last()");
}
if (pos2<this->first())
{ throw std::out_of_range("ITContainer1D::swap(pos1, pos2) "
"pos2<this->first()");
}
if (pos2>this->last())
{ throw std::out_of_range("ITContainer1D::swap(pos1, pos2) "
"pos2>this->last()");
}
#endif
// swap
TYPE aux(this->asLeaf().elt(pos1));
this->asLeaf().elt(pos1) = this->asLeaf().elt(pos2);
this->asLeaf().elt(pos2) = aux;
}
| TYPE& STK::ITContainer1D< TYPE, TContainer1D >::at | ( | Integer const & | pos | ) | [inline] |
STL compatibility : return the element number pos.
| pos | position of the element |
Definition at line 199 of file STK_ITContainer1D.h.
Referenced by STK::ReadWriteCsv::at(), STK::ReadWriteCsv::back(), STK::ReadWriteCsv::data(), STK::ExportToCsv::ExportToCsv(), STK::ReadWriteCsv::firstVe(), STK::ReadWriteCsv::front(), STK::DataFrame::insertDataFrame(), STK::ReadWriteCsv::lastVe(), STK::ReadWriteCsv::name(), STK::ReadWriteCsv::operator()(), STK::operator>>(), STK::ReadWriteCsv::operator[](), STK::DataFrame::pushBackDataFrame(), STK::ReadWriteCsv::setData(), STK::ReadWriteCsv::setName(), STK::ReadWriteCsv::sizeVe(), and STK::ReadWriteCsv::writeSelection().
| TYPE const& STK::ITContainer1D< TYPE, TContainer1D >::at | ( | Integer const & | pos | ) | const [inline] |
STL compatibility : return the element number pos (const).
| pos | position of the element |
Definition at line 217 of file STK_ITContainer1D.h.
| TYPE& STK::ITContainer1D< TYPE, TContainer1D >::front | ( | ) | [inline] |
STL compatibility : return the first element.
Definition at line 234 of file STK_ITContainer1D.h.
Referenced by STK::Svd::bidiag(), STK::house(), STK::Qr::qr(), and STK::EigenvaluesSymmetric::tridiagonalize().
| TYPE const& STK::ITContainer1D< TYPE, TContainer1D >::front | ( | ) | const [inline] |
STL compatibility : return the first element (const).
Definition at line 240 of file STK_ITContainer1D.h.
| TYPE& STK::ITContainer1D< TYPE, TContainer1D >::back | ( | ) | [inline] |
STL compatibility : return the last element.
Definition at line 246 of file STK_ITContainer1D.h.
Referenced by STK::ReadWriteCsv::push_back(), and STK::EigenvaluesSymmetric::tridiagonalize().
| TYPE const& STK::ITContainer1D< TYPE, TContainer1D >::back | ( | ) | const [inline] |
STL compatibility : return the last element (const).
Definition at line 252 of file STK_ITContainer1D.h.
| void STK::ITContainer1D< TYPE, TContainer1D >::push_back | ( | TYPE const & | v | ) | [inline] |
STL compatibility : append an element v.
| v | value to append |
Definition at line 258 of file STK_ITContainer1D.h.
Referenced by STK::Category::addTool(), STK::ReadWriteCsv::appendData(), STK::Funct::coefs_odd_se(), STK::CountCols(), STK::ExportToCsv::ExportToCsv(), STK::ReadWriteCsv::operator+=(), STK::operator>>(), and STK::ReadWriteCsv::push_back().
| void STK::ITContainer1D< TYPE, TContainer1D >::push_front | ( | TYPE const & | v | ) | [inline] |
STL compatibility : push front an element.
| v | value to append |
Definition at line 267 of file STK_ITContainer1D.h.
Referenced by STK::ReadWriteCsv::push_front().
| void STK::ITContainer1D< TYPE, TContainer1D >::insert | ( | Range const & | I, |
| TYPE const & | v | ||
| ) | [inline] |
STL compatibility : insert n elements v in the range I.
| I | range of the element to insert |
| v | value to insert |
Reimplemented in STK::ArrayHo< TYPE >, STK::List1D< TYPE >, STK::List1D< Tool >, and STK::List1D< IVariable * >.
Definition at line 274 of file STK_ITContainer1D.h.
Referenced by STK::IArray2D< Integer, Array2D< Integer > >::insertCols(), and STK::ITContainer1D< TYPE, List1D< TYPE > >::push_front().
| void STK::ITContainer1D< TYPE, TContainer1D >::setRange | ( | Range const & | I = Range() | ) | [inline, protected] |
Set range of the rows of the container.
| I | the range to set (default empty) |
Definition at line 288 of file STK_ITContainer1D.h.
Referenced by STK::IArray1DBase< Range, Range, Array1D< Range > >::swap().
{ range_ = I;}
| void STK::ITContainer1D< TYPE, TContainer1D >::incRange | ( | Integer const & | inc = 1 | ) | [inline, protected] |
increment the range of the container (can be negative).
| inc | increment to apply to the range |
Definition at line 294 of file STK_ITContainer1D.h.
{ range_.inc(inc);}
| void STK::ITContainer1D< TYPE, TContainer1D >::incFirst | ( | Integer const & | inc = 1 | ) | [inline, protected] |
increment the beginning of the container (can be negative).
| inc | the increment to apply to the beginning of the range |
Definition at line 300 of file STK_ITContainer1D.h.
{ range_.incFirst(inc);}
| void STK::ITContainer1D< TYPE, TContainer1D >::decFirst | ( | Integer const & | inc = 1 | ) | [inline, protected] |
decrement the beginning of the container.
| inc | the decrement to apply to the beginning of the range |
Definition at line 306 of file STK_ITContainer1D.h.
{ range_.decFirst(inc);}
| void STK::ITContainer1D< TYPE, TContainer1D >::incLast | ( | Integer const & | inc = 1 | ) | [inline, protected] |
increment the end of the container (can be negative).
| inc | the increment to apply to the end of the range |
Definition at line 312 of file STK_ITContainer1D.h.
Referenced by STK::IArray2D< Integer, Array2D< Integer > >::insertRowsToCol(), and STK::IArray2D< Integer, Array2D< Integer > >::pushBackRowsToCol().
{ range_.incLast(inc);}
| void STK::ITContainer1D< TYPE, TContainer1D >::decLast | ( | Integer const & | inc = 1 | ) | [inline, protected] |
decrement the end of the container.
| inc | the decrement to apply to the end of the range |
Definition at line 318 of file STK_ITContainer1D.h.
Referenced by STK::IArray2D< Integer, Array2D< Integer > >::eraseRowsToCol(), and STK::IArray2D< Integer, Array2D< Integer > >::popBackRowsToCol().
{ range_.decLast(inc);}
Range STK::ITContainer1D< TYPE, TContainer1D >::range_ [protected] |
Range of the container.
Definition at line 283 of file STK_ITContainer1D.h.
Referenced by STK::ITContainer1D< TYPE, List1D< TYPE > >::decFirst(), STK::ITContainer1D< TYPE, List1D< TYPE > >::decLast(), STK::ITContainer1D< TYPE, List1D< TYPE > >::first(), STK::ITContainer1D< TYPE, List1D< TYPE > >::incFirst(), STK::ITContainer1D< TYPE, List1D< TYPE > >::incLast(), STK::ITContainer1D< TYPE, List1D< TYPE > >::incRange(), STK::ITContainer1D< TYPE, List1D< TYPE > >::ITContainer1D(), STK::ITContainer1D< TYPE, List1D< TYPE > >::last(), STK::ITContainer1D< TYPE, List1D< TYPE > >::range(), STK::ITContainer1D< TYPE, List1D< TYPE > >::setRange(), and STK::ITContainer1D< TYPE, List1D< TYPE > >::size().