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

specialization for the vector_ case. More...

#include <STK_CAllocator.h>

Inheritance diagram for STK::StructuredCAllocator< Derived, SizeRows_, 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.
 
TypeConst elt1Impl (int i) const
 
Typeelt1Impl (int i)
 
void shift2Impl (int beginRows, int beginCols)
 shift the first indexes of the allocator
 
void shift1Impl (int beginRows)
 shift the first row index of the allocator.
 
Derived & resize1Impl (int sizeRow)
 resize the allocator.
 
template<int Size_>
CAllocator< Type, Size_, 1, orient_subVector (TRange< Size_ > const &I) const
 
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 nbRow, int)
 wrapper constructor for 0 based C-Array
 

Private Attributes

int col_
 

Detailed Description

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

specialization for the vector_ case.

Definition at line 689 of file STK_CAllocator.h.

Member Typedef Documentation

◆ Allocator

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

Definition at line 709 of file STK_CAllocator.h.

◆ Base

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

Definition at line 707 of file STK_CAllocator.h.

◆ Col

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

Definition at line 694 of file STK_CAllocator.h.

◆ ColRange

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

Type of the Range for the columns.

Definition at line 714 of file STK_CAllocator.h.

◆ LowBase

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

Definition at line 708 of file STK_CAllocator.h.

◆ Row

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

Definition at line 693 of file STK_CAllocator.h.

◆ RowRange

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

Type of the Range for the rows.

Definition at line 712 of file STK_CAllocator.h.

◆ Type

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

Definition at line 695 of file STK_CAllocator.h.

◆ TypeConst

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

Definition at line 696 of file STK_CAllocator.h.

Member Enumeration Documentation

◆ anonymous enum

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

Definition at line 698 of file STK_CAllocator.h.

699 {
700 structure_ = hidden::Traits<Derived>::structure_,
701 orient_ = hidden::Traits<Derived>::orient_,
702 sizeRows_ = hidden::Traits<Derived>::sizeRows_,
703 sizeCols_ = hidden::Traits<Derived>::sizeCols_,
704 sizeProd_ = hidden::Traits<Derived>::sizeProd_,
705 storage_ = hidden::Traits<Derived>::storage_
706 };

Constructor & Destructor Documentation

◆ StructuredCAllocator() [1/4]

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

Default constructor.

Definition at line 719 of file STK_CAllocator.h.

◆ StructuredCAllocator() [2/4]

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

copy constructor

Definition at line 721 of file STK_CAllocator.h.

721: Base(A, ref), col_(A.col_) {}

◆ StructuredCAllocator() [3/4]

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

Reference constructor.

Definition at line 724 of file STK_CAllocator.h.

726 : Base(A, I, J)
727 , col_(J.begin())
728 {}

◆ StructuredCAllocator() [4/4]

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

wrapper constructor for 0 based C-Array

Definition at line 730 of file STK_CAllocator.h.

730: Base(q, nbRow, 1), col_(0) {}

Member Function Documentation

◆ elt1Impl() [1/2]

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

Definition at line 746 of file STK_CAllocator.h.

746{ return this->elt2Impl(i, col_);}

◆ elt1Impl() [2/2]

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

Definition at line 742 of file STK_CAllocator.h.

742{ return this->elt2Impl(i, col_);}

◆ exchange()

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

exchange T with this.

Parameters
Tthe container to exchange

Definition at line 735 of file STK_CAllocator.h.

736 { Base::exchange(T);
737 std::swap(col_, T.col_);
738 }

◆ moveImpl()

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

move T to this.

Parameters
Tthe container to move

Definition at line 782 of file STK_CAllocator.h.

783 { col_ = T.col_;}

◆ resize1Impl()

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

resize the allocator.

Parameters
sizeRowthe size of the vector

Definition at line 767 of file STK_CAllocator.h.

768 {
769 this->asDerived().resize2Impl(sizeRow, 1);
770 col_ = this->beginCols();
771 return this->asDerived();
772 }

◆ shift1Impl()

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

shift the first row index of the allocator.

Parameters
beginRowsthe index of the first row

Definition at line 760 of file STK_CAllocator.h.

761 { shift2Impl(beginRows, beginRows);
762 col_ = beginRows;
763 }
void shift2Impl(int beginRows, int beginCols)
shift the first indexes of the allocator

◆ shift2Impl()

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

shift the first indexes of the allocator

Parameters
beginRows,beginColsindexes to set

Definition at line 750 of file STK_CAllocator.h.

751 {
752 if ((beginRows == this->beginRows())&&(beginCols == this->beginCols())) return;
753 LowBase::shift(beginRows, beginCols);
754 this->allocator_.shift(this->shiftInc(beginRows, beginCols));
755 col_ = beginCols;
756 }

◆ subVector()

template<class Derived , int SizeRows_>
template<int Size_>
CAllocator< Type, Size_, 1, orient_ > STK::StructuredCAllocator< Derived, SizeRows_, 1 >::subVector ( TRange< Size_ > const I) const
inline
Returns
a sub-vector in the specified range of the Allocator.
Parameters
Irange of the sub-vector

Definition at line 777 of file STK_CAllocator.h.

778 { return Base::template col<Size_>(I, col_);}
MultidimRegression(Array const *y=0, Array const *x=0)
Constructor.

Member Data Documentation

◆ col_

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

Definition at line 786 of file STK_CAllocator.h.


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