本文整理汇总了C++中Triple::GetAncestor方法的典型用法代码示例。如果您正苦于以下问题:C++ Triple::GetAncestor方法的具体用法?C++ Triple::GetAncestor怎么用?C++ Triple::GetAncestor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Triple
的用法示例。
在下文中一共展示了Triple::GetAncestor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tit
void BooleanInvolutiveBasis<MonomType>::ConstructInvolutiveBasis()
{
typename TSet<MonomType>::Iterator tit(IntermediateBasis.Begin());
Polynom<MonomType>* newNormalForm = 0;
Triple<MonomType>* currentTriple = 0;
while (!ProlongationsSet.Empty())
{
currentTriple = ProlongationsSet.Get();
newNormalForm = NormalForm(currentTriple);
/* As far as currentTriple can't be 0 (checked in QSET and TSET),
* NormalForm can't return 0.
*/
std::set<typename MonomType::Integer> currentNmpSet;
const Triple<MonomType>* currentAncestor = 0;
if (!newNormalForm->IsZero() && newNormalForm->Lm() == currentTriple->GetPolynomLm())
{
currentNmpSet = currentTriple->GetNmp();
currentAncestor = currentTriple->GetAncestor();
if (currentAncestor == currentTriple)
{
currentAncestor = 0;
}
}
delete currentTriple;
if (!newNormalForm->IsZero())
{
std::list<Triple<MonomType>*> newProlongations;
tit = IntermediateBasis.Begin();
while (tit != IntermediateBasis.End())
{
if ((**tit).GetPolynomLm().IsTrueDivisibleBy(newNormalForm->Lm()))
{
ProlongationsSet.DeleteDescendants(*tit);
newProlongations.push_back(*tit);
tit = IntermediateBasis.Erase(tit);
}
else
{
++tit;
}
}
IntermediateBasis.PushBack(new Triple<MonomType>(newNormalForm, currentAncestor, currentNmpSet, 0, -1));
if (!newNormalForm->Degree())
{
return;
}
IntermediateBasis.CollectNonMultiProlongations(--IntermediateBasis.End(), newProlongations);
ProlongationsSet.Insert(newProlongations);
}
else
{
delete newNormalForm;
}
}
}