STK++ 0.9.13
STK::StructuredCAllocator< Derived, 1, 1 > Class Template Reference

specialization for the number_ case. More...

#include <STK_CAllocator.h>

Inheritance diagram for STK::StructuredCAllocator< Derived, 1, 1 >:
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_ ,
  sizeProd_ = hidden::Traits<Derived>::sizeProd_ , storage_ = hidden::Traits<Derived>::storage_
}
 
typedef hidden::Traits< Derived >::Row Row
 
typedef hidden::Traits< Derived >::Col Col
 
typedef hidden::Traits< Derived >::Type Type
 
typedef hidden::Traits< Derived >::TypeConst TypeConst
 
typedef OrientedCAllocator< Derived, orient_Base
 
typedef IContainer2D< sizeRows_, sizeCols_LowBase
 
typedef hidden::Traits< Derived >::Allocator Allocator
 
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

void exchange (StructuredCAllocator &T)
 exchange T with this.
 
int size () const
 
TypeConst elt0Impl () const
 
Typeelt0Impl ()
 
TypeConst elt1Impl (int) const
 
Typeelt1Impl (int)
 
void shift2Impl (int beginRows, int beginCols)
 shift the first indexes of the allocator
 
void shift1Impl (int begin)
 shift the first indexes of the allocator.
 
Derived & resize1Impl (int)
 resize the allocator (for square and diagonal matrices).
 
void moveImpl (StructuredCAllocator const &T)
 move T to this.
 

Protected Member Functions

 StructuredCAllocator (RowRange const &I, ColRange const &J)
 Default constructor.
 
 StructuredCAllocator (StructuredCAllocator const &A, bool ref)
 copy constructor
 
template<class OtherDerived , int OtherRows_, int OtherCols_>
 StructuredCAllocator (StructuredCAllocator< OtherDerived, OtherRows_, OtherCols_ > const &A, RowRange const &I, ColRange const &J)
 Reference constructor.
 
 StructuredCAllocator (Type *const &q, int, int)
 wrapper constructor for 0 based C-Array
 
 ~StructuredCAllocator ()
 destructor
 
StructuredCAllocatormove (StructuredCAllocator const &T)
 move T to this.
 

Private Attributes

int row_
 
int col_
 

Detailed Description

template<class Derived>
class STK::StructuredCAllocator< Derived, 1, 1 >

specialization for the number_ case.

Definition at line 794 of file STK_CAllocator.h.

Member Typedef Documentation

◆ Allocator

template<class Derived >
typedef hidden::Traits<Derived>::Allocator STK::StructuredCAllocator< Derived, 1, 1 >::Allocator

Definition at line 814 of file STK_CAllocator.h.

◆ Base

template<class Derived >
typedef OrientedCAllocator<Derived, orient_> STK::StructuredCAllocator< Derived, 1, 1 >::Base

Definition at line 812 of file STK_CAllocator.h.

◆ Col

template<class Derived >
typedef hidden::Traits<Derived>::Col STK::StructuredCAllocator< Derived, 1, 1 >::Col

Definition at line 799 of file STK_CAllocator.h.

◆ ColRange

template<class Derived >
typedef TRange<sizeCols_> STK::StructuredCAllocator< Derived, 1, 1 >::ColRange

Type of the Range for the columns.

Definition at line 819 of file STK_CAllocator.h.

◆ LowBase

template<class Derived >
typedef IContainer2D<sizeRows_, sizeCols_> STK::StructuredCAllocator< Derived, 1, 1 >::LowBase

Definition at line 813 of file STK_CAllocator.h.

◆ Row

template<class Derived >
typedef hidden::Traits<Derived>::Row STK::StructuredCAllocator< Derived, 1, 1 >::Row

Definition at line 798 of file STK_CAllocator.h.

◆ RowRange

template<class Derived >
typedef TRange<sizeRows_> STK::StructuredCAllocator< Derived, 1, 1 >::RowRange

Type of the Range for the rows.

Definition at line 817 of file STK_CAllocator.h.

◆ Type

template<class Derived >
typedef hidden::Traits<Derived>::Type STK::StructuredCAllocator< Derived, 1, 1 >::Type

Definition at line 800 of file STK_CAllocator.h.

◆ TypeConst

template<class Derived >
typedef hidden::Traits<Derived>::TypeConst STK::StructuredCAllocator< Derived, 1, 1 >::TypeConst

Definition at line 801 of file STK_CAllocator.h.

Member Enumeration Documentation

◆ anonymous enum

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

Definition at line 803 of file STK_CAllocator.h.

804 {
805 structure_ = hidden::Traits<Derived>::structure_,
806 orient_ = hidden::Traits<Derived>::orient_,
807 sizeRows_ = hidden::Traits<Derived>::sizeRows_,
808 sizeCols_ = hidden::Traits<Derived>::sizeCols_,
809 sizeProd_ = hidden::Traits<Derived>::sizeProd_,
810 storage_ = hidden::Traits<Derived>::storage_
811 };

Constructor & Destructor Documentation

◆ StructuredCAllocator() [1/4]

template<class Derived >
STK::StructuredCAllocator< Derived, 1, 1 >::StructuredCAllocator ( RowRange const I,
ColRange const J 
)
inlineprotected

Default constructor.

Definition at line 823 of file STK_CAllocator.h.

◆ StructuredCAllocator() [2/4]

template<class Derived >
STK::StructuredCAllocator< Derived, 1, 1 >::StructuredCAllocator ( StructuredCAllocator< Derived, 1, 1 > const A,
bool  ref 
)
inlineprotected

copy constructor

Definition at line 827 of file STK_CAllocator.h.

828 : Base(A, ref), row_(A.row_), col_(A.col_)
829 {}

◆ StructuredCAllocator() [3/4]

template<class Derived >
template<class OtherDerived , int OtherRows_, int OtherCols_>
STK::StructuredCAllocator< Derived, 1, 1 >::StructuredCAllocator ( StructuredCAllocator< OtherDerived, OtherRows_, OtherCols_ > const A,
RowRange const I,
ColRange const J 
)
inlineprotected

Reference constructor.

Definition at line 832 of file STK_CAllocator.h.

834 : Base(A, I, J)
835 , row_(I.begin()), col_(J.begin())
836 {}

◆ StructuredCAllocator() [4/4]

template<class Derived >
STK::StructuredCAllocator< Derived, 1, 1 >::StructuredCAllocator ( Type *const q,
int  ,
int   
)
inlineprotected

wrapper constructor for 0 based C-Array

Definition at line 838 of file STK_CAllocator.h.

838: Base(q, 1, 1), row_(0), col_(0) {}

◆ ~StructuredCAllocator()

template<class Derived >
STK::StructuredCAllocator< Derived, 1, 1 >::~StructuredCAllocator ( )
inlineprotected

destructor

Definition at line 840 of file STK_CAllocator.h.

840{}

Member Function Documentation

◆ elt0Impl() [1/2]

template<class Derived >
Type & STK::StructuredCAllocator< Derived, 1, 1 >::elt0Impl ( )
inline
Returns
a reference on the element of the Allocator.

Definition at line 862 of file STK_CAllocator.h.

862{ return this->elt2Impl(row_, col_);}

◆ elt0Impl() [2/2]

template<class Derived >
TypeConst STK::StructuredCAllocator< Derived, 1, 1 >::elt0Impl ( ) const
inline
Returns
a constant reference on the element of the Allocator.

Definition at line 860 of file STK_CAllocator.h.

860{ return this->elt2Impl(row_, col_);}

◆ elt1Impl() [1/2]

template<class Derived >
Type & STK::StructuredCAllocator< Derived, 1, 1 >::elt1Impl ( int  )
inline
Returns
a reference on the element of the Allocator.

Definition at line 866 of file STK_CAllocator.h.

866{ return this->elt2Impl(row_, col_);}

◆ elt1Impl() [2/2]

template<class Derived >
TypeConst STK::StructuredCAllocator< Derived, 1, 1 >::elt1Impl ( int  ) const
inline
Returns
a constant reference on the element of the Allocator.

Definition at line 864 of file STK_CAllocator.h.

864{ return this->elt2Impl(row_, col_);}

◆ exchange()

template<class Derived >
void STK::StructuredCAllocator< Derived, 1, 1 >::exchange ( StructuredCAllocator< Derived, 1, 1 > &  T)
inline

exchange T with this.

Parameters
Tthe container to exchange

Definition at line 851 of file STK_CAllocator.h.

852 { Base::exchange(T);
853 std::swap(row_, T.row_);
854 std::swap(col_, T.col_);
855 }

◆ move()

template<class Derived >
StructuredCAllocator & STK::StructuredCAllocator< Derived, 1, 1 >::move ( StructuredCAllocator< Derived, 1, 1 > const T)
inlineprotected

move T to this.

Parameters
Tthe container to move

Definition at line 844 of file STK_CAllocator.h.

845 { row_ = T.row_; col_ = T.col_; return *this;}

◆ moveImpl()

template<class Derived >
void STK::StructuredCAllocator< Derived, 1, 1 >::moveImpl ( StructuredCAllocator< Derived, 1, 1 > const T)
inline

move T to this.

Parameters
Tthe container to move

Definition at line 892 of file STK_CAllocator.h.

892{ row_ = T.row_; col_ = T.col_;}

◆ resize1Impl()

template<class Derived >
Derived & STK::StructuredCAllocator< Derived, 1, 1 >::resize1Impl ( int  )
inline

resize the allocator (for square and diagonal matrices).

Definition at line 888 of file STK_CAllocator.h.

888{ return this->asDerived().resize2Impl(1, 1);}

◆ shift1Impl()

template<class Derived >
void STK::StructuredCAllocator< Derived, 1, 1 >::shift1Impl ( int  begin)
inline

shift the first indexes of the allocator.

Parameters
beginthe index of the first row and column

Definition at line 882 of file STK_CAllocator.h.

883 {
884 this->shift2Impl(begin, begin);
885 row_ = begin; col_ = begin;
886 }
void shift2Impl(int beginRows, int beginCols)
shift the first indexes of the allocator

◆ shift2Impl()

template<class Derived >
void STK::StructuredCAllocator< Derived, 1, 1 >::shift2Impl ( int  beginRows,
int  beginCols 
)
inline

shift the first indexes of the allocator

Parameters
beginRows,beginColsindexes to set

Definition at line 871 of file STK_CAllocator.h.

872 {
873 if ((beginRows == this->beginRows())&&(beginCols == this->beginCols())) return;
874 LowBase::shift(beginRows, beginCols);
875 this->allocator_.shift(this->shiftInc(beginRows, beginCols));
876 row_ = beginRows;
877 col_ = beginCols;
878 }

◆ size()

template<class Derived >
int STK::StructuredCAllocator< Derived, 1, 1 >::size ( ) const
inline
Returns
the size of the allocator

Definition at line 857 of file STK_CAllocator.h.

857{ return 1;}

Member Data Documentation

◆ col_

template<class Derived >
int STK::StructuredCAllocator< Derived, 1, 1 >::col_
private

Definition at line 896 of file STK_CAllocator.h.

◆ row_

template<class Derived >
int STK::StructuredCAllocator< Derived, 1, 1 >::row_
private

Definition at line 895 of file STK_CAllocator.h.


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