35#ifndef STK_CALLOCATOR_H
36#define STK_CALLOCATOR_H
46template<
typename Type,
int SizeRows_,
int SizeCols_,
bool Orient_>
54template<
typename Type_,
int SizeRows_,
int SizeCols_,
bool Orient_>
70 storage_ = Arrays::dense_
88template<
class Derived>
137#ifdef STK_BOUNDS_CHECK
150#ifdef STK_BOUNDS_CHECK
165#ifdef STK_BOUNDS_CHECK
178#ifdef STK_BOUNDS_CHECK
191 template<
int OtherRows_,
int OtherCols_>
195#ifdef STK_BOUNDS_CHECK
208#ifdef STK_BOUNDS_CHECK
209 if (this->beginCols() >
pos1)
211 if (this->endCols() <=
pos1)
213 if (this->beginCols() >
pos2)
215 if (this->endCols() <=
pos2)
218 for (
int i=this->beginRows();
i< this->endRows(); ++
i)
219 { std::swap(this->asDerived().elt2Impl(
i,
pos1),this->asDerived().elt2Impl(
i,
pos2));}
224#ifdef STK_BOUNDS_CHECK
225 if (this->beginRows() >
pos1)
227 if (this->endRows() <=
pos1)
229 if (this->beginRows() >
pos2)
231 if (this->endRows() <=
pos2)
234 for (
int j=this->beginCols();
j< this->endCols(); ++
j)
235 { std::swap(this->asDerived().elt2Impl(
pos1,
j),this->asDerived().elt2Impl(
pos2,
j));}
243template<
class Derived>
277 :
Base(
I,
J), ldx_(
I.size()), allocator_(prod(
I,
J))
281 :
Base(
A), ldx_(
A.ldx()), allocator_(
A.allocator_, ref)
282 {
if (!ref) allocator_.assign(
A.allocator_);}
284 template<
class OtherDerived>
287 :
Base(
I,
J), ldx_(
A.ldx()), allocator_(
A.allocator(),
true) {}
300 inline int begin()
const {
return allocator_.begin();}
302 inline int end()
const {
return allocator_.end();}
304 inline int size()
const {
return allocator_.size();}
307 inline bool isRef()
const {
return allocator_.isRef();}
309 inline Type*
const&
p_data()
const {
return allocator_.p_data();}
313 inline int ldx()
const {
return ldx_;}
327 { allocator_.assign(range(),
v);}
331 if (this->asPtrDerived() != T.asPtrDerived())
333 allocator_.move(T.allocator_);
334 this->asDerived().moveImpl(T.asDerived());
335 this->setRanges(T.rows(), T.cols());
338 return this->asDerived();
353 allocator_.exchange(T.allocator_);
355 std::swap(ldx_, T.ldx_);
364 {
return Range(
I.size()*
J.begin()+
I.begin(),
I.size()*
J.size()); }
368 {
return ldx_*beginCols+beginRows; }
375template<
class Derived>
409 :
Base(
I,
J), ldx_(
J.size()), allocator_(prod(
I,
J))
413 :
Base(
A), ldx_(
A.ldx_), allocator_(
A.allocator_, ref)
414 {
if (!ref) allocator_.assign(
A.allocator_);}
416 template<
class OtherDerived>
419 :
Base(
I,
J), ldx_(
A.ldx()), allocator_(
A.allocator(),
true)
433 inline int begin()
const {
return allocator_.begin();}
435 inline int end()
const {
return allocator_.end();}
437 inline int size()
const {
return allocator_.size();}
440 inline bool isRef()
const {
return allocator_.isRef();}
442 inline Type*
const&
p_data()
const {
return allocator_.p_data();}
446 inline int ldx()
const {
return ldx_;}
462 if (this->asPtrDerived() != T.asPtrDerived())
464 allocator_.move(T.allocator_);
465 this->asDerived().moveImpl(T.asDerived());
466 this->setRanges(T.rows(), T.cols());
469 return this->asDerived();
482 allocator_.exchange(T.allocator_);
484 std::swap(ldx_, T.ldx_);
493 {
return Range(
J.size()*
I.begin()+
J.begin(),
I.size()*
J.size());}
496 {
return ldx_*beginRows+beginCols; }
504template<
class Derived,
int SizeRows_,
int SizeCols_>
539 template<
class OtherDerived,
int OtherRows_,
int OtherCols_>
565 if ((beginRows == this->beginRows())&&(beginCols == this->beginCols()))
return;
566 LowBase::shift(beginRows, beginCols);
567 this->allocator_.shift(this->shiftInc(beginRows, beginCols));
577 {
return this->asDerived().resize2Impl(size, size);}
584template<
class Derived,
int SizeCols_>
620 template<
class OtherDerived,
int OtherRows_,
int OtherCols_>
633 std::swap(row_, T.row_);
649 if ((beginRows == this->beginRows())&&(beginCols == this->beginCols()))
return;
650 LowBase::shift(beginRows, beginCols);
651 this->allocator_.shift(this->shiftInc(beginRows, beginCols));
657 { shift2Impl(beginCols, beginCols);
664 { this->asDerived().resize2Impl(1, sizeCols);
665 row_ = this->beginRows();
666 return this->asDerived();
688template<
class Derived,
int SizeRows_>
723 template<
class OtherDerived,
int OtherRows_,
int OtherCols_>
737 std::swap(col_, T.col_);
752 if ((beginRows == this->beginRows())&&(beginCols == this->beginCols()))
return;
753 LowBase::shift(beginRows, beginCols);
754 this->allocator_.shift(this->shiftInc(beginRows, beginCols));
761 { shift2Impl(beginRows, beginRows);
769 this->asDerived().resize2Impl(sizeRow, 1);
770 col_ = this->beginCols();
771 return this->asDerived();
793template<
class Derived>
824 :
Base(
I,
J), row_(
I.begin()), col_(
J.begin())
828 :
Base(
A, ref), row_(
A.row_), col_(
A.col_)
831 template<
class OtherDerived,
int OtherRows_,
int OtherCols_>
835 , row_(
I.begin()), col_(
J.begin())
845 { row_ = T.row_; col_ = T.col_;
return *
this;}
853 std::swap(row_, T.row_);
854 std::swap(col_, T.col_);
857 inline int size()
const {
return 1;}
873 if ((beginRows == this->beginRows())&&(beginCols == this->beginCols()))
return;
874 LowBase::shift(beginRows, beginCols);
875 this->allocator_.shift(this->shiftInc(beginRows, beginCols));
884 this->shift2Impl(begin, begin);
885 row_ = begin; col_ = begin;
888 Derived&
resize1Impl(
int) {
return this->asDerived().resize2Impl(1, 1);}
903template<
typename Type_,
int SizeRows_,
int SizeCols_,
bool Orient_>
930 using Base::allocator_;
936 {
if (!ref) { allocator_.assign(
A.allocator_);} }
938 template<
int OtherRows_,
int OtherCols_>
959template<
typename Type_,
bool Orient_>
961 :
public StructuredCAllocator<CAllocator<Type_, UnknownSize, UnknownSize, Orient_>, UnknownSize, UnknownSize>
986 using Base::allocator_;
999 { Base::Base::setValue(
v);}
1005 {
if (!ref) { allocator_.assign(
A.allocator_);}}
1010 template<
int OtherRows_,
int OtherCols_>
1020 void clear() { allocator_.free(); this->setRanges();}
1024 if (this->sizeRows() == sizeRows && this->sizeCols() == sizeCols)
return *
this;
1026 if ((sizeRows <= 0)||(sizeCols<=0))
1030 this->setRanges(sizeRows, sizeCols);
1031 this->setSizedIdx();
1035 allocator_.malloc(this->prod(sizeRows, sizeCols));
1036 this->setRanges(sizeRows, sizeCols);
1037 this->setSizedIdx();
1047 if ((sizeRows == this->sizeRows())&&(sizeCols == this->sizeCols()))
return;
1050 this->exchange(copy);
1054 resize2Impl(sizeRows, sizeCols);
1055 this->shift2Impl(copy.beginRows(), copy.beginCols());
1057 const int endRow = std::min(copy.endRows(),
this->endRows());
1058 const int endCol = std::min(copy.endCols(),
this->endCols());
1059 for (
int j= this->beginCols();
j <
endCol; ++
j)
1060 for (
int i = this->beginRows();
i< endRow; ++
i)
1061 { this->elt(
i,
j) = copy.elt(
i,
j);}
1063 catch (std::bad_alloc & error)
1065 this->exchange(copy);
1074template<
typename Type_,
int SizeRows_,
bool Orient_>
1076 :
public StructuredCAllocator<CAllocator<Type_, SizeRows_, UnknownSize, Orient_>, SizeRows_, UnknownSize>
1101 using Base::allocator_;
1109 template<
int OtherRows_,
int OtherCols_>
1119 void clear() { allocator_.free(); this->setCols();}
1123 if (this->sizeCols() == sizeCols)
return *
this;
1130 this->setSizedIdx();
1134 allocator_.malloc(this->prod(
SizeRows_, sizeCols));
1136 this->setSizedIdx();
1142 this->exchange(copy);
1147 this->shift2Impl(copy.beginRows(), copy.beginCols());
1149 const int endCol = std::min(copy.endCols(),
this->endCols());
1150 for (
int j= this->beginCols();
j <
endCol; ++
j)
1151 for (
int i = this->beginRows();
i < this->endRows(); ++
i)
1152 { this->elt(
i,
j) = copy.elt(
i,
j);}
1155 catch (std::bad_alloc
const& error)
1157 this->exchange(copy);
1166template<
typename Type_,
bool Orient_,
int SizeCols_>
1168 :
public StructuredCAllocator<CAllocator<Type_, UnknownSize, SizeCols_, Orient_>, UnknownSize, SizeCols_>
1195 using Base::allocator_;
1202 {
if (!ref) { allocator_.assign(
A.allocator_);} }
1205 template<
int OtherRows_,
int OtherCols_>
1216 void clear() { allocator_.free(); this->setRows();}
1220 if (this->sizeRows() == sizeRows)
return *
this;
1226 this->setSizedIdx();
1230 allocator_.malloc(this->prod(sizeRows,
SizeCols_));
1232 this->setSizedIdx();
1239 this->exchange(copy);
1244 this->shift2Impl(copy.beginRows(), copy.beginCols());
1246 const int endRow = std::min(copy.endRows(),
this->endRows());
1247 for (
int j= this->beginCols();
j < this->endCols(); ++
j)
1248 for (
int i = this->beginRows();
i< endRow; ++
i)
1249 { this->elt(
i,
j) = copy.elt(
i,
j);}
1251 catch (std::bad_alloc & error)
1253 this->exchange(copy);
#define STKOUT_OF_RANGE_1ARG(Where, Arg, Error)
#define STKOUT_OF_RANGE_2ARG(Where, Arg1, Arg2, Error)
#define STKRUNTIME_ERROR_2ARG(Where, Arg1, Arg2, Error)
Base class for CAllocators.
ColRange const & rangeColsInRow(int) const
CAllocator< Type, OtherRows_, OtherCols_, orient_ > sub(TRange< OtherRows_ > const &I, TRange< OtherCols_ > const &J) const
Access to the sub-part (I,J) of the Allocator.
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
ITContainer2D< Derived > Base
RowRange const & rangeRowsInCol(int) const
hidden::Traits< Derived >::Col Col
CAllocatorBase()
default constructor
hidden::Traits< Derived >::TypeConst TypeConst
hidden::Traits< Derived >::Row Row
CAllocator< Type, Size_, 1, orient_ > col(TRange< Size_ > const &I, int j) const
Access to the column (I,j) of the Allocator.
TRange< sizeProd_ > AllocatorRange
Type of the Range for the allocator.
Row row(int i) const
Access to the ith row of the Allocator.
Col col(int j) const
Access to the jth column of the Allocator.
CAllocator< Type, 1, Size_, orient_ > row(int i, TRange< Size_ > const &J) const
Access to the row (i,J) of the Allocator.
hidden::Traits< Derived >::Type Type
CAllocatorBase(CAllocatorBase const &A)
copy constructor
hidden::Traits< Derived >::Allocator Allocator
void swapRows(int pos1, int pos2)
CAllocatorBase(RowRange const &I, ColRange const &J)
constructor
void swapCols(int pos1, int pos2)
CAllocator(Type *const &q, int, int nbCol)
wrapper constructor for 0 based C-Array
CAllocator(int, int sizeCols)
hidden::Traits< CAllocator >::Col Col
void clear()
clear allocated memories.
void realloc(int, int sizeCols)
CAllocator(int, int sizeCols, Type const &v)
CAllocator(CAllocator< Type, OtherRows_, OtherCols_, Orient_ > const &A, RowRange const &I, ColRange const &J)
MemAllocator< Type, UnknownSize > Allocator
hidden::Traits< CAllocator >::TypeConst TypeConst
CAllocator(CAllocator const &A, bool ref=true)
StructuredCAllocator< CAllocator, SizeRows_, UnknownSize > Base
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
hidden::Traits< CAllocator >::Row Row
hidden::Traits< CAllocator >::Type Type
CAllocator & resize2Impl(int, int sizeCols)
resize allocator
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
CAllocator(CAllocator const &A, bool ref=true)
hidden::Traits< CAllocator >::Col Col
MemAllocator< Type, UnknownSize > Allocator
CAllocator(Type *const &q, int nbRow, int)
wrapper constructor for 0 based C-Array
hidden::Traits< CAllocator >::TypeConst TypeConst
hidden::Traits< CAllocator >::Row Row
TRange< sizeProd_ > AllocatorRange
Type of the Range for the columns.
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
hidden::Traits< CAllocator >::Type Type
CAllocator(CAllocator< Type, OtherRows_, OtherCols_, Orient_ > const &A, RowRange const &I, ColRange const &J)
wrap other allocator
void clear()
clear allocated memories.
StructuredCAllocator< CAllocator, UnknownSize, SizeCols_ > Base
CAllocator(int sizeRows, int, Type const &v)
CAllocator(int sizeRows, int)
void realloc(int sizeRows, int)
CAllocator & resize2Impl(int sizeRows, int)
resize the rows
CAllocator()
Default constructor.
CAllocator(CAllocator const &A, bool ref=true)
Copy or wrapper constructor.
hidden::Traits< CAllocator >::Col Col
hidden::Traits< CAllocator >::TypeConst TypeConst
void realloc(int sizeRows, int sizeCols)
function for memory reallocation.
CAllocator(CAllocator< Type, OtherRows_, OtherCols_, Orient_ > const &A, RowRange const &I, ColRange const &J)
Wrapper constructor.
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
CAllocator(Type *const &q, int nbRow, int nbCol)
wrapper constructor for 0 based C-Array
CAllocator & resize2Impl(int sizeRows, int sizeCols)
resize CAllocator
CAllocator(int sizeRows, int sizeCols)
Constructor with specified size.
StructuredCAllocator< CAllocator, UnknownSize, UnknownSize > Base
hidden::Traits< CAllocator >::Row Row
CAllocator(int sizeRows, int sizeCols, Type const &v)
Constructor with specified size and specified value.
hidden::Traits< CAllocator >::Type Type
MemAllocator< Type, UnknownSize > Allocator
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
void clear()
clear allocated memories
Allocator for dense Array classes.
CAllocator(CAllocator const &A, bool ref=true)
hidden::Traits< CAllocator >::Type Type
MemAllocator< Type, SizeRows_ *SizeCols_ > Allocator
IContainer2D< SizeRows_, SizeCols_ > LowBase
void clear()
clear allocated memories
hidden::Traits< CAllocator >::TypeConst TypeConst
CAllocator(int, int, Type const &v)
CAllocator & resize2Impl(int, int)
resize this
hidden::Traits< CAllocator >::Row Row
CAllocator()
default constructor
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
CAllocator(Type *const &q, int, int)
wrapper constructor for 0 based C-Array
CAllocator(CAllocator< Type, OtherRows_, OtherCols_, Orient_ > const &A, RowRange const &I, ColRange const &J)
hidden::Traits< CAllocator >::Col Col
StructuredCAllocator< CAllocator, SizeRows_, SizeCols_ > Base
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
Interface base class for homogeneous 2D containers like allocators.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
void setSizedIdx()
set the index corresponding to the actual size of the allocator.
int shiftInc(int beginRows, int beginCols)
return the increment to apply to a zero based pointer corresponding to the actual first row and first...
Type & elt2Impl(int i, int j)
AllocatorRange range() const
OrientedCAllocator(Type *const &q, int nbRow, int nbCol)
wrapper constructor for 0 based C-Array
TypeConst elt2Impl(int i, int j) const
OrientedCAllocator(OrientedCAllocator const &A, bool ref)
copy constructor
CAllocatorBase< Derived > Base
OrientedCAllocator(RowRange const &I, ColRange const &J)
default constructor
static Range prod(Range const &I, Range const &J)
Compute the range of the 1D Allocator when we want to allocate a 2D array with range I for the rows a...
hidden::Traits< Derived >::Allocator Allocator
Derived & move(OrientedCAllocator const &T)
move T to this without copying data
void exchange(OrientedCAllocator &T)
exchange T with this.
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
hidden::Traits< Derived >::Col Col
Type *const & p_data() const
int ldx_
leading dimension of the data set
hidden::Traits< Derived >::Type Type
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
Allocator allocator_
manager of the memory
OrientedCAllocator(OrientedCAllocator< OtherDerived, Arrays::by_col_ > const &A, RowRange const &I, ColRange const &J)
Reference constructor.
TRange< sizeProd_ > AllocatorRange
Type of the Range for the allocator.
hidden::Traits< Derived >::Row Row
Allocator const & allocator() const
void moveImpl(OrientedCAllocator const &T)
do nothing by default
hidden::Traits< Derived >::TypeConst TypeConst
void setValue(TypeConst v)
set a value to this allocator.
~OrientedCAllocator()
destructor
OrientedCAllocator(OrientedCAllocator const &A, bool ref)
copy constructor
Allocator const & allocator() const
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
OrientedCAllocator(Type *const &q, int nbRow, int nbCol)
wrapper constructor for 0 based C-Array
TRange< sizeProd_ > AllocatorRange
Type of the Range for the allocator.
int shiftInc(int beginRows, int beginCols)
return the increment corresponding to the actual first row an column.
TypeConst elt2Impl(int i, int j) const
Type & elt2Impl(int i, int j)
static Range prod(Range const &I, Range const &J)
Compute the range of the 1D Allocator when we want to allocate a 2D array with I indexes in the first...
void setValue(TypeConst v)
set a value to this container.
OrientedCAllocator(OrientedCAllocator< OtherDerived, Arrays::by_row_ > const &A, RowRange const &I, ColRange const &J)
Reference constructor.
~OrientedCAllocator()
destructor
CAllocatorBase< Derived > Base
Type *const & p_data() const
hidden::Traits< Derived >::TypeConst TypeConst
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
hidden::Traits< Derived >::Allocator Allocator
OrientedCAllocator(RowRange const &I, ColRange const &J)
constructor with specified ranges
hidden::Traits< Derived >::Row Row
hidden::Traits< Derived >::Type Type
Allocator allocator_
manager of the memory
void setSizedIdx()
set the index corresponding to the actual size of the allocator.
void exchange(OrientedCAllocator &T)
exchange T with this.
Derived & move(OrientedCAllocator const &T)
move T to this without copying data
hidden::Traits< Derived >::Col Col
int ldx_
leading dimension of the data set
AllocatorRange range() const
hidden::Traits< Derived >::Row Row
hidden::Traits< Derived >::Col Col
hidden::Traits< Derived >::Type Type
StructuredCAllocator(Type *const &q, int, int)
wrapper constructor for 0 based C-Array
void shift1Impl(int begin)
shift the first indexes of the allocator.
StructuredCAllocator(StructuredCAllocator const &A, bool ref)
copy constructor
void moveImpl(StructuredCAllocator const &T)
move T to this.
void shift2Impl(int beginRows, int beginCols)
shift the first indexes of the allocator
TypeConst elt0Impl() const
~StructuredCAllocator()
destructor
TypeConst elt1Impl(int) const
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
StructuredCAllocator(RowRange const &I, ColRange const &J)
Default constructor.
hidden::Traits< Derived >::Allocator Allocator
IContainer2D< sizeRows_, sizeCols_ > LowBase
Derived & resize1Impl(int)
resize the allocator (for square and diagonal matrices).
StructuredCAllocator & move(StructuredCAllocator const &T)
move T to this.
void exchange(StructuredCAllocator &T)
exchange T with this.
hidden::Traits< Derived >::TypeConst TypeConst
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
OrientedCAllocator< Derived, orient_ > Base
StructuredCAllocator(StructuredCAllocator< OtherDerived, OtherRows_, OtherCols_ > const &A, RowRange const &I, ColRange const &J)
Reference constructor.
void shift2Impl(int beginRows, int beginCols)
shift the first indexes of the allocator
void exchange(StructuredCAllocator &T)
exchange T with this.
Derived & resize1Impl(int sizeCols)
resize the allocator.
TypeConst elt1Impl(int j) const
StructuredCAllocator(RowRange const &I, ColRange const &J)
Default constructor.
hidden::Traits< Derived >::Col Col
OrientedCAllocator< Derived, orient_ > Base
CAllocator< Type, 1, Size_, orient_ > subVector(TRange< Size_ > const &J) const
TRange< sizeProd_ > AllocatorRange
Type of the Range for the allocator.
StructuredCAllocator(StructuredCAllocator const &A, bool ref)
copy constructor
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
StructuredCAllocator(Type *const &q, int, int nbCol)
wrapper constructor for 0 based C-Array
IContainer2D< sizeRows_, sizeCols_ > LowBase
hidden::Traits< Derived >::Allocator Allocator
hidden::Traits< Derived >::TypeConst TypeConst
void moveImpl(StructuredCAllocator const &T)
move T to this.
int row_
row of the point (needed when this is a reference)
void shift1Impl(int beginCols)
shift the first column index of the allocator.
hidden::Traits< Derived >::Row Row
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
hidden::Traits< Derived >::Type Type
StructuredCAllocator(StructuredCAllocator< OtherDerived, OtherRows_, OtherCols_ > const &A, RowRange const &I, ColRange const &J)
Reference constructor.
void shift2Impl(int beginRows, int beginCols)
shift the first indexes of the allocator
StructuredCAllocator(RowRange const &I, ColRange const &J)
Default constructor.
CAllocator< Type, Size_, 1, orient_ > subVector(TRange< Size_ > const &I) const
StructuredCAllocator(Type *const &q, int nbRow, int)
wrapper constructor for 0 based C-Array
void shift1Impl(int beginRows)
shift the first row index of the allocator.
hidden::Traits< Derived >::Allocator Allocator
StructuredCAllocator(StructuredCAllocator< OtherDerived, OtherRows_, OtherCols_ > const &A, RowRange const &I, ColRange const &J)
Reference constructor.
hidden::Traits< Derived >::Col Col
hidden::Traits< Derived >::Row Row
StructuredCAllocator(StructuredCAllocator const &A, bool ref)
copy constructor
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
IContainer2D< sizeRows_, sizeCols_ > LowBase
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
Derived & resize1Impl(int sizeRow)
resize the allocator.
void moveImpl(StructuredCAllocator const &T)
move T to this.
hidden::Traits< Derived >::Type Type
TypeConst elt1Impl(int i) const
hidden::Traits< Derived >::TypeConst TypeConst
OrientedCAllocator< Derived, orient_ > Base
void exchange(StructuredCAllocator &T)
exchange T with this.
Base class for the general by_col_ structured case.
void shift2Impl(int beginRows, int beginCols)
shift the first indexes of the allocator
Derived & resize1Impl(int size)
resize the allocator (for square and diagonal matrices).
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
hidden::Traits< Derived >::Allocator Allocator
StructuredCAllocator(StructuredCAllocator< OtherDerived, OtherRows_, OtherCols_ > const &A, RowRange const &I, ColRange const &J)
Reference constructor.
hidden::Traits< Derived >::TypeConst TypeConst
OrientedCAllocator< Derived, orient_ > Base
StructuredCAllocator(RowRange const &I, ColRange const &J)
Default constructor.
StructuredCAllocator(StructuredCAllocator const &A, bool ref)
copy constructor
hidden::Traits< Derived >::Row Row
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
TypeConst elt1Impl(int i) const
IContainer2D< sizeRows_, sizeCols_ > LowBase
void exchange(StructuredCAllocator &T)
exchange T with this.
void shift1Impl(int begin)
shift the first indexes of the allocator (for square and diagonal matrices).
hidden::Traits< Derived >::Type Type
hidden::Traits< Derived >::Col Col
StructuredCAllocator(Type *const &q, int nbRow, int nbCol)
wrapper constructor for 0 based C-Array
TRange< sizeProd_ > AllocatorRange
Type of the Range for the allocator.
Index sub-vector region: Specialization when the size is unknown.
@ number_
(1,1) matrix/vector/array/expression (like a number)
@ point_
row oriented vector/array/expression
@ vector_
column oriented vector/array/expression
@ square_
square matrix/array/expression
const int UnknownSize
This value means that an integer is not known at compile-time, and that instead the value is stored i...
The namespace STK is the main domain space of the Statistical ToolKit project.
Convenient structure for computing the product of two template integer parameters without overflow.
MemAllocator< Type_, sizeProd_ > Allocator
Type of the base allocator allocating data.
CAllocator< Type_, 1, SizeCols_, Orient_ > Row
RemoveConst< Type_ >::Type const & TypeConst
CAllocator< Type_, SizeRows_, 1, Orient_ > Col