|
STK++ 1.0
|
Specialization of the templated class Array1D for Real.
More...
#include <STK_Vector.h>

Public Member Functions | |
| Array1D (Range const &I=Range()) | |
| Default constructor : first_ =1 and last_ =0. | |
| Array1D (Range const &I, Real const &v) | |
| Misc constructor with beg and end, initialization with a constant. | |
| Array1D (const Array1D &T, bool ref=false) | |
| Copy constructor. | |
| Array1D (Array1D const &T, Range const &I) | |
| constructor by reference, ref_=1. | |
| Array1D (Real *q, Range const &I, Integer const &index=0) | |
| Wrapper constructor : the container is a reference. | |
| Array1D (const _IArrayBaseType &T, Range const &I, Integer const &index) | |
| constructor by reference, ref_=1. | |
| virtual | ~Array1D () |
| Virtual destructor: allocated memory is liberated by IArrayBase base class. | |
| Real & | elt (Integer const &pos) |
| access to one element. | |
| Real const & | elt (Integer const &pos) const |
| access to one element const. | |
| Array1D | elt (Range const &J) const |
| access to many elements. | |
| Array1D & | operator= (Array1D const &T) |
| operator = : overwrite the Array1D with T. | |
| Array1D & | operator= (Real const &v) |
| operator= : set the container to a constant value. | |
| Array1D & | operator+= (Real const &v) |
| operator+= Adding a constant. | |
| Array1D & | operator-= (Real const &v) |
| operator -= decreasing a constant. | |
| Array1D & | operator/= (Real const &v) |
| operator /= Dividing a constant. | |
| Array1D & | operator*= (Real const &v) |
| operator *= Multiplying a constant. | |
| template<class LEAF > | |
| Array1D & | operator= (const ITContainer1D< Real, LEAF > &T) |
| operator = : overwrite the Array1D with the container T. | |
| template<class Exp > | |
| Array1D & | operator= (const Exp &rhs) |
| operator = overwriting a Array1D with An Expression. | |
| template<class Exp > | |
| Array1D & | operator+= (const Exp &rhs) |
| operator += Adding an Expression. | |
| template<class Exp > | |
| Array1D & | operator-= (const Exp &rhs) |
| operator -= decreasing an Expression. | |
| template<class Exp > | |
| Array1D & | operator/= (const Exp &rhs) |
| operator /= Dividing an Expression. | |
| template<class Exp > | |
| Array1D & | operator*= (const Exp &rhs) |
| operator *= Multiplying an Expression. | |
Private Types | |
| typedef IArrayBase< Real * > | _IArrayBaseType |
| Type for the Base reference Class. | |
| typedef RecursiveArray1D< Real, Array1D< Real > > | _IArray1DType |
| Type for the IArray1DBase Class. | |
Specialization of the templated class Array1D for Real.
A Vector is a final Array1D class. It is a vertical (column) container.
Definition at line 61 of file STK_Vector.h.
typedef IArrayBase<Real*> STK::Array1D< Real >::_IArrayBaseType [private] |
Type for the Base reference Class.
Reimplemented from STK::RecursiveArray1D< Real, Array1D< Real > >.
Definition at line 64 of file STK_Vector.h.
typedef RecursiveArray1D<Real, Array1D<Real> > STK::Array1D< Real >::_IArray1DType [private] |
Type for the IArray1DBase Class.
Reimplemented from STK::RecursiveArray1D< Real, Array1D< Real > >.
Definition at line 66 of file STK_Vector.h.
| STK::Array1D< Real >::Array1D | ( | Range const & | I = Range() | ) | [inline] |
Default constructor : first_ =1 and last_ =0.
| I | range of the container |
Definition at line 72 of file STK_Vector.h.
: _IArray1DType(I) { ;}
| STK::Array1D< Real >::Array1D | ( | Range const & | I, |
| Real const & | v | ||
| ) | [inline] |
Misc constructor with beg and end, initialization with a constant.
| I | range of the container |
| v | initial value of the container |
Definition at line 80 of file STK_Vector.h.
References STK::ITContainer1D< TYPE, Array1D< TYPE > >::first(), STK::ITContainer1D< TYPE, Array1D< TYPE > >::last(), and STK::IArrayBase< TYPE >::setData().
: _IArray1DType(I) { for (Integer i=first(); i<=last(); i++) setData(i, v); }
| STK::Array1D< Real >::Array1D | ( | const Array1D< Real > & | T, |
| bool | ref = false |
||
| ) | [inline] |
Copy constructor.
| T | the container to copy |
| ref | true if T is wrapped |
Definition at line 91 of file STK_Vector.h.
References STK::IArrayBase< DATA >::data(), STK::ITContainer1D< TYPE, Array1D< TYPE > >::first(), STK::ITContainer1D< TYPE, Array1D< TYPE > >::last(), and STK::IArrayBase< TYPE >::setData().
constructor by reference, ref_=1.
| T | the container to copy |
| I | range of the data to wrap |
Definition at line 106 of file STK_Vector.h.
: _IArray1DType(T, I) { ;}
Wrapper constructor : the container is a reference.
| q | pointer on data |
| I | range of the data |
| index | index (row or col) of the data |
Definition at line 115 of file STK_Vector.h.
: _IArray1DType(q, I, index) { ;}
| STK::Array1D< Real >::Array1D | ( | const _IArrayBaseType & | T, |
| Range const & | I, | ||
| Integer const & | index | ||
| ) | [inline] |
constructor by reference, ref_=1.
| T | the container to wrap |
| I | the range of the data to wrap |
| index | the index of the column to wrap |
Definition at line 124 of file STK_Vector.h.
: _IArray1DType(T.data(index), I, index) { ;}
| virtual STK::Array1D< Real >::~Array1D | ( | ) | [inline, virtual] |
Virtual destructor: allocated memory is liberated by IArrayBase base class.
Definition at line 131 of file STK_Vector.h.
{ ;}
| Real& STK::Array1D< Real >::elt | ( | Integer const & | pos | ) | [inline] |
access to one element.
| pos | index of the element |
Reimplemented from STK::ITContainer1D< Real, Array1D< Real > >.
Definition at line 136 of file STK_Vector.h.
References STK::IArrayBase< TYPE >::data().
{ return this->data(pos);}
| Real const& STK::Array1D< Real >::elt | ( | Integer const & | pos | ) | const [inline] |
access to one element const.
| pos | index of the const element |
Reimplemented from STK::ITContainer1D< Real, Array1D< Real > >.
Definition at line 142 of file STK_Vector.h.
References STK::IArrayBase< TYPE >::data().
{ return this->data(pos);}
| Array1D STK::Array1D< Real >::elt | ( | Range const & | J | ) | const [inline] |
access to many elements.
| J | the range of the elements |
Reimplemented from STK::ITContainer1D< Real, Array1D< Real > >.
Definition at line 148 of file STK_Vector.h.
References STK::Array1D< TYPE >::Array1D(), STK::ITContainer1D< TYPE, Array1D< TYPE > >::first(), STK::Range::first(), STK::ITContainer1D< TYPE, Array1D< TYPE > >::last(), and STK::Range::last().
| Array1D& STK::Array1D< Real >::operator= | ( | Array1D< Real > const & | T | ) | [inline] |
operator = : overwrite the Array1D with T.
We resize the object if this and T does not have the same size but if they have the same size, we don't modify the range of the object.
| T | the container to copy |
Definition at line 169 of file STK_Vector.h.
References STK::IArrayBase< DATA >::data(), STK::ITContainer1D< TYPE, TContainer1D >::first(), STK::ITContainer1D< TYPE, Array1D< TYPE > >::first(), STK::ITContainer1D< TYPE, Array1D< TYPE > >::last(), STK::ITContainer1D< TYPE, TContainer1D >::last(), STK::ITContainer1D< TYPE, TContainer1D >::range(), STK::IContainer1D::resize(), STK::IArrayBase< TYPE >::setData(), STK::ITContainer1D< TYPE, TContainer1D >::size(), and STK::ITContainer1D< TYPE, Array1D< TYPE > >::size().
{
// check size
if (size()!=T.size()) resize(T.range());
// copy without ovelapping.
if (first() < T.first())
{ for (Integer i=first(), j=T.first(); j<=T.last(); i++, j++)
setData(i, T.data(j));
}
else
{ for (Integer i=last(), j=T.last(); j>=T.first(); i--, j--)
setData(i, T.data(j));
}
return *this;
}
| Array1D& STK::Array1D< Real >::operator= | ( | Real const & | v | ) | [inline] |
operator= : set the container to a constant value.
| v | the value to set |
Definition at line 188 of file STK_Vector.h.
References STK::ITContainer1D< TYPE, Array1D< TYPE > >::first(), STK::ITContainer1D< TYPE, Array1D< TYPE > >::last(), and STK::IArrayBase< TYPE >::setData().
| Array1D& STK::Array1D< Real >::operator+= | ( | Real const & | v | ) | [inline] |
operator+= Adding a constant.
| v | the value to add |
Definition at line 198 of file STK_Vector.h.
References STK::Array1D< TYPE >::elt(), STK::ITContainer1D< TYPE, Array1D< TYPE > >::first(), and STK::ITContainer1D< TYPE, Array1D< TYPE > >::last().
| Array1D& STK::Array1D< Real >::operator-= | ( | Real const & | v | ) | [inline] |
operator -= decreasing a constant.
| v | the value to decrease |
Definition at line 208 of file STK_Vector.h.
References STK::Array1D< TYPE >::elt(), STK::ITContainer1D< TYPE, Array1D< TYPE > >::first(), and STK::ITContainer1D< TYPE, Array1D< TYPE > >::last().
| Array1D& STK::Array1D< Real >::operator/= | ( | Real const & | v | ) | [inline] |
operator /= Dividing a constant.
| v | the value to divide |
Definition at line 218 of file STK_Vector.h.
References STK::Array1D< TYPE >::elt(), STK::ITContainer1D< TYPE, Array1D< TYPE > >::first(), and STK::ITContainer1D< TYPE, Array1D< TYPE > >::last().
| Array1D& STK::Array1D< Real >::operator*= | ( | Real const & | v | ) | [inline] |
operator *= Multiplying a constant.
| v | the value to multiply |
Definition at line 228 of file STK_Vector.h.
References STK::Array1D< TYPE >::elt(), STK::ITContainer1D< TYPE, Array1D< TYPE > >::first(), and STK::ITContainer1D< TYPE, Array1D< TYPE > >::last().
| Array1D& STK::Array1D< Real >::operator= | ( | const ITContainer1D< Real, LEAF > & | T | ) | [inline] |
operator = : overwrite the Array1D with the container T.
We resize the object if this and T does not have the same size but if they have the same size, we don't modify the range of the object.
| T | the container to copy |
Definition at line 242 of file STK_Vector.h.
References STK::ITContainer1D< TYPE, TContainer1D >::first(), STK::ITContainer1D< TYPE, Array1D< TYPE > >::first(), STK::ITContainer1D< TYPE, Array1D< TYPE > >::last(), STK::ITContainer1D< TYPE, TContainer1D >::last(), STK::ITContainer1D< TYPE, TContainer1D >::range(), STK::IContainer1D::resize(), STK::IArrayBase< TYPE >::setData(), STK::ITContainer1D< TYPE, TContainer1D >::size(), and STK::ITContainer1D< TYPE, Array1D< TYPE > >::size().
{ // We have to resize if this and T does not have the same size
// but if they have the same size, we don't scale the index
if (size()!=T.size()) resize(T.range());
// copy without ovelapping
if (first() < T.first())
{ for (Integer j=first(), i=T.first(); i<=T.last(); j++, i++)
setData(j, T[i]);
}
else
{ for (Integer j=last(), i=T.last(); i>=T.first(); j--, i--)
setData(j, T[i]);
}
return *this;
}
| Array1D& STK::Array1D< Real >::operator= | ( | const Exp & | rhs | ) | [inline] |
operator = overwriting a Array1D with An Expression.
| rhs | the right hand side expression |
Definition at line 263 of file STK_Vector.h.
References STK::ITContainer1D< TYPE, Array1D< TYPE > >::first(), STK::ITContainer1D< TYPE, Array1D< TYPE > >::last(), and STK::IArrayBase< TYPE >::setData().
| Array1D& STK::Array1D< Real >::operator+= | ( | const Exp & | rhs | ) | [inline] |
operator += Adding an Expression.
| rhs | the right hand side expression |
Definition at line 274 of file STK_Vector.h.
References STK::Array1D< TYPE >::elt(), STK::ITContainer1D< TYPE, Array1D< TYPE > >::first(), and STK::ITContainer1D< TYPE, Array1D< TYPE > >::last().
| Array1D& STK::Array1D< Real >::operator-= | ( | const Exp & | rhs | ) | [inline] |
operator -= decreasing an Expression.
| rhs | the right hand side expression |
Definition at line 285 of file STK_Vector.h.
References STK::Array1D< TYPE >::elt(), STK::ITContainer1D< TYPE, Array1D< TYPE > >::first(), and STK::ITContainer1D< TYPE, Array1D< TYPE > >::last().
| Array1D& STK::Array1D< Real >::operator/= | ( | const Exp & | rhs | ) | [inline] |
operator /= Dividing an Expression.
| rhs | the right hand side expression |
Definition at line 296 of file STK_Vector.h.
References STK::Array1D< TYPE >::elt(), STK::ITContainer1D< TYPE, Array1D< TYPE > >::first(), and STK::ITContainer1D< TYPE, Array1D< TYPE > >::last().
| Array1D& STK::Array1D< Real >::operator*= | ( | const Exp & | rhs | ) | [inline] |
operator *= Multiplying an Expression.
| rhs | the right hand side expression |
Definition at line 307 of file STK_Vector.h.
References STK::Array1D< TYPE >::elt(), STK::ITContainer1D< TYPE, Array1D< TYPE > >::first(), and STK::ITContainer1D< TYPE, Array1D< TYPE > >::last().