STK++ 0.9.13
|
Interface class for SparseArray1D. More...
#include <STK_ISparseArray1D.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 ITContainer1D< Derived > | Base |
typedef hidden::Traits< Derived >::Type | Type |
typedef hidden::Traits< Derived >::Col | Col |
typedef hidden::Traits< Derived >::SubArray | SubArray |
typedef hidden::CheckShift< Derived, structure_ > | CheckShift |
typedef TRange< sizeRows_ > | RowRange |
Type of the Range for the rows. | |
typedef TRange< sizeCols_ > | ColRange |
Type of the Range for the columns. | |
![]() | |
enum | { size_ = hidden::Traits<Derived>::size_ } |
typedef hidden::Traits< Derived >::Type | Type |
typedef hidden::Traits< Derived >::TypeConst | TypeConst |
typedef hidden::Traits< Derived >::RowRange | RowRange |
typedef hidden::Traits< Derived >::ColRange | ColRange |
typedef hidden::Traits< Derived >::Row | Row |
typedef hidden::Traits< Derived >::Col | Col |
typedef hidden::Traits< Derived >::SubVector | SubVector |
typedef hidden::Traits< Derived >::Iterator | Iterator |
typedef hidden::Traits< Derived >::ConstIterator | ConstIterator |
typedef hidden::Traits< Derived >::ReverseIterator | ReverseIterator |
typedef hidden::Traits< Derived >::ConstReverseIterator | ConstReverseIterator |
Public Member Functions | |
bool | isRef () const |
void | setRef (bool ref) const |
Modify the state of the container: this become a reference (if ref is true ) or the owner of the data (if ref is false ). | |
Allocator const & | allocator () const |
RowRange const & | rows () const |
int | beginRows () const |
int | endRows () const |
int | sizeRows () const |
ColRange | cols () const |
int | beginCols () const |
int | endCols () const |
int | sizeCols () const |
int | lastIdxRows () const |
int | lastIdxCols () const |
int | capacity () const |
Type & | elt1Impl (int pos) |
access to an element | |
TypeConst | elt1Impl (int pos) const |
access to a constant element | |
void | shiftImpl (int beg=baseIdx) |
New beginning index for the object. | |
Derived & | resizeImpl (Range const &I) |
Resize the container. | |
void | reserve (int size) |
reserve internal memory for at least size elements. | |
void | clear () |
Clear the object. | |
void | move (Derived const &T) |
move T to this. | |
Derived & | pushBack (int n=1) |
Add n Elements to the end of the container. | |
Derived & | popBack (int n=1) |
Delete last elts of the container. | |
Derived & | erase (int pos, int n=1) |
Delete n elements at the pos index to the container. | |
Derived & | insertElt (int pos, int n=1) |
Insert n elements at the position pos of the container. | |
Derived & | insert (int pos, Type const &v) |
STL compatibility: Insert element v at position pos of the Array. | |
Derived & | insert (Range const &I, Type const &v) |
STL compatibility: Insert element v in the range I of the Array. | |
Derived & | push_front (Type const &v) |
STL compatibility: push front an element. | |
Derived & | push_back (Type const &v) |
STL compatibility: append an element v. | |
void | swap (int pos1, int pos2) |
Swapping the pos1 elt and the pos2 elt. | |
void | exchange (ISparseArray1D &T) |
exchange this Container with T. | |
Derived & | assign (ISparseArray1D const &src) |
overwrite this with src . | |
Derived & | setValue (Type const &value) |
set a value to this container. | |
RowRange const & | range () const |
int | begin () const |
int | end () const |
int | size () const |
Type & | elt (int i) |
TypeConst | elt (int i) const |
void | setRange (RowRange const &I=RowRange()) |
Set range of the rows of the container. | |
![]() | |
RowRange const & | range () const |
int | begin () const |
int | end () const |
int | size () const |
int | lastIdx () const |
Iterator | beginIterator () |
Iterator | endIterator () |
ConstIterator | beginConstIterator () const |
ConstIterator | endConstIterator () const |
ReverseIterator | rbeginIterator () |
ReverseIterator | rendIterator () |
ConstReverseIterator | rbeginConstIterator () const |
ConstReverseIterator | rendConstIterator () const |
bool | empty () const |
Is there some data ? | |
Type & | elt (int i) |
TypeConst | elt (int i) const |
Type & | operator[] (int i) |
TypeConst | operator[] (int i) const |
Type & | at (int i) |
TypeConst | at (int i) const |
SubVector | sub (Range const &I) const |
Access to many elements. | |
Type & | front () |
TypeConst | front () const |
Type & | back () |
TypeConst | back () const |
void | shift (int beg) |
Derived & | resize (Range const &I=RowRange()) |
![]() | |
Derived & | asDerived () |
static cast : return a reference of this with a cast to the derived class. | |
Derived const & | asDerived () const |
static cast : return a const reference of this with a cast to the derived class. | |
Derived * | asPtrDerived () |
static cast : return a ptr on a Derived of this with a cast to the derived class. | |
Derived const * | asPtrDerived () const |
static cast : return a ptr on a constant Derived of this with a cast to the derived class. | |
Derived * | clone () const |
create a leaf using the copy constructor of the Derived class. | |
Derived * | clone (bool isRef) const |
create a leaf using the copy constructor of the Derived class and a flag determining if the clone is a reference or not. | |
Protected Member Functions | |
ISparseArray1D () | |
Default constructor. | |
ISparseArray1D (Range const &I) | |
constructor with a specified Range. | |
ISparseArray1D (Range const &I, Type const &v) | |
Misc constructor with first and last, initialization with a constant. | |
ISparseArray1D (const ISparseArray1D &T, bool ref=false) | |
Copy constructor. | |
template<class OtherDerived > | |
ISparseArray1D (ExprBase< OtherDerived > const &T) | |
Copy constructor. | |
ISparseArray1D (ISparseArray1D const &T, Range const &I) | |
constructor by reference, ref_=1. | |
template<class OtherDerived > | |
ISparseArray1D (ISparseArray1D< OtherDerived > const &T, Range const &I) | |
constructor by reference, ref_=1. | |
~ISparseArray1D () | |
destructor: allocated memory is liberated by MemAllocator base class. | |
![]() | |
ITContainer1D () | |
Default constructor. | |
ITContainer1D (RowRange const &I) | |
constructor with a specified range. | |
~ITContainer1D () | |
destructor. | |
void | exchange (ITContainer1D &T) |
exchange this container with T | |
void | setRange (RowRange const &I=RowRange()) |
Set range of the rows of the container. | |
void | incRange (int n=1) |
increment the range of the container (can be negative). | |
void | incFirst (int n=1) |
increment the beginning of the container (can be negative). | |
void | decFirst (int n=1) |
decrement the beginning of the container. | |
void | incLast (int n=1) |
increment the end of the container (can be negative). | |
void | decLast (int n=1) |
decrement the end of the container. | |
![]() | |
IRecursiveTemplate () | |
constructor. | |
~IRecursiveTemplate () | |
destructor. | |
Interface class for SparseArray1D.
This class is the base class that is inherited by all objects (matrix, vector, point) which are not expressions and stored as SparseArrays. The common API for these objects is contained in this class.
Derived | is the derived type, e.g., a matrix type. |
Definition at line 56 of file STK_ISparseArray1D.h.
typedef ITContainer1D<Derived> STK::ISparseArray1D< Derived >::Base |
Definition at line 59 of file STK_ISparseArray1D.h.
typedef hidden::CheckShift<Derived, structure_> STK::ISparseArray1D< Derived >::CheckShift |
Definition at line 77 of file STK_ISparseArray1D.h.
typedef hidden::Traits<Derived>::Col STK::ISparseArray1D< Derived >::Col |
Definition at line 63 of file STK_ISparseArray1D.h.
typedef TRange<sizeCols_> STK::ISparseArray1D< Derived >::ColRange |
Type of the Range for the columns.
Definition at line 81 of file STK_ISparseArray1D.h.
typedef TRange<sizeRows_> STK::ISparseArray1D< Derived >::RowRange |
Type of the Range for the rows.
Definition at line 79 of file STK_ISparseArray1D.h.
typedef hidden::Traits<Derived>::SubArray STK::ISparseArray1D< Derived >::SubArray |
Definition at line 67 of file STK_ISparseArray1D.h.
typedef hidden::Traits<Derived>::Type STK::ISparseArray1D< Derived >::Type |
Definition at line 61 of file STK_ISparseArray1D.h.
Enumerator | |
---|---|
structure_ | |
orient_ | |
sizeRows_ | |
sizeCols_ | |
storage_ |
Definition at line 69 of file STK_ISparseArray1D.h.
|
protected |
Default constructor.
|
protected |
constructor with a specified Range.
I | range of the container |
|
protected |
Misc constructor with first and last, initialization with a constant.
I | range of the container |
v | initial value of the container |
|
protected |
Copy constructor.
T | the container to copy |
ref | true if T is wrapped |
|
protected |
Copy constructor.
T | the container to copy |
|
protected |
constructor by reference, ref_=1.
T,I | the container and the range of data to wrap |
|
protected |
constructor by reference, ref_=1.
T,I | the container and the range of data to wrap |
|
inlineprotected |
destructor: allocated memory is liberated by MemAllocator base class.
Definition at line 124 of file STK_ISparseArray1D.h.
|
inline |
Definition at line 139 of file STK_ISparseArray1D.h.
Derived & STK::ISparseArray1D< Derived >::assign | ( | ISparseArray1D< Derived > const & | src | ) |
overwrite this
with src
.
this
is not resized, and in this case, the method take care of the possibility of overlapping. src | the container to assign |
|
inline |
Definition at line 113 of file STK_ITContainer1D.h.
Referenced by STK::ISparseArray1D< Derived >::beginRows().
|
inline |
Definition at line 153 of file STK_ISparseArray1D.h.
References STK::baseIdx.
|
inline |
Definition at line 144 of file STK_ISparseArray1D.h.
References STK::ISparseArray1D< Derived >::begin().
|
inline |
Definition at line 165 of file STK_ISparseArray1D.h.
References STK::ISparseArray1D< Derived >::isRef().
void STK::ISparseArray1D< Derived >::clear | ( | ) |
Clear the object.
Memory is liberated and the range of the Container is set to 0:-1 or 1:0 (
|
inline |
Definition at line 151 of file STK_ISparseArray1D.h.
|
inline |
i | index of the element to get |
Definition at line 150 of file STK_ITContainer1D.h.
|
inline |
i | index of the element to get |
Definition at line 161 of file STK_ITContainer1D.h.
|
inline |
access to an element
pos | index of the element |
Definition at line 171 of file STK_ISparseArray1D.h.
|
inline |
access to a constant element
pos | index of the const element |
Definition at line 176 of file STK_ISparseArray1D.h.
|
inline |
Definition at line 115 of file STK_ITContainer1D.h.
Referenced by STK::ISparseArray1D< Derived >::endRows().
|
inline |
Definition at line 155 of file STK_ISparseArray1D.h.
References STK::baseIdx.
|
inline |
Definition at line 146 of file STK_ISparseArray1D.h.
References STK::ISparseArray1D< Derived >::end().
Derived & STK::ISparseArray1D< Derived >::erase | ( | int | pos, |
int | n = 1 |
||
) |
Delete n elements at the pos index to the container.
pos | index where to delete elements |
n | number of elements to delete (default 1) |
void STK::ISparseArray1D< Derived >::exchange | ( | ISparseArray1D< Derived > & | T | ) |
exchange this Container with T.
T | the Array to exchange with this |
Derived & STK::ISparseArray1D< Derived >::insert | ( | int | pos, |
Type const & | v | ||
) |
STL compatibility: Insert element v
at position pos
of the Array.
pos | position to insert elements |
v | value to insert |
Derived & STK::ISparseArray1D< Derived >::insert | ( | Range const & | I, |
Type const & | v | ||
) |
STL compatibility: Insert element v
in the range I
of the Array.
I | range of the index where to insert elements |
v | value to insert |
Derived & STK::ISparseArray1D< Derived >::insertElt | ( | int | pos, |
int | n = 1 |
||
) |
Insert n elements at the position pos of the container.
pos,n | index where to insert the n elements (default is 1) |
|
inline |
true
if *this is reference container, false
otherwise Definition at line 128 of file STK_ISparseArray1D.h.
Referenced by STK::ISparseArray1D< Derived >::capacity().
|
inline |
Definition at line 162 of file STK_ISparseArray1D.h.
References STK::baseIdx.
|
inline |
Definition at line 160 of file STK_ISparseArray1D.h.
References STK::ITContainer1D< Derived >::lastIdx().
void STK::ISparseArray1D< Derived >::move | ( | Derived const & | T | ) |
move T to this.
T | the container to move to this. |
Derived & STK::ISparseArray1D< Derived >::popBack | ( | int | n = 1 | ) |
Delete last elts of the container.
n | number of elts to delete |
Derived & STK::ISparseArray1D< Derived >::push_back | ( | Type const & | v | ) |
STL compatibility: append an element v.
v | value to append |
Derived & STK::ISparseArray1D< Derived >::push_front | ( | Type const & | v | ) |
STL compatibility: push front an element.
v | value to append |
Derived & STK::ISparseArray1D< Derived >::pushBack | ( | int | n = 1 | ) |
Add n Elements to the end of the container.
n | number of elements to add |
|
inline |
Definition at line 111 of file STK_ITContainer1D.h.
Referenced by STK::ISparseArray1D< Derived >::rows().
void STK::ISparseArray1D< Derived >::reserve | ( | int | size | ) |
reserve internal memory for at least size elements.
size | number of elements to reserve |
Derived & STK::ISparseArray1D< Derived >::resizeImpl | ( | Range const & | I | ) |
Resize the container.
shift
pushBack
if there will be more elementspopBack
if three will be less elements I | the range to set to the Array1D |
|
inline |
Definition at line 142 of file STK_ISparseArray1D.h.
References STK::ISparseArray1D< Derived >::range().
|
inline |
Set range of the rows of the container.
I | the range to set (default empty) |
Definition at line 255 of file STK_ITContainer1D.h.
|
inline |
Modify the state of the container: this become a reference (if ref is true
) or the owner of the data (if ref is false
).
ref | : has top be false if this own its own data |
Definition at line 134 of file STK_ISparseArray1D.h.
Derived & STK::ISparseArray1D< Derived >::setValue | ( | Type const & | value | ) |
set a value to this container.
value | the value to set |
void STK::ISparseArray1D< Derived >::shiftImpl | ( | int | beg = baseIdx | ) |
New beginning index for the object.
beg | the index of the first column to set |
|
inline |
Definition at line 117 of file STK_ITContainer1D.h.
Referenced by STK::ISparseArray1D< Derived >::sizeRows().
|
inline |
|
inline |
Definition at line 148 of file STK_ISparseArray1D.h.
References STK::ISparseArray1D< Derived >::size().
void STK::ISparseArray1D< Derived >::swap | ( | int | pos1, |
int | pos2 | ||
) |
Swapping the pos1 elt and the pos2 elt.
pos1,pos2 | positions of the elements to swap |