getCorners( corners, &cornerBox->_minmax[0] );
double globCorner[3];
- for ( int iC = 0, nC = corners.size()/_dim; iC < nC; ++iC)
+ for ( std::size_t iC = 0, nC = corners.size()/_dim; iC < nC; ++iC)
{
cornerBox->fromLocalCS( &corners[iC*_dim], globCorner );
mmBox.addPointToBox( globCorner );
getCorners( cornersOther, box );
DirectedBoundingBox mmBox((double*)0,0,_dim); //!< empty box with CS == this->_axes
mmBox._axes = this->_axes;
- for ( int iC = 0, nC = cornersOther.size()/_dim; iC < nC; ++iC)
+ for ( std::size_t iC = 0, nC = cornersOther.size()/_dim; iC < nC; ++iC)
mmBox.addPointToBox( &cornersOther[iC*_dim] );
if ( isMinMaxOut( &mmBox._minmax[0], &this->_minmax[0], _dim ))
getCorners( cornersThis, &_minmax[0] );
DirectedBoundingBox mmBox((double*)0,0,_dim); //!< initailized _minmax
double globCorner[3];
- for ( int iC = 0, nC = cornersThis.size()/_dim; iC < nC; ++iC)
+ for ( std::size_t iC = 0, nC = cornersThis.size()/_dim; iC < nC; ++iC)
{
fromLocalCS( &cornersThis[iC*_dim], globCorner );
for ( int i = 0; i < (int)_dim; ++i )
*_deep_it=*iter;
_deep_it++;
iter++;
- int sizeOfMyList=myListToInsert->size();
+ std::size_t sizeOfMyList=myListToInsert->size();
_list_handle->insert(_deep_it,iter,myListToInsert->end());
if(!changeMySelf)
{
- for(int i=0;i<sizeOfMyList;i++)
+ for(std::size_t i=0;i<sizeOfMyList;i++)
_deep_it--;
}
}
const int SPACE_DIM = 3;
const double adj(getPrecision());// here precision is used instead of getBoundingBoxAdjustment and getBoundingBoxAdjustmentAbs because in the context only precision is relevant
- long size = bbox.size()/(2*SPACE_DIM);
- for (int i=0; i<size; i++)
+ std::size_t size = bbox.size()/(2*SPACE_DIM);
+ for (std::size_t i=0; i<size; i++)
{
for(int idim=0; idim<SPACE_DIM; idim++)
{
const double adj = getBoundingBoxAdjustmentAbs();
const double adjRel = getBoundingBoxAdjustment();
- long size = bbox.size()/(2*SPACE_DIM);
- for (int i=0; i<size; i++)
+ std::size_t size = bbox.size()/(2*SPACE_DIM);
+ for (std::size_t i=0; i<size; i++)
{
double max=- std::numeric_limits<double>::max();
for(int idim=0; idim<SPACE_DIM; idim++)
bool checkDequesEqual(std::deque< double > deque1,
std::deque< double > deque2, double epsilon)
{
- int size1 = deque1.size();
- int size2 = deque2.size();
+ std::size_t size1 = deque1.size();
+ std::size_t size2 = deque2.size();
bool are_equal = size1 == size2;
if(are_equal)
- for(int i = 0; i < size1 && are_equal; i++)
+ for(std::size_t i = 0; i < size1 && are_equal; i++)
are_equal = fabs(deque1[i] - deque2[i]) < epsilon;
return are_equal;
bool checkVectorsEqual(std::vector< double > vect1,
std::vector< double > vect2, double epsilon)
{
- int size1 = vect1.size();
- int size2 = vect2.size();
+ std::size_t size1 = vect1.size();
+ std::size_t size2 = vect2.size();
bool are_equal = size1 == size2;
if(are_equal)
- for(int i = 0; i < size1 && are_equal; i++)
+ for(std::size_t i = 0; i < size1 && are_equal; i++)
are_equal = fabs(vect1[i] - vect2[i]) < epsilon;
return are_equal;
}
void dequePrintOut(std::deque< double > deque1)
{
- for(int i = 0; i< (int)deque1.size(); i++)
+ for(std::size_t i = 0; i< deque1.size(); i++)
{
std::cerr << deque1[i] << " ";
}
}
void vectPrintOut(std::vector< double > vect)
{
- for(int i = 0; i< (int)vect.size(); i++)
+ for(std::size_t i = 0; i< vect.size(); i++)
{
std::cerr << vect[i] << " ";
}
int MEDCouplingBasicsTest::countNonZero(const std::vector< std::map<int,double> >& matrix)
{
- int ret=0.;
+ int ret=0;
for(std::vector< std::map<int,double> >::const_iterator iter=matrix.begin();iter!=matrix.end();iter++)
for(std::map<int,double>::const_iterator iter2=(*iter).begin();iter2!=(*iter).end();iter2++)
if (!INTERP_KERNEL::epsilonEqual((*iter2).second, 0.)) ret +=1;
//
targetMesh=build3DTargetMesh_1();
bool areNodesMerged;
- unsigned int time=targetMesh->getTimeOfThis();
+ std::size_t time=targetMesh->getTimeOfThis();
o2n=targetMesh->mergeNodes(1e-10,areNodesMerged,newNbOfNodes);
targetMesh->updateTime();
CPPUNIT_ASSERT(time==targetMesh->getTimeOfThis());
void MEDCouplingBasicsTest1::testOperationsOnFields4()
{
MEDCouplingUMesh *m=build2DTargetMesh_1();
- int nbOfCells=m->getNumberOfCells();
+ std::size_t nbOfCells=m->getNumberOfCells();
MEDCouplingFieldDouble *f1=MEDCouplingFieldDouble::New(ON_CELLS,CONST_ON_TIME_INTERVAL);
f1->setMesh(m);
DataArrayDouble *array=DataArrayDouble::New();
{
MEDCouplingUMesh *targetMesh=build2DTargetMesh_1();
MEDCouplingFieldDouble *fieldOnCells=MEDCouplingFieldDouble::New(ON_CELLS);
- int nbOfCells=targetMesh->getNumberOfCells();
+ std::size_t nbOfCells=targetMesh->getNumberOfCells();
fieldOnCells->setMesh(targetMesh);
DataArrayDouble *array=DataArrayDouble::New();
array->alloc(nbOfCells,2);
fieldOnCells->setArray(array);
double *tmp=array->getPointer();
- for(int i=0;i<nbOfCells;i++)
+ for(std::size_t i=0;i<nbOfCells;i++)
{ tmp[2*i]=7.+(double)i; tmp[2*i+1]=17.+(double)i; }
array->decrRef();
//
MEDCouplingFieldDouble *f=MEDCouplingFieldDouble::New(ON_CELLS,NO_TIME);
f->setMesh(m);
DataArrayDouble *arr=DataArrayDouble::New();
- int nbOfCells=m->getNumberOfCells();
- arr->alloc(nbOfCells,3);
+
+ arr->alloc(m->getNumberOfCells(),3);
f->setArray(arr);
arr->decrRef();
const double values1[15]={7.,107.,10007.,8.,108.,10008.,9.,109.,10009.,10.,110.,10010.,11.,111.,10011.};
bool isExcep=false;
try { mesh1->checkGeoEquivalWith(mesh2,0,1e-12,cellCor,nodeCor);//deepEqual fails
}
- catch(INTERP_KERNEL::Exception& e) { isExcep=true; }
+ catch(INTERP_KERNEL::Exception&) { isExcep=true; }
CPPUNIT_ASSERT(isExcep); isExcep=false;
CPPUNIT_ASSERT(cellCor==0);
CPPUNIT_ASSERT(nodeCor==0);
try { mesh1->checkGeoEquivalWith(mesh2,1,1e-12,cellCor,nodeCor);//fastEqual has detected something
}
- catch(INTERP_KERNEL::Exception& e) { isExcep=true; }
+ catch(INTERP_KERNEL::Exception&) { isExcep=true; }
CPPUNIT_ASSERT(isExcep); isExcep=false;
CPPUNIT_ASSERT(cellCor==0);
CPPUNIT_ASSERT(nodeCor==0);
void MEDCouplingBasicsTest2::testCopyTinyStringsFromOnFields()
{
MEDCouplingUMesh *m=build3DSurfTargetMesh_1();
- int nbOfCells=m->getNumberOfCells();
+ std::size_t nbOfCells=m->getNumberOfCells();
MEDCouplingFieldDouble *f=MEDCouplingFieldDouble::New(ON_CELLS,LINEAR_TIME);
f->setMesh(m);
CPPUNIT_ASSERT_EQUAL(5,f->getNumberOfMeshPlacesExpected());
void MEDCouplingBasicsTest2::testGetMaxValue1()
{
MEDCouplingUMesh *m=build3DSurfTargetMesh_1();
- int nbOfCells=m->getNumberOfCells();
+ std::size_t nbOfCells=m->getNumberOfCells();
MEDCouplingFieldDouble *f=MEDCouplingFieldDouble::New(ON_CELLS,LINEAR_TIME);
f->setMesh(m);
DataArrayDouble *a1=DataArrayDouble::New();
MEDCouplingFieldDouble *f=MEDCouplingFieldDouble::New(ON_CELLS,NO_TIME);
f->setMesh(m);
DataArrayDouble *arr=DataArrayDouble::New();
- int nbOfCells=m->getNumberOfCells();
+ std::size_t nbOfCells=m->getNumberOfCells();
arr->alloc(nbOfCells,3);
f->setArray(arr);
arr->decrRef();