> <\body> > The function |vector\ pair\ C, E \ \ mmx::integer_roots(const sparse_polynomial\ C, monomial\ vector\ E \ \, V \ &q)> computes the integer roots, with multiplicity, of a lacunary (a.k.a. super-sparse) polynomial. This function is implemented in the file |lacunaryx/integer_roots.hpp>. The input polynomial is a C,monomial\vector\E\ \ \> where is the type of the coefficients and is the type of the exponents. For both, the supported types are and . Note yet that the coefficients should be at least as large as the exponents since this is needed to derive the polynomial. For more on ...\>, please refer to the documentation of |../../../multimix/doc/texmacs/index.en.tm>. The roots are returned as a pair\C,E\ \> where in each C,E\> the first component is the root and the second is its multiplicity. <\cpp-code> #include \lacunaryx/integer_roots.hpp\ ... #define E integer // or int #define C integer // or int #define Monomial monomial\ vector\E\ \ #define Sparse_polynomial sparse_polynomial\C, Monomial\ \; ... \; Sparse_polynomial x (1, Monomial (vec(1))); // defines the variable x Sparse_polynomial p= x*x*(x+1)*(x+1)*(x-2)*(x+3)*(x+3)*(x+3)*(2*x+3)*(x*x+x+1); string s="4356768657564355757856462587657634635"; integer e(s); p *= (1+3*binpow(x,1345) - 2*(x-4)*binpow(x,e)+(x*x*x-6)*binpow(x,2*e)); \; vector\ pair\C,E\ \ v= integer_roots(p); // [(0,2),(-1,2),(2,1),(-3,3)] The package comes with a new type for polynomials called s. The function is glued within under the name and can be used with s as follows: <\session|mathemagix|default> <\input> <|input> use "lacunaryx"; type_mode? := true; <\unfolded-io> <|unfolded-io> x : LPolynomial Integer == lpolynomial(1:\ Integer, 1) <|unfolded-io> : > <\unfolded-io> <|unfolded-io> p : LPolynomial Integer == x^2*(x+1)^2*(x-2)*(x+3)^3*(2*x+3)*(x^2+x+1) <|unfolded-io> +23*x+98*x+164*x-61*x-703*x-1284*x-1242*x-675*x-162*x>: > <\unfolded-io> <|unfolded-io> q : LPolynomial Integer == -x^876546523 + x^876546522 + 2*x^876546520 - 2*x^876546519 + 2*x^156476833 - 12*x^156476832 + 10*x^156476831 + 8*x^1346 - 8*x^1345 - x + 1 <|unfolded-io> +x+2*x-2*x+2*x-12*x+10*x+8*x-8*x-x+1>: > <\unfolded-io> <|unfolded-io> roots (p*q) <|unfolded-io> ,,,,|]>>: > polynomials> The function |vector\ generic \ mmx::integer_roots(const multivariate\ sparse_polynomial\ C, monomial\ vector\ E \ \, V \ \ &p)> can also take as input a sparse_polynomial\...\\>, as defined in |../../../multimix/doc/texmacs/index.en.tm>. A variant of 's , named (for ``Lacunary Multivariate Polynomial''), is defined for polynomials with very large exponents. While s have exponents of type , s have exponents of type The function is glued to under the name , and can be used as follows: <\session|mathemagix|default> <\unfolded-io> <|unfolded-io> X : Coordinate == coordinate ('x) <|unfolded-io> : <\unfolded-io> <|unfolded-io> x : LMVPolynomial Integer == lmvpolynomial(1:\Integer, X) <|unfolded-io> : > <\unfolded-io> <|unfolded-io> p : LMVPolynomial Integer == x^2*(x+1)^2*(x-2)*(x+3)^3*(2*x+3)*(x^2+x+1) <|unfolded-io> +23*x+98*x+164*x-61*x-703*x-1284*x-1242*x-675*x-162*x>: > \; <\unfolded-io> <|unfolded-io> q : LMVPolynomial Integer == -x^876546523 + x^876546522 + 2*x^876546520 - 2*x^876546519 + 2*x^156476833 - 12*x^156476832 + 10*x^156476831 + 8*x^1346 - 8*x^1345 - x + 1 <|unfolded-io> +x+2*x-2*x+2*x-12*x+10*x+8*x-8*x-x+1>: > \; <\unfolded-io> <|unfolded-io> roots(p*q) <|unfolded-io> ,,,,|]>>: > . If you don't have this file, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.> <\initial> <\collection>