本文整理汇总了C++中vec1::resize方法的典型用法代码示例。如果您正苦于以下问题:C++ vec1::resize方法的具体用法?C++ vec1::resize怎么用?C++ vec1::resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vec1
的用法示例。
在下文中一共展示了vec1::resize方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GAPException
Graph(const vec1<vec1<VertexType> >& _points_in, int domain)
{
vec1<vec1<VertexType> > _points = compressGraph(_points_in);
if(_points.size() > domain)
throw GAPException("Graph too large");
edges = _points;
edges.resize(domain);
for(int i : range1(_points.size()))
{
int i_size = _points[i].size();
for(int j = 1; j <= i_size; ++j)
{
if(_points[i][j].target() <= 0 || _points[i][j].target() > domain) {
throw GAPException("Graph contains out-of-bounds vertex: " + toString(_points[i][j].target()));
}
if(_points[i][j].colour() < 0 ) {
throw GAPException(" Graph contains invalid edge colour: " + toString(_points[i][j].colour()));
}
VertexType edge(i, _points[i][j].colour());
if(directed)
{
edge = edge.flipped();
}
edges[_points[i][j].target()].push_back(edge);
}
}
for(int i : range1(edges.size()))
{
std::set<VertexType> pntset(edges[i].begin(), edges[i].end());
edges[i] = vec1<VertexType>(pntset.begin(), pntset.end());
}
}
示例2: fillRBaseOrbitalsCache
const vec1<OrbitalGraph>* fillRBaseOrbitalsCache(const vec1<int>& fix)
{
vec1<OrbitalGraph> orbitals = scc.orbitals(fix, ps->domainSize());
if(original_orbitals.size() < fix.size() + 1)
original_orbitals.resize(fix.size() + 1);
original_orbitals[fix.size() + 1] = std::move(orbitals);
return &(original_orbitals[fix.size() + 1]);
}
示例3: fillRBaseBlocksCache
const vec1<std::map<int,int> >* fillRBaseBlocksCache(const vec1<int>& fix)
{
vec1<vec1<vec1<int> > > blocks = scc.blocks(fix);
vec1<std::map<int,int> > block_functions;
for(int i : range1(blocks.size()))
{
block_functions.push_back(partitionToMap(blocks[i]));
}
if(original_blocks.size() < fix.size() + 1)
original_blocks.resize(fix.size() + 1);
original_blocks[fix.size() + 1] = std::move(block_functions);
return &(original_blocks[fix.size() + 1]);
}
示例4: initalize
void initalize(const vec1<int>& order)
{
D_ASSERT(!fixed_base);
fixed_base = true;
unpacked_stabChain_depth.resize(order.size());
GAP_callFunction(FunObj_ChangeStabChain, stabChain, GAP_make(order));
debug_out(1, "SCC", "Setting up cache");
debug_out(3, "SCC", "Order " << order);
int order_pos = 1;
GAPStabChainWrapper stabChainCpy(stabChain);
do
{
StabChainLevel scl(stabChainCpy);
while(order[order_pos] != scl.base_value)
{
debug_out(3, "SCC", "Skipping depth " << order_pos);
order_pos++;
}
debug_out(3, "SCC", "Setting depth "<<order_pos<<" base point "<<scl.base_value);
levels.push_back(scl);
unpacked_stabChain_depth[order_pos] = levels.size();
stabChainCpy = stabChainCpy.getNextLevel();
}
while(stabChainCpy.hasNextLevel());
#ifndef NO_DEBUG
for(int i : range1(unpacked_stabChain_depth.size()))
{
if(unpacked_stabChain_depth[i] != 0)
{
D_ASSERT(levels[unpacked_stabChain_depth[i]].base_value == order[i]);
}
}
#endif
}
示例5: fillRBaseOrbitPartitionCache
const vec1<int>* fillRBaseOrbitPartitionCache(const vec1<int>& fix)
{
debug_out(3, "scpg", "Fixing: "<< fix);
vec1<vec1<int> > oart = scc.orbits(fix, ps->domainSize());
debug_out(3, "scpg", "Got orbit partition" << oart);
// This might not be necessary, but it doesn't hurt!
for(int i : range1(oart.size()))
std::sort(oart[i].begin(), oart[i].end());
std::sort(oart.begin(), oart.end());
vec1<int> filter;
if(oart.size() > 1)
filter = partitionToList(oart, ps->domainSize(), MissingPoints_Fixed);
debug_out(3, "scpg", "Filter partition: "<< filter);
if(original_partitions.size() < fix.size() + 1)
original_partitions.resize(fix.size() + 1);
original_partitions[fix.size()+1] = std::move(filter);
return &(original_partitions[fix.size() + 1]);
}