本文整理汇总了C++中eigen::PlainObjectBase::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ PlainObjectBase::begin方法的具体用法?C++ PlainObjectBase::begin怎么用?C++ PlainObjectBase::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eigen::PlainObjectBase
的用法示例。
在下文中一共展示了PlainObjectBase::begin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: abs
//.........这里部分代码省略.........
default:
// Should not be here.
throw std::runtime_error("Unknown CGAL state detected.");
}
}
if (debug) {
std::cout << "tie positive: " << std::endl;
for (auto& f : tie_positive_oriented) {
std::cout << get_face_index(f) << " ";
}
std::cout << std::endl;
std::cout << "positive side: " << std::endl;
for (auto& f : positive_side) {
std::cout << get_face_index(f) << " ";
}
std::cout << std::endl;
std::cout << "tie negative: " << std::endl;
for (auto& f : tie_negative_oriented) {
std::cout << get_face_index(f) << " ";
}
std::cout << std::endl;
std::cout << "negative side: " << std::endl;
for (auto& f : negative_side) {
std::cout << get_face_index(f) << " ";
}
std::cout << std::endl;
}
auto index_sort = [](std::vector<int>& data) -> std::vector<size_t>{
const size_t len = data.size();
std::vector<size_t> order(len);
for (size_t i=0; i<len; i++) { order[i] = i; }
auto comp = [&](size_t i, size_t j) { return data[i] < data[j]; };
std::sort(order.begin(), order.end(), comp);
return order;
};
Eigen::PlainObjectBase<DerivedI> positive_order, negative_order;
order_facets_around_edge(V, F, s, d, positive_side, positive_order, debug);
order_facets_around_edge(V, F, s, d, negative_side, negative_order, debug);
std::vector<size_t> tie_positive_order = index_sort(tie_positive_oriented);
std::vector<size_t> tie_negative_order = index_sort(tie_negative_oriented);
// Copy results into order vector.
const size_t tie_positive_size = tie_positive_oriented.size();
const size_t tie_negative_size = tie_negative_oriented.size();
const size_t positive_size = positive_order.size();
const size_t negative_size = negative_order.size();
order.resize(
tie_positive_size + positive_size + tie_negative_size + negative_size,1);
size_t count=0;
for (size_t i=0; i<tie_positive_size; i++)
{
order(count+i, 0) = tie_positive_oriented_index[tie_positive_order[i]];
}
count += tie_positive_size;
for (size_t i=0; i<negative_size; i++)
{
order(count+i, 0) = negative_side_index[negative_order(i, 0)];
}
count += negative_size;
for (size_t i=0; i<tie_negative_size; i++)
开发者ID:AurelGruber,项目名称:Scalable-Locally-Injective-Mappings,代码行数:67,代码来源:order_facets_around_edge.cpp