本文整理汇总了C++中vec1::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ vec1::push_back方法的具体用法?C++ vec1::push_back怎么用?C++ vec1::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vec1
的用法示例。
在下文中一共展示了vec1::push_back方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addSolution
void addSolution(const Permutation& sol)
{
permutations.push_back(sol);
D_ASSERT(sol.size() == orbit_mins.size());
debug_out(3, "SS", "Old orbit_mins:" << orbit_mins);
for(int i : range1(sol.size()))
{
if(sol[i] != i)
{
int val1 = walkToMinimum(i);
int val2 = walkToMinimum(sol[i]);
int orbit_min = -1;
if(comparison(val1, val2))
orbit_min = val1;
else
orbit_min = val2;
update_orbit_mins(orbit_min, val1);
update_orbit_mins(orbit_min, val2);
update_orbit_mins(orbit_min, i);
update_orbit_mins(orbit_min, sol[i]);
}
}
debug_out(1, "SS", "Solution found");
debug_out(3, "SS", "Sol:" << sol);
debug_out(3, "SS", "New orbit_mins:" << orbit_mins);
}
示例2: 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
}
示例3: markLastSolutionFrom
void markLastSolutionFrom(int from, int to)
{
D_ASSERT(permutations.size() == permutations_from.size() + 1);
permutations_from.push_back(std::make_pair(from, to));
}