X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FMEDCoupling%2FMEDCouplingMatrix.hxx;h=42d075755f368ca37dcda336f7492d7f86a01c2e;hb=84031c1872103b9a0c9546ea12c4ebd03838034d;hp=f0e86287c1c79188cc5bcd2ee874565a415595c8;hpb=378cb2ebe08f8f4543ef632b2bd5f77fe180f978;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingMatrix.hxx b/src/MEDCoupling/MEDCouplingMatrix.hxx old mode 100755 new mode 100644 index f0e86287c..42d075755 --- a/src/MEDCoupling/MEDCouplingMatrix.hxx +++ b/src/MEDCoupling/MEDCouplingMatrix.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 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 @@ -25,11 +25,11 @@ #include "MEDCouplingTimeLabel.hxx" #include "MEDCouplingRefCountObject.hxx" #include "MEDCouplingMemArray.hxx" -#include "MEDCouplingAutoRefCountObjectPtr.hxx" +#include "MCAuto.hxx" #include "InterpKernelException.hxx" -namespace ParaMEDMEM +namespace MEDCoupling { /*! * The aim of this class is \b NOT to reimplement all linear algebra but only to store a dense matrix. @@ -38,19 +38,20 @@ namespace ParaMEDMEM 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 DenseMatrix *deepCpy() const; + 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 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,18 +69,18 @@ namespace ParaMEDMEM 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; - MEDCouplingAutoRefCountObjectPtr _data; + mcIdType _nb_rows; + mcIdType _nb_cols; + MCAuto _data; }; }