@@ -539,28 +539,6 @@ cdef class nmod_mpoly(flint_mpoly):
539539 """
540540 return [nmod_mpoly_get_term_coeff_ui(self .val, i, self .ctx.val) for i in range (len (self ))]
541541
542- # def terms(self):
543- # """
544- # Return the terms of this polynomial as a list of nmod_mpolys.
545-
546- # >>> ctx = nmod_mpoly_ctx.get(('x', 2), 11, 'lex')
547- # >>> f = ctx.from_dict({(0, 0): 1, (1, 0): 2, (0, 1): 3, (1, 1): 4})
548- # >>> f.terms()
549- # [4*x0*x1, 2*x0, 3*x1, 1]
550-
551- # """
552- # cdef:
553- # nmod_mpoly term
554- # slong i
555-
556- # res = []
557- # for i in range(len(self)):
558- # term = create_nmod_mpoly(self.ctx)
559- # nmod_mpoly_get_term(term.val, self.val, i, self.ctx.val)
560- # res.append(term)
561-
562- # return res
563-
564542 def subs (self , dict_args ) -> nmod_mpoly:
565543 """
566544 Partial evaluate this polynomial with select constants. Keys must be generator names or generator indices ,
@@ -926,33 +904,6 @@ cdef class nmod_mpoly(flint_mpoly):
926904 nmod_mpoly_factor_clear(fac, self .ctx.val)
927905 return constant, res
928906
929- # TODO: Rethink context conversions, particularly the proposed methods in #132
930- # def project_to_context(self, ctx):
931- # cdef:
932- # nmod_mpoly res
933- # slong *C
934- # slong i
935-
936- # if not typecheck(ctx, nmod_mpoly_ctx):
937- # raise ValueError("provided context is not a nmod_mpoly_ctx")
938-
939- # if self.ctx is ctx:
940- # return self
941-
942- # C = <slong *> libc.stdlib.malloc(self.ctx.val.minfo.nvars * sizeof(slong *))
943- # if C is NULL:
944- # raise MemoryError("malloc returned a null pointer")
945- # res = create_nmod_mpoly(self.ctx)
946-
947- # vars = {x: i for i, x in enumerate(ctx.py_names)}
948- # for i, var in enumerate(self.ctx.py_names):
949- # C[i] = <slong>vars[var]
950-
951- # nmod_mpoly_compose_nmod_mpoly_gen(res.val, self.val, C, self.ctx.val, (<nmod_mpoly_ctx>ctx).val)
952-
953- # libc.stdlib.free(C)
954- # return res
955-
956907 def derivative (self , var ):
957908 """
958909 Return the derivative of this polynomial with respect to the provided variable.
0 commit comments