Salome HOME
fix conflict
[modules/med.git] / medtool / src / MEDCoupling / MEDCouplingMemArray.hxx
1 // Copyright (C) 2007-2015  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author : Anthony Geay (CEA/DEN)
20
21 #ifndef __PARAMEDMEM_MEDCOUPLINGMEMARRAY_HXX__
22 #define __PARAMEDMEM_MEDCOUPLINGMEMARRAY_HXX__
23
24 #include "MEDCoupling.hxx"
25 #include "MEDCouplingTimeLabel.hxx"
26 #include "MEDCouplingRefCountObject.hxx"
27 #include "InterpKernelException.hxx"
28 #include "BBTreePts.txx"
29
30 #include <string>
31 #include <vector>
32 #include <iterator>
33
34 namespace ParaMEDMEM
35 {
36   template<class T>
37   class MEDCouplingPointer
38   {
39   public:
40     MEDCouplingPointer():_internal(0),_external(0) { }
41     void null() { _internal=0; _external=0; }
42     bool isNull() const { return _internal==0 && _external==0; }
43     void setInternal(T *pointer);
44     void setExternal(const T *pointer);
45     const T *getConstPointer() const { if(_internal) return _internal; else return _external; }
46     const T *getConstPointerLoc(std::size_t offset) const { if(_internal) return _internal+offset; else return _external+offset; }
47     T *getPointer() { if(_internal) return _internal; if(_external) throw INTERP_KERNEL::Exception("Trying to write on an external pointer."); else return 0; }
48   private:
49     T *_internal;
50     const T *_external;
51   };
52
53   template<class T>
54   class MemArray
55   {
56   public:
57     typedef void (*Deallocator)(void *,void *);
58   public:
59     MemArray():_nb_of_elem(0),_nb_of_elem_alloc(0),_ownership(false),_dealloc(0),_param_for_deallocator(0) { }
60     MemArray(const MemArray<T>& other);
61     bool isNull() const { return _pointer.isNull(); }
62     const T *getConstPointerLoc(std::size_t offset) const { return _pointer.getConstPointerLoc(offset); }
63     const T *getConstPointer() const { return _pointer.getConstPointer(); }
64     std::size_t getNbOfElem() const { return _nb_of_elem; }
65     std::size_t getNbOfElemAllocated() const { return _nb_of_elem_alloc; }
66     T *getPointer() { return _pointer.getPointer(); }
67     MemArray<T> &operator=(const MemArray<T>& other);
68     T operator[](std::size_t id) const { return _pointer.getConstPointer()[id]; }
69     T& operator[](std::size_t id) { return _pointer.getPointer()[id]; }
70     bool isEqual(const MemArray<T>& other, T prec, std::string& reason) const;
71     void repr(int sl, std::ostream& stream) const;
72     bool reprHeader(int sl, std::ostream& stream) const;
73     void reprZip(int sl, std::ostream& stream) const;
74     void reprNotTooLong(int sl, std::ostream& stream) const;
75     void fillWithValue(const T& val);
76     T *fromNoInterlace(int nbOfComp) const;
77     T *toNoInterlace(int nbOfComp) const;
78     void sort(bool asc);
79     void reverse(int nbOfComp);
80     void alloc(std::size_t nbOfElements);
81     void reserve(std::size_t newNbOfElements);
82     void reAlloc(std::size_t newNbOfElements);
83     void useArray(const T *array, bool ownership, DeallocType type, std::size_t nbOfElem);
84     void useExternalArrayWithRWAccess(const T *array, std::size_t nbOfElem);
85     void writeOnPlace(std::size_t id, T element0, const T *others, std::size_t sizeOfOthers);
86     template<class InputIterator>
87     void insertAtTheEnd(InputIterator first, InputIterator last);
88     void pushBack(T elem);
89     T popBack();
90     void pack() const;
91     bool isDeallocatorCalled() const { return _ownership; }
92     Deallocator getDeallocator() const { return _dealloc; }
93     void setSpecificDeallocator(Deallocator dealloc) { _dealloc=dealloc; }
94     void setParameterForDeallocator(void *param) { _param_for_deallocator=param; }
95     void *getParameterForDeallocator() const { return _param_for_deallocator; }
96     void destroy();
97     ~MemArray() { destroy(); }
98   public:
99     static void CPPDeallocator(void *pt, void *param);
100     static void CDeallocator(void *pt, void *param);
101   private:
102     static void DestroyPointer(T *pt, Deallocator dealloc, void *param);
103     static Deallocator BuildFromType(DeallocType type);
104   private:
105     std::size_t _nb_of_elem;
106     std::size_t _nb_of_elem_alloc;
107     bool _ownership;
108     MEDCouplingPointer<T> _pointer;
109     Deallocator _dealloc;
110     void *_param_for_deallocator;
111   };
112
113   class DataArrayInt;
114   class DataArrayByte;
115
116   class DataArray : public RefCountObject, public TimeLabel
117   {
118   public:
119     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
120     MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
121     MEDCOUPLING_EXPORT void setName(const std::string& name);
122     MEDCOUPLING_EXPORT void copyStringInfoFrom(const DataArray& other);
123     MEDCOUPLING_EXPORT void copyPartOfStringInfoFrom(const DataArray& other, const std::vector<int>& compoIds);
124     MEDCOUPLING_EXPORT void copyPartOfStringInfoFrom2(const std::vector<int>& compoIds, const DataArray& other);
125     MEDCOUPLING_EXPORT bool areInfoEqualsIfNotWhy(const DataArray& other, std::string& reason) const;
126     MEDCOUPLING_EXPORT bool areInfoEquals(const DataArray& other) const;
127     MEDCOUPLING_EXPORT std::string cppRepr(const std::string& varName) const;
128     MEDCOUPLING_EXPORT std::string getName() const { return _name; }
129     MEDCOUPLING_EXPORT const std::vector<std::string> &getInfoOnComponents() const { return _info_on_compo; }
130     MEDCOUPLING_EXPORT std::vector<std::string> &getInfoOnComponents() { return _info_on_compo; }
131     MEDCOUPLING_EXPORT void setInfoOnComponents(const std::vector<std::string>& info);
132     MEDCOUPLING_EXPORT void setInfoAndChangeNbOfCompo(const std::vector<std::string>& info);
133     MEDCOUPLING_EXPORT std::vector<std::string> getVarsOnComponent() const;
134     MEDCOUPLING_EXPORT std::vector<std::string> getUnitsOnComponent() const;
135     MEDCOUPLING_EXPORT std::string getInfoOnComponent(int i) const;
136     MEDCOUPLING_EXPORT std::string getVarOnComponent(int i) const;
137     MEDCOUPLING_EXPORT std::string getUnitOnComponent(int i) const;
138     MEDCOUPLING_EXPORT void setInfoOnComponent(int i, const std::string& info);
139     MEDCOUPLING_EXPORT int getNumberOfComponents() const { return (int)_info_on_compo.size(); }
140     MEDCOUPLING_EXPORT void setPartOfValuesBase3(const DataArray *aBase, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true);
141     MEDCOUPLING_EXPORT virtual DataArray *deepCpy() const = 0;
142     MEDCOUPLING_EXPORT virtual bool isAllocated() const = 0;
143     MEDCOUPLING_EXPORT virtual void checkAllocated() const = 0;
144     MEDCOUPLING_EXPORT virtual void desallocate() = 0;
145     MEDCOUPLING_EXPORT virtual int getNumberOfTuples() const = 0;
146     MEDCOUPLING_EXPORT virtual std::size_t getNbOfElems() const = 0;
147     MEDCOUPLING_EXPORT virtual std::size_t getNbOfElemAllocated() const = 0;
148     MEDCOUPLING_EXPORT virtual void alloc(int nbOfTuple, int nbOfCompo=1) = 0;
149     MEDCOUPLING_EXPORT virtual void reAlloc(int newNbOfTuple) = 0;
150     MEDCOUPLING_EXPORT virtual void renumberInPlace(const int *old2New) = 0;
151     MEDCOUPLING_EXPORT virtual void renumberInPlaceR(const int *new2Old) = 0;
152     MEDCOUPLING_EXPORT virtual void setContigPartOfSelectedValues(int tupleIdStart, const DataArray *aBase, const DataArrayInt *tuplesSelec) = 0;
153     MEDCOUPLING_EXPORT virtual void setContigPartOfSelectedValues2(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step) = 0;
154     MEDCOUPLING_EXPORT virtual DataArray *selectByTupleRanges(const std::vector<std::pair<int,int> >& ranges) const = 0;
155     MEDCOUPLING_EXPORT virtual DataArray *keepSelectedComponents(const std::vector<int>& compoIds) const = 0;
156     MEDCOUPLING_EXPORT virtual DataArray *selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const = 0;
157     MEDCOUPLING_EXPORT virtual DataArray *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const = 0;
158     MEDCOUPLING_EXPORT virtual DataArray *selectByTupleId2(int bg, int end2, int step) const = 0;
159     MEDCOUPLING_EXPORT virtual void rearrange(int newNbOfCompo) = 0;
160     MEDCOUPLING_EXPORT void checkNbOfTuples(int nbOfTuples, const std::string& msg) const;
161     MEDCOUPLING_EXPORT void checkNbOfComps(int nbOfCompo, const std::string& msg) const;
162     MEDCOUPLING_EXPORT void checkNbOfTuplesAndComp(const DataArray& other, const std::string& msg) const;
163     MEDCOUPLING_EXPORT void checkNbOfTuplesAndComp(int nbOfTuples, int nbOfCompo, const std::string& msg) const;
164     MEDCOUPLING_EXPORT void checkNbOfElems(std::size_t nbOfElems, const std::string& msg) const;
165     MEDCOUPLING_EXPORT static void GetSlice(int start, int stop, int step, int sliceId, int nbOfSlices, int& startSlice, int& stopSlice);
166     MEDCOUPLING_EXPORT static int GetNumberOfItemGivenBES(int begin, int end, int step, const std::string& msg);
167     MEDCOUPLING_EXPORT static int GetNumberOfItemGivenBESRelative(int begin, int end, int step, const std::string& msg);
168     MEDCOUPLING_EXPORT static int GetPosOfItemGivenBESRelativeNoThrow(int value, int begin, int end, int step);
169     MEDCOUPLING_EXPORT static std::string GetVarNameFromInfo(const std::string& info);
170     MEDCOUPLING_EXPORT static std::string GetUnitFromInfo(const std::string& info);
171     MEDCOUPLING_EXPORT static std::string BuildInfoFromVarAndUnit(const std::string& var, const std::string& unit);
172     MEDCOUPLING_EXPORT static DataArray *Aggregate(const std::vector<const DataArray *>& arrs);
173     MEDCOUPLING_EXPORT virtual void reprStream(std::ostream& stream) const = 0;
174     MEDCOUPLING_EXPORT virtual void reprZipStream(std::ostream& stream) const = 0;
175     MEDCOUPLING_EXPORT virtual void reprWithoutNameStream(std::ostream& stream) const;
176     MEDCOUPLING_EXPORT virtual void reprZipWithoutNameStream(std::ostream& stream) const = 0;
177     MEDCOUPLING_EXPORT virtual void reprCppStream(const std::string& varName, std::ostream& stream) const = 0;
178     MEDCOUPLING_EXPORT virtual void reprQuickOverview(std::ostream& stream) const = 0;
179     MEDCOUPLING_EXPORT virtual void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const = 0;
180   protected:
181     DataArray() { }
182     ~DataArray() { }
183   protected:
184     static void CheckValueInRange(int ref, int value, const std::string& msg);
185     static void CheckValueInRangeEx(int value, int start, int end, const std::string& msg);
186     static void CheckClosingParInRange(int ref, int value, const std::string& msg);
187   protected:
188     std::string _name;
189     std::vector<std::string> _info_on_compo;
190   };
191 }
192
193 #include "MEDCouplingMemArray.txx"
194
195 namespace ParaMEDMEM
196 {
197   class DataArrayInt;
198   class DataArrayDoubleIterator;
199   class DataArrayDouble : public DataArray
200   {
201   public:
202     MEDCOUPLING_EXPORT static DataArrayDouble *New();
203     MEDCOUPLING_EXPORT bool isAllocated() const;
204     MEDCOUPLING_EXPORT void checkAllocated() const;
205     MEDCOUPLING_EXPORT void desallocate();
206     MEDCOUPLING_EXPORT int getNumberOfTuples() const { return _info_on_compo.empty()?0:_mem.getNbOfElem()/getNumberOfComponents(); }
207     MEDCOUPLING_EXPORT std::size_t getNbOfElems() const { return _mem.getNbOfElem(); }
208     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
209     MEDCOUPLING_EXPORT double doubleValue() const;
210     MEDCOUPLING_EXPORT bool empty() const;
211     MEDCOUPLING_EXPORT DataArrayDouble *deepCpy() const;
212     MEDCOUPLING_EXPORT DataArrayDouble *performCpy(bool deepCpy) const;
213     MEDCOUPLING_EXPORT void cpyFrom(const DataArrayDouble& other);
214     MEDCOUPLING_EXPORT void reserve(std::size_t nbOfElems);
215     MEDCOUPLING_EXPORT void pushBackSilent(double val);
216     MEDCOUPLING_EXPORT void pushBackValsSilent(const double *valsBg, const double *valsEnd);
217     MEDCOUPLING_EXPORT double popBackSilent();
218     MEDCOUPLING_EXPORT void pack() const;
219     MEDCOUPLING_EXPORT std::size_t getNbOfElemAllocated() const { return _mem.getNbOfElemAllocated(); }
220     MEDCOUPLING_EXPORT void alloc(int nbOfTuple, int nbOfCompo=1);
221     MEDCOUPLING_EXPORT void allocIfNecessary(int nbOfTuple, int nbOfCompo);
222     MEDCOUPLING_EXPORT void fillWithZero();
223     MEDCOUPLING_EXPORT void fillWithValue(double val);
224     MEDCOUPLING_EXPORT void iota(double init=0.);
225     MEDCOUPLING_EXPORT bool isUniform(double val, double eps) const;
226     MEDCOUPLING_EXPORT void sort(bool asc=true);
227     MEDCOUPLING_EXPORT void reverse();
228     MEDCOUPLING_EXPORT void checkMonotonic(bool increasing, double eps) const;
229     MEDCOUPLING_EXPORT bool isMonotonic(bool increasing, double eps) const;
230     MEDCOUPLING_EXPORT std::string repr() const;
231     MEDCOUPLING_EXPORT std::string reprZip() const;
232     MEDCOUPLING_EXPORT std::string reprNotTooLong() const;
233     MEDCOUPLING_EXPORT void writeVTK(std::ostream& ofs, int indent, const std::string& nameInFile, DataArrayByte *byteArr) const;
234     MEDCOUPLING_EXPORT void reprStream(std::ostream& stream) const;
235     MEDCOUPLING_EXPORT void reprZipStream(std::ostream& stream) const;
236     MEDCOUPLING_EXPORT void reprNotTooLongStream(std::ostream& stream) const;
237     MEDCOUPLING_EXPORT void reprWithoutNameStream(std::ostream& stream) const;
238     MEDCOUPLING_EXPORT void reprZipWithoutNameStream(std::ostream& stream) const;
239     MEDCOUPLING_EXPORT void reprNotTooLongWithoutNameStream(std::ostream& stream) const;
240     MEDCOUPLING_EXPORT void reprCppStream(const std::string& varName, std::ostream& stream) const;
241     MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const;
242     MEDCOUPLING_EXPORT void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const;
243     MEDCOUPLING_EXPORT bool isEqual(const DataArrayDouble& other, double prec) const;
244     MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const DataArrayDouble& other, double prec, std::string& reason) const;
245     MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const DataArrayDouble& other, double prec) const;
246     MEDCOUPLING_EXPORT void reAlloc(int nbOfTuples);
247     MEDCOUPLING_EXPORT DataArrayInt *convertToIntArr() const;
248     MEDCOUPLING_EXPORT DataArrayDouble *fromNoInterlace() const;
249     MEDCOUPLING_EXPORT DataArrayDouble *toNoInterlace() const;
250     MEDCOUPLING_EXPORT void renumberInPlace(const int *old2New);
251     MEDCOUPLING_EXPORT void renumberInPlaceR(const int *new2Old);
252     MEDCOUPLING_EXPORT DataArrayDouble *renumber(const int *old2New) const;
253     MEDCOUPLING_EXPORT DataArrayDouble *renumberR(const int *new2Old) const;
254     MEDCOUPLING_EXPORT DataArrayDouble *renumberAndReduce(const int *old2New, int newNbOfTuple) const;
255     MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const;
256     MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleId(const DataArrayInt & di) const;
257     MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const;
258     MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleId2(int bg, int end2, int step) const;
259     MEDCOUPLING_EXPORT DataArray *selectByTupleRanges(const std::vector<std::pair<int,int> >& ranges) const;
260     MEDCOUPLING_EXPORT DataArrayDouble *substr(int tupleIdBg, int tupleIdEnd=-1) const;
261     MEDCOUPLING_EXPORT void rearrange(int newNbOfCompo);
262     MEDCOUPLING_EXPORT void transpose();
263     MEDCOUPLING_EXPORT DataArrayDouble *changeNbOfComponents(int newNbOfComp, double dftValue) const;
264     MEDCOUPLING_EXPORT DataArrayDouble *keepSelectedComponents(const std::vector<int>& compoIds) const;
265     MEDCOUPLING_EXPORT void meldWith(const DataArrayDouble *other);
266     MEDCOUPLING_EXPORT bool areIncludedInMe(const DataArrayDouble *other, double prec, DataArrayInt *&tupleIds) const;
267     MEDCOUPLING_EXPORT void findCommonTuples(double prec, int limitTupleId, DataArrayInt *&comm, DataArrayInt *&commIndex) const;
268     MEDCOUPLING_EXPORT double minimalDistanceTo(const DataArrayDouble *other, int& thisTupleId, int& otherTupleId) const;
269     MEDCOUPLING_EXPORT DataArrayDouble *duplicateEachTupleNTimes(int nbTimes) const;
270     MEDCOUPLING_EXPORT DataArrayDouble *getDifferentValues(double prec, int limitTupleId=-1) const;
271     MEDCOUPLING_EXPORT DataArrayInt *findClosestTupleId(const DataArrayDouble *other) const;
272     MEDCOUPLING_EXPORT DataArrayInt *computeNbOfInteractionsWith(const DataArrayDouble *otherBBoxFrmt, double eps) const;
273     MEDCOUPLING_EXPORT void setSelectedComponents(const DataArrayDouble *a, const std::vector<int>& compoIds);
274     MEDCOUPLING_EXPORT void setPartOfValues1(const DataArrayDouble *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true);
275     MEDCOUPLING_EXPORT void setPartOfValuesSimple1(double a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp);
276     MEDCOUPLING_EXPORT void setPartOfValues2(const DataArrayDouble *a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp, bool strictCompoCompare=true);
277     MEDCOUPLING_EXPORT void setPartOfValuesSimple2(double a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp);
278     MEDCOUPLING_EXPORT void setPartOfValues3(const DataArrayDouble *a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true);
279     MEDCOUPLING_EXPORT void setPartOfValuesSimple3(double a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp);
280     MEDCOUPLING_EXPORT void setPartOfValues4(const DataArrayDouble *a, int bgTuples, int endTuples, int stepTuples, const int *bgComp, const int *endComp, bool strictCompoCompare=true);
281     MEDCOUPLING_EXPORT void setPartOfValuesSimple4(double a, int bgTuples, int endTuples, int stepTuples, const int *bgComp, const int *endComp);
282     MEDCOUPLING_EXPORT void setPartOfValuesAdv(const DataArrayDouble *a, const DataArrayInt *tuplesSelec);
283     MEDCOUPLING_EXPORT void setContigPartOfSelectedValues(int tupleIdStart, const DataArray *aBase, const DataArrayInt *tuplesSelec);
284     MEDCOUPLING_EXPORT void setContigPartOfSelectedValues2(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step);
285     MEDCOUPLING_EXPORT void getTuple(int tupleId, double *res) const { std::copy(_mem.getConstPointerLoc(tupleId*_info_on_compo.size()),_mem.getConstPointerLoc((tupleId+1)*_info_on_compo.size()),res); }
286     MEDCOUPLING_EXPORT double getIJ(int tupleId, int compoId) const { return _mem[tupleId*_info_on_compo.size()+compoId]; }
287     MEDCOUPLING_EXPORT double front() const;
288     MEDCOUPLING_EXPORT double back() const;
289     MEDCOUPLING_EXPORT double getIJSafe(int tupleId, int compoId) const;
290     MEDCOUPLING_EXPORT void setIJ(int tupleId, int compoId, double newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; declareAsNew(); }
291     MEDCOUPLING_EXPORT void setIJSilent(int tupleId, int compoId, double newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; }
292     MEDCOUPLING_EXPORT double *getPointer() { return _mem.getPointer(); declareAsNew(); }
293     MEDCOUPLING_EXPORT static void SetArrayIn(DataArrayDouble *newArray, DataArrayDouble* &arrayToSet);
294     MEDCOUPLING_EXPORT const double *getConstPointer() const { return _mem.getConstPointer(); }
295     MEDCOUPLING_EXPORT DataArrayDoubleIterator *iterator();
296     MEDCOUPLING_EXPORT const double *begin() const { return getConstPointer(); }
297     MEDCOUPLING_EXPORT const double *end() const { return getConstPointer()+getNbOfElems(); }
298     MEDCOUPLING_EXPORT void useArray(const double *array, bool ownership, DeallocType type, int nbOfTuple, int nbOfCompo);
299     MEDCOUPLING_EXPORT void useExternalArrayWithRWAccess(const double *array, int nbOfTuple, int nbOfCompo);
300     template<class InputIterator>
301     void insertAtTheEnd(InputIterator first, InputIterator last);
302     MEDCOUPLING_EXPORT void writeOnPlace(std::size_t id, double element0, const double *others, int sizeOfOthers) { _mem.writeOnPlace(id,element0,others,sizeOfOthers); }
303     MEDCOUPLING_EXPORT void checkNoNullValues() const;
304     MEDCOUPLING_EXPORT void getMinMaxPerComponent(double *bounds) const;
305     MEDCOUPLING_EXPORT DataArrayDouble *computeBBoxPerTuple(double epsilon=0.0) const;
306     MEDCOUPLING_EXPORT void computeTupleIdsNearTuples(const DataArrayDouble *other, double eps, DataArrayInt *& c, DataArrayInt *& cI) const;
307     MEDCOUPLING_EXPORT void recenterForMaxPrecision(double eps);
308     MEDCOUPLING_EXPORT double getMaxValue(int& tupleId) const;
309     MEDCOUPLING_EXPORT double getMaxValueInArray() const;
310     MEDCOUPLING_EXPORT double getMinValue(int& tupleId) const;
311     MEDCOUPLING_EXPORT double getMinValueInArray() const;
312     MEDCOUPLING_EXPORT double getMaxValue2(DataArrayInt*& tupleIds) const;
313     MEDCOUPLING_EXPORT double getMinValue2(DataArrayInt*& tupleIds) const;
314     MEDCOUPLING_EXPORT int count(double value, double eps) const;
315     MEDCOUPLING_EXPORT double getAverageValue() const;
316     MEDCOUPLING_EXPORT double norm2() const;
317     MEDCOUPLING_EXPORT double normMax() const;
318     MEDCOUPLING_EXPORT double normMin() const;
319     MEDCOUPLING_EXPORT void accumulate(double *res) const;
320     MEDCOUPLING_EXPORT double accumulate(int compId) const;
321     MEDCOUPLING_EXPORT DataArrayDouble *accumulatePerChunck(const int *bgOfIndex, const int *endOfIndex) const;
322     MEDCOUPLING_EXPORT double distanceToTuple(const double *tupleBg, const double *tupleEnd, int& tupleId) const;
323     MEDCOUPLING_EXPORT DataArrayDouble *fromPolarToCart() const;
324     MEDCOUPLING_EXPORT DataArrayDouble *fromCylToCart() const;
325     MEDCOUPLING_EXPORT DataArrayDouble *fromSpherToCart() const;
326     MEDCOUPLING_EXPORT DataArrayDouble *doublyContractedProduct() const;
327     MEDCOUPLING_EXPORT DataArrayDouble *determinant() const;
328     MEDCOUPLING_EXPORT DataArrayDouble *eigenValues() const;
329     MEDCOUPLING_EXPORT DataArrayDouble *eigenVectors() const;
330     MEDCOUPLING_EXPORT DataArrayDouble *inverse() const;
331     MEDCOUPLING_EXPORT DataArrayDouble *trace() const;
332     MEDCOUPLING_EXPORT DataArrayDouble *deviator() const;
333     MEDCOUPLING_EXPORT DataArrayDouble *magnitude() const;
334     MEDCOUPLING_EXPORT DataArrayDouble *sumPerTuple() const;
335     MEDCOUPLING_EXPORT DataArrayDouble *maxPerTuple() const;
336     MEDCOUPLING_EXPORT DataArrayDouble *maxPerTupleWithCompoId(DataArrayInt* &compoIdOfMaxPerTuple) const;
337     MEDCOUPLING_EXPORT DataArrayDouble *buildEuclidianDistanceDenseMatrix() const;
338     MEDCOUPLING_EXPORT DataArrayDouble *buildEuclidianDistanceDenseMatrixWith(const DataArrayDouble *other) const;
339     MEDCOUPLING_EXPORT void sortPerTuple(bool asc);
340     MEDCOUPLING_EXPORT void abs();
341     MEDCOUPLING_EXPORT DataArrayDouble *computeAbs() const;
342     MEDCOUPLING_EXPORT void applyLin(double a, double b, int compoId);
343     MEDCOUPLING_EXPORT void applyLin(double a, double b);
344     MEDCOUPLING_EXPORT void applyInv(double numerator);
345     MEDCOUPLING_EXPORT void applyPow(double val);
346     MEDCOUPLING_EXPORT void applyRPow(double val);
347     MEDCOUPLING_EXPORT DataArrayDouble *negate() const;
348     MEDCOUPLING_EXPORT DataArrayDouble *applyFunc(int nbOfComp, FunctionToEvaluate func) const;
349     MEDCOUPLING_EXPORT DataArrayDouble *applyFunc(int nbOfComp, const std::string& func, bool isSafe=true) const;
350     MEDCOUPLING_EXPORT DataArrayDouble *applyFunc(const std::string& func, bool isSafe=true) const;
351     MEDCOUPLING_EXPORT void applyFuncOnThis(const std::string& func, bool isSafe=true);
352     MEDCOUPLING_EXPORT DataArrayDouble *applyFunc2(int nbOfComp, const std::string& func, bool isSafe=true) const;
353     MEDCOUPLING_EXPORT DataArrayDouble *applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func, bool isSafe=true) const;
354     MEDCOUPLING_EXPORT void applyFuncFast32(const std::string& func);
355     MEDCOUPLING_EXPORT void applyFuncFast64(const std::string& func);
356     MEDCOUPLING_EXPORT DataArrayInt *getIdsInRange(double vmin, double vmax) const;
357     MEDCOUPLING_EXPORT DataArrayInt *getIdsNotInRange(double vmin, double vmax) const;
358     MEDCOUPLING_EXPORT static DataArrayDouble *Aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2);
359     MEDCOUPLING_EXPORT static DataArrayDouble *Aggregate(const std::vector<const DataArrayDouble *>& arr);
360     MEDCOUPLING_EXPORT static DataArrayDouble *Meld(const DataArrayDouble *a1, const DataArrayDouble *a2);
361     MEDCOUPLING_EXPORT static DataArrayDouble *Meld(const std::vector<const DataArrayDouble *>& arr);
362     MEDCOUPLING_EXPORT static DataArrayDouble *Dot(const DataArrayDouble *a1, const DataArrayDouble *a2);
363     MEDCOUPLING_EXPORT static DataArrayDouble *CrossProduct(const DataArrayDouble *a1, const DataArrayDouble *a2);
364     MEDCOUPLING_EXPORT static DataArrayDouble *Max(const DataArrayDouble *a1, const DataArrayDouble *a2);
365     MEDCOUPLING_EXPORT static DataArrayDouble *Min(const DataArrayDouble *a1, const DataArrayDouble *a2);
366     MEDCOUPLING_EXPORT static DataArrayDouble *Add(const DataArrayDouble *a1, const DataArrayDouble *a2);
367     MEDCOUPLING_EXPORT void addEqual(const DataArrayDouble *other);
368     MEDCOUPLING_EXPORT static DataArrayDouble *Substract(const DataArrayDouble *a1, const DataArrayDouble *a2);
369     MEDCOUPLING_EXPORT void substractEqual(const DataArrayDouble *other);
370     MEDCOUPLING_EXPORT static DataArrayDouble *Multiply(const DataArrayDouble *a1, const DataArrayDouble *a2);
371     MEDCOUPLING_EXPORT void multiplyEqual(const DataArrayDouble *other);
372     MEDCOUPLING_EXPORT static DataArrayDouble *Divide(const DataArrayDouble *a1, const DataArrayDouble *a2);
373     MEDCOUPLING_EXPORT void divideEqual(const DataArrayDouble *other);
374     MEDCOUPLING_EXPORT static DataArrayDouble *Pow(const DataArrayDouble *a1, const DataArrayDouble *a2);
375     MEDCOUPLING_EXPORT void powEqual(const DataArrayDouble *other);
376     MEDCOUPLING_EXPORT void updateTime() const { }
377     MEDCOUPLING_EXPORT MemArray<double>& accessToMemArray() { return _mem; }
378     MEDCOUPLING_EXPORT const MemArray<double>& accessToMemArray() const { return _mem; }
379     MEDCOUPLING_EXPORT std::vector<bool> toVectorOfBool(double eps) const;
380   public:
381     MEDCOUPLING_EXPORT void getTinySerializationIntInformation(std::vector<int>& tinyInfo) const;
382     MEDCOUPLING_EXPORT void getTinySerializationStrInformation(std::vector<std::string>& tinyInfo) const;
383     MEDCOUPLING_EXPORT bool resizeForUnserialization(const std::vector<int>& tinyInfoI);
384     MEDCOUPLING_EXPORT void finishUnserialization(const std::vector<int>& tinyInfoI, const std::vector<std::string>& tinyInfoS);
385   public:
386     template<int SPACEDIM>
387     void findCommonTuplesAlg(const double *bbox, int nbNodes, int limitNodeId, double prec, DataArrayInt *c, DataArrayInt *cI) const;
388     template<int SPACEDIM>
389     static void FindClosestTupleIdAlg(const BBTreePts<SPACEDIM,int>& myTree, double dist, const double *pos, int nbOfTuples, const double *thisPt, int thisNbOfTuples, int *res);
390     template<int SPACEDIM>
391     static void FindTupleIdsNearTuplesAlg(const BBTreePts<SPACEDIM,int>& myTree, const double *pos, int nbOfTuples, double eps,
392                                           DataArrayInt *c, DataArrayInt *cI);
393   private:
394     ~DataArrayDouble() { }
395     DataArrayDouble() { }
396   private:
397     MemArray<double> _mem;
398   };
399
400   class DataArrayDoubleTuple;
401
402   class DataArrayDoubleIterator
403   {
404   public:
405     MEDCOUPLING_EXPORT DataArrayDoubleIterator(DataArrayDouble *da);
406     MEDCOUPLING_EXPORT ~DataArrayDoubleIterator();
407     MEDCOUPLING_EXPORT DataArrayDoubleTuple *nextt();
408   private:
409     DataArrayDouble *_da;
410     double *_pt;
411     int _tuple_id;
412     int _nb_comp;
413     int _nb_tuple;
414   };
415
416   class DataArrayDoubleTuple
417   {
418   public:
419     MEDCOUPLING_EXPORT DataArrayDoubleTuple(double *pt, int nbOfComp);
420     MEDCOUPLING_EXPORT std::string repr() const;
421     MEDCOUPLING_EXPORT int getNumberOfCompo() const { return _nb_of_compo; }
422     MEDCOUPLING_EXPORT const double *getConstPointer() const { return  _pt; }
423     MEDCOUPLING_EXPORT double *getPointer() { return _pt; }
424     MEDCOUPLING_EXPORT double doubleValue() const;
425     MEDCOUPLING_EXPORT DataArrayDouble *buildDADouble(int nbOfTuples, int nbOfCompo) const;
426   private:
427     double *_pt;
428     int _nb_of_compo;
429   };
430
431   class DataArrayIntIterator;
432
433   class DataArrayInt : public DataArray
434   {
435   public:
436     MEDCOUPLING_EXPORT static DataArrayInt *New();
437     MEDCOUPLING_EXPORT bool isAllocated() const;
438     MEDCOUPLING_EXPORT void checkAllocated() const;
439     MEDCOUPLING_EXPORT void desallocate();
440     MEDCOUPLING_EXPORT int getNumberOfTuples() const { return _info_on_compo.empty()?0:_mem.getNbOfElem()/getNumberOfComponents(); }
441     MEDCOUPLING_EXPORT std::size_t getNbOfElems() const { return _mem.getNbOfElem(); }
442     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
443     MEDCOUPLING_EXPORT int intValue() const;
444     MEDCOUPLING_EXPORT int getHashCode() const;
445     MEDCOUPLING_EXPORT bool empty() const;
446     MEDCOUPLING_EXPORT DataArrayInt *deepCpy() const;
447     MEDCOUPLING_EXPORT DataArrayInt *performCpy(bool deepCpy) const;
448     MEDCOUPLING_EXPORT void cpyFrom(const DataArrayInt& other);
449     MEDCOUPLING_EXPORT void reserve(std::size_t nbOfElems);
450     MEDCOUPLING_EXPORT void pushBackSilent(int val);
451     MEDCOUPLING_EXPORT void pushBackValsSilent(const int *valsBg, const int *valsEnd);
452     MEDCOUPLING_EXPORT int popBackSilent();
453     MEDCOUPLING_EXPORT void pack() const;
454     MEDCOUPLING_EXPORT std::size_t getNbOfElemAllocated() const { return _mem.getNbOfElemAllocated(); }
455     MEDCOUPLING_EXPORT void alloc(int nbOfTuple, int nbOfCompo=1);
456     MEDCOUPLING_EXPORT void allocIfNecessary(int nbOfTuple, int nbOfCompo);
457     MEDCOUPLING_EXPORT bool isEqual(const DataArrayInt& other) const;
458     MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const DataArrayInt& other, std::string& reason) const;
459     MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const DataArrayInt& other) const;
460     MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStrAndOrder(const DataArrayInt& other) const;
461     MEDCOUPLING_EXPORT bool isFittingWith(const std::vector<bool>& v) const;
462     MEDCOUPLING_EXPORT void switchOnTupleEqualTo(int val, std::vector<bool>& vec) const;
463     MEDCOUPLING_EXPORT DataArrayInt *buildPermutationArr(const DataArrayInt& other) const;
464     MEDCOUPLING_EXPORT DataArrayInt *sumPerTuple() const;
465     MEDCOUPLING_EXPORT void sort(bool asc=true);
466     MEDCOUPLING_EXPORT void reverse();
467     MEDCOUPLING_EXPORT void checkMonotonic(bool increasing) const;
468     MEDCOUPLING_EXPORT bool isMonotonic(bool increasing) const;
469     MEDCOUPLING_EXPORT void checkStrictlyMonotonic(bool increasing) const;
470     MEDCOUPLING_EXPORT bool isStrictlyMonotonic(bool increasing) const;
471     MEDCOUPLING_EXPORT void fillWithZero();
472     MEDCOUPLING_EXPORT void fillWithValue(int val);
473     MEDCOUPLING_EXPORT void iota(int init=0);
474     MEDCOUPLING_EXPORT std::string repr() const;
475     MEDCOUPLING_EXPORT std::string reprZip() const;
476     MEDCOUPLING_EXPORT std::string reprNotTooLong() const;
477     MEDCOUPLING_EXPORT void writeVTK(std::ostream& ofs, int indent, const std::string& type, const std::string& nameInFile, DataArrayByte *byteArr) const;
478     MEDCOUPLING_EXPORT void reprStream(std::ostream& stream) const;
479     MEDCOUPLING_EXPORT void reprZipStream(std::ostream& stream) const;
480     MEDCOUPLING_EXPORT void reprNotTooLongStream(std::ostream& stream) const;
481     MEDCOUPLING_EXPORT void reprWithoutNameStream(std::ostream& stream) const;
482     MEDCOUPLING_EXPORT void reprZipWithoutNameStream(std::ostream& stream) const;
483     MEDCOUPLING_EXPORT void reprNotTooLongWithoutNameStream(std::ostream& stream) const;
484     MEDCOUPLING_EXPORT void reprCppStream(const std::string& varName, std::ostream& stream) const;
485     MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const;
486     MEDCOUPLING_EXPORT void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const;
487     MEDCOUPLING_EXPORT void transformWithIndArr(const int *indArrBg, const int *indArrEnd);
488     MEDCOUPLING_EXPORT void replaceOneValByInThis(int valToBeReplaced, int replacedBy);
489     MEDCOUPLING_EXPORT DataArrayInt *transformWithIndArrR(const int *indArrBg, const int *indArrEnd) const;
490     MEDCOUPLING_EXPORT void splitByValueRange(const int *arrBg, const int *arrEnd,
491                                               DataArrayInt *& castArr, DataArrayInt *& rankInsideCast, DataArrayInt *& castsPresent) const;
492     MEDCOUPLING_EXPORT bool isRange(int& strt, int& sttoopp, int& stteepp) const;
493     MEDCOUPLING_EXPORT DataArrayInt *invertArrayO2N2N2O(int newNbOfElem) const;
494     MEDCOUPLING_EXPORT DataArrayInt *invertArrayN2O2O2N(int oldNbOfElem) const;
495     MEDCOUPLING_EXPORT DataArrayInt *invertArrayO2N2N2OBis(int newNbOfElem) const;
496     MEDCOUPLING_EXPORT void reAlloc(int nbOfTuples);
497     MEDCOUPLING_EXPORT DataArrayDouble *convertToDblArr() const;
498     MEDCOUPLING_EXPORT DataArrayInt *fromNoInterlace() const;
499     MEDCOUPLING_EXPORT DataArrayInt *toNoInterlace() const;
500     MEDCOUPLING_EXPORT void renumberInPlace(const int *old2New);
501     MEDCOUPLING_EXPORT void renumberInPlaceR(const int *new2Old);
502     MEDCOUPLING_EXPORT DataArrayInt *renumber(const int *old2New) const;
503     MEDCOUPLING_EXPORT DataArrayInt *renumberR(const int *new2Old) const;
504     MEDCOUPLING_EXPORT DataArrayInt *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const;
505     MEDCOUPLING_EXPORT DataArrayInt *selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const;
506     MEDCOUPLING_EXPORT DataArrayInt *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const;
507     MEDCOUPLING_EXPORT DataArrayInt *selectByTupleId2(int bg, int end, int step) const;
508     MEDCOUPLING_EXPORT DataArray *selectByTupleRanges(const std::vector<std::pair<int,int> >& ranges) const;
509     MEDCOUPLING_EXPORT DataArrayInt *checkAndPreparePermutation() const;
510     MEDCOUPLING_EXPORT static DataArrayInt *FindPermutationFromFirstToSecond(const DataArrayInt *ids1, const DataArrayInt *ids2);
511     MEDCOUPLING_EXPORT void changeSurjectiveFormat(int targetNb, DataArrayInt *&arr, DataArrayInt *&arrI) const;
512     MEDCOUPLING_EXPORT static DataArrayInt *BuildOld2NewArrayFromSurjectiveFormat2(int nbOfOldTuples, const int *arr, const int *arrIBg, const int *arrIEnd, int &newNbOfTuples);
513     MEDCOUPLING_EXPORT DataArrayInt *buildPermArrPerLevel() const;
514     MEDCOUPLING_EXPORT bool isIdentity() const;
515     MEDCOUPLING_EXPORT bool isIdentity2(int sizeExpected) const;
516     MEDCOUPLING_EXPORT bool isUniform(int val) const;
517     MEDCOUPLING_EXPORT DataArrayInt *substr(int tupleIdBg, int tupleIdEnd=-1) const;
518     MEDCOUPLING_EXPORT void rearrange(int newNbOfCompo);
519     MEDCOUPLING_EXPORT void transpose();
520     MEDCOUPLING_EXPORT DataArrayInt *changeNbOfComponents(int newNbOfComp, int dftValue) const;
521     MEDCOUPLING_EXPORT DataArrayInt *keepSelectedComponents(const std::vector<int>& compoIds) const;
522     MEDCOUPLING_EXPORT void meldWith(const DataArrayInt *other);
523     MEDCOUPLING_EXPORT void setSelectedComponents(const DataArrayInt *a, const std::vector<int>& compoIds);
524     MEDCOUPLING_EXPORT void setPartOfValues1(const DataArrayInt *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true);
525     MEDCOUPLING_EXPORT void setPartOfValuesSimple1(int a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp);
526     MEDCOUPLING_EXPORT void setPartOfValues2(const DataArrayInt *a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp, bool strictCompoCompare=true);
527     MEDCOUPLING_EXPORT void setPartOfValuesSimple2(int a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp);
528     MEDCOUPLING_EXPORT void setPartOfValues3(const DataArrayInt *a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true);
529     MEDCOUPLING_EXPORT void setPartOfValuesSimple3(int a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp);
530     MEDCOUPLING_EXPORT void setPartOfValues4(const DataArrayInt *a, int bgTuples, int endTuples, int stepTuples, const int *bgComp, const int *endComp, bool strictCompoCompare=true);
531     MEDCOUPLING_EXPORT void setPartOfValuesSimple4(int a, int bgTuples, int endTuples, int stepTuples, const int *bgComp, const int *endComp);
532     MEDCOUPLING_EXPORT void setPartOfValuesAdv(const DataArrayInt *a, const DataArrayInt *tuplesSelec);
533     MEDCOUPLING_EXPORT void setContigPartOfSelectedValues(int tupleIdStart, const DataArray *aBase, const DataArrayInt *tuplesSelec);
534     MEDCOUPLING_EXPORT void setContigPartOfSelectedValues2(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step);
535     MEDCOUPLING_EXPORT void getTuple(int tupleId, int *res) const { std::copy(_mem.getConstPointerLoc(tupleId*_info_on_compo.size()),_mem.getConstPointerLoc((tupleId+1)*_info_on_compo.size()),res); }
536     MEDCOUPLING_EXPORT int getIJ(int tupleId, int compoId) const { return _mem[tupleId*_info_on_compo.size()+compoId]; }
537     MEDCOUPLING_EXPORT int getIJSafe(int tupleId, int compoId) const;
538     MEDCOUPLING_EXPORT int front() const;
539     MEDCOUPLING_EXPORT int back() const;
540     MEDCOUPLING_EXPORT void setIJ(int tupleId, int compoId, int newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; declareAsNew(); }
541     MEDCOUPLING_EXPORT void setIJSilent(int tupleId, int compoId, int newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; }
542     MEDCOUPLING_EXPORT int *getPointer() { return _mem.getPointer(); declareAsNew(); }
543     MEDCOUPLING_EXPORT static void SetArrayIn(DataArrayInt *newArray, DataArrayInt* &arrayToSet);
544     MEDCOUPLING_EXPORT const int *getConstPointer() const { return _mem.getConstPointer(); }
545     MEDCOUPLING_EXPORT DataArrayIntIterator *iterator();
546     MEDCOUPLING_EXPORT const int *begin() const { return getConstPointer(); }
547     MEDCOUPLING_EXPORT const int *end() const { return getConstPointer()+getNbOfElems(); }
548     MEDCOUPLING_EXPORT DataArrayInt *getIdsEqual(int val) const;
549     MEDCOUPLING_EXPORT DataArrayInt *getIdsNotEqual(int val) const;
550     MEDCOUPLING_EXPORT DataArrayInt *getIdsEqualList(const int *valsBg, const int *valsEnd) const;
551     MEDCOUPLING_EXPORT DataArrayInt *getIdsNotEqualList(const int *valsBg, const int *valsEnd) const;
552     MEDCOUPLING_EXPORT DataArrayInt *getIdsEqualTuple(const int *tupleBg, const int *tupleEnd) const;
553     MEDCOUPLING_EXPORT int changeValue(int oldValue, int newValue);
554     MEDCOUPLING_EXPORT int locateTuple(const std::vector<int>& tupl) const;
555     MEDCOUPLING_EXPORT int locateValue(int value) const;
556     MEDCOUPLING_EXPORT int locateValue(const std::vector<int>& vals) const;
557     MEDCOUPLING_EXPORT int search(const std::vector<int>& vals) const;
558     MEDCOUPLING_EXPORT bool presenceOfTuple(const std::vector<int>& tupl) const;
559     MEDCOUPLING_EXPORT bool presenceOfValue(int value) const;
560     MEDCOUPLING_EXPORT bool presenceOfValue(const std::vector<int>& vals) const;
561     MEDCOUPLING_EXPORT int count(int value) const;
562     MEDCOUPLING_EXPORT void accumulate(int *res) const;
563     MEDCOUPLING_EXPORT int accumulate(int compId) const;
564     MEDCOUPLING_EXPORT DataArrayInt *accumulatePerChunck(const int *bgOfIndex, const int *endOfIndex) const;
565     MEDCOUPLING_EXPORT int getMaxValue(int& tupleId) const;
566     MEDCOUPLING_EXPORT int getMaxValueInArray() const;
567     MEDCOUPLING_EXPORT int getMinValue(int& tupleId) const;
568     MEDCOUPLING_EXPORT int getMinValueInArray() const;
569     MEDCOUPLING_EXPORT void getMinMaxValues(int& minValue, int& maxValue) const;
570     MEDCOUPLING_EXPORT void abs();
571     MEDCOUPLING_EXPORT DataArrayInt *computeAbs() const;
572     MEDCOUPLING_EXPORT void applyLin(int a, int b, int compoId);
573     MEDCOUPLING_EXPORT void applyLin(int a, int b);
574     MEDCOUPLING_EXPORT void applyInv(int numerator);
575     MEDCOUPLING_EXPORT DataArrayInt *negate() const;
576     MEDCOUPLING_EXPORT void applyDivideBy(int val);
577     MEDCOUPLING_EXPORT void applyModulus(int val);
578     MEDCOUPLING_EXPORT void applyRModulus(int val);
579     MEDCOUPLING_EXPORT void applyPow(int val);
580     MEDCOUPLING_EXPORT void applyRPow(int val);
581     MEDCOUPLING_EXPORT DataArrayInt *getIdsInRange(int vmin, int vmax) const;
582     MEDCOUPLING_EXPORT DataArrayInt *getIdsNotInRange(int vmin, int vmax) const;
583     MEDCOUPLING_EXPORT DataArrayInt *getIdsStrictlyNegative() const;
584     MEDCOUPLING_EXPORT bool checkAllIdsInRange(int vmin, int vmax) const;
585     MEDCOUPLING_EXPORT static DataArrayInt *Aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2);
586     MEDCOUPLING_EXPORT static DataArrayInt *Aggregate(const std::vector<const DataArrayInt *>& arr);
587     MEDCOUPLING_EXPORT static DataArrayInt *AggregateIndexes(const std::vector<const DataArrayInt *>& arrs);
588     MEDCOUPLING_EXPORT static DataArrayInt *Meld(const DataArrayInt *a1, const DataArrayInt *a2);
589     MEDCOUPLING_EXPORT static DataArrayInt *Meld(const std::vector<const DataArrayInt *>& arr);
590     MEDCOUPLING_EXPORT static DataArrayInt *MakePartition(const std::vector<const DataArrayInt *>& groups, int newNb, std::vector< std::vector<int> >& fidsOfGroups);
591     MEDCOUPLING_EXPORT static DataArrayInt *BuildUnion(const std::vector<const DataArrayInt *>& arr);
592     MEDCOUPLING_EXPORT static DataArrayInt *BuildIntersection(const std::vector<const DataArrayInt *>& arr);
593     MEDCOUPLING_EXPORT static DataArrayInt *BuildListOfSwitchedOn(const std::vector<bool>& v);
594     MEDCOUPLING_EXPORT static DataArrayInt *BuildListOfSwitchedOff(const std::vector<bool>& v);
595     MEDCOUPLING_EXPORT static void PutIntoToSkylineFrmt(const std::vector< std::vector<int> >& v, DataArrayInt *& data, DataArrayInt *& dataIndex);
596     MEDCOUPLING_EXPORT DataArrayInt *buildComplement(int nbOfElement) const;
597     MEDCOUPLING_EXPORT DataArrayInt *buildSubstraction(const DataArrayInt *other) const;
598     MEDCOUPLING_EXPORT DataArrayInt *buildSubstractionOptimized(const DataArrayInt *other) const;
599     MEDCOUPLING_EXPORT DataArrayInt *buildUnion(const DataArrayInt *other) const;
600     MEDCOUPLING_EXPORT DataArrayInt *buildIntersection(const DataArrayInt *other) const;
601     MEDCOUPLING_EXPORT DataArrayInt *buildUnique() const;
602     MEDCOUPLING_EXPORT DataArrayInt *buildUniqueNotSorted() const;
603     MEDCOUPLING_EXPORT DataArrayInt *deltaShiftIndex() const;
604     MEDCOUPLING_EXPORT void computeOffsets();
605     MEDCOUPLING_EXPORT void computeOffsets2();
606     MEDCOUPLING_EXPORT void searchRangesInListOfIds(const DataArrayInt *listOfIds, DataArrayInt *& rangeIdsFetched, DataArrayInt *& idsInInputListThatFetch) const;
607     MEDCOUPLING_EXPORT DataArrayInt *buildExplicitArrByRanges(const DataArrayInt *offsets) const;
608     MEDCOUPLING_EXPORT DataArrayInt *buildExplicitArrOfSliceOnScaledArr(int begin, int stop, int step) const;
609     MEDCOUPLING_EXPORT DataArrayInt *findRangeIdForEachTuple(const DataArrayInt *ranges) const;
610     MEDCOUPLING_EXPORT DataArrayInt *findIdInRangeForEachTuple(const DataArrayInt *ranges) const;
611     MEDCOUPLING_EXPORT void sortEachPairToMakeALinkedList();
612     MEDCOUPLING_EXPORT DataArrayInt *duplicateEachTupleNTimes(int nbTimes) const;
613     MEDCOUPLING_EXPORT DataArrayInt *getDifferentValues() const;
614     MEDCOUPLING_EXPORT std::vector<DataArrayInt *> partitionByDifferentValues(std::vector<int>& differentIds) const;
615     MEDCOUPLING_EXPORT std::vector< std::pair<int,int> > splitInBalancedSlices(int nbOfSlices) const;
616     MEDCOUPLING_EXPORT void useArray(const int *array, bool ownership, DeallocType type, int nbOfTuple, int nbOfCompo);
617     MEDCOUPLING_EXPORT void useExternalArrayWithRWAccess(const int *array, int nbOfTuple, int nbOfCompo);
618     template<class InputIterator>
619     void insertAtTheEnd(InputIterator first, InputIterator last);
620     MEDCOUPLING_EXPORT void writeOnPlace(std::size_t id, int element0, const int *others, int sizeOfOthers) { _mem.writeOnPlace(id,element0,others,sizeOfOthers); }
621     MEDCOUPLING_EXPORT static DataArrayInt *Add(const DataArrayInt *a1, const DataArrayInt *a2);
622     MEDCOUPLING_EXPORT void addEqual(const DataArrayInt *other);
623     MEDCOUPLING_EXPORT static DataArrayInt *Substract(const DataArrayInt *a1, const DataArrayInt *a2);
624     MEDCOUPLING_EXPORT void substractEqual(const DataArrayInt *other);
625     MEDCOUPLING_EXPORT static DataArrayInt *Multiply(const DataArrayInt *a1, const DataArrayInt *a2);
626     MEDCOUPLING_EXPORT void multiplyEqual(const DataArrayInt *other);
627     MEDCOUPLING_EXPORT static DataArrayInt *Divide(const DataArrayInt *a1, const DataArrayInt *a2);
628     MEDCOUPLING_EXPORT void divideEqual(const DataArrayInt *other);
629     MEDCOUPLING_EXPORT static DataArrayInt *Modulus(const DataArrayInt *a1, const DataArrayInt *a2);
630     MEDCOUPLING_EXPORT void modulusEqual(const DataArrayInt *other);
631     MEDCOUPLING_EXPORT static DataArrayInt *Pow(const DataArrayInt *a1, const DataArrayInt *a2);
632     MEDCOUPLING_EXPORT void powEqual(const DataArrayInt *other);
633     MEDCOUPLING_EXPORT void updateTime() const { }
634     MEDCOUPLING_EXPORT MemArray<int>& accessToMemArray() { return _mem; }
635     MEDCOUPLING_EXPORT const MemArray<int>& accessToMemArray() const { return _mem; }
636   public:
637     MEDCOUPLING_EXPORT static int *CheckAndPreparePermutation(const int *start, const int *end);
638     MEDCOUPLING_EXPORT static DataArrayInt *Range(int begin, int end, int step);
639   public:
640     MEDCOUPLING_EXPORT void getTinySerializationIntInformation(std::vector<int>& tinyInfo) const;
641     MEDCOUPLING_EXPORT void getTinySerializationStrInformation(std::vector<std::string>& tinyInfo) const;
642     MEDCOUPLING_EXPORT bool resizeForUnserialization(const std::vector<int>& tinyInfoI);
643     MEDCOUPLING_EXPORT void finishUnserialization(const std::vector<int>& tinyInfoI, const std::vector<std::string>& tinyInfoS);
644   private:
645     ~DataArrayInt() { }
646     DataArrayInt() { }
647   private:
648     MemArray<int> _mem;
649   };
650
651   class DataArrayIntTuple;
652
653   class DataArrayIntIterator
654   {
655   public:
656     MEDCOUPLING_EXPORT DataArrayIntIterator(DataArrayInt *da);
657     MEDCOUPLING_EXPORT ~DataArrayIntIterator();
658     MEDCOUPLING_EXPORT DataArrayIntTuple *nextt();
659   private:
660     DataArrayInt *_da;
661     int *_pt;
662     int _tuple_id;
663     int _nb_comp;
664     int _nb_tuple;
665   };
666
667   class DataArrayIntTuple
668   {
669   public:
670     MEDCOUPLING_EXPORT DataArrayIntTuple(int *pt, int nbOfComp);
671     MEDCOUPLING_EXPORT std::string repr() const;
672     MEDCOUPLING_EXPORT int getNumberOfCompo() const { return _nb_of_compo; }
673     MEDCOUPLING_EXPORT const int *getConstPointer() const { return  _pt; }
674     MEDCOUPLING_EXPORT int *getPointer() { return _pt; }
675     MEDCOUPLING_EXPORT int intValue() const;
676     MEDCOUPLING_EXPORT DataArrayInt *buildDAInt(int nbOfTuples, int nbOfCompo) const;
677   private:
678     int *_pt;
679     int _nb_of_compo;
680   };
681
682   class DataArrayChar : public DataArray
683   {
684   public:
685     MEDCOUPLING_EXPORT virtual DataArrayChar *buildEmptySpecializedDAChar() const = 0;
686     MEDCOUPLING_EXPORT bool isAllocated() const;
687     MEDCOUPLING_EXPORT void checkAllocated() const;
688     MEDCOUPLING_EXPORT void desallocate();
689     MEDCOUPLING_EXPORT int getNumberOfTuples() const { return _info_on_compo.empty()?0:_mem.getNbOfElem()/getNumberOfComponents(); }
690     MEDCOUPLING_EXPORT std::size_t getNbOfElems() const { return _mem.getNbOfElem(); }
691     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
692     MEDCOUPLING_EXPORT int getHashCode() const;
693     MEDCOUPLING_EXPORT bool empty() const;
694     MEDCOUPLING_EXPORT void cpyFrom(const DataArrayChar& other);
695     MEDCOUPLING_EXPORT void reserve(std::size_t nbOfElems);
696     MEDCOUPLING_EXPORT void pushBackSilent(char val);
697     MEDCOUPLING_EXPORT void pushBackValsSilent(const char *valsBg, const char *valsEnd);
698     MEDCOUPLING_EXPORT char popBackSilent();
699     MEDCOUPLING_EXPORT void pack() const;
700     MEDCOUPLING_EXPORT std::size_t getNbOfElemAllocated() const { return _mem.getNbOfElemAllocated(); }
701     MEDCOUPLING_EXPORT void alloc(int nbOfTuple, int nbOfCompo=1);
702     MEDCOUPLING_EXPORT void allocIfNecessary(int nbOfTuple, int nbOfCompo);
703     MEDCOUPLING_EXPORT bool isEqual(const DataArrayChar& other) const;
704     MEDCOUPLING_EXPORT virtual bool isEqualIfNotWhy(const DataArrayChar& other, std::string& reason) const;
705     MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const DataArrayChar& other) const;
706     MEDCOUPLING_EXPORT void reverse();
707     MEDCOUPLING_EXPORT void fillWithZero();
708     MEDCOUPLING_EXPORT void fillWithValue(char val);
709     MEDCOUPLING_EXPORT std::string repr() const;
710     MEDCOUPLING_EXPORT std::string reprZip() const;
711     MEDCOUPLING_EXPORT void reAlloc(int nbOfTuples);
712     MEDCOUPLING_EXPORT DataArrayInt *convertToIntArr() const;
713     MEDCOUPLING_EXPORT void renumberInPlace(const int *old2New);
714     MEDCOUPLING_EXPORT void renumberInPlaceR(const int *new2Old);
715     MEDCOUPLING_EXPORT DataArrayChar *renumber(const int *old2New) const;
716     MEDCOUPLING_EXPORT DataArrayChar *renumberR(const int *new2Old) const;
717     MEDCOUPLING_EXPORT DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const;
718     MEDCOUPLING_EXPORT DataArrayChar *selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const;
719     MEDCOUPLING_EXPORT DataArrayChar *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const;
720     MEDCOUPLING_EXPORT DataArrayChar *selectByTupleId2(int bg, int end, int step) const;
721     MEDCOUPLING_EXPORT bool isUniform(char val) const;
722     MEDCOUPLING_EXPORT void rearrange(int newNbOfCompo);
723     MEDCOUPLING_EXPORT DataArrayChar *substr(int tupleIdBg, int tupleIdEnd=-1) const;
724     MEDCOUPLING_EXPORT DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const;
725     MEDCOUPLING_EXPORT DataArrayChar *keepSelectedComponents(const std::vector<int>& compoIds) const;
726     MEDCOUPLING_EXPORT void meldWith(const DataArrayChar *other);
727     MEDCOUPLING_EXPORT void setPartOfValues1(const DataArrayChar *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true);
728     MEDCOUPLING_EXPORT void setPartOfValuesSimple1(char a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp);
729     MEDCOUPLING_EXPORT void setPartOfValues2(const DataArrayChar *a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp, bool strictCompoCompare=true);
730     MEDCOUPLING_EXPORT void setPartOfValuesSimple2(char a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp);
731     MEDCOUPLING_EXPORT void setPartOfValues3(const DataArrayChar *a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true);
732     MEDCOUPLING_EXPORT void setPartOfValuesSimple3(char a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp);
733     MEDCOUPLING_EXPORT void setPartOfValues4(const DataArrayChar *a, int bgTuples, int endTuples, int stepTuples, const int *bgComp, const int *endComp, bool strictCompoCompare=true);
734     MEDCOUPLING_EXPORT void setPartOfValuesSimple4(char a, int bgTuples, int endTuples, int stepTuples, const int *bgComp, const int *endComp);
735     MEDCOUPLING_EXPORT void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayChar *tuplesSelec);
736     MEDCOUPLING_EXPORT void setContigPartOfSelectedValues(int tupleIdStart, const DataArray *aBase, const DataArrayInt *tuplesSelec);
737     MEDCOUPLING_EXPORT void setContigPartOfSelectedValues2(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step);
738     MEDCOUPLING_EXPORT DataArray *selectByTupleRanges(const std::vector<std::pair<int,int> >& ranges) const;
739     MEDCOUPLING_EXPORT void getTuple(int tupleId, char *res) const { std::copy(_mem.getConstPointerLoc(tupleId*_info_on_compo.size()),_mem.getConstPointerLoc((tupleId+1)*_info_on_compo.size()),res); }
740     MEDCOUPLING_EXPORT char getIJ(int tupleId, int compoId) const { return _mem[tupleId*_info_on_compo.size()+compoId]; }
741     MEDCOUPLING_EXPORT char getIJSafe(int tupleId, int compoId) const;
742     MEDCOUPLING_EXPORT char front() const;
743     MEDCOUPLING_EXPORT char back() const;
744     MEDCOUPLING_EXPORT void setIJ(int tupleId, int compoId, char newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; declareAsNew(); }
745     MEDCOUPLING_EXPORT void setIJSilent(int tupleId, int compoId, char newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; }
746     MEDCOUPLING_EXPORT char *getPointer() { return _mem.getPointer(); declareAsNew(); }
747     MEDCOUPLING_EXPORT const char *getConstPointer() const { return _mem.getConstPointer(); }
748     MEDCOUPLING_EXPORT const char *begin() const { return getConstPointer(); }
749     MEDCOUPLING_EXPORT const char *end() const { return getConstPointer()+getNbOfElems(); }
750     MEDCOUPLING_EXPORT DataArrayInt *getIdsEqual(char val) const;
751     MEDCOUPLING_EXPORT DataArrayInt *getIdsNotEqual(char val) const;
752     MEDCOUPLING_EXPORT int search(const std::vector<char>& vals) const;
753     MEDCOUPLING_EXPORT int locateTuple(const std::vector<char>& tupl) const;
754     MEDCOUPLING_EXPORT int locateValue(char value) const;
755     MEDCOUPLING_EXPORT int locateValue(const std::vector<char>& vals) const;
756     MEDCOUPLING_EXPORT bool presenceOfTuple(const std::vector<char>& tupl) const;
757     MEDCOUPLING_EXPORT bool presenceOfValue(char value) const;
758     MEDCOUPLING_EXPORT bool presenceOfValue(const std::vector<char>& vals) const;
759     MEDCOUPLING_EXPORT char getMaxValue(int& tupleId) const;
760     MEDCOUPLING_EXPORT char getMaxValueInArray() const;
761     MEDCOUPLING_EXPORT char getMinValue(int& tupleId) const;
762     MEDCOUPLING_EXPORT char getMinValueInArray() const;
763     MEDCOUPLING_EXPORT DataArrayInt *getIdsInRange(char vmin, char vmax) const;
764     MEDCOUPLING_EXPORT static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2);
765     MEDCOUPLING_EXPORT static DataArrayChar *Aggregate(const std::vector<const DataArrayChar *>& arr);
766     MEDCOUPLING_EXPORT static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2);
767     MEDCOUPLING_EXPORT static DataArrayChar *Meld(const std::vector<const DataArrayChar *>& arr);
768     MEDCOUPLING_EXPORT void useArray(const char *array, bool ownership, DeallocType type, int nbOfTuple, int nbOfCompo);
769     template<class InputIterator>
770     void insertAtTheEnd(InputIterator first, InputIterator last);
771     MEDCOUPLING_EXPORT void useExternalArrayWithRWAccess(const char *array, int nbOfTuple, int nbOfCompo);
772     MEDCOUPLING_EXPORT void updateTime() const { }
773     MEDCOUPLING_EXPORT MemArray<char>& accessToMemArray() { return _mem; }
774     MEDCOUPLING_EXPORT const MemArray<char>& accessToMemArray() const { return _mem; }
775   public:
776     //MEDCOUPLING_EXPORT void getTinySerializationIntInformation(std::vector<int>& tinyInfo) const;
777     //MEDCOUPLING_EXPORT void getTinySerializationStrInformation(std::vector<std::string>& tinyInfo) const;
778     //MEDCOUPLING_EXPORT bool resizeForUnserialization(const std::vector<int>& tinyInfoI);
779     //MEDCOUPLING_EXPORT void finishUnserialization(const std::vector<int>& tinyInfoI, const std::vector<std::string>& tinyInfoS);
780   protected:
781     DataArrayChar() { }
782   protected:
783     MemArray<char> _mem;
784   };
785
786   class DataArrayByteIterator;
787
788   class DataArrayByte : public DataArrayChar
789   {
790   public:
791     MEDCOUPLING_EXPORT static DataArrayByte *New();
792     MEDCOUPLING_EXPORT DataArrayChar *buildEmptySpecializedDAChar() const;
793     MEDCOUPLING_EXPORT DataArrayByteIterator *iterator();
794     MEDCOUPLING_EXPORT DataArrayByte *deepCpy() const;
795     MEDCOUPLING_EXPORT DataArrayByte *performCpy(bool deepCpy) const;
796     MEDCOUPLING_EXPORT char byteValue() const;
797     MEDCOUPLING_EXPORT void reprStream(std::ostream& stream) const;
798     MEDCOUPLING_EXPORT void reprZipStream(std::ostream& stream) const;
799     MEDCOUPLING_EXPORT void reprWithoutNameStream(std::ostream& stream) const;
800     MEDCOUPLING_EXPORT void reprZipWithoutNameStream(std::ostream& stream) const;
801     MEDCOUPLING_EXPORT void reprCppStream(const std::string& varName, std::ostream& stream) const;
802     MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const;
803     MEDCOUPLING_EXPORT void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const;
804     MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const DataArrayChar& other, std::string& reason) const;
805     MEDCOUPLING_EXPORT std::vector<bool> toVectorOfBool() const;
806   private:
807     ~DataArrayByte() { }
808     DataArrayByte() { }
809   };
810
811   class DataArrayByteTuple;
812
813   class DataArrayByteIterator
814   {
815   public:
816     MEDCOUPLING_EXPORT DataArrayByteIterator(DataArrayByte *da);
817     MEDCOUPLING_EXPORT ~DataArrayByteIterator();
818     MEDCOUPLING_EXPORT DataArrayByteTuple *nextt();
819   private:
820     DataArrayByte *_da;
821     char *_pt;
822     int _tuple_id;
823     int _nb_comp;
824     int _nb_tuple;
825   };
826
827   class DataArrayByteTuple
828   {
829   public:
830     MEDCOUPLING_EXPORT DataArrayByteTuple(char *pt, int nbOfComp);
831     MEDCOUPLING_EXPORT std::string repr() const;
832     MEDCOUPLING_EXPORT int getNumberOfCompo() const { return _nb_of_compo; }
833     MEDCOUPLING_EXPORT const char *getConstPointer() const { return  _pt; }
834     MEDCOUPLING_EXPORT char *getPointer() { return _pt; }
835     MEDCOUPLING_EXPORT char byteValue() const;
836     MEDCOUPLING_EXPORT DataArrayByte *buildDAByte(int nbOfTuples, int nbOfCompo) const;
837   private:
838     char *_pt;
839     int _nb_of_compo;
840   };
841
842   class DataArrayAsciiCharIterator;
843
844   class DataArrayAsciiChar : public DataArrayChar
845   {
846   public:
847     MEDCOUPLING_EXPORT static DataArrayAsciiChar *New();
848     MEDCOUPLING_EXPORT static DataArrayAsciiChar *New(const std::string& st);
849     MEDCOUPLING_EXPORT static DataArrayAsciiChar *New(const std::vector<std::string>& vst, char defaultChar);
850     MEDCOUPLING_EXPORT DataArrayChar *buildEmptySpecializedDAChar() const;
851     MEDCOUPLING_EXPORT DataArrayAsciiCharIterator *iterator();
852     MEDCOUPLING_EXPORT DataArrayAsciiChar *deepCpy() const;
853     MEDCOUPLING_EXPORT DataArrayAsciiChar *performCpy(bool deepCpy) const;
854     MEDCOUPLING_EXPORT char asciiCharValue() const;
855     MEDCOUPLING_EXPORT void reprStream(std::ostream& stream) const;
856     MEDCOUPLING_EXPORT void reprZipStream(std::ostream& stream) const;
857     MEDCOUPLING_EXPORT void reprWithoutNameStream(std::ostream& stream) const;
858     MEDCOUPLING_EXPORT void reprZipWithoutNameStream(std::ostream& stream) const;
859     MEDCOUPLING_EXPORT void reprCppStream(const std::string& varName, std::ostream& stream) const;
860     MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const;
861     MEDCOUPLING_EXPORT void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const;
862     MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const DataArrayChar& other, std::string& reason) const;
863   private:
864     ~DataArrayAsciiChar() { }
865     DataArrayAsciiChar() { }
866     DataArrayAsciiChar(const std::string& st);
867     DataArrayAsciiChar(const std::vector<std::string>& vst, char defaultChar);
868   };
869
870   class DataArrayAsciiCharTuple;
871
872   class DataArrayAsciiCharIterator
873   {
874   public:
875     MEDCOUPLING_EXPORT DataArrayAsciiCharIterator(DataArrayAsciiChar *da);
876     MEDCOUPLING_EXPORT ~DataArrayAsciiCharIterator();
877     MEDCOUPLING_EXPORT DataArrayAsciiCharTuple *nextt();
878   private:
879     DataArrayAsciiChar *_da;
880     char *_pt;
881     int _tuple_id;
882     int _nb_comp;
883     int _nb_tuple;
884   };
885
886   class DataArrayAsciiCharTuple
887   {
888   public:
889     MEDCOUPLING_EXPORT DataArrayAsciiCharTuple(char *pt, int nbOfComp);
890     MEDCOUPLING_EXPORT std::string repr() const;
891     MEDCOUPLING_EXPORT int getNumberOfCompo() const { return _nb_of_compo; }
892     MEDCOUPLING_EXPORT const char *getConstPointer() const { return  _pt; }
893     MEDCOUPLING_EXPORT char *getPointer() { return _pt; }
894     MEDCOUPLING_EXPORT char asciiCharValue() const;
895     MEDCOUPLING_EXPORT DataArrayAsciiChar *buildDAAsciiChar(int nbOfTuples, int nbOfCompo) const;
896   private:
897     char *_pt;
898     int _nb_of_compo;
899   };
900
901   template<class InputIterator>
902   void DataArrayDouble::insertAtTheEnd(InputIterator first, InputIterator last)
903   {
904     int nbCompo(getNumberOfComponents());
905     if(nbCompo==1)
906       _mem.insertAtTheEnd(first,last);
907     else if(nbCompo==0)
908       {
909         _info_on_compo.resize(1);
910         _mem.insertAtTheEnd(first,last);
911       }
912     else
913       throw INTERP_KERNEL::Exception("DataArrayDouble::insertAtTheEnd : not available for DataArrayDouble with number of components different than 1 !");
914   }
915
916   template<class InputIterator>
917   void DataArrayInt::insertAtTheEnd(InputIterator first, InputIterator last)
918   {
919     int nbCompo(getNumberOfComponents());
920     if(nbCompo==1)
921       _mem.insertAtTheEnd(first,last);
922     else if(nbCompo==0)
923       {
924         _info_on_compo.resize(1);
925         _mem.insertAtTheEnd(first,last);
926       }
927     else
928       throw INTERP_KERNEL::Exception("DataArrayInt::insertAtTheEnd : not available for DataArrayInt with number of components different than 1 !");
929   }
930
931   template<class InputIterator>
932   void DataArrayChar::insertAtTheEnd(InputIterator first, InputIterator last)
933   {
934     int nbCompo(getNumberOfComponents());
935     if(nbCompo==1)
936       _mem.insertAtTheEnd(first,last);
937     else if(nbCompo==0)
938       {
939         _info_on_compo.resize(1);
940         _mem.insertAtTheEnd(first,last);
941       }
942     else
943       throw INTERP_KERNEL::Exception("DataArrayChar::insertAtTheEnd : not available for DataArrayChar with number of components different than 1 !");
944   }
945 }
946
947 #endif