52template<
class Type>
class List1D;
179 for (
int j=T.
begin(); j<T.
end(); j++)
180 { (*p1) = pt1->
data();
194#ifdef STK_BOUNDS_CHECK
196 { STKOUT_OF_RANGE_1ARG(List1D::List1D,J,J.begin()<T.begin());}
198 { STKOUT_OF_RANGE_1ARG(List1D::List1D,J,J.lastIdx()>T.lastIdx());}
289 if ((J.
lastIdx()>this->lastIdx()))
295 return List1D(p_first, p_last, J);
302 if (
begin() == beg)
return;
307 int inc = beg -
begin();
316 if (this->
isRef())
return;
338 catch (std::bad_alloc & error)
342 for (
int j=2; j<=n; j++)
344 { p2 =
new Cell(p1);}
345 catch (std::bad_alloc & error)
381 if (other.
empty())
return;
401 const int first =
range.lastIdx() + 1;
430 for (
int j1=1; j1<=n; j1++)
434 { p2 =
new Cell(p1);}
435 catch (std::bad_alloc & error)
494 for (
int l=1; l<=n; l++)
521 void swap(
int const& j1,
int const& j2)
523#ifdef STK_BOUNDS_CHECK
558 for (
int j=1; j<=
size(); j++)
559 { (*p1) = pt1->data();
561 pt1 = pt1->getRight();
566 for (
int j=
size(); j>=1; j--)
567 { (*p1) = pt1->data();
569 pt1 = pt1->getLeft();
583 if ( this->
range() == I)
return *
this;
601 for (
int j=1; j<=
size(); j++)
627 { p2 =
new Cell(p1);}
628 catch (std::bad_alloc & error)
629 {
while (p1 != (
Cell*)NULL)
653 if (this->
isRef())
return;
In this file we define the main traits class we use for the STK++ Containers.
In this file we define utilities functions and enum for the Array classes.
In this file we implement the BiDirectionalIterator class.
This file define the cell classes for the list classes.
In this file we define and implement the DenseRandomIterator and ConstDenseRandomIterator classes.
This is an internal header file, included by other Containers library headers.
in this file we define the interface class ITContainer1D.
#define STKOUT_OF_RANGE_1ARG(Where, Arg, Error)
#define STKRUNTIME_ERROR_1ARG(Where, Arg, Error)
#define STKOUT_OF_RANGE_2ARG(Where, Arg1, Arg2, Error)
#define STKRUNTIME_ERROR_NO_ARG(Where, Error)
#define STKRUNTIME_ERROR_2ARG(Where, Arg1, Arg2, Error)
This file include all the header files of the project STKernel.
Type const & data() const
void setData(Type const &data)
Set data.
template class for the Horizontal Cell of a Horizontal List.
void setRight(CellHo< Type > *right)
Set the right cell adress.
void setLeft(CellHo< Type > *left)
Set the left cell adress.
CellHo< Type > * getRight() const
Give the adress of the cell right.
CellHo< Type > * getLeft() const
Give the adress of the cell left.
List1D< Type_ > & resize(Range const &I=RowRange())
void setRange(RowRange const &I=RowRange())
RowRange const & range() const
template One dimensional Horizontal List.
ReverseIterator reverse_iterator
hidden::Traits< List1D< IVariable * > >::ConstReverseIterator ConstReverseIterator
void pushBack(int const &n=1)
Add n Elts to the container.
List1D(List1D< Type > const &T, Range const &J, bool ref=true)
access to many elements.
List1D subImpl(Range const &J) const
access to many elements.
List1D(Range const &I, Type const &v)
Misc constructor, initialization with a constant.
List1D< Type > & operator=(Type const &v)
operator= : set the container to a constant value.
hidden::Traits< List1D< IVariable * > >::ReverseIterator ReverseIterator
void erase(int pos, int const &n=1)
Delete n elts at the pos index to the container.
List1D(List1D< Type > const &T)
Copy constructor.
hidden::Traits< List1D< IVariable * > >::RowRange RowRange
void setDefault()
set members values to default.
Type & elt1Impl(int pos)
access to one element.
void moveCurrentPosition(int pos) const
Move the current position to pos.
hidden::Traits< List1D< IVariable * > >::TypeConst TypeConst
void shiftImpl(int const &beg)
New first index for the object.
ConstReverseIterator const_reverse_iterator
void moveCurrentPositionRight() const
move CurrentPositionent position to right
hidden::Traits< List1D< IVariable * > >::ConstIterator ConstIterator
void initialize(Range const &I)
Protected function for initialization.
void merge(List1D const &other)
merge this with other.
ConstIterator const_iterator
List1D & operator=(const List1D &T)
operator = : overwrite the List1D with T.
hidden::Traits< List1D< IVariable * > >::Type Type
void insertElt(int pos, int const &n=1)
Insert n elts at the position pos of the container.
Type const & elt1Impl(int pos) const
access to one element const.
ITContainer1D< List1D< Type > > Base
hidden::Traits< List1D< IVariable * > >::Iterator Iterator
List1D< Type > & resizeImpl(Range const &I)
Resize the container.
void insert(Range const &I, Type const &v)
Insert element v in the range I of the List1D.
List1D()
Default constructor : empty List.
void moveCurrentPositionLeft() const
Move CurrentPositionent position to left.
void popBack(int const &n=1)
Delete n last elements of the container.
List1D(Range const &I)
constructor with specified Range.
Cell const *const p_lastIdx() const
void clear()
Clear the object.
void freeMem()
Protected function for deallocation.
RowRange const & rows() const
List1D(Cell *const &p_first, Cell *const &p_last, Range const &J)
constructor by reference, ref_=1.
hidden::Traits< List1D< IVariable * > >::ColRange ColRange
void swap(int const &j1, int const &j2)
Swapping the j1th column and the j2th column.
Cell const *const p_begin() const
int begin() const
get the first index of the TRange.
TRange & incLast(int inc=1)
create the TRange [begin_, end_+inc)
int lastIdx() const
get the last index of the TRange.
int size() const
get the size of the TRange (the number of elements).
Index sub-vector region with fixed size.
@ dense_
dense matrix/vector/array/expression
@ point_
row oriented vector/array/expression
const int UnknownSize
This value means that an integer is not known at compile-time, and that instead the value is stored i...
const int baseIdx
base index of the containers created in STK++.
The hidden namespace enclose the classes and methods which are used internally by the STK++ classes.
The namespace STK is the main domain space of the Statistical ToolKit project.
TRange< UnknownSize > Range
BiDirectionalIterator allows to loop over the element of one dimensional list containers.
ConstBiDirectionalIterator allows to loop over the element of one dimensional list containers.
void setRef(bool ref) const
Modify the container : can become a reference or the owner of the data.
std::remove_const< typenamestd::remove_reference< Type_ >::type >::type Type
BiDirectionalIterator< List1D< Type_ > > Iterator
List1D< Type_ > SubVector
RemoveConst< Type_ >::Type const & TypeConst
std::reverse_iterator< ConstIterator > ConstReverseIterator
std::reverse_iterator< Iterator > ReverseIterator
ConstBiDirectionalIterator< List1D< Type_ > > ConstIterator