コード例 #1
0
ファイル: modules.py プロジェクト: msgoff/sympy
    def _groebner(self, extended=False):
        """Returns a standard basis in sdm form."""
        from sympy.polys.distributedmodules import sdm_groebner, sdm_nf_mora

        if self._gbe is None and extended:
            gb, gbe = sdm_groebner(
                [self.ring._vector_to_sdm(x, self.order) for x in self.gens],
                sdm_nf_mora,
                self.order,
                self.ring.dom,
                extended=True,
            )
            self._gb, self._gbe = tuple(gb), tuple(gbe)
        if self._gb is None:
            self._gb = tuple(
                sdm_groebner(
                    [self.ring._vector_to_sdm(x, self.order) for x in self.gens],
                    sdm_nf_mora,
                    self.order,
                    self.ring.dom,
                )
            )
        if extended:
            return self._gb, self._gbe
        else:
            return self._gb
コード例 #2
0
ファイル: modules.py プロジェクト: abhi98khandelwal/sympy
 def _groebner(self, extended=False):
     """Returns a standard basis in sdm form."""
     from sympy.polys.distributedmodules import sdm_groebner, sdm_nf_mora
     if self._gbe is None and extended:
         gb, gbe = sdm_groebner(
             [self.ring._vector_to_sdm(x, self.order) for x in self.gens],
             sdm_nf_mora, self.order, self.ring.dom, extended=True)
         self._gb, self._gbe = tuple(gb), tuple(gbe)
     if self._gb is None:
         self._gb = tuple(sdm_groebner(
                          [self.ring._vector_to_sdm(x, self.order) for x in self.gens],
            sdm_nf_mora, self.order, self.ring.dom))
     if extended:
         return self._gb, self._gbe
     else:
         return self._gb
コード例 #3
0
ファイル: modules.py プロジェクト: piyushbansal/sympy
 def _groebner(self):
     """Returns a standard basis in sdm form."""
     from sympy.polys.distributedmodules import sdm_groebner, sdm_nf_mora
     if self._gb is None:
         self._gb = tuple(sdm_groebner(
            [self.ring._vector_to_sdm(x, self.order) for x in self.gens],
            sdm_nf_mora, self.order, self.ring.dom))
     return self._gb
コード例 #4
0
def test_chain_criterion():
    gens = [x]
    f1 = sdm_from_vector([1, x], grlex, QQ, gens=gens)
    f2 = sdm_from_vector([0, x - 2], grlex, QQ, gens=gens)
    assert len(sdm_groebner([f1, f2], sdm_nf_mora, grlex, QQ)) == 2
コード例 #5
0
 def contains(I, f):
     S = [sdm_from_vector([g], igrlex, QQ, gens=gens) for g in I]
     G = sdm_groebner(S, sdm_nf_mora, igrlex, QQ)
     return sdm_nf_mora(sdm_from_vector([f], lex, QQ, gens=gens), G, lex,
                        QQ) == sdm_zero()
コード例 #6
0
def test_chain_criterion():
    gens = [x]
    f1 = sdm_from_vector([1, x], grlex, QQ, gens=gens)
    f2 = sdm_from_vector([0, x - 2], grlex, QQ, gens=gens)
    assert len(sdm_groebner([f1, f2], sdm_nf_mora, grlex, QQ)) == 2
コード例 #7
0
 def contains(I, f):
     S = [sdm_from_vector([g], igrlex, QQ, gens=gens) for g in I]
     G = sdm_groebner(S, sdm_nf_mora, igrlex, QQ)
     return sdm_nf_mora(sdm_from_vector([f], lex, QQ, gens=gens),
                        G, lex, QQ) == sdm_zero()