1 #ifndef CORE_MorseArray_H 2 #define CORE_MorseArray_H 78 mIsIndicesReferenced=
false;
115 p=boost::dynamic_pointer_cast<
const CORE_MorseArray<T> >(r);
121 inline boost::shared_ptr<CORE_MorseArray<T> >
getThis() {
122 boost::shared_ptr<CORE_MorseArray<T> > p;
129 inline boost::shared_ptr<const CORE_MorseArray<T> >
getThis()
const {
130 boost::shared_ptr<const CORE_MorseArray<T> > p;
143 static inline boost::shared_ptr<CORE_MorseArray<T> >
New() {
144 boost::shared_ptr<CORE_MorseArray<T> > p(
new CORE_MorseArray<T>(),
237 "CORE_MorseArray::begin(start,ipack,iter)",
257 "CORE_MorseArray::begin(start,ipack,iter)",
284 "CORE_MorseArray::begin(start,iter)",
331 mIndices->setSize(2);
333 (*mIndices.get())[0]=0;
334 (*mIndices.get())[1]=mLD;
348 mIndices->setSize(n+p);
369 mIsIndicesReferenced=
true;
382 mIndices->initArray(0);
411 const tUIndex *index=&(*mIndices.get())[i*mIncI];
412 return (
tUIndex) ((*(index+1))-(*index));
450 return *mIndices.
get();
496 return *mIndices.
get();
506 return (*mIndices.get())[i*mIncI];
513 return (*mIndices.get())[i*mIncI];
519 return (mIncI==0) || (mIndices->getSize()==2);
537 mValues.
setSize((*mIndices.get())[mIndices->getSize()-1]);
T * operator[](const tUIndex &i)
return the values for element at i
Definition: CORE_MorseArray.h:156
virtual void clear()
clear the array : desallocate the array
Definition: CORE_Array.h:300
const CORE_UIndexArray & getIndices() const
get the indices of the morse array for reading
Definition: CORE_MorseArray.h:449
static boost::shared_ptr< CORE_Array< tUIndex > > New()
return a CORE_Array shared pointer
Definition: CORE_Array.h:120
void init(T *values, tUIndex *index, const tBoolean &inc)
init the iterator to pointers
Definition: CORE_MorseArrayIterator.h:81
CORE_Array< tUIndex > CORE_UIndexArray
Definition: CORE_Array.h:1073
void copy(const CORE_MorseArray< Q > &c)
copy the morse array param c: the morse array to copy
Definition: CORE_MorseArray.h:308
CORE_UIndexArray & getIndices()
get the indices of the morse array for reading
Definition: CORE_MorseArray.h:495
void setUniformSize(const tUIndex &n, const tUIndex &ld)
set the morse array to be uniform of size n x ld
Definition: CORE_MorseArray.h:328
tUIndex mSize
Definition: CORE_MorseArray.h:43
tBoolean mIsConstant
Definition: CORE_MorseArray.h:62
boost::shared_ptr< CORE_MorseArray< T > > getThis()
return the shared pointer this for writing
Definition: CORE_MorseArray.h:121
CORE_MorseArray< tUIndex > CORE_UIndexMorseArray
Definition: CORE_MorseArray.h:633
#define tUInteger
Definition: types.h:91
const tBoolean & getIndexIncrement() const
get the index increment
Definition: CORE_MorseArray.h:418
CORE_MorseArray< tUSInt > CORE_USIntMorseArray
Definition: CORE_MorseArray.h:637
This class describes a general morse array of size N. A morse array is composed by.
Definition: CORE_MorseArray.h:31
const T * operator[](const tUIndex &i) const
return the values for element at i
Definition: CORE_MorseArray.h:163
CORE_MorseArray< T > & operator/=(const Q &f)
This/=f.
Definition: CORE_MorseArray.h:204
CORE_MorseArray< tReal > CORE_RealMorseArray
Definition: CORE_MorseArray.h:639
tBoolean loadFromFile(const tString &fn)
load the morse array from file
Definition: CORE_MorseArray.hpp:74
T & get(const tUIndex &i)
get the value of the array at index i
Definition: CORE_Array.h:555
virtual ~CORE_MorseArray(void)
destroy
Definition: CORE_MorseArray.h:88
void reset()
init the array to 0
Definition: CORE_MorseArray.h:381
void setIndicesByReference(SP::CORE_UIndexArray indices)
set the indices by reference
Definition: CORE_MorseArray.h:367
void fitToSize()
fit to size
Definition: CORE_MorseArray.h:536
const tUIndex & getMaxValuesNumberPerElement() const
get the max number of values per element
Definition: CORE_MorseArray.h:424
#define tBoolean
Definition: types.h:139
CORE_MorseArray()
create an array
Definition: CORE_MorseArray.h:71
static boost::shared_ptr< CORE_MorseArray< T > > New()
create a new shared pointer of CORE_MorseArray
Definition: CORE_MorseArray.h:143
CORE_MorseArray< tIndex > CORE_IndexMorseArray
Definition: CORE_MorseArray.h:634
void setSize(const tUIndex &n)
set the size
Definition: CORE_Array.h:292
tBoolean uniformize()
uniformize the array
Definition: CORE_MorseArray.h:558
tString toString() const
return the string associated to the integer
Definition: CORE_Integer.h:106
void begin(const tUIndex &start, CORE_MorseArrayConstIterator< T > &iter) const
create an iterator to index start for reading
Definition: CORE_MorseArray.h:280
SP::CORE_UIndexArray mIndices
Definition: CORE_MorseArray.h:49
CORE_MorseArray< tUChar > CORE_UCharMorseArray
Definition: CORE_MorseArray.h:636
tBoolean saveToFile(const tString &fn) const
save the morse array into file
Definition: CORE_MorseArray.hpp:16
void begin(CORE_MorseArrayConstIterator< T > &iter) const
create an iterator to index 0 fro reading
Definition: CORE_MorseArray.h:296
const tUInteger & getPacksNumber() const
get the number of packed
Definition: CORE_MorseArray.h:431
static void MergeMorseArrays(const tUInteger &nSubsets, CORE_UIndexArray &indices, const tUIndex &ld, const vector< CORE_Array< T > * > &arrays)
merge morse arrays
Definition: CORE_MorseArray.hpp:459
void merge()
merge the morse array built by P packs
Definition: CORE_MorseArray.h:530
CORE_MorseArray< T > & operator-=(const Q &f)
This+=f.
Definition: CORE_MorseArray.h:185
const CORE_Array< T > & getValues() const
get the values of the morse array
Definition: CORE_MorseArray.h:437
this class describes the exceptions raised for CORE package
Definition: CORE_Exception.h:15
void removeValue(const T &v)
remove the value
Definition: CORE_MorseArray.hpp:237
tBoolean isUniform() const
return true if the morse array is unifom
Definition: CORE_MorseArray.h:518
tUInteger mPacksNumber
Definition: CORE_MorseArray.h:59
void clear()
clear the morse array : desallocate the data.
Definition: CORE_MorseArray.h:318
const tUIndex & getIndex(const tUIndex &i) const
get the pointer to the index of the first value for element i for reading
Definition: CORE_MorseArray.h:505
this class describes an array
Definition: CORE_Array.h:19
This class describes a more array iterator.
Definition: CORE_MorseArrayConstIterator.h:17
void getSharedPointer(boost::shared_ptr< const CORE_MorseArray< T > > &p) const
return the shared pointer corresponding to the class whith casting
Definition: CORE_MorseArray.h:112
virtual tString toString() const
return the string reprensetaion of the morse array
Definition: CORE_MorseArray.hpp:5
virtual void fitToSize()
fit the array alocation exactly to size fit the allocation of the array to its size ...
Definition: CORE_Array.hpp:128
CORE_MorseArray< long double > CORE_LDoubleMorseArray
Definition: CORE_MorseArray.h:631
const tUIndex & getSize() const
get the number of elements of the array
Definition: CORE_MorseArray.h:404
tUIndex getSize(const tUIndex &i) const
get the number of values for element i
Definition: CORE_MorseArray.h:410
void getSharedPointer(SP::CORE_Object &p)
get the shared pointer of this class into p
Definition: CORE_Object.h:97
virtual tULLInt getMemorySize() const
return the memory size in byte
Definition: CORE_Array.h:545
SP::CORE_UIndexArray getIndicesByReference() const
get the indices of the morse array for reading/writing
Definition: CORE_MorseArray.h:443
virtual tULLInt getMemorySize() const
return the memory size in byte
Definition: CORE_MorseArray.h:396
CORE_MorseArray< double > CORE_DoubleMorseArray
Definition: CORE_MorseArray.h:630
CORE_MorseArray< T > & operator*=(const Q &f)
This*=f.
Definition: CORE_MorseArray.h:195
#define tUIndex
Definition: types.h:126
CORE_MorseArray< tBoolean > CORE_BooleanMorseArray
Definition: CORE_MorseArray.h:640
CORE_Array< T > & getValues()
get the values of the morse array
Definition: CORE_MorseArray.h:489
CORE_MorseArray< tFlag > CORE_FlagMorseArray
Definition: CORE_MorseArray.h:638
void begin(CORE_MorseArrayIterator< T > &iter)
create an iterator to index 0 of pack 0 for writing
Definition: CORE_MorseArray.h:272
void setSize(const tUIndex &n, const tUIndex &m)
set the size of the morse array
Definition: CORE_MorseArray.h:360
void init(const T *values, const tUIndex *index, const tBoolean &inc)
init an iterator to pointers
Definition: CORE_MorseArrayConstIterator.h:79
abstract base class for most classes.
Definition: CORE_Object.h:53
boost::shared_ptr< const CORE_MorseArray< T > > getThis() const
return the shared pointer this for reading
Definition: CORE_MorseArray.h:129
#define tString
Definition: types.h:135
CORE_MorseArray< T > & operator+=(const Q &f)
This+=f.
Definition: CORE_MorseArray.h:175
CORE_MorseArray< tChar > CORE_CharMorseArray
Definition: CORE_MorseArray.h:635
tUIndex mLD
Definition: CORE_MorseArray.h:53
const tBoolean & isConstant() const
return true if the morse array is constant
Definition: CORE_MorseArray.h:523
tBoolean mIncI
Definition: CORE_MorseArray.h:56
CORE_MorseArray< T > & operator=(const CORE_MorseArray< Q > &f)
copy the array
Definition: CORE_MorseArray.h:216
void begin(const tUIndex &start, const tUInteger &iPack, CORE_MorseArrayIterator< T > &iter)
create an iterator to index start for the pack at iPack for creating the morse array ...
Definition: CORE_MorseArray.h:232
void getSharedPointer(boost::shared_ptr< CORE_MorseArray< T > > &p)
return the shared pointer corresponding to the class with casting d*
Definition: CORE_MorseArray.h:104
#define tULLInt
Definition: types.h:45
TYPEDEF_SVPTR(CORE_DoubleMorseArray)
tUIndex & getIndex(const tUIndex &i)
get the index of the first value for element i for writting
Definition: CORE_MorseArray.h:512
CORE_MorseArray< float > CORE_FloatMorseArray
Definition: CORE_MorseArray.h:632
This class describes a more array iterator.
Definition: CORE_MorseArrayIterator.h:15
TYPEDEF_SPTR(CORE_DoubleMorseArray)
tBoolean mIsIndicesReferenced
Definition: CORE_MorseArray.h:50
void begin(const tUIndex &start, CORE_MorseArrayIterator< T > &iter)
create an iterator to index start for the pack at iPack for writing the morse array only in values ...
Definition: CORE_MorseArray.h:253
static void MergeMorseArray(const tUInteger &P, CORE_UIndexArray &indices, const tUIndex &ld, CORE_Array< T > &array)
merge morse arrays
Definition: CORE_MorseArray.hpp:358
void initArray(const Q &f)
init the array to uniform value
Definition: CORE_Array.h:316
void copy(const CORE_Array< Q > &f)
copy the array
Definition: CORE_Array.hpp:16
void setSize(const tUIndex &n, const tUIndex &m, const tUInteger &p)
set the size of the morse array
Definition: CORE_MorseArray.h:342
CORE_Array< T > mValues
Definition: CORE_MorseArray.h:46
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141