本文整理汇总了C++中Boundary::size方法的典型用法代码示例。如果您正苦于以下问题:C++ Boundary::size方法的具体用法?C++ Boundary::size怎么用?C++ Boundary::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Boundary
的用法示例。
在下文中一共展示了Boundary::size方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkMorseBoundariesUpstreamVersusDownstream
Result checkMorseBoundariesUpstreamVersusDownstream(VolumeData const& candidate)
{
CubicalComplex const& complex = candidate.complex;
Field const& field = candidate.field;
Field::Vectors const& V = field.V();
Field::Vectors const& coV = field.coV();
Facets I(complex.xdim(), complex.ydim(), complex.zdim(), false);
Facets coI(complex.xdim(), complex.ydim(), complex.zdim(), true);
std::map<Cell, Boundary> M1;
std::map<Cell, Boundary> M2;
for (Cell c = 0; c < complex.cellIdLimit(); ++c)
{
if (complex.isCell(c) and field.isCritical(c))
{
Boundary B = morseBoundary(c, V, I);
Boundary coB = morseBoundary(c, coV, coI);
M1[c] = B;
for (size_t i = 0; i < coB.size(); ++i)
{
Cell const d = coB.at(i).first;
int const n = coB.at(i).second;
M2[d].push_back(std::pair<Cell, int>(c, n));
}
}
}
for (Cell c = 0; c < complex.cellIdLimit(); ++c)
{
if (complex.isCell(c) and field.isCritical(c))
{
if (M1[c] != M2[c]) {
std::stringstream msg;
msg << "Mismatching Morse boundaries for cell "
<< complex.cellPosition(c)
<< ": " << M1[c] << " vs " << M2[c];
return failure(msg.str());
}
}
}
return success();
}
示例2: simpleChainComplex
SimpleComplex simpleChainComplex(
CubicalComplex const& complex,
Scalars const& scalars,
std::map<Cell, Boundary> const& chains,
std::vector<Cell> const& sources)
{
size_t const n = sources.size();
Vertices const vertices(complex.xdim(), complex.ydim(), complex.zdim());
std::map<Cell, size_t> index;
for (size_t i = 0; i < n; ++i)
index[sources.at(i)] = i;
std::vector<unsigned int> dims;
std::vector<float> values;
std::vector<std::vector<Cell> > faceLists;
for (size_t i = 0; i < n; ++i)
{
Cell const v = sources.at(i);
dims.push_back(complex.cellDimension(v));
values.push_back(cellValue(v, scalars, vertices));
Boundary const flin = chains.at(v);
std::vector<Cell> flout;
for (size_t j = 0; j < flin.size(); ++j)
{
std::pair<Cell, int> p = flin.at(j);
for (int k = 0; k < p.second; ++k)
flout.push_back(index.at(p.first));
}
faceLists.push_back(flout);
}
return SimpleComplex(dims, values, faceLists);
}