STK++ 0.9.13
STK::ITContainer< Derived, Arrays::diagonal_ > Class Template Reference

Specialization for diagonal_. More...

#include <STK_ITContainer.h>

Inheritance diagram for STK::ITContainer< Derived, Arrays::diagonal_ >:
Inheritance graph

Public Types

enum  {
  structure_ = hidden::Traits<Derived>::structure_ , orient_ = hidden::Traits<Derived>::orient_ , sizeRows_ = hidden::Traits<Derived>::sizeRows_ , sizeCols_ = hidden::Traits<Derived>::sizeCols_ ,
  storage_ = hidden::Traits<Derived>::storage_
}
 
typedef ITContainerBase< Derived > Base
 
typedef hidden::Traits< Derived >::Type Type
 
typedef hidden::Traits< Derived >::TypeConst TypeConst
 
typedef TRange< sizeRows_RowRange
 Type of the Range for the rows.
 
typedef TRange< sizeCols_ColRange
 Type of the Range for the columns.
 
- Public Types inherited from STK::ITContainerBase< Derived >
enum  {
  structure_ = hidden::Traits<Derived>::structure_ , orient_ = hidden::Traits<Derived>::orient_ , sizeRows_ = hidden::Traits<Derived>::sizeRows_ , sizeCols_ = hidden::Traits<Derived>::sizeCols_ ,
  storage_ = hidden::Traits<Derived>::storage_
}
 
typedef IRecursiveTemplate< Derived > Base
 
typedef hidden::Traits< Derived >::Type Type
 
typedef hidden::Traits< Derived >::TypeConst TypeConst
 
typedef TRange< sizeRows_RowRange
 Type of the Range for the rows.
 
typedef TRange< sizeCols_ColRange
 Type of the Range for the columns.
 

Public Member Functions

RowRange constrange () const
 
int begin () const
 
int end () const
 
int size () const
 
int firstIdx () const
 
int lastIdx () const
 
Range rangeRowsInCol (int pos) const
 
Range rangeColsInRow (int pos) const
 
TypeConst front () const
 
TypeConst back () const
 
Typefront ()
 
Typeback ()
 
Type at (int i, int j) const
 
TypeConst at (int i) const
 
Typeat (int i, int j)
 
Typeat (int i)
 
- Public Member Functions inherited from STK::ITContainerBase< Derived >
ColRange constcols () const
 
int beginCols () const
 
int endCols () const
 
int sizeCols () const
 
RowRange constrows () const
 
int beginRows () const
 
int endRows () const
 
int sizeRows () const
 
int firstIdxCols () const
 
int firstIdxRows () const
 
int lastIdxCols () const
 
int lastIdxRows () const
 
RowRange constrangeRowsInCol (int) const
 
ColRange constrangeColsInRow (int) const
 
bool empty () const
 
int size () const
 
TypeConst elt (int i, int j) const
 
TypeConst elt (int i) const
 
TypeConst elt () const
 
Typeelt (int i, int j)
 
Typeelt (int i)
 
Typeelt ()
 
TypeConst at (int i, int j) const
 
TypeConst at (int i) const
 
Typeat (int i, int j)
 
Typeat (int i)
 
TypeConst operator() (int i, int j) const
 
Typeoperator() (int i, int j)
 
TypeConst operator[] (int i) const
 
Typeoperator[] (int i)
 
TypeConst operator() () const
 
Typeoperator() ()
 
- Public Member Functions inherited from STK::IRecursiveTemplate< Derived >
Derived & asDerived ()
 static cast : return a reference of this with a cast to the derived class.
 
Derived constasDerived () 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 constasPtrDerived () 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

 ITContainer ()
 default constructor.
 
 ~ITContainer ()
 destructor.
 
- Protected Member Functions inherited from STK::ITContainerBase< Derived >
 ITContainerBase ()
 Default constructor.
 
 ~ITContainerBase ()
 destructor.
 
- Protected Member Functions inherited from STK::IRecursiveTemplate< Derived >
 IRecursiveTemplate ()
 constructor.
 
 ~IRecursiveTemplate ()
 destructor.
 

Detailed Description

template<class Derived>
class STK::ITContainer< Derived, Arrays::diagonal_ >

Specialization for diagonal_.

Definition at line 760 of file STK_ITContainer.h.

Member Typedef Documentation

◆ Base

template<class Derived >
typedef ITContainerBase<Derived> STK::ITContainer< Derived, Arrays::diagonal_ >::Base

Definition at line 763 of file STK_ITContainer.h.

◆ ColRange

template<class Derived >
typedef TRange<sizeCols_> STK::ITContainer< Derived, Arrays::diagonal_ >::ColRange

Type of the Range for the columns.

Definition at line 777 of file STK_ITContainer.h.

◆ RowRange

template<class Derived >
typedef TRange<sizeRows_> STK::ITContainer< Derived, Arrays::diagonal_ >::RowRange

Type of the Range for the rows.

Definition at line 775 of file STK_ITContainer.h.

◆ Type

template<class Derived >
typedef hidden::Traits<Derived>::Type STK::ITContainer< Derived, Arrays::diagonal_ >::Type

Definition at line 764 of file STK_ITContainer.h.

◆ TypeConst

template<class Derived >
typedef hidden::Traits<Derived>::TypeConst STK::ITContainer< Derived, Arrays::diagonal_ >::TypeConst

Definition at line 765 of file STK_ITContainer.h.

Member Enumeration Documentation

◆ anonymous enum

template<class Derived >
anonymous enum
Enumerator
structure_ 
orient_ 
sizeRows_ 
sizeCols_ 
storage_ 

Definition at line 766 of file STK_ITContainer.h.

767 {
768 structure_ = hidden::Traits<Derived>::structure_,
769 orient_ = hidden::Traits<Derived>::orient_,
770 sizeRows_ = hidden::Traits<Derived>::sizeRows_,
771 sizeCols_ = hidden::Traits<Derived>::sizeCols_,
772 storage_ = hidden::Traits<Derived>::storage_
773 };

Constructor & Destructor Documentation

◆ ITContainer()

template<class Derived >
STK::ITContainer< Derived, Arrays::diagonal_ >::ITContainer ( )
inlineprotected

default constructor.

Definition at line 781 of file STK_ITContainer.h.

781: Base() {}

◆ ~ITContainer()

template<class Derived >
STK::ITContainer< Derived, Arrays::diagonal_ >::~ITContainer ( )
inlineprotected

destructor.

Definition at line 783 of file STK_ITContainer.h.

783{}

Member Function Documentation

◆ at() [1/4]

template<class Derived >
Type & STK::ITContainer< Derived, Arrays::diagonal_ >::at ( int  i)
inline
Returns
safely a reference on the element (i)
Note
this method is only valid for arrays as it allow to modify the element.
Parameters
iindex of the element

Definition at line 856 of file STK_ITContainer.h.

857 {
858 if (this->begin() > i) { STKOUT_OF_RANGE_1ARG(ITContainerBase::at, i, begin() > i);}
859 if (this->end() <= i) { STKOUT_OF_RANGE_1ARG(ITContainerBase::at, i, end() <= i);}
860 return this->asDerived().elt1Impl(i);
861 }
#define STKOUT_OF_RANGE_1ARG(Where, Arg, Error)
Definition STK_Macros.h:93
Derived & asDerived()
static cast : return a reference of this with a cast to the derived class.
TypeConst at(int i, int j) const

References STK::ITContainerBase< Derived >::at(), and STKOUT_OF_RANGE_1ARG.

◆ at() [2/4]

template<class Derived >
TypeConst STK::ITContainer< Derived, Arrays::diagonal_ >::at ( int  i) const
inline
Returns
safely the constant ith diagonal element.
Parameters
iindex of the diagonal element

Definition at line 830 of file STK_ITContainer.h.

831 {
832 if (this->begin() > i) { STKOUT_OF_RANGE_1ARG(ITContainer::at, i, begin() > i);}
833 if (this->lastIdx() < i) { STKOUT_OF_RANGE_1ARG(ITContainer::at, i, lastIdx() < i);}
834 return this->asDerived().elt1Impl(i);
835 }

References STKOUT_OF_RANGE_1ARG.

◆ at() [3/4]

template<class Derived >
Type & STK::ITContainer< Derived, Arrays::diagonal_ >::at ( int  i,
int  j 
)
inline
Returns
safely a reference on the element (i, j)
Note
this method is only valid for arrays as it allow to modify the element.
Parameters
i,jrow and column indexes

Definition at line 841 of file STK_ITContainer.h.

842 {
843 if (this->beginRows() > i){ STKOUT_OF_RANGE_2ARG(ITContainer::at, i, j, beginRows() > i);}
844 if (this->endRows() <= i) { STKOUT_OF_RANGE_2ARG(ITContainer::at, i, j, endRows() <= i);}
845 if (this->beginCols() > j){ STKOUT_OF_RANGE_2ARG(ITContainer::at, i, j, beginCols() > j);}
846 if (this->endCols() <= j) { STKOUT_OF_RANGE_2ARG(ITContainer::at, i, j, endCols() <= j);}
847 if (i != j)
848 { STKOUT_OF_RANGE_2ARG(ITContainer::at, i, j, i != j);}
849 return this->asDerived().elt2Impl(i,j);
850 }
#define STKOUT_OF_RANGE_2ARG(Where, Arg1, Arg2, Error)
Definition STK_Macros.h:102

References STKOUT_OF_RANGE_2ARG.

◆ at() [4/4]

template<class Derived >
Type STK::ITContainer< Derived, Arrays::diagonal_ >::at ( int  i,
int  j 
) const
inline
Returns
safely the constant element (i, j).
Parameters
i,jindexes of the rows and columns

Definition at line 819 of file STK_ITContainer.h.

820 {
821 if (this->beginRows() > i){ STKOUT_OF_RANGE_2ARG(ITContainer::at, i, j, beginRows() > i);}
822 if (this->endRows() <= i) { STKOUT_OF_RANGE_2ARG(ITContainer::at, i, j, endRows() <= i);}
823 if (this->beginCols() > j){ STKOUT_OF_RANGE_2ARG(ITContainer::at, i, j, beginCols() > j);}
824 if (this->endCols() <= j) { STKOUT_OF_RANGE_2ARG(ITContainer::at, i, j, endCols() <= j);}
825 return (i==j) ? this->asDerived().elt2Impl(i,j) : Type();
826 }

References STKOUT_OF_RANGE_2ARG.

◆ back() [1/2]

template<class Derived >
Type & STK::ITContainer< Derived, Arrays::diagonal_ >::back ( )
inline
Returns
the last element

Definition at line 814 of file STK_ITContainer.h.

814{ return this->elt(lastIdx());}
TypeConst elt() const

◆ back() [2/2]

template<class Derived >
TypeConst STK::ITContainer< Derived, Arrays::diagonal_ >::back ( ) const
inline
Returns
the last element

Definition at line 809 of file STK_ITContainer.h.

809{ return this->elt(lastIdx());}

◆ begin()

template<class Derived >
int STK::ITContainer< Derived, Arrays::diagonal_ >::begin ( ) const
inline
Returns
the index of the first element

Definition at line 789 of file STK_ITContainer.h.

789{ return range().begin();}

◆ end()

template<class Derived >
int STK::ITContainer< Derived, Arrays::diagonal_ >::end ( ) const
inline
Returns
the ending index of the elements

Definition at line 791 of file STK_ITContainer.h.

791{ return range().end();}

◆ firstIdx()

template<class Derived >
int STK::ITContainer< Derived, Arrays::diagonal_ >::firstIdx ( ) const
inline
Returns
the first index of the diagonal container

Definition at line 797 of file STK_ITContainer.h.

797{ return begin();}

◆ front() [1/2]

template<class Derived >
Type & STK::ITContainer< Derived, Arrays::diagonal_ >::front ( )
inline
Returns
the first element

Definition at line 812 of file STK_ITContainer.h.

◆ front() [2/2]

template<class Derived >
TypeConst STK::ITContainer< Derived, Arrays::diagonal_ >::front ( ) const
inline
Returns
the first element

Definition at line 807 of file STK_ITContainer.h.

807{ return this->elt(firstIdx());}

◆ lastIdx()

template<class Derived >
int STK::ITContainer< Derived, Arrays::diagonal_ >::lastIdx ( ) const
inline
Returns
the last index of the diagonal container.

Definition at line 799 of file STK_ITContainer.h.

799{ return end()-1;}

◆ range()

template<class Derived >
RowRange const & STK::ITContainer< Derived, Arrays::diagonal_ >::range ( ) const
inline
Returns
the range of the diagonal container.

Definition at line 787 of file STK_ITContainer.h.

787{ return this->rows();}
RowRange const & rows() const

◆ rangeColsInRow()

template<class Derived >
Range STK::ITContainer< Derived, Arrays::diagonal_ >::rangeColsInRow ( int  pos) const
inline
Returns
the Range of the row pos.

Definition at line 804 of file STK_ITContainer.h.

804{ return Range(pos,1);}
TRange< UnknownSize > Range
Definition STK_Range.h:59

◆ rangeRowsInCol()

template<class Derived >
Range STK::ITContainer< Derived, Arrays::diagonal_ >::rangeRowsInCol ( int  pos) const
inline
Returns
the Range of the column pos.

Definition at line 802 of file STK_ITContainer.h.

802{ return Range(pos,1);}

◆ size()

template<class Derived >
int STK::ITContainer< Derived, Arrays::diagonal_ >::size ( ) const
inline
Returns
the size of the vector

Definition at line 793 of file STK_ITContainer.h.

793{ return range().size();}

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