STK++ 0.9.13
|
template interface base class for two-dimensional arrays. More...
#include <STK_IArray2D.h>
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 hidden::Traits< Derived >::Type | Type |
typedef hidden::Traits< Derived >::TypeConst | TypeConst |
typedef hidden::Traits< Derived >::Row | Row |
typedef hidden::Traits< Derived >::Col | Col |
typedef hidden::Traits< Derived >::SubRow | SubRow |
typedef hidden::Traits< Derived >::SubCol | SubCol |
typedef hidden::Traits< Derived >::SubArray | SubArray |
typedef hidden::Traits< Derived >::SubVector | SubVector |
typedef hidden::Traits< Derived >::ColVector | ColVector |
typedef ColVector * | PtrCol |
typedef ColVector const * | PtrColConst |
typedef TRange< sizeRows_ > | RowRange |
Type of the Range for the rows. | |
typedef TRange< sizeCols_ > | ColRange |
Type of the Range for the columns. | |
typedef IContainer2D< sizeRows_, sizeCols_ > | Base2D |
Type for the IContainer2D base Class. | |
typedef MemAllocator< PtrCol, sizeCols_ > | Allocator |
Type for the Base Class. | |
typedef ArrayBase< Derived > | Base |
type of the Base Container Class. | |
![]() | |
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 ExprBase< Derived > | Base |
typedef hidden::Traits< Derived >::Type | Type |
typedef hidden::Traits< Derived >::TypeConst | TypeConst |
![]() | |
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 ITContainer< Derived, structure_ > | Base |
typedef hidden::Traits< Derived >::Type | Type |
typedef hidden::Traits< Derived >::TypeConst | TypeConst |
Protected Attributes | |
Allocator | allocator_ |
allocator of the column data set | |
Array1D< Range, sizeCols_ > | rangeCols_ |
range of the index of the columns of the container. | |
Private Member Functions | |
void | freeMem () |
Internal method for memory deallocation. | |
void | mallocCols (ColRange const &J) |
Internal method for memory allocation and initialization of the horizontal range of the container. | |
void | initializeCols (Range const &J) |
Internal method for memory allocation and initialization of a range of columns. | |
void | freeCols (Range const &J) |
Internal method for releasing memory in a given range of columns. | |
void | reserveRowsCols (Range const &J, int size) |
Internal method for reserving memory in a range of columns. | |
void | copyCol (IArray2D const &src, int j) |
copy column j of src into column j of this | |
template<class OtherDerived > | |
void | transferCol (IArray2D< OtherDerived > &T, int pos) |
Internal method transferring column pos of container T to column pos of this. | |
void | nullCol (int col) |
Internal method setting default parameters and dimension to a column of the container. | |
void | initializeCol (int col, Range const &I) |
Internal method for initializing a column. | |
void | freeCol (int col) |
Internal method for memory deallocation. | |
void | shiftRowCol (int col, int beg) |
internal method for translating a column. | |
void | resizeRowCol (int col, Range const &I) |
Internal method for resizing a column with a specified range. | |
void | reserveRowCol (int col, int size) |
Internal method for reserving rows to a specified column. | |
void | insertRowsCol (int col, int pos, int n) |
Internal method for inserting rows to a specified column. | |
void | eraseRowsCol (int col, int pos, int n) |
Internal method for deleting rows from a specified column. | |
Friends | |
template<class OtherDerived > | |
class | IArray2D |
Additional Inherited Members | |
![]() | |
typedef TRange< SizeRows_ > | RowRange |
Type of the Range for the rows. | |
typedef TRange< SizeCols_ > | ColRange |
Type of the Range for the columns. | |
![]() | |
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 ExprBase< Derived > | Base |
typedef hidden::Traits< Derived >::Type | Type |
typedef hidden::Traits< Derived >::TypeConst | TypeConst |
![]() | |
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 ITContainer< Derived, structure_ > | Base |
typedef hidden::Traits< Derived >::Type | Type |
typedef hidden::Traits< Derived >::TypeConst | TypeConst |
template interface base class for two-dimensional arrays.
A IArray2D is an interface class for two-dimensional Arrays stored in columns and having flexible dimensions. It is possible to add, remove easily columns and rows in Derived class.
Each column has a Range stored in the array rangeCols_
. It should be worth noting that we always have
Pseudo virtual function expected by this interface in derived classes are
Derived | is the name of the class that implements IArray2D . |
Definition at line 77 of file STK_IArray2D.h.
typedef MemAllocator<PtrCol, sizeCols_> STK::IArray2D< Derived >::Allocator |
Type for the Base Class.
Definition at line 114 of file STK_IArray2D.h.
typedef ArrayBase<Derived> STK::IArray2D< Derived >::Base |
type of the Base Container Class.
Definition at line 116 of file STK_IArray2D.h.
typedef IContainer2D<sizeRows_, sizeCols_ > STK::IArray2D< Derived >::Base2D |
Type for the IContainer2D base Class.
Definition at line 112 of file STK_IArray2D.h.
typedef hidden::Traits<Derived>::Col STK::IArray2D< Derived >::Col |
Definition at line 88 of file STK_IArray2D.h.
typedef TRange<sizeCols_> STK::IArray2D< Derived >::ColRange |
Type of the Range for the columns.
Definition at line 110 of file STK_IArray2D.h.
typedef hidden::Traits<Derived>::ColVector STK::IArray2D< Derived >::ColVector |
Definition at line 95 of file STK_IArray2D.h.
typedef ColVector* STK::IArray2D< Derived >::PtrCol |
Definition at line 96 of file STK_IArray2D.h.
typedef ColVector const* STK::IArray2D< Derived >::PtrColConst |
Definition at line 97 of file STK_IArray2D.h.
typedef hidden::Traits<Derived>::Row STK::IArray2D< Derived >::Row |
Definition at line 87 of file STK_IArray2D.h.
typedef TRange<sizeRows_> STK::IArray2D< Derived >::RowRange |
Type of the Range for the rows.
Definition at line 108 of file STK_IArray2D.h.
typedef hidden::Traits<Derived>::SubArray STK::IArray2D< Derived >::SubArray |
Definition at line 91 of file STK_IArray2D.h.
typedef hidden::Traits<Derived>::SubCol STK::IArray2D< Derived >::SubCol |
Definition at line 90 of file STK_IArray2D.h.
typedef hidden::Traits<Derived>::SubRow STK::IArray2D< Derived >::SubRow |
Definition at line 89 of file STK_IArray2D.h.
typedef hidden::Traits<Derived>::SubVector STK::IArray2D< Derived >::SubVector |
Definition at line 93 of file STK_IArray2D.h.
typedef hidden::Traits<Derived>::Type STK::IArray2D< Derived >::Type |
Definition at line 84 of file STK_IArray2D.h.
typedef hidden::Traits<Derived>::TypeConst STK::IArray2D< Derived >::TypeConst |
Definition at line 85 of file STK_IArray2D.h.
Enumerator | |
---|---|
structure_ | |
orient_ | |
sizeRows_ | |
sizeCols_ | |
storage_ |
Definition at line 99 of file STK_IArray2D.h.
|
protected |
Default constructor.
Definition at line 786 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::cols(), and STK::IArray2D< Derived >::mallocCols().
|
protected |
constructor with specified ranges
Constructor with specified ranges.
I,J | rows and columns range |
I,J | range of the rows and columns |
Definition at line 794 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::cols(), STK::IArray2D< Derived >::initializeCols(), and STK::IArray2D< Derived >::mallocCols().
|
protected |
Copy constructor If we want to wrap T, the main ptr will be wrapped in MemAllocator class.
If we want to copy T, Allocator is initialized to default values.
T | the container to copy |
ref | true if we wrap T |
Definition at line 804 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::beginCols(), STK::IArray2D< Derived >::cols(), STK::IArray2D< Derived >::copyCol(), STK::IArray2D< Derived >::endCols(), and STK::IArray2D< Derived >::initializeCols().
|
protected |
constructor by reference, ref_=1.
T | the container to wrap |
I,J | rows and columns to wrap |
Definition at line 822 of file STK_IArray2D.h.
References STK::inf(), and STK::IArray2D< Derived >::rangeCols_.
|
protected |
destructor.
Allocated horizontal memory (the array with the pointers on the columns) is liberated by the Allocator.
Definition at line 837 of file STK_IArray2D.h.
|
inlineprotected |
Definition at line 649 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::allocator_.
|
inline |
Definition at line 204 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::allocator_.
hidden::Traits< Derived >::SubCol STK::IArray2D< Derived >::atCol | ( | int | j | ) | const |
j | index of the column |
Definition at line 159 of file STK_IArray2DSlicers.h.
References STK::IArray2D< Derived >::atCol(), and STKOUT_OF_RANGE_1ARG.
Referenced by STK::IArray2D< Derived >::atCol().
hidden::Traits< Derived >::Row STK::IArray2D< Derived >::atRow | ( | int | i | ) | const |
i | the index of the row |
Definition at line 169 of file STK_IArray2DSlicers.h.
References STK::IArray2D< Derived >::atRow(), and STKOUT_OF_RANGE_1ARG.
Referenced by STK::IArray2D< Derived >::atRow().
|
inline |
Definition at line 210 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::allocator_, and STK::MemAllocator< Type_, Size_ >::size().
|
inline |
Definition at line 189 of file STK_IArray2D.h.
References STK::IContainer2D< SizeRows_, SizeCols_ >::beginCols().
Referenced by STK::IArray2D< Derived >::IArray2D(), STK::IArray2D< Derived >::operator()(), STK::IArray2D< Derived >::operator()(), STK::IArray2D< Derived >::swapCols(), STK::IArray2D< Derived >::update(), and STK::IArray2D< Derived >::update().
|
inline |
Definition at line 180 of file STK_IArray2D.h.
References STK::IContainer2D< SizeRows_, SizeCols_ >::beginRows().
Referenced by STK::Svd< Array >::diag(), main(), STK::IArray2D< Derived >::operator()(), STK::IArray2D< Derived >::operator()(), and STK::Qr::qr().
|
inline |
col
. col | index of the column we want the capacity |
Definition at line 214 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::col(), and STK::IArray2D< Derived >::ptr().
void STK::IArray2D< Derived >::clear | ( | ) |
clear the object.
This will free all allocated memory and reset all range to Range(). (while freeMem() does not modify rows range (rows_)
Definition at line 844 of file STK_IArray2D.h.
Referenced by STK::AdditiveBSplineCoefficients< Array >::run(), STK::IQr< Derived >::setData(), and STK::Stat::Univariate< TContainer1D, Real >::setData().
|
inline |
access to a part of a column.
j | index of the column |
Definition at line 47 of file STK_IArray2DSlicers.h.
References STKOUT_OF_RANGE_1ARG.
Referenced by STK::IArray2D< Derived >::capacityCol(), main(), main(), STK::IArray2D< Derived >::rangeCol(), and STK::IArray2D< Derived >::update().
|
inline |
access to a part of a column.
I | range of the rows |
j | index of the col |
Definition at line 61 of file STK_IArray2DSlicers.h.
References STK::inf(), and STKOUT_OF_RANGE_2ARG.
|
inline |
access to many columns.
J | range of the index of the cols |
J
Definition at line 76 of file STK_IArray2DSlicers.h.
|
inline |
Definition at line 187 of file STK_IArray2D.h.
References STK::IContainer2D< SizeRows_, SizeCols_ >::cols().
Referenced by STK::IArray2D< Derived >::IArray2D(), STK::IArray2D< Derived >::IArray2D(), STK::IArray2D< Derived >::IArray2D(), STK::IArray2D< Derived >::merge(), and STK::IArray2D< Derived >::merge().
|
inline |
Definition at line 175 of file STK_IArray2D.h.
References STK::IContainer2D< SizeRows_, SizeCols_ >::cols().
|
private |
copy column j of src into column j of this
src | source to copy |
j | index of the columns to copy |
Definition at line 966 of file STK_IArray2D.h.
Referenced by STK::IArray2D< Derived >::IArray2D().
|
inline |
access to an element.
i,j | indexes of the element to get |
Definition at line 235 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::allocator_, and STK::MemAllocator< Type_, Size_ >::elt().
|
inline |
constant access to an element.
i,j | indexes of the element to get |
Definition at line 240 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::ptr().
|
inline |
true
if the container is empty, false
otherwise Definition at line 201 of file STK_IArray2D.h.
References STK::IContainer2D< SizeRows_, SizeCols_ >::empty().
|
inline |
Definition at line 191 of file STK_IArray2D.h.
References STK::IContainer2D< SizeRows_, SizeCols_ >::endCols().
Referenced by STK::IArray2D< Derived >::IArray2D(), STK::IArray2D< Derived >::operator()(), STK::IArray2D< Derived >::operator()(), STK::Qr::qr(), STK::IArray2D< Derived >::swapCols(), and STK::IArray2D< Derived >::update().
|
inline |
Definition at line 182 of file STK_IArray2D.h.
References STK::IContainer2D< SizeRows_, SizeCols_ >::endRows().
Referenced by main(), STK::IArray2D< Derived >::operator()(), STK::IArray2D< Derived >::operator()(), and STK::Qr::qr().
void STK::IArray2D< Derived >::erase | ( | int | pos, |
int | n = 1 |
||
) |
STL compatibility:Delete n elements at the pos
index from the container.
pos | index where to delete elements |
n | number of elements to delete (default 1) |
Definition at line 583 of file STK_IArray2DModifiers.h.
References STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STK::Arrays::vector_.
void STK::IArray2D< Derived >::eraseCols | ( | int | pos, |
int | n = 1 |
||
) |
Delete n columns at the specified position of the array.
pos | the position of the deleted Columns |
n | the number of column to delete (default is 1) |
Definition at line 468 of file STK_IArray2DModifiers.h.
Referenced by STK::IArray2D< Array2D< Type_ > >::popBackCols(), STK::IArray2D< Array2D< Type_ > >::popFrontCols(), and STK::IArray2D< Array2D< Type_ > >::pushBackCols().
void STK::IArray2D< Derived >::eraseRows | ( | int | pos, |
int | n = 1 |
||
) |
Delete n rows at the position pos.
pos | index where to delete elements |
n | number of rows to delete (default is 1) |
Definition at line 528 of file STK_IArray2DModifiers.h.
References STK::IArray2D< Derived >::eraseRows(), STKOUT_OF_RANGE_2ARG, and STKRUNTIME_ERROR_2ARG.
Referenced by STK::SArray2DVector< Type_ >::erase(), STK::IArray2D< Derived >::eraseRows(), and main().
|
private |
Internal method for deleting rows from a specified column.
Delete n rows at the position pos
to the column col
of the array.
col,pos,n | index of the column, row position and number of elements to delete |
Definition at line 643 of file STK_IArray2DModifiers.h.
void STK::IArray2D< Derived >::exchange | ( | IArray2D< Derived > & | T | ) |
exchange this container with T.
T | the container to exchange with this |
Definition at line 872 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::allocator_, and STK::IArray2D< Derived >::rangeCols_.
|
private |
Internal method for memory deallocation.
col | the number of the column to free |
Definition at line 1051 of file STK_IArray2D.h.
|
private |
Internal method for releasing memory in a given range of columns.
J | range of columns to liberate. |
Definition at line 959 of file STK_IArray2D.h.
|
private |
Internal method for memory deallocation.
This method clear all allocated memory and reset ranges to default value. Do nothing if this is a reference Range of the columns is set to default. Range of the rows (rows_) remains unmodified.
Definition at line 887 of file STK_IArray2D.h.
|
private |
Internal method for initializing a column.
Method for the allocation of memory of the column col with given range I.
col,I | index and range of the column to initialize |
Definition at line 1024 of file STK_IArray2D.h.
References _T, STK::IRunnerBase::error(), STK::IArray2D< Derived >::initializeCol(), stk_cout, and STKRUNTIME_ERROR_2ARG.
Referenced by STK::IArray2D< Derived >::initializeCol().
|
private |
Internal method for memory allocation and initialization of a range of columns.
The capacity for the rows have to be set before calling this method.
J | vertical range of the Columns to initialize |
Definition at line 935 of file STK_IArray2D.h.
References STK::IRunnerBase::error(), STK::IArray2D< Derived >::initializeCols(), and STKOUT_OF_RANGE_1ARG.
Referenced by STK::IArray2D< Derived >::IArray2D(), STK::IArray2D< Derived >::IArray2D(), and STK::IArray2D< Derived >::initializeCols().
STL compatibility: insert element v
in the range I
of the Array.
v,I | value and range of indexes |
Definition at line 571 of file STK_IArray2DModifiers.h.
References STK_STATIC_ASSERT_ONE_DIMENSION_ONLY.
void STK::IArray2D< Derived >::insertCols | ( | int | pos, |
int | n = 1 |
||
) |
Insert n columns at the index pos to the array.
pos | position to insert columns |
n | the number of column to insert (default is 1) |
Definition at line 440 of file STK_IArray2DModifiers.h.
Referenced by main(), and STK::IArray2D< Array2D< Type_ > >::pushFrontRows().
void STK::IArray2D< Derived >::insertRows | ( | int | pos, |
int | n = 1 |
||
) |
Insert n rows at position pos in the array If pos is outside the range of a column, then the method do nothing (useful for triangular/diagonal/... arrays).
pos | index where to insert rows |
n | number of elements to insert (default is 1) |
Definition at line 499 of file STK_IArray2DModifiers.h.
Referenced by STK::IArray2D< Array2D< Type_ > >::erase(), STK::IArray2D< Array2D< Type_ > >::insert(), STK::SArray2DVector< Type_ >::insertElt(), and main().
|
private |
Internal method for inserting rows to a specified column.
Insert n rows at the position pos to the column column of the array. No check is done about the index.
col,pos,n | column position, row position and number of rows to insert |
Definition at line 625 of file STK_IArray2DModifiers.h.
|
inline |
true
if the container is empty, false
otherwise Definition at line 171 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::allocator_, and STK::MemAllocator< Type_, Size_ >::isRef().
Referenced by main(), STK::IArray2D< Derived >::merge(), and STK::IArray2D< Derived >::merge().
|
inline |
Definition at line 196 of file STK_IArray2D.h.
References STK::IContainer2D< SizeRows_, SizeCols_ >::lastIdxCols().
Referenced by STK::IArray2D< Derived >::update().
|
inline |
Definition at line 198 of file STK_IArray2D.h.
References STK::IContainer2D< SizeRows_, SizeCols_ >::lastIdxRows().
Referenced by STK::Svd< Array >::diag().
|
private |
Internal method for memory allocation and initialization of the horizontal range of the container.
This method is called once at creation of the container.
The range of the column is not set in this method. Except if an error occur during memory allocation, cols_ will be set to default and an error thrown.
J | horizontal range |
Definition at line 905 of file STK_IArray2D.h.
References STK::IRunnerBase::error(), and STK::Arrays::evalSizeCapacity().
Referenced by STK::IArray2D< Derived >::IArray2D(), and STK::IArray2D< Derived >::IArray2D().
|
inline |
Append the vector other
to this
without copying the data explicitly.
other
is appended to this and other
will become a reference container. The data in itself are not altered, the Array1D become a reference on its own data.
other | the container to merge with this |
Definition at line 587 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::allocator_, STK::IArray2D< Derived >::cols(), STK::MemAllocator< Type_, Size_ >::elt(), STK::TRange< UnknownSize >::incLast(), STK::IArray2D< Derived >::isRef(), STK::TRange< Size_ >::lastIdx(), STK::IArray2D< Derived >::merge(), STK::IArray2D< Derived >::rangeCols_, STK::IArray2D< Derived >::reallocCols(), STK::IArray2D< Derived >::rows(), STK::IArray2D< Derived >::setRows(), STK::IArray2D< Derived >::sizeCols(), and STKRUNTIME_ERROR_NO_ARG.
|
inline |
Append the container other
to this
without copying the data explicitly.
The column of other
are appended to this.
Observe that the const
keyword is not respected in this method: but it is useful to define this method even for constant objects.
other | the container to merge with this |
Definition at line 548 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::allocator_, STK::IArray2D< Derived >::cols(), STK::TRange< Size_ >::end(), STK::TRange< Size_ >::incLast(), STK::IArray2D< Derived >::isRef(), STK::IArray2D< Derived >::merge(), STK::MemAllocator< Type_, Size_ >::p_data(), STK::IArray2D< Derived >::reallocCols(), STK::IArray2D< Derived >::rows(), STK::IArray2D< Derived >::setRows(), STK::IArray2D< Derived >::sizeCols(), STKRUNTIME_ERROR_NO_ARG, and STK::IArray2D< Derived >::transferCol().
Referenced by STK::AdditiveBSplineCoefficients< Array >::extrapolate(), main(), STK::IArray2D< Derived >::merge(), STK::IArray2D< Derived >::merge(), and STK::AdditiveBSplineCoefficients< Array >::run().
Derived & STK::IArray2D< Derived >::move | ( | Derived const & | T | ) |
move T to this.
T | the array to move. |
Definition at line 856 of file STK_IArray2D.h.
Referenced by STK::applySort1D(), main(), STK::MultidimRegression< Array, Weight >::regressionStep(), and STK::MultidimRegression< Array, Weight >::regressionStep().
|
private |
Internal method setting default parameters and dimension to a column of the container.
col | the position of the column to initialize to a default value. |
Definition at line 1013 of file STK_IArray2D.h.
|
protected |
Internal method for initializing to default values (null pointer and null range) to a range of columns.
J | horizontal range |
Definition at line 998 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::nullCols(), and STKOUT_OF_RANGE_1ARG.
Referenced by STK::IArray2D< Derived >::nullCols().
|
inline |
|
inline |
Definition at line 294 of file STK_IArray2D.h.
|
inline |
i,j | indexes of the element to get |
Definition at line 259 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::beginCols(), STK::IArray2D< Derived >::beginRows(), STK::IArray2D< Derived >::endCols(), STK::IArray2D< Derived >::endRows(), and STKOUT_OF_RANGE_2ARG.
|
inline |
i,j | row and column indexes |
Definition at line 246 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::beginCols(), STK::IArray2D< Derived >::beginRows(), STK::IArray2D< Derived >::endCols(), STK::IArray2D< Derived >::endRows(), and STKOUT_OF_RANGE_2ARG.
|
inline |
i,J | index of the row and range of the columns |
i
of this in the range J
Definition at line 147 of file STK_IArray2DSlicers.h.
|
inline |
I,j | range of the rows and index of the column |
j
of this in the range I
Definition at line 131 of file STK_IArray2DSlicers.h.
References STKOUT_OF_RANGE_2ARG.
|
inline |
I,J | range of the rows and of the columns |
I
, J
Definition at line 152 of file STK_IArray2DSlicers.h.
|
inline |
i | index of the element to get |
Definition at line 284 of file STK_IArray2D.h.
References STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STKOUT_OF_RANGE_1ARG.
|
inline |
i | index of the element to get |
Definition at line 272 of file STK_IArray2D.h.
References STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STKOUT_OF_RANGE_1ARG.
|
inline |
I | range to get |
Definition at line 120 of file STK_IArray2DSlicers.h.
References STK_STATIC_ASSERT_ONE_DIMENSION_ONLY.
void STK::IArray2D< Derived >::popBackCols | ( | int | n = 1 | ) |
Delete last columns of the array.
n | the number of Columns to delete (default is 1) |
Definition at line 371 of file STK_IArray2DModifiers.h.
Referenced by main(), STK::IArray2D< Derived >::popFrontCols(), STK::IArray2D< Array2D< Type_ > >::reserveCols(), and STK::IArray2D< Array2D< Type_ > >::reserveRows().
void STK::IArray2D< Derived >::popBackRows | ( | int | n = 1 | ) |
Delete n latest rows of the array.
n | number of rows to delete (default is 1) |
Definition at line 255 of file STK_IArray2DModifiers.h.
References STK::IArray2D< Derived >::popBackRows(), STKOUT_OF_RANGE_1ARG, and STKRUNTIME_ERROR_1ARG.
Referenced by STK::IArray2D< Derived >::popBackRows().
void STK::IArray2D< Derived >::popFrontCols | ( | int | n = 1 | ) |
Delete first columns of the array.
n | the number of Columns to delete (default is 1) |
Definition at line 355 of file STK_IArray2DModifiers.h.
References STK::IArray2D< Derived >::popBackCols(), STKOUT_OF_RANGE_1ARG, and STKRUNTIME_ERROR_1ARG.
void STK::IArray2D< Derived >::popFrontRows | ( | int | n = 1 | ) |
Delete n first rows of the array.
n | number of rows to delete (default is 1) |
Definition at line 240 of file STK_IArray2DModifiers.h.
References STK::IArray2D< Derived >::popFrontRows(), STKOUT_OF_RANGE_1ARG, and STKRUNTIME_ERROR_1ARG.
Referenced by STK::IArray2D< Derived >::popFrontRows().
|
inline |
j | the index of the column |
Definition at line 208 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::allocator_, and STK::MemAllocator< Type_, Size_ >::elt().
Referenced by STK::IArray2D< Derived >::capacityCol(), and STK::IArray2D< Derived >::elt2Impl().
void STK::IArray2D< Derived >::push_back | ( | Type const & | v | ) |
STL compatibility: append an element v.
v | value to append back |
Definition at line 561 of file STK_IArray2DModifiers.h.
References STK_STATIC_ASSERT_ONE_DIMENSION_ONLY.
void STK::IArray2D< Derived >::push_front | ( | Type const & | v | ) |
STL compatibility: push front an element.
v | value to push front |
Definition at line 552 of file STK_IArray2DModifiers.h.
References STK_STATIC_ASSERT_ONE_DIMENSION_ONLY.
Derived & STK::IArray2D< Derived >::pushBackCols | ( | IArray1D< Other > const & | other | ) |
Specialization for Array1D.
merge (by value) the array other with this
other | the column to add to this |
Definition at line 413 of file STK_IArray2DModifiers.h.
void STK::IArray2D< Derived >::pushBackCols | ( | int | n = 1 | ) |
Add n columns at the end of the array.
n | the number of Columns to add (default is 1) |
Definition at line 343 of file STK_IArray2DModifiers.h.
References STK::IArray2D< Derived >::pushBackCols(), and STKRUNTIME_ERROR_1ARG.
Referenced by main(), and STK::IArray2D< Derived >::pushBackCols().
Derived & STK::IArray2D< Derived >::pushBackRows | ( | ExprBase< Other > const & | other | ) |
set other at the end of this (concatenate).
Perform a copy of the values stored in other to this.
other | the array to add back |
Definition at line 302 of file STK_IArray2DModifiers.h.
References STK::IArray2D< Derived >::pushBackRows(), and STKRUNTIME_ERROR_NO_ARG.
void STK::IArray2D< Derived >::pushBackRows | ( | int | n = 1 | ) |
Add n rows to the array.
n | number of rows to add (default is 1) |
Definition at line 228 of file STK_IArray2DModifiers.h.
References STK::IArray2D< Derived >::pushBackRows(), and STKRUNTIME_ERROR_1ARG.
Referenced by main(), STK::SArray2DVector< Type_ >::pushBack(), STK::IArray2D< Derived >::pushBackRows(), STK::IArray2D< Derived >::pushBackRows(), and STK::IArray2D< Derived >::pushFrontRows().
Derived & STK::IArray2D< Derived >::pushFrontCols | ( | ExprBase< Other > const & | other | ) |
merge (by value) the array other with this.
other | the array to merge to this |
Definition at line 388 of file STK_IArray2DModifiers.h.
void STK::IArray2D< Derived >::pushFrontCols | ( | int | n = 1 | ) |
Insert n columns at the beginning of the array.
n | the number of column to insert (default is 1) |
Definition at line 331 of file STK_IArray2DModifiers.h.
References STK::IArray2D< Derived >::pushFrontCols(), and STKRUNTIME_ERROR_1ARG.
Referenced by main(), and STK::IArray2D< Derived >::pushFrontCols().
Derived & STK::IArray2D< Derived >::pushFrontRows | ( | ExprBase< Other > const & | other | ) |
set other at the beginning of this (concatenate).
Perform a copy of the values stored in other to this.
other | the array to add |
Definition at line 273 of file STK_IArray2DModifiers.h.
References STK::IArray2D< Derived >::pushBackRows(), and STKRUNTIME_ERROR_NO_ARG.
void STK::IArray2D< Derived >::pushFrontRows | ( | int | n = 1 | ) |
Insert n rows in front of the array.
n | number of elements to insert (default is 1) |
Definition at line 216 of file STK_IArray2DModifiers.h.
References STK::IArray2D< Derived >::pushFrontRows(), and STKRUNTIME_ERROR_1ARG.
Referenced by main(), and STK::IArray2D< Derived >::pushFrontRows().
|
inline |
col | index of the column we want the range |
Definition at line 220 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::col(), and STK::IArray2D< Derived >::rangeCols_.
|
inline |
Definition at line 216 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::rangeCols_.
|
protected |
Method for memory reallocation and initialization of the horizontal range of the container.
The vertical range is not set in this method. If an error occur, we set the cols_ of the container to default.
J | horizontal range |
Definition at line 979 of file STK_IArray2D.h.
References STK::Arrays::evalSizeCapacity().
Referenced by STK::IArray2D< Derived >::merge(), and STK::IArray2D< Derived >::merge().
void STK::IArray2D< Derived >::reserve | ( | int | sizeRows, |
int | sizeCols | ||
) |
function for reserving memory in all the columns
sizeRows,sizeCols | the size to reserve for the rows and columns |
Definition at line 46 of file STK_IArray2DModifiers.h.
void STK::IArray2D< Derived >::reserveCols | ( | int | sizeCols | ) |
Reserve a certain amount of columns.
sizeCols | the size to reserve. |
Definition at line 61 of file STK_IArray2DModifiers.h.
References STK::IRunnerBase::error(), STK::IArray2D< Derived >::reserveCols(), and STKRUNTIME_ERROR_1ARG.
Referenced by STK::IArray2D< Derived >::reserveCols().
|
private |
Internal method for reserving rows to a specified column.
reserve size
memory place to the column col
of the array
col,size | index of the column and size to reserve |
Definition at line 95 of file STK_IArray2DModifiers.h.
void STK::IArray2D< Derived >::reserveRows | ( | int | size | ) |
Reserve a certain amount of rows in all columns.
size | the size to reserve |
Definition at line 55 of file STK_IArray2DModifiers.h.
|
private |
Internal method for reserving memory in a range of columns.
J | range of the columns to initialize |
size | the size to reserve |
Definition at line 85 of file STK_IArray2DModifiers.h.
Derived & STK::IArray2D< Derived >::resize | ( | Range const & | I | ) |
I | the new range for the vector/point |
Definition at line 208 of file STK_IArray2DModifiers.h.
Derived & STK::IArray2D< Derived >::resize | ( | Range const & | I, |
Range const & | J | ||
) |
resize the array.
I | the new range for the rows of the array |
J | the new range for the columns of the array |
Definition at line 172 of file STK_IArray2DModifiers.h.
References STK::IArray2D< Derived >::resize(), and STKRUNTIME_ERROR_2ARG.
Referenced by STK::bidiag(), STK::Law::Categorical::computeCumProb(), STK::CategoricalBase< Derived >::initializeModelImpl(), STK::LocalVariance< Array >::LocalVariance(), STK::Qr::qr(), STK::IArray2D< Derived >::resize(), STK::SArray2DVector< Type_ >::resize1D(), STK::JointBernoulliParameters::resizeImpl(), STK::JointGammaParameters::resizeImpl(), STK::JointGaussianParameters::resizeImpl(), STK::AdditiveBSplineCoefficients< Array >::run(), STK::lapack::Qr::runImpl(), and STK::MultiLaw::Normal< RowVector >::setParameters().
|
private |
Internal method for resizing a column with a specified range.
This method resize the column col
to the desired range using:
shiftRow
popBackRowsToCol
or pushBackRowsToCol
if needed. col | index of the column |
I | range to set to the column |
Definition at line 601 of file STK_IArray2DModifiers.h.
Referenced by STK::IArray2D< Derived >::update().
|
inline |
access to a part of a row.
i | index of the row |
Definition at line 84 of file STK_IArray2DSlicers.h.
Referenced by main(), main(), and STK::Qr::qr().
|
inline |
access to a part of a row.
i,J | index of the row and range of the columns |
Definition at line 92 of file STK_IArray2DSlicers.h.
References STK::inf().
|
inline |
access to many rows.
I | range of the index of the rows |
I
Definition at line 99 of file STK_IArray2DSlicers.h.
|
inline |
Definition at line 178 of file STK_IArray2D.h.
References STK::IContainer2D< SizeRows_, SizeCols_ >::rows().
Referenced by STK::IArray2D< Derived >::merge(), and STK::IArray2D< Derived >::merge().
|
inline |
Definition at line 173 of file STK_IArray2D.h.
References STK::IContainer2D< SizeRows_, SizeCols_ >::rows().
|
inline |
Set the columns range.
J | the columns range |
Definition at line 143 of file STK_IContainer2D.h.
|
inline |
Set the range of the number of rows.
I | the range of the rows number |
Definition at line 114 of file STK_IContainer2D.h.
Referenced by STK::IArray2D< Derived >::merge(), and STK::IArray2D< Derived >::merge().
|
inline |
implement setValue for vector/point/diagonal arrays
Definition at line 229 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::allocator_, and STK::MemAllocator< Type_, Size_ >::elt().
|
inline |
implement setValue for vector/point/diagonal arrays
Definition at line 223 of file STK_IArray2D.h.
References STK_STATIC_ASSERT_ONE_DIMENSION_ONLY.
void STK::IArray2D< Derived >::shift | ( | int | beg | ) |
New first index for the object (only for vectors/points/square/... arrays)
beg | the index of the first element to set |
Definition at line 116 of file STK_IArray2DModifiers.h.
void STK::IArray2D< Derived >::shift | ( | int | rbeg, |
int | cbeg | ||
) |
Set new beginning indexes to the array.
rbeg,cbeg | the indexes of the first row and first column to set |
Definition at line 107 of file STK_IArray2DModifiers.h.
Referenced by STK::SArray2DVector< Type_ >::shift1D().
void STK::IArray2D< Derived >::shiftCols | ( | int | cbeg | ) |
New first index for the columns of the object.
cbeg | the index of the first column to set |
Definition at line 140 of file STK_IArray2DModifiers.h.
References STK::IArray2D< Derived >::shiftCols(), and STKRUNTIME_ERROR_1ARG.
Referenced by STK::IArray2D< Derived >::shiftCols().
|
private |
internal method for translating a column.
Method for the the allocation of memory of the column pos with the given range.
col,beg | index of the column and new begin of the column |
Definition at line 159 of file STK_IArray2DModifiers.h.
void STK::IArray2D< Derived >::shiftRows | ( | int | beg | ) |
New first index for the rows of the array.
beg | the index of the first row to set |
Definition at line 122 of file STK_IArray2DModifiers.h.
References STK::IArray2D< Derived >::shiftRows(), and STKRUNTIME_ERROR_1ARG.
Referenced by STK::IArray2D< Derived >::shiftRows().
|
inline |
Definition at line 193 of file STK_IArray2D.h.
References STK::IContainer2D< SizeRows_, SizeCols_ >::sizeCols().
Referenced by STK::MultidimRegression< Array, Weight >::computeNbFreeParameter(), STK::IArray2D< Derived >::merge(), and STK::IArray2D< Derived >::merge().
|
inline |
Definition at line 184 of file STK_IArray2D.h.
References STK::IContainer2D< SizeRows_, SizeCols_ >::sizeRows().
Referenced by STK::MultidimRegression< Array, Weight >::computeNbFreeParameter().
|
inline |
access to a sub-array.
I,J | range of the rows and of the columns |
Definition at line 112 of file STK_IArray2DSlicers.h.
|
inline |
J | Range of the elements |
Definition at line 106 of file STK_IArray2DSlicers.h.
Referenced by main().
|
inline |
swap two elements: only for vectors and points
i,j | indexes of the elemet to swap |
Definition at line 532 of file STK_IArray2D.h.
References STK_STATIC_ASSERT_ONE_DIMENSION_ONLY.
Referenced by STK::Svd< Array >::diag(), and STK::LocalVariance< Array >::prim().
|
inline |
Swapping two columns.
pos1,pos2 | positions of the columns to swap |
Definition at line 514 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::allocator_, STK::IArray2D< Derived >::beginCols(), STK::IArray2D< Derived >::endCols(), STK::IArray2D< Derived >::rangeCols_, STKOUT_OF_RANGE_2ARG, STK::MemAllocator< Type_, Size_ >::swap(), and STK::IArray2D< Derived >::swapCols().
Referenced by STK::Svd< Array >::diag(), and STK::IArray2D< Derived >::swapCols().
|
inlineprivate |
Internal method transferring column pos of container T to column pos of this.
Set the column pos in T to zero. The column pos in this should not exists or should be deleted previously otherwise user will experiment a memory leak.
T | the container with the column to transfer |
pos | index of the column to transfer |
Definition at line 720 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::allocator_, STK::MemAllocator< Type_, Size_ >::elt(), and STK::IArray2D< Derived >::rangeCols_.
|
inlineprotected |
Transfer the column pos2 to the column pos1 of this.
pos1,pos2 | indexes of the columns |
Definition at line 654 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::allocator_, STK::MemAllocator< Type_, Size_ >::elt(), and STK::IArray2D< Derived >::rangeCols_.
Referenced by STK::IArray2D< Derived >::merge().
|
inline |
Update column of the array at specified position.
col | index of the column to update |
Definition at line 630 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::beginCols(), STK::IArray2D< Derived >::col(), STK::IArray2D< Derived >::lastIdxCols(), STK::IArray2D< Derived >::rangeCols_, STK::IArray2D< Derived >::resizeRowCol(), STKOUT_OF_RANGE_1ARG, and STK::IArray2D< Derived >::update().
|
inline |
Update columns of the array at a specified range.
J | range of the columns to update |
Definition at line 616 of file STK_IArray2D.h.
References STK::IArray2D< Derived >::beginCols(), STK::IArray2D< Derived >::endCols(), STKOUT_OF_RANGE_1ARG, and STK::IArray2D< Derived >::update().
Referenced by STK::IArray2D< Derived >::update(), and STK::IArray2D< Derived >::update().
Definition at line 81 of file STK_IArray2D.h.
|
protected |
allocator of the column data set
Definition at line 644 of file STK_IArray2D.h.
Referenced by STK::IArray2D< Derived >::allocator(), STK::IArray2D< Derived >::allocator(), STK::IArray2D< Derived >::availableCols(), STK::IArray2D< Derived >::elt2Impl(), STK::IArray2D< Derived >::exchange(), STK::IArray2D< Derived >::isRef(), STK::IArray2D< Derived >::merge(), STK::IArray2D< Derived >::merge(), STK::IArray2D< Derived >::ptr(), STK::IArray2D< Derived >::setValueImpl(), STK::IArray2D< Derived >::swapCols(), STK::IArray2D< Derived >::transferCol(), and STK::IArray2D< Derived >::transferCol().
|
protected |
range of the index of the columns of the container.
Definition at line 646 of file STK_IArray2D.h.
Referenced by STK::IArray2D< Derived >::exchange(), STK::IArray2D< Derived >::IArray2D(), STK::IArray2D< Derived >::merge(), STK::IArray2D< Derived >::rangeCol(), STK::IArray2D< Derived >::rangeCols(), STK::IArray2D< Derived >::swapCols(), STK::IArray2D< Derived >::transferCol(), STK::IArray2D< Derived >::transferCol(), and STK::IArray2D< Derived >::update().