Serge D. Mechveliani wrote:
> 
> Please,
> 
> what may be a  fast  way in Axiom to build  f : P = MPOLY([x,y,z], INT)
> 
> from a list of power products and a coefficient list?
> For example,
>     [[1,3,2],  [0,4,0],  [0,0,0]]  [-1, -2, -3]  ->
> 
>    - x*y^3*z^2 - 2*y^4 - 3    : P.
> 
> How the       power product list must be ordered for this aim?
> How to form each particular monomial?
> May be,       the source data (in integers) must be organized in a different
> structure?
> 

Basically, form polynomials from lower order tems to upper ones.
Most polynomial domains in FriCAS use recursive representation,
and oder is lexicographic on variables.  So in inner loop handle
smallest variable, bigger ones do in outer loops.  If you
want an example of somewhat optimised code look at 'unpack_poly'
in 'src/algebra/modhpsol.spad.pamphlet'.


However, your question looks like premature optimization.  For
example profiling indicates that 'unpack_poly' is not performace
critical -- more important was that corresponding package keeps
polynomials in single representation and converts them only
at the end.  In first version of another package at first I was
converting polynomials between representations inside inner
loop and performance was bad.  Trying to make convertion faster
was not a solution -- the solution was to re-organize data so
that convertion in inner loop was not needed at all.  Now this
package uses (slow) convertion routine at the very beginning
and at very end.  Since convertion is outside of inner loop,
despite slowness it is not performance critical.

-- 
                              Waldek Hebisch
[email protected] 

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to