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

specialization for the point_ case (derived class is a RowVector). More...

#include <STK_CAllocator.h>

Inheritance diagram for STK::StructuredCAllocator< Derived, 1, SizeCols_ >:
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.
 
typedef TRange< sizeProd_AllocatorRange
 Type of the Range for the allocator.
 

Public Member Functions

void exchange (StructuredCAllocator &T)
 exchange T with this.
 
TypeConst elt1Impl (int j) const
 
Typeelt1Impl (int j)
 
void shift2Impl (int beginRows, int beginCols)
 shift the first indexes of the allocator
 
void shift1Impl (int beginCols)
 shift the first column index of the allocator.
 
Derived & resize1Impl (int sizeCols)
 resize the allocator.
 
template<int Size_>
CAllocator< Type, 1, Size_, orient_subVector (TRange< Size_ > const &J) 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, int nbCol)
 wrapper constructor for 0 based C-Array
 

Private Attributes

int row_
 row of the point (needed when this is a reference)
 

Detailed Description

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

specialization for the point_ case (derived class is a RowVector).

Definition at line 585 of file STK_CAllocator.h.

Member Typedef Documentation

◆ Allocator

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

Definition at line 605 of file STK_CAllocator.h.

◆ AllocatorRange

template<class Derived , int SizeCols_>
typedef TRange<sizeProd_> STK::StructuredCAllocator< Derived, 1, SizeCols_ >::AllocatorRange

Type of the Range for the allocator.

Definition at line 612 of file STK_CAllocator.h.

◆ Base

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

Definition at line 603 of file STK_CAllocator.h.

◆ Col

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

Definition at line 590 of file STK_CAllocator.h.

◆ ColRange

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

Type of the Range for the columns.

Definition at line 610 of file STK_CAllocator.h.

◆ LowBase

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

Definition at line 604 of file STK_CAllocator.h.

◆ Row

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

Definition at line 589 of file STK_CAllocator.h.

◆ RowRange

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

Type of the Range for the rows.

Definition at line 608 of file STK_CAllocator.h.

◆ Type

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

Definition at line 591 of file STK_CAllocator.h.

◆ TypeConst

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

Definition at line 592 of file STK_CAllocator.h.

Member Enumeration Documentation

◆ anonymous enum

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

Definition at line 594 of file STK_CAllocator.h.

595 {
596 structure_ = hidden::Traits<Derived>::structure_,
597 orient_ = hidden::Traits<Derived>::orient_,
598 sizeRows_ = hidden::Traits<Derived>::sizeRows_,
599 sizeCols_ = hidden::Traits<Derived>::sizeCols_,
600 sizeProd_ = hidden::Traits<Derived>::sizeProd_,
601 storage_ = hidden::Traits<Derived>::storage_
602 };

Constructor & Destructor Documentation

◆ StructuredCAllocator() [1/4]

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

Default constructor.

Definition at line 616 of file STK_CAllocator.h.

616: Base(I, J), row_(I.begin()) {}
OrientedCAllocator< Derived, orient_ > Base
int row_
row of the point (needed when this is a reference)

◆ StructuredCAllocator() [2/4]

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

copy constructor

Definition at line 618 of file STK_CAllocator.h.

618: Base(A, ref), row_(A.row_) {}

◆ StructuredCAllocator() [3/4]

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

Reference constructor.

Definition at line 621 of file STK_CAllocator.h.

623 : Base(A, I, J), row_(I.begin())
624 {}

◆ StructuredCAllocator() [4/4]

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

wrapper constructor for 0 based C-Array

Definition at line 626 of file STK_CAllocator.h.

626: Base(q, 1, nbCol), row_(0) {}

Member Function Documentation

◆ elt1Impl() [1/2]

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

Definition at line 643 of file STK_CAllocator.h.

643{ return this->elt2Impl(row_,j);}

◆ elt1Impl() [2/2]

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

Definition at line 639 of file STK_CAllocator.h.

639{ return this->elt2Impl(row_,j);}

◆ exchange()

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

exchange T with this.

Parameters
Tthe container to exchange

Definition at line 631 of file STK_CAllocator.h.

632 { Base::exchange(T);
633 std::swap(row_, T.row_);
634 }

◆ moveImpl()

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

move T to this.

Parameters
Tthe container to move

Definition at line 677 of file STK_CAllocator.h.

678 { row_ = T.row_;}

◆ resize1Impl()

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

resize the allocator.

Parameters
sizeColsthe size of the point

Definition at line 663 of file STK_CAllocator.h.

664 { this->asDerived().resize2Impl(1, sizeCols);
665 row_ = this->beginRows();
666 return this->asDerived();
667 }

◆ shift1Impl()

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

shift the first column index of the allocator.

Parameters
beginColsthe index of the first column

Definition at line 656 of file STK_CAllocator.h.

657 { shift2Impl(beginCols, beginCols);
658 row_ = beginCols;
659 }
void shift2Impl(int beginRows, int beginCols)
shift the first indexes of the allocator

◆ shift2Impl()

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

shift the first indexes of the allocator

Parameters
beginRows,beginColsindexes to set

Definition at line 647 of file STK_CAllocator.h.

648 {
649 if ((beginRows == this->beginRows())&&(beginCols == this->beginCols())) return;
650 LowBase::shift(beginRows, beginCols);
651 this->allocator_.shift(this->shiftInc(beginRows, beginCols));
652 row_ = beginRows;
653 }

◆ subVector()

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

Definition at line 672 of file STK_CAllocator.h.

673 { return Base::template row<Size_>(row_, J);}
MultidimRegression(Array const *y=0, Array const *x=0)
Constructor.

Member Data Documentation

◆ row_

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

row of the point (needed when this is a reference)

Definition at line 682 of file STK_CAllocator.h.


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