Commit d0565b60 authored by Pierre Kraemer's avatar Pierre Kraemer
Browse files

orbit as template -> parallel + particles

parent 4b26d77d
...@@ -39,10 +39,10 @@ namespace BooleanOperator ...@@ -39,10 +39,10 @@ namespace BooleanOperator
{ {
template <typename PFP> template <typename PFP>
void mergeVertex(typename PFP::MAP& map, const typename PFP::TVEC3& positions, Dart d, Dart e); void mergeVertex(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& positions, Dart d, Dart e);
template <typename PFP> template <typename PFP>
void mergeVertices(typename PFP::MAP& map, const typename PFP::TVEC3& positions); void mergeVertices(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& positions);
} }
......
...@@ -32,7 +32,7 @@ namespace BooleanOperator ...@@ -32,7 +32,7 @@ namespace BooleanOperator
{ {
template <typename PFP> template <typename PFP>
void mergeVertex(typename PFP::MAP& map, const typename PFP::TVEC3& positions, Dart d, Dart e) void mergeVertex(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& positions, Dart d, Dart e)
{ {
assert(Geom::arePointsEquals(positions[d],positions[e]) && !map.sameVertex(d,e)); assert(Geom::arePointsEquals(positions[d],positions[e]) && !map.sameVertex(d,e));
Dart dd; Dart dd;
...@@ -55,11 +55,11 @@ void mergeVertex(typename PFP::MAP& map, const typename PFP::TVEC3& positions, D ...@@ -55,11 +55,11 @@ void mergeVertex(typename PFP::MAP& map, const typename PFP::TVEC3& positions, D
} }
template <typename PFP> template <typename PFP>
void mergeVertices(typename PFP::MAP& map, const typename PFP::TVEC3& positions) void mergeVertices(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& positions)
{ {
for(Dart d = map.begin() ; d != map.end() ; map.next(d)) for(Dart d = map.begin() ; d != map.end() ; map.next(d))
{ {
CellMarker vM(map,VERTEX); CellMarker<VERTEX> vM(map);
vM.mark(d); vM.mark(d);
for(Dart dd = map.begin() ; dd != map.end() ; map.next(dd)) for(Dart dd = map.begin() ; dd != map.end() ; map.next(dd))
{ {
......
...@@ -35,7 +35,7 @@ void exportTrianglePlain(std::ofstream& out,typename PFP::VEC3& p1,typename PFP: ...@@ -35,7 +35,7 @@ void exportTrianglePlain(std::ofstream& out,typename PFP::VEC3& p1,typename PFP:
} }
template <typename PFP> template <typename PFP>
void exportMeshPlain(std::ofstream& out, typename PFP::MAP& map, typename PFP::TVEC3& position, const std::string& meshName, const FunctorSelect& good = allDarts) void exportMeshPlain(std::ofstream& out, typename PFP::MAP& map, AttributeHandler<typename PFP::VEC3, VERTEX>& position, const std::string& meshName, const FunctorSelect& good = allDarts)
{ {
out << "#declare " << meshName << "= union {" << std::endl; out << "#declare " << meshName << "= union {" << std::endl;
...@@ -75,7 +75,7 @@ void exportMeshPlain(std::ofstream& out, typename PFP::MAP& map, typename PFP::T ...@@ -75,7 +75,7 @@ void exportMeshPlain(std::ofstream& out, typename PFP::MAP& map, typename PFP::T
} }
template <typename PFP> template <typename PFP>
void export3MeshPlainSmooth(std::ofstream& out, typename PFP::MAP& map, typename PFP::TVEC3& position, const std::string& meshName, const FunctorSelect& good = allDarts) void export3MeshPlainSmooth(std::ofstream& out, typename PFP::MAP& map, AttributeHandler<typename PFP::VEC3, VERTEX>& position, const std::string& meshName, const FunctorSelect& good = allDarts)
{ {
typedef typename PFP::VEC3 VEC3; typedef typename PFP::VEC3 VEC3;
...@@ -102,7 +102,7 @@ void export3MeshPlainSmooth(std::ofstream& out, typename PFP::MAP& map, typename ...@@ -102,7 +102,7 @@ void export3MeshPlainSmooth(std::ofstream& out, typename PFP::MAP& map, typename
vertices.reserve(nbDarts/6) ; vertices.reserve(nbDarts/6) ;
normals.reserve(nbDarts/6) ; normals.reserve(nbDarts/6) ;
CellMarker markV(map, VERTEX) ; CellMarker<VERTEX> markV(map) ;
DartMarker markF(map) ; DartMarker markF(map) ;
for(Dart d = map.begin(); d != map.end(); map.next(d)) for(Dart d = map.begin(); d != map.end(); map.next(d))
{ {
...@@ -173,7 +173,7 @@ void export3MeshPlainSmooth(std::ofstream& out, typename PFP::MAP& map, typename ...@@ -173,7 +173,7 @@ void export3MeshPlainSmooth(std::ofstream& out, typename PFP::MAP& map, typename
} }
template <typename PFP> template <typename PFP>
void exportMeshWire(std::ofstream& out, typename PFP::MAP& map, typename PFP::TVEC3& position, const std::string& meshName, const FunctorSelect& good = allDarts) void exportMeshWire(std::ofstream& out, typename PFP::MAP& map, AttributeHandler<typename PFP::VEC3, VERTEX>& position, const std::string& meshName, const FunctorSelect& good = allDarts)
{ {
out << "#declare " << meshName << "= union {" << std::endl; out << "#declare " << meshName << "= union {" << std::endl;
...@@ -187,7 +187,7 @@ void exportMeshWire(std::ofstream& out, typename PFP::MAP& map, typename PFP::TV ...@@ -187,7 +187,7 @@ void exportMeshWire(std::ofstream& out, typename PFP::MAP& map, typename PFP::TV
Dart dd = d; Dart dd = d;
do do
{ {
traite.markOrbit(DART, dd); traite.mark(dd);
dd = map.phi1(dd); dd = map.phi1(dd);
nb++; nb++;
} while(dd != d); } while(dd != d);
...@@ -216,7 +216,7 @@ void exportMeshWire(std::ofstream& out, typename PFP::MAP& map, typename PFP::TV ...@@ -216,7 +216,7 @@ void exportMeshWire(std::ofstream& out, typename PFP::MAP& map, typename PFP::TV
} }
template <typename PFP> template <typename PFP>
bool exportScenePov(typename PFP::MAP& map, typename PFP::TVEC3& position, const std::string& filename, typename PFP::VEC3 cameraPos, typename PFP::VEC3 cameraLook, typename PFP::VEC3 translate, float angle_X, float angle_Y, float angle_Z,const FunctorSelect& good = allDarts) bool exportScenePov(typename PFP::MAP& map, AttributeHandler<typename PFP::VEC3, VERTEX>& position, const std::string& filename, typename PFP::VEC3 cameraPos, typename PFP::VEC3 cameraLook, typename PFP::VEC3 translate, float angle_X, float angle_Y, float angle_Z,const FunctorSelect& good = allDarts)
{ {
std::ofstream out(filename.c_str(), std::ios::out); std::ofstream out(filename.c_str(), std::ios::out);
if (!out.good()) if (!out.good())
...@@ -258,7 +258,7 @@ bool exportScenePov(typename PFP::MAP& map, typename PFP::TVEC3& position, const ...@@ -258,7 +258,7 @@ bool exportScenePov(typename PFP::MAP& map, typename PFP::TVEC3& position, const
} }
template <typename PFP> template <typename PFP>
bool exportScenePovSmooth(typename PFP::MAP& map, typename PFP::TVEC3& position, const std::string& filename, typename PFP::VEC3 cameraPos, typename PFP::VEC3 cameraLook, typename PFP::VEC3 translate, float angle_X, float angle_Y, float angle_Z,const FunctorSelect& good = allDarts) bool exportScenePovSmooth(typename PFP::MAP& map, AttributeHandler<typename PFP::VEC3, VERTEX>& position, const std::string& filename, typename PFP::VEC3 cameraPos, typename PFP::VEC3 cameraLook, typename PFP::VEC3 translate, float angle_X, float angle_Y, float angle_Z,const FunctorSelect& good = allDarts)
{ {
std::ofstream out(filename.c_str(), std::ios::out); std::ofstream out(filename.c_str(), std::ios::out);
if (!out.good()) { if (!out.good()) {
......
...@@ -39,21 +39,21 @@ namespace Geometry ...@@ -39,21 +39,21 @@ namespace Geometry
{ {
template <typename PFP> template <typename PFP>
Geom::Plane3D<typename PFP::REAL> trianglePlane(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position) Geom::Plane3D<typename PFP::REAL> trianglePlane(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{ {
typename PFP::VEC3 n = triangleNormal<PFP>(map, d, position) ; typename PFP::VEC3 n = triangleNormal<PFP>(map, d, position) ;
return Geom::Plane3D<typename PFP::REAL>(n, position[d]) ; return Geom::Plane3D<typename PFP::REAL>(n, position[d]) ;
} }
template <typename PFP> template <typename PFP>
Geom::Plane3D<typename PFP::REAL> facePlane(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position) Geom::Plane3D<typename PFP::REAL> facePlane(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{ {
typename PFP::VEC3 n = faceNormal<PFP>(map, d, position) ; typename PFP::VEC3 n = faceNormal<PFP>(map, d, position) ;
return Geom::Plane3D<typename PFP::REAL>(n, position[d]) ; return Geom::Plane3D<typename PFP::REAL>(n, position[d]) ;
} }
template <typename PFP> template <typename PFP>
Geom::Plane3D<typename PFP::REAL> vertexTangentPlane(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position) Geom::Plane3D<typename PFP::REAL> vertexTangentPlane(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{ {
typename PFP::VEC3 n = vertexNormal<PFP>(map, d, position) ; typename PFP::VEC3 n = vertexNormal<PFP>(map, d, position) ;
return Geom::Plane3D<typename PFP::REAL>(n, position[d]) ; return Geom::Plane3D<typename PFP::REAL>(n, position[d]) ;
......
...@@ -35,16 +35,16 @@ namespace IHM ...@@ -35,16 +35,16 @@ namespace IHM
{ {
template <typename PFP> template <typename PFP>
void subdivideEdge(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position) ; void subdivideEdge(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position) ;
template <typename PFP> template <typename PFP>
void subdivideFace(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position) ; void subdivideFace(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position) ;
template <typename PFP> template <typename PFP>
void coarsenEdge(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position) ; void coarsenEdge(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position) ;
template <typename PFP> template <typename PFP>
void coarsenFace(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position) ; void coarsenFace(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position) ;
} //namespace IHM } //namespace IHM
......
...@@ -32,7 +32,7 @@ namespace IHM ...@@ -32,7 +32,7 @@ namespace IHM
{ {
template <typename PFP> template <typename PFP>
void subdivideEdge(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position) void subdivideEdge(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{ {
assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ; assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ;
assert(!map.edgeIsSubdivided(d) || !"Trying to subdivide an already subdivided edge") ; assert(!map.edgeIsSubdivided(d) || !"Trying to subdivide an already subdivided edge") ;
...@@ -58,7 +58,7 @@ void subdivideEdge(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position ...@@ -58,7 +58,7 @@ void subdivideEdge(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position
} }
template <typename PFP> template <typename PFP>
void subdivideFace(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position) void subdivideFace(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{ {
assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ; assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ;
assert(!map.faceIsSubdivided(d) || !"Trying to subdivide an already subdivided face") ; assert(!map.faceIsSubdivided(d) || !"Trying to subdivide an already subdivided face") ;
...@@ -141,7 +141,7 @@ void subdivideFace(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position ...@@ -141,7 +141,7 @@ void subdivideFace(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position
} }
template <typename PFP> template <typename PFP>
void coarsenEdge(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position) void coarsenEdge(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{ {
assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ; assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ;
assert(map.edgeCanBeCoarsened(d) || !"Trying to coarsen an edge that can not be coarsened") ; assert(map.edgeCanBeCoarsened(d) || !"Trying to coarsen an edge that can not be coarsened") ;
...@@ -157,7 +157,7 @@ void coarsenEdge(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position) ...@@ -157,7 +157,7 @@ void coarsenEdge(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position)
} }
template <typename PFP> template <typename PFP>
void coarsenFace(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position) void coarsenFace(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{ {
assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ; assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ;
assert(map.faceIsSubdividedOnce(d) || !"Trying to coarsen a non-subdivided face or a more than once subdivided face") ; assert(map.faceIsSubdividedOnce(d) || !"Trying to coarsen a non-subdivided face or a more than once subdivided face") ;
......
...@@ -43,8 +43,7 @@ namespace Import ...@@ -43,8 +43,7 @@ namespace Import
bool checkXmlNode(xmlNodePtr node, const std::string& name); bool checkXmlNode(xmlNodePtr node, const std::string& name);
template <typename PFP> template <typename PFP>
bool importSVG(typename PFP::MAP& map, const std::string& filename, typename PFP::TVEC3& position, CellMarker& polygons); bool importSVG(typename PFP::MAP& map, const std::string& filename, AttributeHandler<typename PFP::VEC3, VERTEX>& position, CellMarker<EDGE>& polygons, CellMarker<FACE>& polygonsFaces);
/** /**
* *
......
...@@ -211,7 +211,7 @@ void getPolygonFromSVG(std::string allcoords, std::vector<VEC3>& curPoly, bool& ...@@ -211,7 +211,7 @@ void getPolygonFromSVG(std::string allcoords, std::vector<VEC3>& curPoly, bool&
} }
template <typename PFP> template <typename PFP>
bool importSVG(typename PFP::MAP& map, const std::string& filename, typename PFP::TVEC3& position, CellMarker& polygons, CellMarker& polygonsFaces) bool importSVG(typename PFP::MAP& map, const std::string& filename, AttributeHandler<typename PFP::VEC3, VERTEX>& position, CellMarker<EDGE>& polygons, CellMarker<FACE>& polygonsFaces)
{ {
typedef typename PFP::VEC3 VEC3; typedef typename PFP::VEC3 VEC3;
typedef std::vector<VEC3 > POLYGON; typedef std::vector<VEC3 > POLYGON;
...@@ -343,9 +343,9 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, typename PFP ...@@ -343,9 +343,9 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, typename PFP
return false; return false;
} }
CellMarker brokenMark(map,EDGE); CellMarker<EDGE> brokenMark(map);
AttributeHandler<float> edgeWidth = map.template addAttribute<float>(EDGE, "width"); AttributeHandler<float, EDGE> edgeWidth = map.template addAttribute<float, EDGE>("width");
AttributeHandler<NoMathAttribute<Geom::Plane3D<typename PFP::REAL> > > edgePlanes = map.template addAttribute<NoMathAttribute<Geom::Plane3D<typename PFP::REAL> > >(EDGE, "planes"); AttributeHandler<NoMathAttribute<Geom::Plane3D<typename PFP::REAL> >, EDGE> edgePlanes = map.template addAttribute<NoMathAttribute<Geom::Plane3D<typename PFP::REAL> >, EDGE>("planes");
///////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////
//create broken lines //create broken lines
...@@ -453,7 +453,7 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, typename PFP ...@@ -453,7 +453,7 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, typename PFP
///////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////
//add bounding box //add bounding box
CellMarker boundingBox(map,VERTEX); CellMarker<VERTEX> boundingBox(map);
// Dart dBorder = map.newFace(4); // Dart dBorder = map.newFace(4);
// //
// VEC3 bbCenter = bb->center(); // VEC3 bbCenter = bb->center();
...@@ -512,7 +512,7 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, typename PFP ...@@ -512,7 +512,7 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, typename PFP
///////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////
//process broken lines //process broken lines
CellMarker eMTreated(map,EDGE); CellMarker<EDGE> eMTreated(map);
for(Dart d = map.begin();d != map.end(); map.next(d)) for(Dart d = map.begin();d != map.end(); map.next(d))
{ {
if(brokenL.isMarked(d) && !eMTreated.isMarked(d)) if(brokenL.isMarked(d) && !eMTreated.isMarked(d))
......
#ifndef PARTCELL_H #ifndef PARTCELL_H
#define PARTCELL_H #define PARTCELL_H
#include "particle_base.h" #include "Algo/MovingObjects/particle_base.h"
#include "Algo/Geometry/inclusion.h" #include "Algo/Geometry/inclusion.h"
#include "Geometry/intersection.h" #include "Geometry/intersection.h"
...@@ -32,7 +32,7 @@ class ParticleCell2D : public ParticleBase ...@@ -32,7 +32,7 @@ class ParticleCell2D : public ParticleBase
public : public :
typedef typename PFP::MAP Map; typedef typename PFP::MAP Map;
typedef typename PFP::VEC3 VEC3; typedef typename PFP::VEC3 VEC3;
typedef typename PFP::TVEC3 TAB_POS; typedef AttributeHandler<typename PFP::VEC3, VERTEX> TAB_POS;
Map& m; Map& m;
......
...@@ -27,7 +27,7 @@ class ParticleCell2DMemo : public ParticleCell2D<PFP> ...@@ -27,7 +27,7 @@ class ParticleCell2DMemo : public ParticleCell2D<PFP>
public : public :
typedef typename PFP::MAP Map; typedef typename PFP::MAP Map;
typedef typename PFP::VEC3 VEC3; typedef typename PFP::VEC3 VEC3;
typedef typename PFP::TVEC3 TAB_POS; typedef AttributeHandler<typename PFP::VEC3, VERTEX> TAB_POS;
std::list<Dart> memo_cross; std::list<Dart> memo_cross;
......
...@@ -34,7 +34,7 @@ class ParticleCell2DAndHalf : public ParticleBase ...@@ -34,7 +34,7 @@ class ParticleCell2DAndHalf : public ParticleBase
public : public :
typedef typename PFP::MAP Map; typedef typename PFP::MAP Map;
typedef typename PFP::VEC3 VEC3; typedef typename PFP::VEC3 VEC3;
typedef typename PFP::TVEC3 TAB_POS; typedef AttributeHandler<typename PFP::VEC3, VERTEX> TAB_POS;
Map& m; Map& m;
......
...@@ -33,7 +33,7 @@ class ParticleCell3D : public ParticleBase ...@@ -33,7 +33,7 @@ class ParticleCell3D : public ParticleBase
public : public :
typedef typename PFP::MAP Map; typedef typename PFP::MAP Map;
typedef typename PFP::VEC3 VEC3; typedef typename PFP::VEC3 VEC3;
typedef typename PFP::TVEC3 TAB_POS; typedef AttributeHandler<typename PFP::VEC3, VERTEX> TAB_POS;
Map& m; Map& m;
......
...@@ -52,7 +52,7 @@ public: ...@@ -52,7 +52,7 @@ public:
* @param map traversed map * @param map traversed map
* @param th current thread id * @param th current thread id
*/ */
FunctorMapThreaded(MAP& m, unsigned int th=0): FunctorMap<MAP>(m), m_threadId(th) {} FunctorMapThreaded(MAP& m, unsigned int th = 0): FunctorMap<MAP>(m), m_threadId(th) {}
/** /**
* Method that duplicate the fonctor for each thread, typically: * Method that duplicate the fonctor for each thread, typically:
...@@ -61,7 +61,6 @@ public: ...@@ -61,7 +61,6 @@ public:
* @param id thread id assigned to functor * @param id thread id assigned to functor
*/ */
virtual FunctorMapThreaded<MAP>* duplicate(unsigned int id)=0; virtual FunctorMapThreaded<MAP>* duplicate(unsigned int id)=0;
}; };
/** /**
...@@ -71,7 +70,7 @@ template<typename MAP,typename T> ...@@ -71,7 +70,7 @@ template<typename MAP,typename T>
class FunctorMapThreadedResult: public FunctorMapThreaded<MAP> class FunctorMapThreadedResult: public FunctorMapThreaded<MAP>
{ {
public: public:
FunctorMapThreadedResult(MAP& m, unsigned int th=0): FunctorMapThreaded<MAP>(m,th) {} FunctorMapThreadedResult(MAP& m, unsigned int th = 0): FunctorMapThreaded<MAP>(m,th) {}
/** /**
* get back result (used by foreach_xxx_res for filling vector of results * get back result (used by foreach_xxx_res for filling vector of results
...@@ -79,23 +78,18 @@ public: ...@@ -79,23 +78,18 @@ public:
virtual T getResult() = 0; virtual T getResult() = 0;
}; };
/** /**
* Traverse orbits of a map in parallel. Use topological marker * Traverse orbits of a map in parallel. Use topological marker
* Functor application must be independant * Functor application must be independant
* @param map the map * @param map the map
* @param orbit the orbit (VERTEX/EDGE/FACE/..
* @param func the functor to apply * @param func the functor to apply
* @param nbth number of thread to use * @param nbth number of thread to use
* @param szbuff size of buffers to store darts in each thread (default is 8192, use less for lower memory consumsion) * @param szbuff size of buffers to store darts in each thread (default is 8192, use less for lower memory consumsion)
* @param needMarkers set to yes if you want that each thread use different markers (markers are allocated if necessary) * @param needMarkers set to yes if you want that each thread use different markers (markers are allocated if necessary)
* @param good a selector * @param good a selector
*/ */
template <typename PFP> template <typename PFP, unsigned int ORBIT>
void foreach_orbit(typename PFP::MAP& map, unsigned int orbit, FunctorMapThreaded<typename PFP::MAP>& func, unsigned int nbth, unsigned int szbuff=8192, bool needMarkers=false, const FunctorSelect& good= allDarts); void foreach_orbit(typename PFP::MAP& map, FunctorMapThreaded<typename PFP::MAP>& func, unsigned int nbth, unsigned int szbuff = 8192, bool needMarkers = false, const FunctorSelect& good = allDarts);
/** /**
* Traverse cells of a map in parallel. Use embedding marker * Traverse cells of a map in parallel. Use embedding marker
...@@ -108,9 +102,8 @@ void foreach_orbit(typename PFP::MAP& map, unsigned int orbit, FunctorMapThread ...@@ -108,9 +102,8 @@ void foreach_orbit(typename PFP::MAP& map, unsigned int orbit, FunctorMapThread
* @param needMarkers set to yes if you want that each thread use different markers (markers are allocated if necessary) * @param needMarkers set to yes if you want that each thread use different markers (markers are allocated if necessary)
* @param good a selector * @param good a selector
*/ */
template <typename PFP> template <typename PFP, unsigned int CELL>
void foreach_cell(typename PFP::MAP& map, unsigned int cell, FunctorMapThreaded<typename PFP::MAP>& func, unsigned int nbth, unsigned int szbuff=8192, bool needMarkers=false, const FunctorSelect& good= allDarts); void foreach_cell(typename PFP::MAP& map, FunctorMapThreaded<typename PFP::MAP>& func, unsigned int nbth, unsigned int szbuff = 8192, bool needMarkers = false, const FunctorSelect& good = allDarts);
/** /**
* Traverse darts of a map in parallel * Traverse darts of a map in parallel
...@@ -123,9 +116,7 @@ void foreach_cell(typename PFP::MAP& map, unsigned int cell, FunctorMapThreaded< ...@@ -123,9 +116,7 @@ void foreach_cell(typename PFP::MAP& map, unsigned int cell, FunctorMapThreaded<
* @param good a selector * @param good a selector
*/ */
template <typename PFP> template <typename PFP>
void foreach_dart(typename PFP::MAP& map, FunctorMapThreaded<typename PFP::MAP>& func, unsigned int nbth, unsigned int szbuff=8192, bool needMarkers=false, const FunctorSelect& good = allDarts); void foreach_dart(typename PFP::MAP& map, FunctorMapThreaded<typename PFP::MAP>& func, unsigned int nbth, unsigned int szbuff = 8192, bool needMarkers = false, const FunctorSelect& good = allDarts);
/** /**
* Traverse orbits of a map in parallel. Use topo marker * Traverse orbits of a map in parallel. Use topo marker
...@@ -139,8 +130,8 @@ void foreach_dart(typename PFP::MAP& map, FunctorMapThreaded<typename PFP::MAP>& ...@@ -139,8 +130,8 @@ void foreach_dart(typename PFP::MAP& map, FunctorMapThreaded<typename PFP::MAP>&
* @param needMarkers set to yes if you want that each thread use different markers (markers are allocated if necessary) * @param needMarkers set to yes if you want that each thread use different markers (markers are allocated if necessary)
* @param good a selector * @param good a selector
*/ */
template <typename PFP, typename T> template <typename PFP, unsigned int ORBIT, typename T>
void foreach_orbit_res(typename PFP::MAP& map, unsigned int orbit, FunctorMapThreadedResult<typename PFP::MAP, T>& func, unsigned int nbth, unsigned int szbuff, std::vector<T>& results, bool needMarkers=false, const FunctorSelect& good = allDarts); void foreach_orbit_res(typename PFP::MAP& map, FunctorMapThreadedResult<typename PFP::MAP, T>& func, unsigned int nbth, unsigned int szbuff, std::vector<T>& results, bool needMarkers = false, const FunctorSelect& good = allDarts);
/** /**
* Traverse cells of a map in parallel. Use embedding marker * Traverse cells of a map in parallel. Use embedding marker
...@@ -154,8 +145,8 @@ void foreach_orbit_res(typename PFP::MAP& map, unsigned int orbit, FunctorMapTh ...@@ -154,8 +145,8 @@ void foreach_orbit_res(typename PFP::MAP& map, unsigned int orbit, FunctorMapTh
* @param needMarkers set to yes if you want that each thread use different markers (markers are allocated if necessary) * @param needMarkers set to yes if you want that each thread use different markers (markers are allocated if necessary)
* @param good a selector * @param good a selector
*/ */
template <typename PFP, typename T> template <typename PFP, unsigned int CELL, typename T>
void foreach_cell_res(typename PFP::MAP& map, unsigned int cell, FunctorMapThreadedResult<typename PFP::MAP, T>& func, unsigned int nbth, unsigned int szbuff, std::vector<T>& results, bool needMarkers=false, const FunctorSelect& good = allDarts); void foreach_cell_res(typename PFP::MAP& map, FunctorMapThreadedResult<typename PFP::MAP, T>& func, unsigned int nbth, unsigned int szbuff, std::vector<T>& results, bool needMarkers = false, const FunctorSelect& good = allDarts);
/** /**
* Traverse cells of a map in parallel. Use embedding marker * Traverse cells of a map in parallel. Use embedding marker
...@@ -170,10 +161,7 @@ void foreach_cell_res(typename PFP::MAP& map, unsigned int cell, FunctorMapThre ...@@ -170,10 +161,7 @@ void foreach_cell_res(typename PFP::MAP& map, unsigned int cell, FunctorMapThre
* @param good a selector * @param good a selector
*/ */
template <typename PFP, typename T> template <typename PFP, typename T>
void foreach_dart_res(typename PFP::MAP& map, FunctorMapThreadedResult<typename PFP::MAP, T>& func, unsigned int nbth, unsigned int szbuff, std::vector<T>& results, bool needMarkers=false, const FunctorSelect& good = allDarts); void foreach_dart_res(typename PFP::MAP& map, FunctorMapThreadedResult<typename PFP::MAP, T>& func, unsigned int nbth, unsigned int szbuff, std::vector<T>& results, bool needMarkers = false, const FunctorSelect& good = allDarts);
/** /**