当前位置: 首页>>代码示例>>C++>>正文


C++ Triple::GetAncestor方法代码示例

本文整理汇总了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;
            }
        }
    }
开发者ID:AlessandroOneto,项目名称:M2,代码行数:61,代码来源:involutive.hpp


注:本文中的Triple::GetAncestor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。