Skip to content

Commit f0ca650

Browse files
committed
Remove commented out methods
1 parent 77f4bc0 commit f0ca650

File tree

4 files changed

+0
-142
lines changed

4 files changed

+0
-142
lines changed

src/flint/types/fmpq_mpoly.pyx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -548,28 +548,6 @@ cdef class fmpq_mpoly(flint_mpoly):
548548

549549
return res
550550

551-
# def terms(self):
552-
# """
553-
# Return the terms of this polynomial as a list of fmpq_mpolys.
554-
555-
# >>> ctx = fmpq_mpoly_ctx.get(('x', 2), 'lex')
556-
# >>> f = ctx.from_dict({(0, 0): 1, (1, 0): 2, (0, 1): 3, (1, 1): 4})
557-
# >>> f.terms()
558-
# [4*x0*x1, 2*x0, 3*x1, 1]
559-
560-
# """
561-
# cdef:
562-
# fmpq_mpoly term
563-
# slong i
564-
565-
# res = []
566-
# for i in range(len(self)):
567-
# term = create_fmpq_mpoly(self.ctx)
568-
# fmpq_mpoly_get_term(term.val, self.val, i, self.ctx.val)
569-
# res.append(term)
570-
571-
# return res
572-
573551
def subs(self, dict_args) -> fmpq_mpoly:
574552
"""
575553
Partial evaluate this polynomial with select constants. Keys must be generator names or generator indices,

src/flint/types/fmpz_mod_mpoly.pyx

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -556,28 +556,6 @@ cdef class fmpz_mod_mpoly(flint_mpoly):
556556

557557
return res
558558

559-
# def terms(self):
560-
# """
561-
# Return the terms of this polynomial as a list of fmpz_mod_mpolys.
562-
563-
# >>> ctx = fmpz_mod_mpoly_ctx.get(('x', 2), 11, 'lex')
564-
# >>> f = ctx.from_dict({(0, 0): 1, (1, 0): 2, (0, 1): 3, (1, 1): 4})
565-
# >>> f.terms()
566-
# [4*x0*x1, 2*x0, 3*x1, 1]
567-
568-
# """
569-
# cdef:
570-
# fmpz_mod_mpoly term
571-
# slong i
572-
573-
# res = []
574-
# for i in range(len(self)):
575-
# term = create_fmpz_mod_mpoly(self.ctx)
576-
# fmpz_mod_mpoly_get_term(term.val, self.val, i, self.ctx.val)
577-
# res.append(term)
578-
579-
# return res
580-
581559
def subs(self, dict_args) -> fmpz_mod_mpoly:
582560
"""
583561
Partial evaluate this polynomial with select constants. Keys must be generator names or generator indices,
@@ -948,33 +926,6 @@ cdef class fmpz_mod_mpoly(flint_mpoly):
948926
fmpz_mod_mpoly_factor_clear(fac, self.ctx.val)
949927
return c, res
950928

951-
# TODO: Rethink context conversions, particularly the proposed methods in #132
952-
# def project_to_context(self, ctx):
953-
# cdef:
954-
# fmpz_mod_mpoly res
955-
# slong *C
956-
# slong i
957-
958-
# if not typecheck(ctx, fmpz_mod_mpoly_ctx):
959-
# raise ValueError("provided context is not a fmpz_mod_mpoly_ctx")
960-
961-
# if self.ctx is ctx:
962-
# return self
963-
964-
# C = <slong *> libc.stdlib.malloc(self.ctx.val.minfo.nvars * sizeof(slong *))
965-
# if C is NULL:
966-
# raise MemoryError("malloc returned a null pointer")
967-
# res = create_fmpz_mod_mpoly(self.ctx)
968-
969-
# vars = {x: i for i, x in enumerate(ctx.py_names)}
970-
# for i, var in enumerate(self.ctx.py_names):
971-
# C[i] = <slong>vars[var]
972-
973-
# fmpz_mod_mpoly_compose_fmpz_mod_mpoly_gen(res.val, self.val, C, self.ctx.val, (<fmpz_mod_mpoly_ctx>ctx).val)
974-
975-
# libc.stdlib.free(C)
976-
# return res
977-
978929
def derivative(self, var):
979930
"""
980931
Return the derivative of this polynomial with respect to the provided variable.

src/flint/types/fmpz_mpoly.pyx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -538,28 +538,6 @@ cdef class fmpz_mpoly(flint_mpoly):
538538

539539
return res
540540

541-
# def terms(self):
542-
# """
543-
# Return the terms of this polynomial as a list of fmpz_mpolys.
544-
545-
# >>> ctx = fmpz_mpoly_ctx.get(('x', 2), 'lex')
546-
# >>> f = ctx.from_dict({(0, 0): 1, (1, 0): 2, (0, 1): 3, (1, 1): 4})
547-
# >>> f.terms()
548-
# [4*x0*x1, 2*x0, 3*x1, 1]
549-
550-
# """
551-
# cdef:
552-
# fmpz_mpoly term
553-
# slong i
554-
555-
# res = []
556-
# for i in range(len(self)):
557-
# term = create_fmpz_mpoly(self.ctx)
558-
# fmpz_mpoly_get_term(term.val, self.val, i, self.ctx.val)
559-
# res.append(term)
560-
561-
# return res
562-
563541
def subs(self, dict_args) -> fmpz_mpoly:
564542
"""
565543
Partial evaluate this polynomial with select constants. Keys must be generator names or generator indices,

src/flint/types/nmod_mpoly.pyx

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)