return result;
}
template<class T, int dim>
- inline double distance2( T * a, int inda, T * b, int indb)
+ inline double distance2( T * a, std::size_t inda, T * b, std::size_t indb)
{
double result =0;
for(int idim =0; idim<dim; idim++) result += ((*a)[inda+idim] - (*b)[indb+idim])* ((*a)[inda+idim] - (*b)[indb+idim]);
/*! Indexes istart1 and istart2 designate two points P1 in L1 and P2 in L2 that have identical coordinates. Generally called with istart1=0.*/
/*! Integer sign ( 1 or -1) indicate the direction used in going all over L2. */
template<class T, int dim>
- bool checkEqualPolygonsOneDirection(T * L1, T * L2, int size1, int size2, int istart1, int istart2, double epsilon, int sign)
+ bool checkEqualPolygonsOneDirection(T * L1, T * L2, std::size_t size1, std::size_t size2, std::size_t istart1, std::size_t istart2, double epsilon, int sign)
{
- int i1 = istart1;
- int i2 = istart2;
- int i1next = ( i1 + 1 ) % size1;
- int i2next = ( i2 + sign +size2) % size2;
-
+ std::size_t i1 = istart1;
+ std::size_t i2 = istart2;
+ std::size_t i1next = ( i1 + 1 ) % size1;
+ std::size_t i2next = ( i2 + sign +size2) % size2;
+
while(true)
{
while( i1next!=istart1 && distance2<T,dim>(L1,i1*dim, L1,i1next*dim) < epsilon ) i1next = ( i1next + 1 ) % size1;
while( i2next!=istart2 && distance2<T,dim>(L2,i2*dim, L2,i2next*dim) < epsilon ) i2next = ( i2next + sign +size2 ) % size2;
-
+
if(i1next == istart1)
{
if(i2next == istart2)
std::cout << "Warning InterpolationUtils.hxx:checkEqualPolygonsPointer: Null pointer " << std::endl;
throw(Exception("big error: not closed polygon..."));
}
-
- int size1 = (*L1).size()/dim;
- int size2 = (*L2).size()/dim;
- int istart1 = 0;
- int istart2 = 0;
-
+
+ std::size_t size1 = (*L1).size()/dim;
+ std::size_t size2 = (*L2).size()/dim;
+ std::size_t istart1 = 0;
+ std::size_t istart2 = 0;
+
while( istart2 < size2 && distance2<T,dim>(L1,istart1*dim, L2,istart2*dim) > epsilon ) istart2++;
-
+
if(istart2 == size2)
{
return (size1 == 0) && (size2 == 0);
CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0972222 ,res[4][2],precis);
CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0138889 ,res[4][5],precis);
- std::vector<std::map<int,double> > resRev;
+ std::vector<std::map<mcIdType,double> > resRev;
myInterpolator.interpolateMeshesRev(targetWrapper,sourceWrapper,resRev,"P0P0");
CPPUNIT_ASSERT_DOUBLES_EQUAL( res[0][0] ,resRev[0][0],precis);
int rank(-1);
ci.commRank(comm,&rank);
T vmin(std::numeric_limits<T>::max()),vmax(-std::numeric_limits<T>::max());
- DataArrayTools<T>::GetSlice(0,nbOfElems,1,static_cast<T>(rank),static_cast<T>(size),vmin,vmax);
+ DataArrayTools<T>::GetSlice(0,nbOfElems,1,ToIdType(rank),ToIdType(size),vmin,vmax);
aggregatedIds->applyLin(1,-vmin);
MCAuto<DataArrayIdType> seqComp(aggregatedIds->buildComplement(ToIdType(vmax-vmin)));
seqComp->applyLin(1,ToIdType(vmin));
}
CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesExpected1[type],pmin,1e-12);
CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesExpected2[type],pmax,1e-12);
-
- int nbCompo(vitesse->getField()->getNumberOfComponents());
+
+ std::size_t nbCompo(vitesse->getField()->getNumberOfComponents());
p=vitesse->getField()->getArray()->begin();
for(int i=0;i<vitesse->getField()->getNumberOfTuples();i++)
- for(int c=0;c<nbCompo;c++,p++)
+ for(std::size_t c=0;c<nbCompo;c++,p++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesExpected3[type][i*nbCompo+c],*p,1e-12);
}
delete vitesse;