X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingMatrix.cxx;h=35cc14364150ce7daf830daa0c69b5e575b1d5a4;hb=b1681460da1d3c8e3a196e9b13410321587db207;hp=bdc26d1e4eff3eb610170d16163c342412e7aa9b;hpb=378cb2ebe08f8f4543ef632b2bd5f77fe180f978;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingMatrix.cxx b/src/MEDCoupling/MEDCouplingMatrix.cxx old mode 100755 new mode 100644 index bdc26d1e4..35cc14364 --- a/src/MEDCoupling/MEDCouplingMatrix.cxx +++ b/src/MEDCoupling/MEDCouplingMatrix.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D +// Copyright (C) 2007-2016 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 @@ -22,7 +22,9 @@ #include "InterpKernelMatrixTools.hxx" -using namespace ParaMEDMEM; +#include + +using namespace MEDCoupling; DenseMatrix *DenseMatrix::New(int nbRows, int nbCols) { @@ -34,16 +36,16 @@ DenseMatrix *DenseMatrix::New(DataArrayDouble *array, int nbRows, int nbCols) return new DenseMatrix(array,nbRows,nbCols); } -DenseMatrix *DenseMatrix::deepCpy() const +DenseMatrix *DenseMatrix::deepCopy() const { - MEDCouplingAutoRefCountObjectPtr arr(getData()->deepCpy()); - MEDCouplingAutoRefCountObjectPtr ret(DenseMatrix::New(arr,getNumberOfRows(),getNumberOfCols())); + MCAuto arr(getData()->deepCopy()); + MCAuto ret(DenseMatrix::New(arr,getNumberOfRows(),getNumberOfCols())); return ret.retn(); } DenseMatrix *DenseMatrix::shallowCpy() const { - MEDCouplingAutoRefCountObjectPtr ret(DenseMatrix::New(const_cast(getData()),getNumberOfRows(),getNumberOfCols())); + MCAuto ret(DenseMatrix::New(const_cast(getData()),getNumberOfRows(),getNumberOfCols())); return ret.retn(); } @@ -177,7 +179,7 @@ DataArrayDouble *DenseMatrix::MatVecMult(const DenseMatrix *mat, const DataArray throw INTERP_KERNEL::Exception("DenseMatrix::MatVecMult : input vector must have only one component !"); if(vec->getNumberOfTuples()!=mat->getNumberOfCols()) throw INTERP_KERNEL::Exception("DenseMatrix::MatVecMult : Number of columns of this must be equal to number of tuples of vec !"); - MEDCouplingAutoRefCountObjectPtr ret(DataArrayDouble::New()); ret->alloc(mat->getNumberOfRows(),1); + MCAuto ret(DataArrayDouble::New()); ret->alloc(mat->getNumberOfRows(),1); INTERP_KERNEL::matrixProduct(mat->getData()->begin(),mat->getNumberOfRows(),mat->getNumberOfCols(),vec->begin(),vec->getNumberOfTuples(),1,ret->getPointer()); return ret.retn(); } @@ -187,8 +189,8 @@ DenseMatrix *DenseMatrix::Add(const DenseMatrix *a1, const DenseMatrix *a2) if(!a1 || !a2) throw INTERP_KERNEL::Exception("DenseMatrix::Add : input matrices must be not NULL !"); CheckSameSize(a1,a2); - MEDCouplingAutoRefCountObjectPtr data(DataArrayDouble::Add(a1->getData(),a2->getData())); - MEDCouplingAutoRefCountObjectPtr ret(DenseMatrix::New(data,a1->getNumberOfRows(),a1->getNumberOfCols())); + MCAuto data(DataArrayDouble::Add(a1->getData(),a2->getData())); + MCAuto ret(DenseMatrix::New(data,a1->getNumberOfRows(),a1->getNumberOfCols())); return ret.retn(); } @@ -205,8 +207,8 @@ DenseMatrix *DenseMatrix::Substract(const DenseMatrix *a1, const DenseMatrix *a2 if(!a1 || !a2) throw INTERP_KERNEL::Exception("DenseMatrix::Substract : input matrices must be not NULL !"); CheckSameSize(a1,a2); - MEDCouplingAutoRefCountObjectPtr data(DataArrayDouble::Substract(a1->getData(),a2->getData())); - MEDCouplingAutoRefCountObjectPtr ret(DenseMatrix::New(data,a1->getNumberOfRows(),a1->getNumberOfCols())); + MCAuto data(DataArrayDouble::Substract(a1->getData(),a2->getData())); + MCAuto ret(DenseMatrix::New(data,a1->getNumberOfRows(),a1->getNumberOfCols())); return ret.retn(); } @@ -224,8 +226,8 @@ DenseMatrix *DenseMatrix::Multiply(const DenseMatrix *a1, const DenseMatrix *a2) throw INTERP_KERNEL::Exception("DenseMatrix::Multiply : input matrices must be not NULL !"); CheckCompatibleSizeForMul(a1,a2); int nbr(a1->getNumberOfRows()),nbc(a2->getNumberOfCols()); - MEDCouplingAutoRefCountObjectPtr data(DataArrayDouble::New()); data->alloc(nbr*nbc,1); - MEDCouplingAutoRefCountObjectPtr ret(DenseMatrix::New(data,a1->getNumberOfRows(),a2->getNumberOfCols())); + MCAuto data(DataArrayDouble::New()); data->alloc(nbr*nbc,1); + MCAuto ret(DenseMatrix::New(data,a1->getNumberOfRows(),a2->getNumberOfCols())); INTERP_KERNEL::matrixProduct(a1->getData()->begin(),a1->getNumberOfRows(),a1->getNumberOfCols(),a2->getData()->begin(),a2->getNumberOfRows(),a2->getNumberOfCols(),data->getPointer()); return ret.retn(); } @@ -236,7 +238,7 @@ DenseMatrix *DenseMatrix::Multiply(const DenseMatrix *a1, const DataArrayDouble throw INTERP_KERNEL::Exception("DenseMatrix::Multiply #2 : input matrices must be not NULL and a2 allocated !"); if(a2->getNumberOfComponents()!=1) throw INTERP_KERNEL::Exception("DenseMatrix::Multiply #2 : The 2nd member must have exactly one component !"); - MEDCouplingAutoRefCountObjectPtr a2Bis(DenseMatrix::New(const_cast(a2),a2->getNumberOfTuples(),1)); + MCAuto a2Bis(DenseMatrix::New(const_cast(a2),a2->getNumberOfTuples(),1)); return DenseMatrix::Multiply(a1,a2Bis); }