Package cc.redberry.core.transformations.factor.jasfactor.edu.jas.arith

Examples of cc.redberry.core.transformations.factor.jasfactor.edu.jas.arith.BigInteger


        GenPolynomial<BigRational> Pr = P;
        BigRational ldcf = P.leadingBaseCoefficient();
        if (!ldcf.isONE()) {
            Pr = Pr.monic();
        }
        BigInteger bi = BigInteger.ONE;
        GenPolynomialRing<BigInteger> ifac = new GenPolynomialRing<>(bi, pfac);
        GenPolynomial<BigInteger> Pi = PolyUtil.integerFromRationalCoefficients(ifac, Pr);
        List<GenPolynomial<BigInteger>> ifacts = iengine.baseFactorsSquarefree(Pi);
        if (ifacts.size() <= 1) {
            factors.add(P);
View Full Code Here


        GenPolynomial<BigRational> Pr = P;
        BigRational ldcf = P.leadingBaseCoefficient();
        if (!ldcf.isONE()) {
            Pr = Pr.monic();
        }
        BigInteger bi = BigInteger.ONE;
        GenPolynomialRing<BigInteger> ifac = new GenPolynomialRing<>(bi, pfac);
        GenPolynomial<BigInteger> Pi = PolyUtil.integerFromRationalCoefficients(ifac, Pr);
        List<GenPolynomial<BigInteger>> ifacts = iengine.factorsSquarefree(Pi);
        if (ifacts.size() <= 1) {
            factors.add(P);
View Full Code Here

        if (pkfac.nvar == 2 && !HenselUtil.isDiophantLift(Bp, Ap, su.get(0), su.get(1), Cp)) {
        }
        if (!ckfac.equals(su.get(0).ring)) {
            throw new IllegalArgumentException("qfac != ckfac: " + su.get(0).ring + " != " + ckfac);
        }
        GenPolynomialRing<BigInteger> ifac = new GenPolynomialRing<>(new BigInteger(), pkfac);
        //GenPolynomialRing<BigInteger> cifac = new GenPolynomialRing<BigInteger>(new BigInteger(), ckfac);
        String[] mn = new String[]{pkfac.getVars()[pkfac.nvar - 1]};
        GenPolynomialRing<GenPolynomial<MOD>> qrfac = new GenPolynomialRing<>(ckfac, 1, mn);

        List<GenPolynomial<MOD>> sup = new ArrayList<>(su.size());
View Full Code Here

        if (pkfac.nvar == 2 && !HenselUtil.isDiophantLift(Ap, su, Cp)) {
        }
        if (!ckfac.equals(su.get(0).ring)) {
            throw new IllegalArgumentException("qfac != ckfac: " + su.get(0).ring + " != " + ckfac);
        }
        GenPolynomialRing<BigInteger> ifac = new GenPolynomialRing<>(new BigInteger(), pkfac);
        //GenPolynomialRing<BigInteger> cifac = new GenPolynomialRing<BigInteger>(new BigInteger(), ckfac);
        String[] mn = new String[]{pkfac.getVars()[pkfac.nvar - 1]};
        GenPolynomialRing<GenPolynomial<MOD>> qrfac = new GenPolynomialRing<>(ckfac, 1, mn);

        List<GenPolynomial<MOD>> sup = new ArrayList<>(su.size());
View Full Code Here

            xv = xv.subtract(pkfac.fromInteger(v.getSymmetricInteger().getVal()));

            long deg = Cp.degree(pkfac.nvar - 1);

            // convert to integer polynomials
            GenPolynomialRing<BigInteger> ifac = new GenPolynomialRing<>(new BigInteger(), pkfac);
            List<GenPolynomial<BigInteger>> Bi = PolyUtil.integerFromModularCoefficients(ifac, U);
            GenPolynomial<BigInteger> Ci = PolyUtil.integerFromModularCoefficients(ifac, Cp);

            // compute error:
            E = ifac.getONE();
View Full Code Here

        }
        n += (p.bitCount() + 1); // log2(p)
        n /= 2;
        v = new java.math.BigInteger("" + 2);
        v = v.shiftLeft(n);
        BigInteger N = new BigInteger(v);
        return N;
    }
View Full Code Here

class ModSymToInt<C extends RingElem<C> & Modular> implements UnaryFunctor<C, BigInteger> {


    public BigInteger eval(C c) {
        if (c == null) {
            return new BigInteger();
        }
        return c.getSymmetricInteger();
    }
View Full Code Here

    }


    public BigInteger eval(BigRational c) {
        if (c == null) {
            return new BigInteger();
        }
        // p = num*(lcm/denom)
        java.math.BigInteger b = lcm.divide(c.denominator());
        return new BigInteger(c.numerator().multiply(b));
    }
View Full Code Here

    }


    public BigInteger eval(BigRational c) {
        if (c == null) {
            return new BigInteger();
        }
        if (gcd.equals(java.math.BigInteger.ONE)) {
            // p = num*(lcm/denom)
            java.math.BigInteger b = lcm.divide(c.denominator());
            return new BigInteger(c.numerator().multiply(b));
        }
        // p = (num/gcd)*(lcm/denom)
        java.math.BigInteger a = c.numerator().divide(gcd);
        java.math.BigInteger b = lcm.divide(c.denominator());
        return new BigInteger(a.multiply(b));
    }
View Full Code Here

    static Tensor poly2Tensor(GenPolynomial<BigInteger> poly, Var[] varsArray) {
        if (poly.length() == 0)
            return Complex.ZERO;
        List<Tensor> temp = new ArrayList<>(), sum = new ArrayList<>(poly.length());
        long lExp;
        BigInteger coefficient;
        ExpVector exp;
        for (Monomial<BigInteger> monomial : poly) {
            coefficient = monomial.coefficient();
            exp = monomial.exponent();
            temp.clear();

            temp.add(new Complex(new Rational(coefficient.getVal())));
            for (int i = 0; i < exp.length(); ++i)
                if ((lExp = exp.getVal(i)) != 0)
                    temp.add(Tensors.pow(varsArray[i].simpleTensor, new Complex(lExp)));

            sum.add(Tensors.multiply(temp.toArray(new Tensor[temp.size()])));
View Full Code Here

TOP

Related Classes of cc.redberry.core.transformations.factor.jasfactor.edu.jas.arith.BigInteger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.