本文整理汇总了C++中pointVec_t类的典型用法代码示例。如果您正苦于以下问题:C++ pointVec_t类的具体用法?C++ pointVec_t怎么用?C++ pointVec_t使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了pointVec_t类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: serial_initialize
void serial_initialize(pointVec_t &points) {
points.reserve(cfg::numberOfPoints);
unsigned int rseed=1;
for(size_t i=0, count=0; long(i)<cfg::numberOfPoints; ++i) {
points.push_back(util::GenerateRNDPoint<double>(count,&std::rand,RAND_MAX ));
}
}
开发者ID:Chalenko,项目名称:PCM,代码行数:8,代码来源:convex_hull_bench.cpp
示例2: divide
point_t divide(const pointVec_t &P, pointVec_t &P_reduced, const point_t &p1, const point_t &p2) {
SplitByCP splitByCP(p1, p2, P_reduced);
point_t farPoint = std::for_each(P.begin(), P.end(), splitByCP);
if(util::verbose) {
std::stringstream ss;
ss << P.size() << " nodes in bucket"<< ", "
<< "dividing by: [ " << p1 << ", " << p2 << " ], "
<< "farthest node: " << farPoint;
util::OUTPUT.push_back(ss.str());
}
return farPoint;
}
开发者ID:Chalenko,项目名称:PCM,代码行数:14,代码来源:convex_hull_bench.cpp
示例3: divide
point_t divide(const pointVec_t &P, pointVec_t &P_reduced,
const point_t &p1, const point_t &p2) {
SplitByCP_buf sbcpb(p1, p2, P, P_reduced);
// Must use simple_partitioner (see the comment in initialize() above)
tbb::parallel_reduce(range_t(0, P.size(), SplitByCP_buf::grainSize),
sbcpb, tbb::simple_partitioner());
if(util::verbose) {
std::stringstream ss;
ss << P.size() << " nodes in bucket"<< ", "
<< "dividing by: [ " << p1 << ", " << p2 << " ], "
<< "farthest node: " << sbcpb.farthestPoint();
util::OUTPUT.push_back(ss.str());
}
return sbcpb.farthestPoint();
}
开发者ID:BigR-Lab,项目名称:CodeRes_Cpp,代码行数:17,代码来源:convex_hull_sample.cpp
示例4: divide_and_conquer
void divide_and_conquer(const pointVec_t &P, pointVec_t &H,
point_t p1, point_t p2) {
assert(P.size() >= 2);
pointVec_t P_reduced;
pointVec_t H1, H2;
point_t p_far = divide(P, P_reduced, p1, p2);
if (P_reduced.size()<2) {
H.push_back(p1);
appendVector(P_reduced, H);
}
else {
divide_and_conquer(P_reduced, H1, p1, p_far);
divide_and_conquer(P_reduced, H2, p_far, p2);
appendVector(H1, H);
appendVector(H2, H);
}
}
开发者ID:BigR-Lab,项目名称:CodeRes_Cpp,代码行数:18,代码来源:convex_hull_sample.cpp
示例5: divide_and_conquer
void divide_and_conquer(const pointVec_t &P, pointVec_t &H,
point_t p1, point_t p2, bool buffered) {
assert(P.size() >= 2);
pointVec_t P_reduced;
pointVec_t H1, H2;
point_t p_far;
if(buffered) {
p_far = divide<SplitByCP_buf>(P, P_reduced, p1, p2);
} else {
p_far = divide<SplitByCP>(P, P_reduced, p1, p2);
}
if (P_reduced.size()<2) {
H.push_back(p1);
#if USECONCVEC
appendVector(P_reduced, H);
#else // insert into STD::VECTOR
H.insert(H.end(), P_reduced.begin(), P_reduced.end());
#endif
}
else {
divide_and_conquer(P_reduced, H1, p1, p_far, buffered);
divide_and_conquer(P_reduced, H2, p_far, p2, buffered);
#if USECONCVEC
appendVector(H1, H);
appendVector(H2, H);
#else // insert into STD::VECTOR
H.insert(H.end(), H1.begin(), H1.end());
H.insert(H.end(), H2.begin(), H2.end());
#endif
}
}
开发者ID:Chalenko,项目名称:PCM,代码行数:34,代码来源:convex_hull_bench.cpp
示例6: quickhull
void quickhull(const pointVec_t &points, pointVec_t &hull) {
if (points.size() < 2) {
appendVector(points, hull);
return;
}
point_t p_maxx = extremum<FindXExtremum::maxX>(points);
point_t p_minx = extremum<FindXExtremum::minX>(points);
pointVec_t H;
divide_and_conquer(points, hull, p_maxx, p_minx);
divide_and_conquer(points, H, p_minx, p_maxx);
appendVector(H, hull);
}
开发者ID:BigR-Lab,项目名称:CodeRes_Cpp,代码行数:16,代码来源:convex_hull_sample.cpp
示例7: quickhull
void quickhull(const pointVec_t &points, pointVec_t &hull) {
if (points.size() < 2) {
hull.insert(hull.end(), points.begin(), points.end());
return;
}
point_t p_maxx = extremum<FindXExtremum::maxX>(points);
point_t p_minx = extremum<FindXExtremum::minX>(points);
pointVec_t H;
divide_and_conquer(points, hull, p_maxx, p_minx);
divide_and_conquer(points, H, p_minx, p_maxx);
hull.insert(hull.end(), H.begin(), H.end());
}
开发者ID:Chalenko,项目名称:PCM,代码行数:14,代码来源:convex_hull_bench.cpp
示例8: appendVector
void appendVector(const pointVec_t& src, pointVec_t& dest) {
std::copy(src.begin(), src.end(), dest.grow_by(src.size()));
}
开发者ID:BigR-Lab,项目名称:CodeRes_Cpp,代码行数:3,代码来源:convex_hull_sample.cpp
示例9: grow_vector_to_at_least
void grow_vector_to_at_least(pointVec_t& vect, size_t size) {
vect.grow_to_at_least(size);
}
开发者ID:Chalenko,项目名称:PCM,代码行数:3,代码来源:convex_hull_bench.cpp
示例10: appendVector
void appendVector(mutex_t& insertMutex, const pointVec_t& src, pointVec_t& dest) {
mutex_t::scoped_lock lock(insertMutex);
dest.insert(dest.end(), src.begin(), src.end());
}
开发者ID:Chalenko,项目名称:PCM,代码行数:4,代码来源:convex_hull_bench.cpp
示例11: extremum
point_t extremum(const pointVec_t &P) {
FindXExtremum fxBody(P, type);
tbb::parallel_reduce(range_t(0, P.size(), FindXExtremum::grainSize), fxBody);
return fxBody.extremeXPoint();
}
开发者ID:BigR-Lab,项目名称:CodeRes_Cpp,代码行数:5,代码来源:convex_hull_sample.cpp
示例12: extremum
point_t extremum(const pointVec_t &points) {
assert(!points.empty());
return std::for_each(points.begin(), points.end(), FindXExtremum(points[0], type));
}
开发者ID:Chalenko,项目名称:PCM,代码行数:4,代码来源:convex_hull_bench.cpp
注:本文中的pointVec_t类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论