Salome HOME
Fix 32bits config bug
[tools/medcoupling.git] / src / MEDCoupling / MEDCouplingMatrix.hxx
index 80c3f14a817eb513b909f00bd925987e1bc01aeb..42d075755f368ca37dcda336f7492d7f86a01c2e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2020  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -38,19 +38,20 @@ namespace MEDCoupling
   class DenseMatrix : public RefCountObject, public TimeLabel
   {
   public:
-    MEDCOUPLING_EXPORT static DenseMatrix *New(int nbRows, int nbCols);
-    MEDCOUPLING_EXPORT static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols);
+    MEDCOUPLING_EXPORT static DenseMatrix *New(mcIdType nbRows, mcIdType nbCols);
+    MEDCOUPLING_EXPORT static DenseMatrix *New(DataArrayDouble *array, mcIdType nbRows, mcIdType nbCols);
+    MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("DenseMatrix"); }
     MEDCOUPLING_EXPORT DenseMatrix *deepCopy() const;
     MEDCOUPLING_EXPORT DenseMatrix *shallowCpy() const;
     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
     MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDCOUPLING_EXPORT void updateTime() const;
     //
-    MEDCOUPLING_EXPORT int getNumberOfRows() const { return _nb_rows; }
-    MEDCOUPLING_EXPORT int getNumberOfCols() const { return _nb_cols; }
-    MEDCOUPLING_EXPORT int getNbOfElems() const { return _nb_rows*_nb_cols; }
-    MEDCOUPLING_EXPORT void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1);
-    MEDCOUPLING_EXPORT void reShape(int nbRows, int nbCols);
+    MEDCOUPLING_EXPORT mcIdType getNumberOfRows() const { return _nb_rows; }
+    MEDCOUPLING_EXPORT mcIdType getNumberOfCols() const { return _nb_cols; }
+    MEDCOUPLING_EXPORT mcIdType getNbOfElems() const { return _nb_rows*_nb_cols; }
+    MEDCOUPLING_EXPORT void reBuild(DataArrayDouble *array, mcIdType nbRows=-1, mcIdType nbCols=-1);
+    MEDCOUPLING_EXPORT void reShape(mcIdType nbRows, mcIdType nbCols);
     MEDCOUPLING_EXPORT void transpose();
     //
     MEDCOUPLING_EXPORT bool isEqual(const DenseMatrix& other, double eps) const;
@@ -68,17 +69,17 @@ namespace MEDCoupling
     MEDCOUPLING_EXPORT DataArrayDouble *getData() { return _data; }
   private:
     ~DenseMatrix();
-    DenseMatrix(int nbRows, int nbCols);
-    DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols);
-    int getNumberOfRowsExt(int nbRows) const;
-    int getNumberOfColsExt(int nbCols) const;
+    DenseMatrix(mcIdType nbRows, mcIdType nbCols);
+    DenseMatrix(DataArrayDouble *array, mcIdType nbRows, mcIdType nbCols);
+    mcIdType getNumberOfRowsExt(mcIdType nbRows) const;
+    mcIdType getNumberOfColsExt(mcIdType nbCols) const;
     void checkValidData() const;
-    static void CheckArraySizes(DataArrayDouble *array, int nbRows, int nbCols);
+    static void CheckArraySizes(DataArrayDouble *array, mcIdType nbRows, mcIdType nbCols);
     static void CheckSameSize(const DenseMatrix *a1, const DenseMatrix *a2);
     static void CheckCompatibleSizeForMul(const DenseMatrix *a1, const DenseMatrix *a2);
   private:
-    int _nb_rows;
-    int _nb_cols;
+    mcIdType _nb_rows;
+    mcIdType _nb_cols;
     MCAuto<DataArrayDouble> _data;
   };
 }