本文整理汇总了C++中MultiIndex::size方法的典型用法代码示例。如果您正苦于以下问题:C++ MultiIndex::size方法的具体用法?C++ MultiIndex::size怎么用?C++ MultiIndex::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MultiIndex
的用法示例。
在下文中一共展示了MultiIndex::size方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: result
static typename Point::value_type
coeff(const MultiIndex& i,
const Point& p) {
typedef typename Point::value_type value_type;
typedef Chebyshev<value_type,Q> C;
value_type result(1);
for (std::size_t k = 0; k < i.size(); ++k) {
for (std::size_t q = 0; q < Q; ++q) {
if (q != i[k]) {
result *= (p[k] - C::x[q]) / (C::x[i[k]] - C::x[q]);
}
}
}
return result;
}
示例2: coeff
static std::vector<typename Point::value_type>
coeff(const MultiIndex& i,
const std::vector<Point>& p) {
typedef typename Point::value_type value_type;
typedef Chebyshev<value_type,Q> C;
std::vector<value_type> result(p.size(), 1);
for (std::size_t k = 0; k != i.size(); ++k) {
for (std::size_t q = 0; q != Q; ++q) {
if (q != i[k]) {
//const value_type xkxq = C::x[i[k]]-C::x[q]; // Don't help compiler!
for (std::size_t r = 0; r != p.size(); ++r) {
result[r] *= (p[r][k] - C::x[q]) / (C::x[i[k]] - C::x[q]);
}
}
}
}
return result;
}
示例3: int
void R_s_k_2::draw_relevance(const float line_width, const int nb)
{
MultiIndex mindex;
FT min_value = (std::numeric_limits<FT>::max)();
FT max_value = -(std::numeric_limits<FT>::max)();
unsigned int nb_initial = 0;
for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei)
{
Edge edge = *ei;
if (m_dt.is_ghost(edge)) continue;
FT value = m_dt.get_edge_relevance(edge); // >= 0
nb_initial++;
min_value = (std::min)(min_value, value);
max_value = (std::max)(max_value, value);
mindex.insert(PEdge(edge, value));
}
if (min_value == max_value) max_value += 1.0;
viewer->glLineWidth(line_width);
int nb_remove = (std::min)(nb, int(mindex.size()));
viewer->glColor3d(0.5, 0.1, 0.1);
for (int i = 0; i < nb_remove; ++i)
{
PEdge pedge = *(mindex.get<1>()).begin();
(mindex.get<0>()).erase(pedge);
}
viewer->glColor3d(0.0, 0.5, 0.0);
while (!mindex.empty())
{
PEdge pedge = *(mindex.get<1>()).begin();
(mindex.get<0>()).erase(pedge);
draw_edge(pedge.edge());
}
}