Skip to content

Optimize computations by working with MPolyRingElem instead of UPoly where possible #250

@fingolfin

Description

@fingolfin

We already discussed this before, just to make sure it is not forgotten:

When possible we should consider unpacking all UPoly into MPolyRingElem then working with those, then only wrapping the result back into UPoly. That should avoid redundant allocations and also in some cases ensure we use optimized algorithms.

Caveat: we need to make sure the unwrapped polynomials all have the same parent. There is no nice helper for this right now, but there should be... in the meantime we can write something like this (untested, may need tweaking, but gives the right idea):

function unwrap(a)
   R = parent(a)
   s = data(a)
   if nvars(parent(s)) != nvars(R)
      s = upgrade(R, s)
   end
   return s
end

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions