本文整理汇总了C++中Dims::resize方法的典型用法代码示例。如果您正苦于以下问题:C++ Dims::resize方法的具体用法?C++ Dims::resize怎么用?C++ Dims::resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dims
的用法示例。
在下文中一共展示了Dims::resize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CellDescriptor
void CollapsedAKQReducedCubSComplexSupplier<Traits>::CreateKappaMapFromQuotient(
CubCellSetPtr cubCellSet,
Dims& dims,
KappaMap& kappaMap)
{
_allCells.clear();
_cellsMapByDim.clear();
_nullSetCell = new CellDescriptor(0, 0);
_allCells.push_back(_nullSetCell);
_cellsCountByDim[0] = 1;
size_t maxDim = static_cast<size_t>(cubCellSet().embDim());
PointCoordIterator it = PointCoordIterator(cubCellSet().begin());
BitCoordIterator itEnd = cubCellSet().end();
for ( ; it < itEnd; ++it)
{
if (it.ownDim() == maxDim)
{
CreateCell(cubCellSet, it, maxDim);
}
}
std::map<size_t, size_t> cellsIndicesOffsets;
size_t totalCellsCount = 0;
for (size_t i = 0; i <= maxDim; i++)
{
if (i > 0)
{
cellsIndicesOffsets[i] = cellsIndicesOffsets[i - 1] + _cellsCountByDim[i - 1];
}
totalCellsCount += _cellsCountByDim[i];
_logger.Log(FGLogger::Debug)<<_cellsCountByDim[i]<<" cells in dim "<<i;
_logger.Log(FGLogger::Debug)<<" with offset "<<cellsIndicesOffsets[i]<<std::endl;
}
_logger.Log(FGLogger::Debug)<<"total cells generated: "<<totalCellsCount<<std::endl;
dims.resize(totalCellsCount);
kappaMap.clear();
typename CellsDescriptors::iterator jt = _allCells.begin();
typename CellsDescriptors::iterator jtEnd = _allCells.end();
for ( ; jt != jtEnd; ++jt)
{
CellDescriptor* cell = *jt;
size_t index = cell->_index + cellsIndicesOffsets[cell->_dim];
size_t faceIndexOffset = cellsIndicesOffsets[cell->_dim - 1];
dims[index] = cell->_dim;
std::vector<int>::iterator cIt = cell->_coefficients.begin();
for (typename CellsDescriptors::iterator fIt = cell->_faces.begin();
fIt != cell->_faces.end();
++fIt)
{
CellDescriptor* face = *fIt;
kappaMap.push_back(KappaMapEntry(static_cast<Id>(index),
static_cast<Id>(face->_index + faceIndexOffset),
*cIt));
cIt++;
}
}
jt = _allCells.begin();
for ( ; jt != jtEnd; ++jt)
{
delete *jt;
}
}