File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 4545Base. getindex (x:: MonomialVector , i:: Integer ) = Monomial (x. vars, x. Z[i])
4646Base. getindex (x:: MonomialVector , i:: CartesianIndex{1} ) = x[i. I[1 ]]
4747
48+ function Base. deleteat! (x:: MonomialVector , i)
49+ deleteat! (x. Z, i)
50+ return x
51+ end
52+
4853Base. firstindex (x:: MonomialVector ) = firstindex (x. Z)
4954Base. lastindex (x:: MonomialVector ) = lastindex (x. Z)
5055Base. size (x:: MonomialVector ) = (length (x),)
Original file line number Diff line number Diff line change @@ -121,6 +121,11 @@ MP.leadingterm(p::Polynomial) = iszero(p) ? zeroterm(p) : first(terms(p))
121121function MP. removeleadingterm (p:: Polynomial )
122122 Polynomial (p. a[2 : end ], p. x[2 : end ])
123123end
124+ function MA. mutable_operate! (:: typeof (MP. removeleadingterm), p:: Polynomial )
125+ deleteat! (p. a, 1 )
126+ deleteat! (p. x, 1 )
127+ return p
128+ end
124129function MP. removemonomials (p:: Polynomial , x:: MonomialVector )
125130 # use the fact that monomials are sorted to do this O(n) instead of O(n^2)
126131 j = 1
You can’t perform that action at this time.
0 commit comments