From: ageay Date: Tue, 30 Nov 2010 07:09:09 +0000 (+0000) Subject: Acceleration of algorithm. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8deeb57f636d8b051f5d6f14cee84f149be742a4;p=tools%2Fmedcoupling.git Acceleration of algorithm. --- diff --git a/src/MEDCoupling/MEDCouplingPointSet.txx b/src/MEDCoupling/MEDCouplingPointSet.txx index 658d6d9c5..9374a1cb6 100644 --- a/src/MEDCoupling/MEDCouplingPointSet.txx +++ b/src/MEDCoupling/MEDCouplingPointSet.txx @@ -36,30 +36,35 @@ namespace ParaMEDMEM BBTree myTree(&bbox[0],0,0,nbNodes,-prec); double bb[2*SPACEDIM]; double prec2=prec*prec; + std::vector isDone(nbNodes); for(int i=0;i intersectingElems; - myTree.getIntersectingElems(bb,intersectingElems); - if(intersectingElems.size()>1) - { - std::vector commonNodes; - for(std::vector::const_iterator it=intersectingElems.begin();it!=intersectingElems.end();it++) - if(*it!=i) - if(*it>=limitNodeId) - if(INTERP_KERNEL::distance2(coordsPtr+SPACEDIM*i,coordsPtr+SPACEDIM*(*it)) intersectingElems; + myTree.getIntersectingElems(bb,intersectingElems); + if(intersectingElems.size()>1) { - cI.push_back(cI.back()+commonNodes.size()+1); - c.push_back(i); - c.insert(c.end(),commonNodes.begin(),commonNodes.end()); + std::vector commonNodes; + for(std::vector::const_iterator it=intersectingElems.begin();it!=intersectingElems.end();it++) + if(*it!=i) + if(*it>=limitNodeId) + if(INTERP_KERNEL::distance2(coordsPtr+SPACEDIM*i,coordsPtr+SPACEDIM*(*it))