STK++ 1.0

STK::ArrayHo< TYPE > Class Template Reference

Templated one dimensional horizontal Array. More...

#include <STK_ArrayHo.h>

Inheritance diagram for STK::ArrayHo< TYPE >:

List of all members.

Public Types

typedef IArrayBase< TYPE * > _IArrayBaseType
 Type for the Base reference Class.
typedef IArray1DBase< TYPE,
TYPE *, ArrayHo< TYPE > > 
_IArrayHoType
 Type for the Implementation Class.

Public Member Functions

 ArrayHo (Range const &I=Range())
 Default constructor : beg_ =1 and end_ =0.
 ArrayHo (Range const &I, TYPE const &v)
 Misc constructor with beg and end, initialization with a constant.
 ArrayHo (const ArrayHo &T, bool ref=false)
 Copy constructor.
 ArrayHo (const ArrayHo< TYPE > &T, Range const &I)
 constructor by reference, ref_=1.
 ArrayHo (const _IArrayBaseType &T, Range const &I, Integer row)
 constructor by reference, ref_=1.
virtual ~ArrayHo ()
 virtual destructor.
TYPE const & elt (Integer const &pos) const
 Get one element const.
TYPE & elt (Integer const &pos)
 Get one element.
ArrayHo elt (Range const &J) const
 access to many elements.
void clear ()
 clear the object.
void freeMem ()
 Method for memory deallocation.
void initialize (Range const &I)
 function for memory allocation and initialization.
void insert (Range const &I, TYPE const &v)
 Insert element v in the range I of the Container.
void pushBack (Integer const &n=1)
 Add n elements to the container.
void popBack (Integer const &n=1)
 Delete last elts of the container.
void erase (Integer const &pos, Integer const &n=1)
 Delete n elts at the pos index to the container.
ArrayHooperator= (const ArrayHo &T)
 operator = : overwrite the ArrayHo with the ArrayHo T.
ArrayHooperator= (TYPE const &v)
 operator= : set the container to a constant value.
template<class LEAF >
ArrayHooperator= (const ITContainer1D< TYPE, LEAF > &T)
 operator = : overwrite the ArrayHo with the container T.

Protected Member Functions

void insertElt (Integer const &pos, Integer const &n=1)
 Insert n elts at the position pos of the container.

Private Member Functions

void initElts (Range const &J)
 Method for elements memory allocation.
void freeElt (Integer const &pos)
 Method for elements memory deallocation.
void freeElts (Range const &J)
void initElt (Integer const &pos)
 function for the the allocation of memory of element pos.

Detailed Description

template<class TYPE>
class STK::ArrayHo< TYPE >

Templated one dimensional horizontal Array.

A ArrayHo is a horizontal container. In STK, the objects are vertical (column) or horizontal (rows).

By default the index of the first element is 1 but this can be modified using the appropriate constructor or using the method shift.

Definition at line 57 of file STK_ArrayHo.h.


Member Typedef Documentation

template<class TYPE>
typedef IArrayBase<TYPE*> STK::ArrayHo< TYPE >::_IArrayBaseType

Type for the Base reference Class.

Reimplemented from STK::IArray1DBase< TYPE, TYPE *, ArrayHo< TYPE > >.

Definition at line 61 of file STK_ArrayHo.h.

template<class TYPE>
typedef IArray1DBase<TYPE, TYPE*, ArrayHo<TYPE> > STK::ArrayHo< TYPE >::_IArrayHoType

Type for the Implementation Class.

Definition at line 64 of file STK_ArrayHo.h.


Constructor & Destructor Documentation

template<class TYPE>
STK::ArrayHo< TYPE >::ArrayHo ( Range const &  I = Range()) [inline]

Default constructor : beg_ =1 and end_ =0.

Parameters:
Irange of the container

Definition at line 69 of file STK_ArrayHo.h.

References STK::ArrayHo< TYPE >::initElts().

Referenced by STK::ArrayHo< Real >::elt(), and STK::ArrayHo< TYPE >::elt().

           : _IArrayHoType(I)
    { this->initElts(I);}
template<class TYPE>
STK::ArrayHo< TYPE >::ArrayHo ( Range const &  I,
TYPE const &  v 
) [inline]

Misc constructor with beg and end, initialization with a constant.

Parameters:
Irange of the container
vinitial value of the container

Definition at line 77 of file STK_ArrayHo.h.

References STK::ArrayHo< TYPE >::elt(), STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::first(), STK::ArrayHo< TYPE >::initElts(), and STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::last().

           : _IArrayHoType(I)
    {
      this->initElts(I);
      // set value v
      for (Integer i=this->first(); i<=this->last(); i++)
        this->elt(i) = v;
    }
template<class TYPE>
STK::ArrayHo< TYPE >::ArrayHo ( const ArrayHo< TYPE > &  T,
bool  ref = false 
) [inline]

Copy constructor.

Parameters:
Tthe container to copy
reftrue if this is a wrapper of T

Definition at line 90 of file STK_ArrayHo.h.

References STK::IArrayBase< DATA >::data(), STK::IArrayBase< TYPE * >::data(), STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::first(), STK::IArray1DBase< TYPE, PTRELT, TArray1D >::getIndex(), STK::ArrayHo< TYPE >::initElts(), STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::last(), and STK::ITContainer1D< TYPE, TContainer1D >::range().

           : _IArrayHoType(T, ref)
    {
      // check if we want just a reference
      if (!ref)
      {
        // if this is not a reference, initialize the container
        this->initElts(T.range());
        // this and T have the same row : save time
        const Integer row(T.getIndex());
        // and copy the data
        for (Integer j=this->first(); j<=this->last(); j++)
          this->data(j)[row] = T.data(j)[row];
      }
    }
template<class TYPE>
STK::ArrayHo< TYPE >::ArrayHo ( const ArrayHo< TYPE > &  T,
Range const &  I 
) [inline]

constructor by reference, ref_=1.

Parameters:
Tthe container to wrap
Ithe range of the data to wrap

Definition at line 110 of file STK_ArrayHo.h.

           : _IArrayHoType(T, I)
    { ;}
template<class TYPE>
STK::ArrayHo< TYPE >::ArrayHo ( const _IArrayBaseType T,
Range const &  I,
Integer  row 
) [inline]

constructor by reference, ref_=1.

Parameters:
Tthe container to wrap
Ithe range of the data to wrap
rowthe index of the row to wrap

Definition at line 119 of file STK_ArrayHo.h.

            : _IArrayHoType(T, I, row)
    { ;}
template<class TYPE>
virtual STK::ArrayHo< TYPE >::~ArrayHo ( ) [inline, virtual]

virtual destructor.

Definition at line 124 of file STK_ArrayHo.h.

References STK::ArrayHo< TYPE >::freeElts(), STK::IContainerRef::isRef(), and STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::range().

    { if (!this->isRef())
      { freeElts(this->range());}
    }

Member Function Documentation

template<class TYPE>
TYPE& STK::ArrayHo< TYPE >::elt ( Integer const &  pos) [inline]

Get one element.

Parameters:
posindex of the element

Reimplemented from STK::ITContainer1D< TYPE, ArrayHo< TYPE > >.

Definition at line 138 of file STK_ArrayHo.h.

References STK::IArrayBase< TYPE * >::data(), and STK::IArray1DBase< TYPE, TYPE *, ArrayHo< TYPE > >::getIndex().

    { return this->data(pos)[this->getIndex()];}
template<class TYPE>
ArrayHo STK::ArrayHo< TYPE >::elt ( Range const &  J) const [inline]

access to many elements.

Parameters:
JRange of the elements

Reimplemented from STK::ITContainer1D< TYPE, ArrayHo< TYPE > >.

Definition at line 144 of file STK_ArrayHo.h.

References STK::ArrayHo< TYPE >::ArrayHo(), and STK::IArray1DBase< TYPE, TYPE *, ArrayHo< TYPE > >::getIndex().

    { return ArrayHo(*this, J, this->getIndex());}
template<class TYPE>
void STK::ArrayHo< TYPE >::clear ( ) [inline, virtual]

clear the object.

Implements STK::IContainer1D.

Definition at line 148 of file STK_ArrayHo.h.

References STK::ArrayHo< TYPE >::freeMem(), and STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::setRange().

Referenced by STK::ArrayHo< Real >::initialize(), and STK::ArrayHo< TYPE >::initialize().

    {
      this->freeMem();  // Free Mem
      this->setRange(); // Set dimension to default
    }
template<class TYPE>
void STK::ArrayHo< TYPE >::freeMem ( ) [inline]

Method for memory deallocation.

Memory is liberated but the range of the container is not updated.

Definition at line 157 of file STK_ArrayHo.h.

References STK::IArray1DBase< TYPE, TYPE *, ArrayHo< TYPE > >::free1D(), STK::ArrayHo< TYPE >::freeElts(), STK::IContainerRef::isRef(), and STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::range().

Referenced by STK::ArrayHo< Real >::clear(), STK::ArrayHo< TYPE >::clear(), STK::ArrayHo< Real >::erase(), STK::ArrayHo< TYPE >::erase(), STK::ArrayHo< Real >::popBack(), and STK::ArrayHo< TYPE >::popBack().

    {
      if (this->isRef()) return;        // Nothing to do for ref
      this->freeElts(this->range()); // free the ptr of elts
      this->free1D();                   // free the elts
    }
template<class TYPE>
void STK::ArrayHo< TYPE >::initialize ( Range const &  I) [inline]

function for memory allocation and initialization.

This method will free all allocated memory owned by this container before initialization.

Parameters:
Irange of the container

Definition at line 169 of file STK_ArrayHo.h.

References STK::ArrayHo< TYPE >::clear(), STK::IArray1DBase< TYPE, TYPE *, ArrayHo< TYPE > >::init1D(), STK::ArrayHo< TYPE >::initElts(), STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::setRange(), and STK::IContainerRef::setRef().

Referenced by STK::ArrayHo< Real >::pushBack(), and STK::ArrayHo< TYPE >::pushBack().

    {
      // check if there is memory allocated
      this->clear();
      // if we initialize the memory the container is not a reference
      this->setRef(false);
      // try to allocate memory
      this->init1D(I);
      // initialize Horizontally the container
      this->initElts(I);
      // set the range of the container if init1D is successful
      this->setRange(I);
    }
template<class TYPE>
void STK::ArrayHo< TYPE >::insert ( Range const &  I,
TYPE const &  v 
) [inline]

Insert element v in the range I of the Container.

Parameters:
Irange of the index where to insert elements
vthe value tu insert

Reimplemented from STK::ITContainer1D< TYPE, ArrayHo< TYPE > >.

Definition at line 187 of file STK_ArrayHo.h.

    { ITContainer1D<TYPE, ArrayHo<TYPE> >::insert(I, v);}
template<class TYPE>
void STK::ArrayHo< TYPE >::pushBack ( Integer const &  n = 1) [inline, virtual]

Add n elements to the container.

Parameters:
nnumber of elements to add

Implements STK::IContainer1D.

Definition at line 193 of file STK_ArrayHo.h.

References STK::IContainer1D::empty(), STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::first(), STK::ArrayHo< TYPE >::initialize(), STK::ArrayHo< TYPE >::insertElt(), STK::IContainerRef::isRef(), and STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::last().

    {
      // if n<=0 nothing to do
      if (n <= 0) return;
      // is this structure just a pointer?
      if (this->isRef())
      { throw std::runtime_error("ArrayHo::pushBack(n) "
                                 "can't operate on references.");
      }
      // If the container is empty : create it
      if (this->empty())
        this->initialize(Range(this->first(), this->first()+n-1));
      else
        this->insertElt(this->last()+1, n);
    }
template<class TYPE>
void STK::ArrayHo< TYPE >::popBack ( Integer const &  n = 1) [inline, virtual]

Delete last elts of the container.

Parameters:
nnumber of elts to delete

Implements STK::IContainer1D.

Definition at line 212 of file STK_ArrayHo.h.

References STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::decLast(), STK::ArrayHo< TYPE >::freeElts(), STK::ArrayHo< TYPE >::freeMem(), STK::IContainerRef::isRef(), STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::last(), and STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::size().

    {
      // if n<=0 nothing to do
      if (n <= 0) return;
      // is this structure just a pointer?
      if (this->isRef())
      { throw std::runtime_error("ArrayHo::popBack() "
                            "can't operate on references.");
      }
#ifdef STK_BOUNDS_CHECK
      // if there is elts to erase
      if (this->size()<n)
      { throw std::out_of_range("ArrayHo::popBack(n) "
                           "this->size() < n");
      }
#endif
      // delete each elt
      this->freeElts(Range(this->last()-n+1, this->last()));
      // update range
      this->decLast(n);
      // if there is no more elements
      if (this->size() == 0) this->freeMem();
    }
template<class TYPE>
void STK::ArrayHo< TYPE >::erase ( Integer const &  pos,
Integer const &  n = 1 
) [inline, virtual]

Delete n elts at the pos index to the container.

Parameters:
posindex where to delete elements
nnumber of elements to delete (default 1)

Implements STK::IContainer1D.

Definition at line 240 of file STK_ArrayHo.h.

References STK::IArrayBase< TYPE * >::data(), STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::decLast(), STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::first(), STK::ArrayHo< TYPE >::freeElts(), STK::ArrayHo< TYPE >::freeMem(), STK::IContainerRef::isRef(), STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::last(), STK::IArrayBase< TYPE * >::setData(), and STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::size().

    {
      // if n==0 nothing to do
      if (n<=0) return;
      // is this structure just a pointer?
      if (this->isRef())
      { throw std::runtime_error("ArrayHo::erase(pos, n) "
                            "can't operate on references.");
      }
#ifdef STK_BOUNDS_CHECK
      // check bounds
      if (this->first() > pos)
      { throw std::out_of_range("ArrayHo::erase(pos, n) "
                           "this->first() > pos");
      }
      if (this->last() < pos)
      { throw std::out_of_range("ArrayHo::erase(pos, n)"
                           " this->last() < pos");
      }
      if (this->last() < pos+n-1)
      { throw std::out_of_range("ArrayHo::erase(pos, n)"
                           " this->last() < pos+n-1");
      }
#endif
      // delete each col
      freeElts(Range(pos, pos+n-1));
      // shift elements
      const Integer last = this->last()-n;
      for (Integer k=pos; k<=last; k++)
        this->setData(k, this->data(k+n));
      // update rangeHo_
      this->decLast(n);
      // if there is no more elements
      if (this->size() == 0) this->freeMem();
    }
template<class TYPE>
ArrayHo& STK::ArrayHo< TYPE >::operator= ( const ArrayHo< TYPE > &  T) [inline]

operator = : overwrite the ArrayHo with the ArrayHo 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.

Parameters:
Tthe container to copy

Definition at line 282 of file STK_ArrayHo.h.

References STK::ArrayHo< TYPE >::elt(), STK::ITContainer1D< TYPE, TContainer1D >::first(), STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::first(), STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::last(), STK::ITContainer1D< TYPE, TContainer1D >::last(), STK::ITContainer1D< TYPE, TContainer1D >::range(), STK::IContainer1D::resize(), STK::ITContainer1D< TYPE, TContainer1D >::size(), and STK::ITContainer1D< TYPE, ArrayHo< 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 (this->size()!=T.size()) this->resize(T.range());

      // copy without ovelapping
      if (this->first() < T.first())
      { for (Integer j=this->first(), i=T.first(); i<=T.last(); j++, i++)
          elt(j) = T.elt(i);
      }
      else
      { for (Integer j=this->last(), i=T.last(); i>=T.first(); j--, i--)
          elt(j) = T.elt(i);
      }
      return *this;
    }
template<class TYPE>
ArrayHo& STK::ArrayHo< TYPE >::operator= ( TYPE const &  v) [inline]

operator= : set the container to a constant value.

Parameters:
vthe value to set

Definition at line 302 of file STK_ArrayHo.h.

References STK::ArrayHo< TYPE >::elt(), STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::first(), and STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::last().

    {
      for (Integer i=this->first(); i<=this->last(); i++)
        this->elt(i) = v;
      return *this;
    }
template<class TYPE>
template<class LEAF >
ArrayHo& STK::ArrayHo< TYPE >::operator= ( const ITContainer1D< TYPE, LEAF > &  T) [inline]

operator = : overwrite the ArrayHo 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.

Parameters:
Tthe container to copy

Definition at line 316 of file STK_ArrayHo.h.

References STK::ArrayHo< TYPE >::elt(), STK::ITContainer1D< TYPE, TContainer1D >::first(), STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::first(), STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::last(), STK::ITContainer1D< TYPE, TContainer1D >::last(), STK::ITContainer1D< TYPE, TContainer1D >::range(), STK::IContainer1D::resize(), STK::ITContainer1D< TYPE, TContainer1D >::size(), and STK::ITContainer1D< TYPE, ArrayHo< 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 (this->size()!=T.size()) this->resize(T.range());

      // copy without ovelapping
      if (this->first() < T.first())
      { for (Integer j=this->first(), i=T.first(); i<=T.last(); j++, i++)
          elt(j) = T[i];
      }
      else
      { for (Integer j=this->last(), i=T.last(); i>=T.first(); j--, i--)
          elt(j) = T[i];
      }
      return *this;
    }
template<class TYPE>
void STK::ArrayHo< TYPE >::insertElt ( Integer const &  pos,
Integer const &  n = 1 
) [inline, protected, virtual]

Insert n elts at the position pos of the container.

The bound last_ should be modified at the very end of the insertion as pos can be a reference to it.

Parameters:
posindex where to insert elements
nnumber of elements to insert (default 1)

Implements STK::IContainer1D.

Definition at line 340 of file STK_ArrayHo.h.

References STK::IArray1DBase< TYPE, TYPE *, ArrayHo< TYPE > >::capacity(), STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::first(), STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::incLast(), STK::Range::incLast(), STK::IArray1DBase< TYPE, TYPE *, ArrayHo< TYPE > >::init1D(), STK::ArrayHo< TYPE >::initElts(), STK::IContainerRef::isRef(), STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::last(), STK::IArray1DBase< TYPE, TYPE *, ArrayHo< TYPE > >::moveElt(), STK::ITContainer1D< TYPE, TContainer1D >::range(), STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::range(), STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::setRange(), STK::ITContainer1D< TYPE, ArrayHo< TYPE > >::size(), and STK::IArray1DBase< TYPE, TYPE *, ArrayHo< TYPE > >::swap().

Referenced by STK::ArrayHo< Real >::pushBack(), and STK::ArrayHo< TYPE >::pushBack().

    {
      // if n<=0 nothing to do
      if (n <= 0) return;
      // is this structure just a pointer?
      if (this->isRef())
      { throw std::runtime_error("ArrayHo::insertElt(pos, n) "
                                 "can't operate on references.");
      }
#ifdef STK_BOUNDS_CHECK
      // check indices
      if (this->first() > pos)
      { throw std::out_of_range("ArrayHo::insertElt(pos, n) "
                                "this->first() > pos");
      }
      if (this->last()+1 < pos)
      { throw std::out_of_range("ArrayHo::insertElt(pos, n) "
                                "this->last()+1 < pos");
      }
#endif
      // allocate, if necessary, the mem for the elts
      if (this->capacity() < this->size()+n)
      {
        // compute range of the container after insertion
        Range range(this->range());
        range.incLast(n);
        // temporary empty container
        ArrayHo Taux;
        // save elements in Taux
        this->swap(Taux);
        // initialize elements of the container
        try
        {
          this->init1D(range);
        }
        catch (std::runtime_error & error)   // if an error occur
        {
          this->swap(Taux);   // restore container
          throw error;        // and send again the exception
        }
        // reset initial stored in range
        this->setRange(Taux.range());
        // move first elements from Taux to this
        for (Integer k=this->first(); k<pos; k++)
          this->moveElt(k,  Taux, k);
        // translate and copy last elements from Taux to this
        for (Integer k=this->last(); k>=pos; k--)
          this->moveElt(k+n, Taux, k);
      }
      else // enough space -> initialize and shift the last elts
      {
        // translate data
        for (Integer k=this->last(); k>=pos; k--)
          this->moveElt(k+n, *this, k);
      }
      // initialize the elements in the range pos:pos+n-1
      initElts(Range(pos, pos+n-1));
      // update range
      this->incLast(n);
    }
template<class TYPE>
void STK::ArrayHo< TYPE >::initElts ( Range const &  J) [inline, private]

Method for elements memory allocation.

Parameters:
Jthe range of the elements to initialize

Definition at line 404 of file STK_ArrayHo.h.

References STK::Range::first(), STK::ArrayHo< TYPE >::freeElt(), STK::ArrayHo< TYPE >::initElt(), STK::Range::last(), and STK::IArrayBase< TYPE * >::setData().

Referenced by STK::ArrayHo< Real >::ArrayHo(), STK::ArrayHo< TYPE >::ArrayHo(), STK::ArrayHo< Real >::initialize(), STK::ArrayHo< TYPE >::initialize(), STK::ArrayHo< Real >::insertElt(), and STK::ArrayHo< TYPE >::insertElt().

    {
      // for each col
      for (Integer j=J.first(); j<=J.last(); j++)
      {
        // try to Allocate mem for the jth elt
        try
        {
          this->initElt(j);
        }
        catch (std::runtime_error & error)   // if an error occur
        {
          // for each column allocated
          for (Integer k=J.first(); k<j; k++)
            this->freeElt(k);
          // put default parameters for the elts j to end
          for (Integer k=j; k<=J.last(); k++)
            this->setData(k);
          // and throw an exception
          throw error;
        }
      }
    }
template<class TYPE>
void STK::ArrayHo< TYPE >::freeElt ( Integer const &  pos) [inline, private]

Method for elements memory deallocation.

Parameters:
posthe position of the elements to liberate

Definition at line 431 of file STK_ArrayHo.h.

References STK::IArrayBase< TYPE * >::data(), STK::IArray1DBase< TYPE, TYPE *, ArrayHo< TYPE > >::getIndex(), and STK::IArrayBase< TYPE * >::setData().

Referenced by STK::ArrayHo< Real >::freeElts(), STK::ArrayHo< TYPE >::freeElts(), STK::ArrayHo< Real >::initElts(), and STK::ArrayHo< TYPE >::initElts().

    {
      if (this->data(pos))  // if there is an elt
      {
        this->data(pos) += this->getIndex();
        delete this->data(pos);  // erase
        this->setData(pos);         // set default
      }
    }
template<class TYPE>
void STK::ArrayHo< TYPE >::initElt ( Integer const &  pos) [inline, private]

function for the the allocation of memory of element pos.

Parameters:
posthe number of the elt to initialize

Definition at line 451 of file STK_ArrayHo.h.

References STK::IArrayBase< TYPE * >::data(), STK::IArray1DBase< TYPE, TYPE *, ArrayHo< TYPE > >::getIndex(), and STK::IArrayBase< TYPE * >::setData().

Referenced by STK::ArrayHo< Real >::initElts(), and STK::ArrayHo< TYPE >::initElts().

    {
      // try to Allocate mem for each col
      try
      {
        this->setData(pos, new TYPE);
        this->data(pos) -= this->getIndex();
      }
      catch (std::bad_alloc & error)        // if an alloc error occur
      {
        // set default
        this->setData(pos);
        // throw an exception
        throw std::runtime_error("ArrayHo::initElt(pos) "
                            "memory allocation failed.");
      }
    }

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