if(deepCpy)
{
if(other._x_array)
- _x_array=_x_array->deepCopy();
+ _x_array=_x_array->deepCpy();
if(other._y_array)
- _y_array=_y_array->deepCopy();
+ _y_array=_y_array->deepCpy();
if(other._z_array)
- _z_array=_z_array->deepCopy();
+ _z_array=_z_array->deepCpy();
}
else
{
{
_mesh2D=other._mesh2D->clone(true);
_mesh1D=other._mesh1D->clone(true);
- _mesh3D_ids=other._mesh3D_ids->deepCopy();
+ _mesh3D_ids=other._mesh3D_ids->deepCpy();
}
else
{
int oldNbOfElems=arr->getNumberOfTuples();
int nbOfComp=arr->getNumberOfComponents();
int newNbOfTuples=(*std::max_element(old2NewPtr,old2NewPtr+oldNbOfElems))+1;
- DataArrayDouble *arrCpy=arr->deepCopy();
+ DataArrayDouble *arrCpy=arr->deepCpy();
const double *ptSrc=arrCpy->getConstPointer();
arr->reAlloc(newNbOfTuples);
double *ptToFill=arr->getPointer();
void MEDCouplingFieldDiscretization::renumberEntitiesFromN2OArr(const int *new2OldPtr, int new2OldSz, DataArrayDouble *arr, const char *msg)
{
int nbOfComp=arr->getNumberOfComponents();
- DataArrayDouble *arrCpy=arr->deepCopy();
+ DataArrayDouble *arrCpy=arr->deepCpy();
const double *ptSrc=arrCpy->getConstPointer();
arr->reAlloc(new2OldSz);
double *ptToFill=arr->getPointer();
{
DataArrayInt *arr=other._discr_per_cell;
if(arr)
- _discr_per_cell=arr->deepCopy();
+ _discr_per_cell=arr->deepCpy();
}
void MEDCouplingFieldDiscretizationPerCell::updateTime()
throw INTERP_KERNEL::Exception("DataArrayDouble::checkAllocated : Array is defined but not allocated ! Call alloc or setValues method first !");
}
-DataArrayDouble *DataArrayDouble::deepCopy() const
-{
- return new DataArrayDouble(*this);
-}
-
DataArrayDouble *DataArrayDouble::deepCpy() const
{
return new DataArrayDouble(*this);
}
-DataArrayDouble *DataArrayDouble::performCpy(bool deepCpy) const
+DataArrayDouble *DataArrayDouble::performCpy(bool dCpy) const
{
- if(deepCpy)
- return deepCopy();
+ if(dCpy)
+ return deepCpy();
else
{
incrRef();
throw INTERP_KERNEL::Exception("DataArrayInt::checkAllocated : Array is defined but not allocated ! Call alloc or setValues method first !");
}
-DataArrayInt *DataArrayInt::deepCopy() const
-{
- return new DataArrayInt(*this);
-}
-
DataArrayInt *DataArrayInt::deepCpy() const
{
return new DataArrayInt(*this);
}
-DataArrayInt *DataArrayInt::performCpy(bool deepCpy) const
+DataArrayInt *DataArrayInt::performCpy(bool dCpy) const
{
- if(deepCpy)
- return deepCopy();
+ if(dCpy)
+ return deepCpy();
else
{
incrRef();
MEDCOUPLING_EXPORT static DataArrayDouble *New();
MEDCOUPLING_EXPORT bool isAllocated() const;
MEDCOUPLING_EXPORT void checkAllocated() const throw(INTERP_KERNEL::Exception);
- MEDCOUPLING_EXPORT DataArrayDouble *deepCopy() const;
MEDCOUPLING_EXPORT DataArrayDouble *deepCpy() const;
MEDCOUPLING_EXPORT DataArrayDouble *performCpy(bool deepCpy) const;
MEDCOUPLING_EXPORT void alloc(int nbOfTuple, int nbOfCompo);
MEDCOUPLING_EXPORT static DataArrayInt *New();
MEDCOUPLING_EXPORT bool isAllocated() const;
MEDCOUPLING_EXPORT void checkAllocated() const throw(INTERP_KERNEL::Exception);
- MEDCOUPLING_EXPORT DataArrayInt *deepCopy() const;
MEDCOUPLING_EXPORT DataArrayInt *deepCpy() const;
MEDCOUPLING_EXPORT DataArrayInt *performCpy(bool deepCpy) const;
MEDCOUPLING_EXPORT void alloc(int nbOfTuple, int nbOfCompo);
double *retPtr=ret->getPointer();
retPtr=std::copy(getCoords()->getConstPointer(),getCoords()->getConstPointer()+getCoords()->getNbOfElems(),retPtr);
MEDCouplingUMesh *tmp=MEDCouplingUMesh::New();
- DataArrayDouble *tmp2=getCoords()->deepCopy();
+ DataArrayDouble *tmp2=getCoords()->deepCpy();
tmp->setCoords(tmp2);
tmp2->decrRef();
const double *coo1D=mesh1D->getCoords()->getConstPointer();
double *retPtr=ret->getPointer();
retPtr=std::copy(getCoords()->getConstPointer(),getCoords()->getConstPointer()+getCoords()->getNbOfElems(),retPtr);
MEDCouplingUMesh *tmp=MEDCouplingUMesh::New();
- DataArrayDouble *tmp2=getCoords()->deepCopy();
+ DataArrayDouble *tmp2=getCoords()->deepCpy();
tmp->setCoords(tmp2);
tmp2->decrRef();
const double *coo1D=mesh1D->getCoords()->getConstPointer();
std::fill(array->getPointer(),array->getPointer()+5*3,7.);
CPPUNIT_ASSERT_DOUBLES_EQUAL(7.,array->getIJ(3,2),1e-14);
double *tmp1=array->getPointer();
- DataArrayDouble *array2=array->deepCopy();
+ DataArrayDouble *array2=array->deepCpy();
double *tmp2=array2->getPointer();
CPPUNIT_ASSERT(tmp1!=tmp2);
array->decrRef();
std::fill(array3->getPointer(),array3->getPointer()+5*3,17);
CPPUNIT_ASSERT_EQUAL(17,array3->getIJ(3,2));
int *tmp3=array3->getPointer();
- DataArrayInt *array4=array3->deepCopy();
+ DataArrayInt *array4=array3->deepCpy();
int *tmp4=array4->getPointer();
CPPUNIT_ASSERT(tmp3!=tmp4);
array3->decrRef();
CPPUNIT_ASSERT(fieldOnCells1->isEqual(fieldOnCells2,1e-12,1e-15));
CPPUNIT_ASSERT(fieldOnCells2->isEqual(fieldOnCells1,1e-12,1e-15));
//
- DataArrayDouble *arr2=arr->deepCopy();
+ DataArrayDouble *arr2=arr->deepCpy();
fieldOnCells2->setArray(arr2);
arr2->decrRef();
CPPUNIT_ASSERT(fieldOnCells1->isEqual(fieldOnCells2,1e-12,1e-15));
a1->fillWithZero();
a1->setInfoOnComponent(0,"c");
a1->setInfoOnComponent(1,"d");
- DataArrayDouble *a2=a1->deepCopy();
+ DataArrayDouble *a2=a1->deepCpy();
a2->setInfoOnComponent(0,"e");
a2->setInfoOnComponent(1,"f");
f->setArray(a1);
%newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
%newobject ParaMEDMEM::DataArrayInt::New;
%newobject ParaMEDMEM::DataArrayInt::convertToDblArr;
-%newobject ParaMEDMEM::DataArrayInt::deepCopy;
%newobject ParaMEDMEM::DataArrayInt::deepCpy;
%newobject ParaMEDMEM::DataArrayInt::performCpy;
%newobject ParaMEDMEM::DataArrayInt::substr;
%newobject ParaMEDMEM::DataArrayInt::toNoInterlace;
%newobject ParaMEDMEM::DataArrayDouble::New;
%newobject ParaMEDMEM::DataArrayDouble::convertToIntArr;
-%newobject ParaMEDMEM::DataArrayDouble::deepCopy;
%newobject ParaMEDMEM::DataArrayDouble::deepCpy;
%newobject ParaMEDMEM::DataArrayDouble::performCpy;
%newobject ParaMEDMEM::DataArrayDouble::aggregate;
array=DataArrayDouble.New();
array.setValues(5*3*[7.],5,3);
self.assertEqual(array.getIJ(3,2),7.);
- array2=array.deepCopy();
+ array2=array.deepCpy();
self.assertEqual(array2.getIJ(3,2),7.)
#
array3=DataArrayInt.New();
array3.setValues(5*3*[17],5,3);
self.assertEqual(array3.getIJ(3,2),17);
- array4=array3.deepCopy();
+ array4=array3.deepCpy();
self.assertEqual(array4.getIJ(3,2),17);
pass
def testRevNodal(self):
self.assertTrue(fieldOnCells1.isEqual(fieldOnCells2,1e-12,1e-15));
self.assertTrue(fieldOnCells2.isEqual(fieldOnCells1,1e-12,1e-15));
#
- arr2=arr.deepCopy();
+ arr2=arr.deepCpy();
fieldOnCells2.setArray(arr2);
self.assertTrue(fieldOnCells1.isEqual(fieldOnCells2,1e-12,1e-15));
self.assertTrue(fieldOnCells2.isEqual(fieldOnCells1,1e-12,1e-15));
a1.fillWithZero();
a1.setInfoOnComponent(0,"c");
a1.setInfoOnComponent(1,"d");
- a2=a1.deepCopy();
+ a2=a1.deepCpy();
a2.setInfoOnComponent(0,"e");
a2.setInfoOnComponent(1,"f");
f.setArray(a1);