#endif
#endif
+#ifdef WITH_NUMPY
// specific DataArray deallocator callback. This deallocator is used both in the constructor of DataArray and in the toNumPyArr
// method. This dellocator uses weakref to determine if the linked numArr is still alive or not. If alive the ownership is given to it.
// if no more alive the "standart" DataArray deallocator is called.
}
delete [] wronc;
}
+#endif
template<class MCData>
struct PyCallBackDataArraySt {
PyObject_GC_Del, /*tp_free*/
};
+#ifdef WITH_NUMPY
template<class T>
struct NPYTraits
{
static PyTypeObject *NPYFunc;
static PyObject *Array_SWIGTYPE;
};
+#endif
#endif
return val;
}
+#ifdef WITH_NUMPY
// this is the second type of specific deallocator, only valid for the constructor of DataArrays taking numpy array
// in input when an another DataArray is already client of this.
template<class MCData>
SWIGINTERN PyObject *MEDCoupling_DataArrayInt_toNumPyArray(MEDCoupling::DataArrayInt *self);
SWIGINTERN PyObject *MEDCoupling_DataArrayDouble_toNumPyArray(MEDCoupling::DataArrayDouble *self);
+#endif
+
+#ifdef WITH_SCIPY
PyObject *ToCSRMatrix(const std::vector<std::map<int,double> >& m, int nbCols)
{
int nbRows((int)m.size());
return ret;
}
+#endif
+
static PyObject *convertDataArrayChar(MEDCoupling::DataArrayChar *dac, int owner)
{
PyObject *ret=0;
int nbcells=0;
for (std::size_t i = 0; i < cellMeshes.size(); i++)
nbcells+=cellMeshes[i]->getNumberOfCells();
- CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), nbcells);
+ CPPUNIT_ASSERT_EQUAL((int)cellMesh->getNumberOfCells(), nbcells);
std::vector<MEDCoupling::MEDCouplingUMesh*>faceMeshes=collection.getFaceMesh();
CPPUNIT_ASSERT_EQUAL(5, (int) faceMeshes.size());
int nbfaces=0;
for (std::size_t i=0; i < faceMeshes.size(); i++)
nbfaces+=faceMeshes[i]->getNumberOfCells();
- CPPUNIT_ASSERT_EQUAL(faceMesh->getNumberOfCells(), nbfaces);
+ CPPUNIT_ASSERT_EQUAL((int)faceMesh->getNumberOfCells(), nbfaces);
//merge split meshes and test equality
cmd=execName+" --ndomains=1 --split-method="+MetisOrScotch; //on same proc
MCAuto<MEDCouplingFieldDouble> field2=ReadFieldCell(refusedName.c_str(),refusedCellMesh->getName().c_str(),0,"VectorFieldOnCells",0,1);
int nbcells=corr[1]->getNumberOfTuples();
- CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), nbcells);
+ CPPUNIT_ASSERT_EQUAL((int)cellMesh->getNumberOfCells(), nbcells);
//use corr to test equality of field
DataArrayDouble* f1=field1->getArray();
DataArrayDouble* f2=field2->getArray();
MCAuto<MEDCouplingFieldDouble> field2=ReadField(ON_GAUSS_NE,refusedName.c_str(),refusedCellMesh->getName().c_str(),0,"MyFieldOnGaussNE",5,6);
int nbcells=corr[1]->getNumberOfTuples();
- CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), nbcells);
+ CPPUNIT_ASSERT_EQUAL((int)cellMesh->getNumberOfCells(), nbcells);
//use corr to test equality of field
DataArrayDouble* f1=field1->getArray();
DataArrayDouble* f2=field2->getArray();