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

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


    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


        List<GenPolynomial<BigInteger>> dem = null;
        if (A == null) {
            return dem;
        }

        BigInteger cfac = new BigInteger();
        GenPolynomialRing<BigInteger> ufac
                = new GenPolynomialRing<>(cfac, 1);

        int nvar = A.numberOfVariables();
        dem = new ArrayList<>(nvar);
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

    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

        }
        return temp.isIdentity();
    }

    public BigInteger getOrder() {
        BigInteger order = BigInteger.ONE;
        for (SGSElement element : sgs)
            order = order.multiply(BigInteger.valueOf(element.getOrbitSize()));
        return order;
    }
View Full Code Here

        GenPolynomial<MOD> f = P;
        //GreatestCommonDivisor<MOD> engine = GCDFactory.<MOD> getImplementation(pfac.coFac);
        Power<GenPolynomial<MOD>> pow = new Power<>(pfac);
        GenPolynomial<MOD> g;
        int degi = (int) deg; //f.degree(0);
        BigInteger di = Power.positivePower(new BigInteger(m), deg);
        java.math.BigInteger d = di.getVal(); //.longValue()-1;
        d = d.shiftRight(1); // divide by 2
        do {
            if (p2) {
                h = t;
                for (int i = 1; i < degi; i++) {
View Full Code Here

            // case AlgebraicNumber<ModInteger>: r = c**(p**(d-1)), r**p == c
            long d = aCoFac.totalExtensionDegree();
            if (d <= 1) {
                return r;
            }
            BigInteger p = new BigInteger(aCoFac.characteristic());
            BigInteger q = Power.positivePower(p, d - 1);
            r = Power.positivePower(r, q.getVal());
            return r;
        }
        if (qCoFac != null) {
            throw new UnsupportedOperationException("case QuotientRing not yet implemented");
        }
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.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

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.