> <\body> The function computes the linear factors, with multiplicity, of a lacunary (a.k.a. super-sparse) polynomial.\ 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 factors are returned as a irreducible_factor\Sparse_polynomial\ \> where is the type of the input. An Sparse_polynomial\> is basically a pair made of a and its multiplicity. For more on ...\>, please refer to the documentation of |../../../factorix/doc/texmacs/index.en.tm>. The input polynomial can be either univariate or bivariate. Depending on the dimension of the vector of variables of the input, the function defined in chooses to apply either or .\ If given as input a polynomial in one variable, the function calls . If is directly used, it supposes that the input polynomial has one variable. The behavior if this is not true is not guaranteed but this shall most probably result in an error.\ <\mmx-code> #include \lacunaryx/linear_factors.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\ irreducible_factor\Sparse_polynomial\ \ v= linear_factors(p);\ \ \ \ \ \ \ \ \ \ \ \ // [(x,2),(x+1,2),(x-2,1),(x+3,3),(2*x+3,1)] If given as input a polynomial in two variables, the function calls , which in turn uses as a subroutine. If is directly used, the input polynomial is supposed to be bivariate. The behavior if this is not true is not guaranteed but this shall most probably result in an error.\ <\mmx-code> #include \lacunaryx/linear_factors.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,0))); // defines the variable x Sparse_polynomial y (1, Monomial (vec(0,1))); // defines the variable y \; Sparse_polynomial p= x*x*y*(x-2)*(2*y+3)*(2*y+3)*(y-x+3)*(2*x+7*y)*(x*y+x+1); string s="4356768657564355757856462587657634635"; integer e(s); p *= (1 + 3*binpow(x,1345)*binpow(y,54334) - 2*(x-4*y)*binpow(x,e)*y*y + (x*x*x-6)*binpow(y,2*e)); \; vector\ irreducible_factor\Sparse_polynomial\ \ v= linear_factors(p);\ \ \ \ \ \ \ \ \ \ \ \ // [(x,2),(y,1),(x-2,1),(2*y+3,2),(y-x+3,1),(2*x+7*y,1)] When used with univariate polynomials, the function can take as input a polynomial of type either > or . For multivariate polynomials, the type > has to be used.\ > The function is glued within to take as input a polynomial of type > (for ``Lacunary Polynomial''). It is used as follows: <\session|mathemagix|default> <\input> <|input> use "lacunaryx"; type_mode? := true; <\unfolded-io> <|unfolded-io> x : LPolynomial Integer == lpolynomial (1, 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> e : Integer == 4356768657564355757856462587657634635; r : LPolynomial Integer == 1 + 3*x^1345 - 2*(x-4)*x^e+(x^3-6)*x^(2*e) <|unfolded-io> -6*x-2*x+8*x+3*x+1>: > <\unfolded-io> <|unfolded-io> linear_factors (p*q*r) <|unfolded-io> ,,,,,|]>>: > > The function |vector\< generic \> mmx::linear_factors(const multivariate\< sparse_polynomial\< C, monomial\< vector\< E \> \> \> \> &p)> can also be 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 , and can be used as follows: <\session|mathemagix|default> <\unfolded-io> <|unfolded-io> X : Coordinate == coordinate ('x); x : LMVPolynomial Integer == lmvpolynomial(1:\Integer, X) <|unfolded-io> : > <\unfolded-io> <|unfolded-io> Y : Coordinate == coordinate ('y); y : LMVPolynomial Integer == lmvpolynomial(1:\Integer, Y) <|unfolded-io> : > Using the mechanisms of the ...\> objects, is usable with both univariate and bivariate polynomials. <\session|mathemagix|default> <\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> e : Integer == 4356768657564355757856462587657634635; r : LMVPolynomial Integer == 1 + 3*x^1345 - 2*(x-4)*x^e+(x^3-6)*x^(2*e) <|unfolded-io> -6*x-2*x+8*x+3*x+1>: > <\unfolded-io> <|unfolded-io> linear_factors(p*q*r) <|unfolded-io> ,,,,,|]>>: > <\session|mathemagix|default> <\unfolded-io> <|unfolded-io> p : LMVPolynomial Integer == \ \ x^2*y*(x-2)*(2*y+3)^2*(y-x+3)*(2*x+7*y)*(x*y+x+1)*(3*x-6*y+5) <|unfolded-io> *y+336*x*y+204*x*y-1444*x*y+1904*x*y+336*x*y-12*x*y+848*x*y-3362*x*y+2560*x*y+1736*x*y-24*x*y+32*x*y+1243*x*y-2411*x*y-1072*x*y+2100*x*y-96*x*y+233*x*y+895*x*y+35*x*y-3537*x*y-882*x*y-126*x*y+321*x*y+579*x*y-111*x*y-1701*x*y-1890*x*y-54*x*y+126*x*y+306*x*y-414*x*y-540*x*y>: > <\unfolded-io> <|unfolded-io> q : LMVPolynomial Integer == x^3*y^54354165 - 6*y^54354165 - 2*x^4*y^54354164 + 12*x*y^54354164 + x^5*y^54354163 - 6*x^2*y^54354163 + 3*x^1345*y^54336 - 6*x^1346*y^54335 + 3*x^1347*y^54334 + 8*x^432534*y^5 - 18*x^432535*y^4 + 12*x^432536*y^3 - 2*x^432537*y^2 + y^2 - 2*x*y + x^2 <|unfolded-io> *y-6*y-2*x*y+12*x*y+x*y-6*x*y+3*x*y-6*x*y+3*x*y+8*x*y-18*x*y+12*x*y-2*x*y+y-2*x*y+x>: > <\unfolded-io> <|unfolded-io> e : Integer == 35154014504040115230143514; r : LMVPolynomial Integer == 1 + 3*x^1345*y^54334 - 2*(x-4*y)*x^e*y^2 + (x^3-6)*y^(2*e) <|unfolded-io> *y-6*y+3*x*y+8*x*y-2*x*y+1>: > <\unfolded-io> <|unfolded-io> linear_factors (p*q*r) <|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>