Salome HOME
addition of numpy
[tools/medcoupling.git] / src / MEDCoupling_Swig / MEDCouplingMemArray.i
index 569240dffab47deba89866141b9f2879c541e547..620c02a0f48530b1dc45354860958a4c3566bdd6 100644 (file)
@@ -41,8 +41,10 @@ namespace ParaMEDMEM
     void setInfoOnComponent(int i, const char *info) throw(INTERP_KERNEL::Exception);
     int getNumberOfComponents() const;
     virtual void alloc(int nbOfTuple, int nbOfCompo=1) throw(INTERP_KERNEL::Exception);
+    virtual void reAlloc(int nbOfTuples) throw(INTERP_KERNEL::Exception);
     virtual bool isAllocated() const throw(INTERP_KERNEL::Exception);
     virtual void checkAllocated() const throw(INTERP_KERNEL::Exception);
+    virtual void desallocate() throw(INTERP_KERNEL::Exception);
     virtual int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
     virtual std::size_t getNbOfElems() const throw(INTERP_KERNEL::Exception);
     virtual std::size_t getNbOfElemAllocated() const throw(INTERP_KERNEL::Exception);
@@ -285,7 +287,6 @@ namespace ParaMEDMEM
     std::string reprZip() const throw(INTERP_KERNEL::Exception);
     bool isEqual(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception);
     bool isEqualWithoutConsideringStr(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception);
-    void reAlloc(int nbOfTuples) throw(INTERP_KERNEL::Exception);
     DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
     DataArrayDouble *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
     DataArrayDouble *toNoInterlace() const throw(INTERP_KERNEL::Exception);
@@ -302,6 +303,7 @@ namespace ParaMEDMEM
     void setPartOfValuesSimple1(double a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw(INTERP_KERNEL::Exception);
     void setPartOfValuesAdv(const DataArrayDouble *a, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception);
     double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
+    double front() const throw(INTERP_KERNEL::Exception);
     double back() const throw(INTERP_KERNEL::Exception);
     double getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
     void setIJ(int tupleId, int compoId, double newVal) throw(INTERP_KERNEL::Exception);
@@ -872,6 +874,18 @@ namespace ParaMEDMEM
         return ret;
       }
 
+      PyObject *areIncludedInMe(const DataArrayDouble *other, double prec) const throw(INTERP_KERNEL::Exception)
+      {
+        DataArrayInt *ret1=0;
+        bool ret0=self->areIncludedInMe(other,prec,ret1);
+        PyObject *ret=PyTuple_New(2);
+        PyObject *ret0Py=ret0?Py_True:Py_False;
+        Py_XINCREF(ret0Py);
+        PyTuple_SetItem(ret,0,ret0Py);
+        PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+        return ret;
+      }
+
       PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
       {
         const char msg[]="Unexpected situation in DataArrayDouble::__getitem__ !";
@@ -2301,7 +2315,6 @@ namespace ParaMEDMEM
     DataArrayInt *invertArrayO2N2N2O(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
     DataArrayInt *invertArrayN2O2O2N(int oldNbOfElem) const throw(INTERP_KERNEL::Exception);
     DataArrayInt *invertArrayO2N2N2OBis(int newNbOfElem) const throw(INTERP_KERNEL::Exception);
-    void reAlloc(int nbOfTuples) throw(INTERP_KERNEL::Exception);
     DataArrayDouble *convertToDblArr() const throw(INTERP_KERNEL::Exception);
     DataArrayInt *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
     DataArrayInt *toNoInterlace() const throw(INTERP_KERNEL::Exception);
@@ -2321,6 +2334,7 @@ namespace ParaMEDMEM
     void getTuple(int tupleId, int *res) const throw(INTERP_KERNEL::Exception);
     int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
     int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
+    int front() const throw(INTERP_KERNEL::Exception);
     int back() const throw(INTERP_KERNEL::Exception);
     void setIJ(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
     void setIJSilent(int tupleId, int compoId, int newVal) throw(INTERP_KERNEL::Exception);
@@ -2918,6 +2932,13 @@ namespace ParaMEDMEM
         return DataArrayInt::Aggregate(tmp);
       }
 
+      static DataArrayInt *AggregateIndexes(PyObject *li) throw(INTERP_KERNEL::Exception)
+      {
+        std::vector<const DataArrayInt *> tmp;
+        convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
+        return DataArrayInt::AggregateIndexes(tmp);
+      }
+
       static DataArrayInt *BuildUnion(PyObject *li) throw(INTERP_KERNEL::Exception)
       {
         std::vector<const DataArrayInt *> tmp;
@@ -4551,7 +4572,6 @@ namespace ParaMEDMEM
     void fillWithValue(char val) throw(INTERP_KERNEL::Exception);
     std::string repr() const throw(INTERP_KERNEL::Exception);
     std::string reprZip() const throw(INTERP_KERNEL::Exception);
-    void reAlloc(int nbOfTuples) throw(INTERP_KERNEL::Exception);
     DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
     DataArrayChar *renumber(const int *old2New) const throw(INTERP_KERNEL::Exception);
     DataArrayChar *renumberR(const int *new2Old) const throw(INTERP_KERNEL::Exception);
@@ -4564,6 +4584,7 @@ namespace ParaMEDMEM
     DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const throw(INTERP_KERNEL::Exception);
     void meldWith(const DataArrayChar *other) throw(INTERP_KERNEL::Exception);
     void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayChar *tuplesSelec) throw(INTERP_KERNEL::Exception);
+    char front() const throw(INTERP_KERNEL::Exception);
     char back() const throw(INTERP_KERNEL::Exception);
     void setIJ(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
     void setIJSilent(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);