Index sub-vector region. More...
#include <STK_Inx.h>
Public Member Functions | |
| Inx (const Integer &last=0) | |
| Default Ctor. | |
| Inx (const Integer &first, const Integer &last) | |
| Complete Ctor. | |
| Inx (const Inx &I) | |
| Copy Ctor. | |
| ~Inx () | |
| Integer | first () const |
| Return the beginning of the Inx. | |
| Integer | last () const |
| Return the end ot the Inx. | |
| Integer | size () const |
| Return the size of the Inx. | |
| bool | empty () const |
| Return true if n<=0. | |
| Integer | begin () const |
| STL compatibility : Return the beginning of the Inx. | |
| Integer | end () const |
| STL compatibility : Return the strict end of the Inx. | |
| bool | isIncludeIn (const Inx &I) const |
| bool | isContaining (const Inx &I) const |
| bool | isContaining (const Integer &i) const |
| bool | operator== (const Inx &I) const |
| bool | operator!= (const Inx &I) const |
| Inx & | set (const Integer &first=1, const Integer &last=0) |
| Set dimensions of the Index. | |
| Inx & | shift (const Integer &first=1) |
| create the Inx [first, first+size_]. | |
| Inx & | inc (const Integer &inc=1) |
| create the Inx [first_+inc, last_+inc_]. | |
| Inx & | incFirst (const Integer &inc=1) |
| create the Inx [first_+inc, last_]. | |
| Inx & | incLast (const Integer &inc=1) |
| create the Inx [first_, last_+inc]. | |
| Inx & | dec (const Integer &dec=1) |
| create the Inx [first_-dec, last_-dec]. | |
| Inx & | decFirst (const Integer &dec=1) |
| create the Inx [first_-dec, last_]. | |
| Inx & | decLast (const Integer &dec=1) |
| create the Inx [first_, last_-dec]. | |
| Inx & | sup (const Inx &I) |
| compute sup(this,J) | |
| Inx & | inf (const Inx &I) |
| compute inf(this,J) | |
| Inx & | operator+= (const Integer &inc) |
| same as inc() | |
| Inx & | operator-= (const Integer &dec) |
| same as dec() | |
| Inx | operator+ (const Integer &inc) const |
| return an Index applying inc() to this | |
| Inx | operator- (const Integer &dec) const |
| return an Index applying dec() to this | |
Static Public Member Functions | |
| static Inx | sup (const Inx &I, const Inx &J) |
| compute sup(I,J) | |
| static Inx | inf (const Inx &I, const Inx &J) |
| compute inf(I,J)I | |
Private Attributes | |
| Integer | first_ |
| First index. | |
| Integer | last_ |
| Last index. | |
| Integer | size_ |
| Theoretic Dimension size_ = last_- first_ +1. | |
Friends | |
| ostream & | operator<< (ostream &s, const Inx &I) |
| Print a Inx. | |
An Inx is an ordered pair [first,last] denoting a sub-vector region, similar to a Fortran 90 or Matlab colon notation. For example :
overwrite the elements 2, 3 and 4 of A by the elements 0, 1 and 2 of B. There is no stride argument, only contiguous regions are allowed.
Definition at line 68 of file STK_Inx.h.
| STK::Inx::Inx | ( | const Integer & | last = 0 |
) |
The Default Ctor. Assume the beginning of the sub-region is 1.
| last | the end of the sub-region. |
Definition at line 51 of file STK_Inx.cpp.
Referenced by inf(), operator+(), operator-(), and sup().
| first | is the beginning of the sub-region | |
| last | is the end of the sub-region. |
Complete Ctor. We have to give the beginning and the end of the sub-region.
| first | the beginning of the sub-region | |
| last | the end of the sub-region. |
Definition at line 62 of file STK_Inx.cpp.
| STK::Inx::Inx | ( | const Inx & | I | ) |
| STK::Inx::~Inx | ( | ) |
| Integer STK::Inx::first | ( | ) | const [inline] |
Definition at line 98 of file STK_Inx.h.
References first_.
Referenced by STK::Array2D< Real >::Array2D(), STK::Array2D< Integer >::Array2D(), STK::ITContainer2D< TYPE, TContainerHo, TContainerVe, TContainer2D >::at(), STK::ITContainer2D< TYPE, TContainerHo, TContainerVe, TContainer2D >::atCol(), STK::ITContainer2D< TYPE, TContainerHo, TContainerVe, TContainer2D >::atRow(), STK::ITContainer1D< TYPE, TContainer1D >::begin(), STK::LocalVariance::computeAxis(), STK::ITContainer1D< TYPE, TContainer1D >::erase(), STK::ITContainer1D< TYPE, TContainer1D >::first(), STK::IContainer2D< DataFrame >::firstCol(), STK::IContainer2D< DataFrame >::firstRow(), STK::ArrayHo< Real >::freeElts(), STK::ArrayHo< TYPE >::freeElts(), STK::Array1D< TYPE >::getElt(), STK::IArray1DBase< Integer, Integer, Array1D< Integer > >::IArray1DBase(), STK::IArray2DBase< Real, Real *, ArrayHo< Real >, Array1D< Real >, MatrixUpperTriangular >::IArray2DBase(), STK::ArrayHo< Real >::initElts(), STK::ArrayHo< TYPE >::initElts(), STK::IArray2DBase< Real, Real *, ArrayHo< Real >, Array1D< Real >, MatrixUpperTriangular >::initHo(), STK::ITContainer1D< TYPE, TContainer1D >::insert(), STK::MatrixLowerTriangular::MatrixLowerTriangular(), STK::MatrixUpperTriangular::MatrixUpperTriangular(), operator!=(), and operator==().
00098 { return first_;};
| Integer STK::Inx::last | ( | ) | const [inline] |
Definition at line 101 of file STK_Inx.h.
References last_.
Referenced by STK::Array2D< Real >::Array2D(), STK::Array2D< Integer >::Array2D(), STK::ITContainer2D< TYPE, TContainerHo, TContainerVe, TContainer2D >::at(), STK::ITContainer2D< TYPE, TContainerHo, TContainerVe, TContainer2D >::atCol(), STK::ITContainer2D< TYPE, TContainerHo, TContainerVe, TContainer2D >::atRow(), STK::LocalVariance::computeAxis(), STK::ArrayHo< Real >::freeElts(), STK::ArrayHo< TYPE >::freeElts(), STK::Array1D< TYPE >::getElt(), STK::IArray2DBase< Real, Real *, ArrayHo< Real >, Array1D< Real >, MatrixUpperTriangular >::IArray2DBase(), STK::ArrayHo< Real >::initElts(), STK::ArrayHo< TYPE >::initElts(), STK::ITContainer1D< TYPE, TContainer1D >::insert(), STK::ITContainer1D< TYPE, TContainer1D >::last(), STK::IContainer2D< DataFrame >::lastCol(), STK::IContainer2D< DataFrame >::lastRow(), STK::MatrixLowerTriangular::MatrixLowerTriangular(), STK::MatrixUpperTriangular::MatrixUpperTriangular(), operator!=(), and operator==().
00101 { return last_;};
| Integer STK::Inx::size | ( | ) | const [inline] |
Definition at line 104 of file STK_Inx.h.
References size_.
Referenced by STK::ITContainer1D< TYPE, TContainer1D >::erase(), STK::IArray2DBase< Real, Real *, ArrayHo< Real >, Array1D< Real >, MatrixUpperTriangular >::initHo(), STK::ITContainer1D< TYPE, TContainer1D >::insert(), STK::ITContainer1D< TYPE, TContainer1D >::size(), STK::IContainer2D< DataFrame >::sizeHo(), and STK::IContainer2D< DataFrame >::sizeVe().
00104 { return size_;};
| bool STK::Inx::empty | ( | ) | const [inline] |
Definition at line 107 of file STK_Inx.h.
References size_.
Referenced by STK::ITContainer1D< TYPE, TContainer1D >::empty(), and STK::IContainer2D< DataFrame >::empty().
00107 { return size_<=0;};
| Integer STK::Inx::begin | ( | ) | const [inline] |
| Integer STK::Inx::end | ( | ) | const [inline] |
Definition at line 113 of file STK_Inx.h.
References last_.
Referenced by STK::ITContainer1D< TYPE, TContainer1D >::end().
00113 { return last_+1;};
| bool STK::Inx::isIncludeIn | ( | const Inx & | I | ) | const [inline] |
| bool STK::Inx::isContaining | ( | const Inx & | I | ) | const [inline] |
| bool STK::Inx::isContaining | ( | const Integer & | i | ) | const [inline] |
| bool STK::Inx::operator== | ( | const Inx & | I | ) | const [inline] |
| bool STK::Inx::operator!= | ( | const Inx & | I | ) | const [inline] |
Shift the Inx giving the first element : the size is not modified.
| first | new value of the first element |
Definition at line 97 of file STK_Inx.cpp.
Referenced by STK::IContainer2D< DataFrame >::setFirstHo(), and STK::IContainer2D< DataFrame >::setFirstVe().
Increase first_ and last_
| inc | the increment to apply |
Definition at line 105 of file STK_Inx.cpp.
Referenced by STK::ITContainer1D< TYPE, TContainer1D >::incRange(), STK::IContainer2D< DataFrame >::incRangeHo(), STK::IContainer2D< DataFrame >::incRangeVe(), and shift().
Increase first_
| inc | the increment to apply |
Definition at line 114 of file STK_Inx.cpp.
Referenced by STK::Svd::bidiag(), STK::ITContainer1D< TYPE, TContainer1D >::incFirst(), STK::IContainer2D< DataFrame >::incFirstHo(), STK::IContainer2D< DataFrame >::incFirstVe(), and STK::Eigenvalues::tridiag().
Increase last_
| inc | the increment to apply |
Definition at line 123 of file STK_Inx.cpp.
Referenced by STK::ITContainer1D< TYPE, TContainer1D >::incLast(), STK::IContainer2D< DataFrame >::incLastHo(), STK::IContainer2D< DataFrame >::incLastVe(), STK::Array1D< Real >::insertElts(), STK::ArrayHo< Real >::insertElts(), STK::ArrayHo< TYPE >::insertElts(), and STK::Array1D< TYPE >::insertElts().
Decrease first_ and last_
| dec | the decrement to apply |
Definition at line 133 of file STK_Inx.cpp.
Referenced by STK::IContainer2D< DataFrame >::decRangeHo(), and STK::IContainer2D< DataFrame >::decRangeVe().
Decrease first_
| dec | the decrement to apply |
Definition at line 142 of file STK_Inx.cpp.
Referenced by STK::Svd::compV(), STK::ITContainer1D< TYPE, TContainer1D >::decFirst(), STK::IContainer2D< DataFrame >::decFirstHo(), and STK::IContainer2D< DataFrame >::decFirstVe().
Decrease last_
| dec | the decrement to apply |
Definition at line 151 of file STK_Inx.cpp.
Referenced by STK::ITContainer1D< TYPE, TContainer1D >::decLast(), STK::IContainer2D< DataFrame >::decLastHo(), and STK::IContainer2D< DataFrame >::decLastVe().
Take the lowest value of first_ and I.first_ for first_ and the largest value of last_ and I.last_ for last_.
| I | the index to apply |
Definition at line 162 of file STK_Inx.cpp.
References first_, last_, STK::max(), STK::min(), and size_.
Referenced by STK::IContainer2D< DataFrame >::supHo(), and STK::IContainer2D< DataFrame >::supve().
Take the largest value of first_ and I.first_ for first_ and the lowest value of last_ and I.last_ for last_.
| I | the index to apply |
Definition at line 174 of file STK_Inx.cpp.
References first_, last_, STK::max(), STK::min(), and size_.
Referenced by STK::MatrixUpperTriangular::getCol(), STK::MatrixLowerTriangular::getCol(), STK::MatrixUpperTriangular::getRow(), STK::MatrixLowerTriangular::getRow(), STK::IArray2DBase< Real, Real *, ArrayHo< Real >, Array1D< Real >, MatrixUpperTriangular >::IArray2DBase(), STK::IContainer2D< DataFrame >::infHo(), and STK::IContainer2D< DataFrame >::infVe().
Take the lowest value of I.first_ and J.first_ for first_ and the largest value of I.last_ and J.last_ for last_.
| I | first the index to apply | |
| J | second the index to apply |
Definition at line 186 of file STK_Inx.cpp.
References first_, Inx(), last_, STK::max(), and STK::min().
Take the largest value of I.first_ and J.first_ for first_ and the lowest value of I.last_ and J.last_ for last_.
| I | first the index to apply | |
| J | second the index to apply |
Definition at line 196 of file STK_Inx.cpp.
References first_, Inx(), last_, STK::max(), and STK::min().
Print a Inx using the colon notation.
| s | output stream | |
| I | the Inx to write |
Definition at line 232 of file STK_Inx.cpp.
Integer STK::Inx::first_ [private] |
Definition at line 71 of file STK_Inx.h.
Referenced by begin(), dec(), decFirst(), first(), inc(), incFirst(), inf(), isContaining(), isIncludeIn(), operator!=(), operator+(), operator+=(), operator-(), operator-=(), STK::operator<<(), operator==(), set(), shift(), and sup().
Integer STK::Inx::last_ [private] |
Definition at line 72 of file STK_Inx.h.
Referenced by dec(), decLast(), end(), inc(), incLast(), inf(), isContaining(), isIncludeIn(), last(), operator!=(), operator+(), operator+=(), operator-(), operator-=(), STK::operator<<(), operator==(), set(), and sup().
Integer STK::Inx::size_ [private] |
1.6.3