当前位置: 首页>>代码示例>>Java>>正文


Java ExpVector.multipleOf方法代码示例

本文整理汇总了Java中edu.jas.poly.ExpVector.multipleOf方法的典型用法代码示例。如果您正苦于以下问题:Java ExpVector.multipleOf方法的具体用法?Java ExpVector.multipleOf怎么用?Java ExpVector.multipleOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在edu.jas.poly.ExpVector的用法示例。


在下文中一共展示了ExpVector.multipleOf方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: pruneP

import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
 * Prune total pair list P.
 * @param P pair list.
 * @param syz list of exponent vectors representing syzygies.
 * @return updated pair list. <b>Note:<b> stores polynomials not only
 *         indices.
 */
@Override
List<SigPair<C>> pruneP(List<SigPair<C>> P, List<ExpVector> syz) {
    List<SigPair<C>> res = new ArrayList<SigPair<C>>(P.size());
    for (SigPair<C> p : P) {
        ExpVector f = p.sigma.leadingExpVector();
        if (f == null) {
            continue;
        }
        boolean div = false;
        for (ExpVector e : syz) {
            if (f.multipleOf(e)) {
                div = true;
                break;
            }
        }
        if (div) {
            continue;
        }
        res.add(p);
    }
    return res;
}
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:30,代码来源:GroebnerBaseF5zSigSeqIter.java

示例2: pruneP

import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
 * Prune total pair list P.
 * @param P pair list.
 * @param syz list of exponent vectors representing syzygies.
 * @return updated pair list.
 */
@Override
List<SigPair<C>> pruneP(List<SigPair<C>> P, List<ExpVector> syz) {
    List<SigPair<C>> res = new ArrayList<SigPair<C>>(P.size());
    for (SigPair<C> p : P) {
        ExpVector f = p.sigma.leadingExpVector();
        if (f == null) {
            continue;
        }
        boolean div = false;
        for (ExpVector e : syz) {
            if (f.multipleOf(e)) {
                div = true;
                break;
            }
        }
        if (div) {
            continue;
        }
        res.add(p);
    }
    return res;
}
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:29,代码来源:GroebnerBaseGGVSigSeqIter.java

示例3: isTopReducible

import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
 * Is top reducible.
 * @param A polynomial.
 * @param P polynomial list.
 * @return true if A is top reducible with respect to P.
 */
//SuppressWarnings("unchecked") // not jet working
@Override
public boolean isTopReducible(List<GenPolynomial<C>> P, GenPolynomial<C> A) {
    if (P == null || P.isEmpty()) {
        return false;
    }
    if (A == null || A.isZERO()) {
        return false;
    }
    boolean mt = false;
    ExpVector e = A.leadingExpVector();
    C a = A.leadingBaseCoefficient();
    for (GenPolynomial<C> p : P) {
        mt = e.multipleOf(p.leadingExpVector());
        if (mt) {
            C b = p.leadingBaseCoefficient();
            C r = a.remainder(b);
            mt = !r.equals(a);
            if (mt) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:32,代码来源:EReductionSeq.java

示例4: criterion3

import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
 * GB criterion 3.
 * @return true if the S-power-series(i,j) is required.
 */
public boolean criterion3(int i, int j, ExpVector eij) {
    // assert i < j;
    boolean s = red.get(j).get(i);
    if (!s) {
        logger.warn("c3.s false for " + j + " " + i);
        return s;
    }
    // now s = true;
    for (int k = 0; k < P.size(); k++) {
        MultiVarPowerSeries<C> A = P.get(k);
        ExpVector ek = A.orderExpVector();
        boolean m = eij.multipleOf(ek);
        if (m) {
            if (k < i) {
                // System.out.println("k < i "+k+" "+i); 
                s = red.get(i).get(k) || red.get(j).get(k);
            } else if (i < k && k < j) {
                // System.out.println("i < k < j "+i+" "+k+" "+j); 
                s = red.get(k).get(i) || red.get(j).get(k);
            } else if (j < k) {
                //System.out.println("j < k "+j+" "+k); 
                s = red.get(k).get(i) || red.get(k).get(j);
            }
            //System.out.println("s."+k+" = " + s); 
            if (!s) {
                return s;
            }
        }
    }
    return true;
}
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:36,代码来源:OrderedPairlist.java

示例5: isSigRedundantAlt

import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
 * Is sigma redundant, alternative algorithm.
 * @param A polynomial.
 * @param G polynomial list.
 * @return true if A is sigma redundant per alternative algorithm with
 *         respect to G.
 */
public boolean isSigRedundantAlt(List<SigPoly<C>> G, SigPoly<C> A) {
    if (G.isEmpty()) {
        return false;
    }
    ExpVector e = A.sigma.leadingExpVector();
    if (e == null) {
        e = A.poly.ring.evzero;
    }
    for (SigPoly<C> p : G) {
        if (p.sigma.isZERO()) {
            continue;
        }
        ExpVector f = p.sigma.leadingExpVector();
        if (f == null) { // does not happen
            f = p.poly.ring.evzero;
        }
        boolean mt = e.multipleOf(f);
        if (mt) {
            if (p.poly.isZERO()) {
                continue;
            }
            ExpVector h = p.poly.leadingExpVector();
            ExpVector g = A.poly.leadingExpVector();
            if (g.multipleOf(h)) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:38,代码来源:SigReductionSeq.java

示例6: isSigRedundant

import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
 * Is sigma redundant.
 * @param A polynomial.
 * @param G polynomial list.
 * @return true if A is sigma redundant with respect to G.
 */
public boolean isSigRedundant(List<SigPoly<C>> G, SigPoly<C> A) {
    if (G.isEmpty()) {
        return false;
    }
    ExpVector e = A.sigma.leadingExpVector();
    if (e == null) {
        e = A.poly.ring.evzero;
    }
    for (SigPoly<C> p : G) {
        if (p.sigma.isZERO()) {
            continue;
        }
        ExpVector f = p.sigma.leadingExpVector();
        if (f == null) { // does not happen
            f = p.poly.ring.evzero;
        }
        boolean mt = e.multipleOf(f);
        if (mt) {
            ExpVector g = e.subtract(f);
            ExpVector h = p.poly.leadingExpVector();
            h = h.sum(g);
            if (h.compareTo(A.poly.leadingExpVector()) == 0) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:35,代码来源:SigReductionSeq.java

示例7: criterion3

import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
 * GB criterium 3.
 * @return true if the S-polynomial(i,j) is required.
 */
public boolean criterion3(int i, int j, ExpVector eij) {
    // assert i < j;
    boolean s = red.get(j).get(i);
    if (!s) {
        logger.warn("c3.s false for " + j + " " + i);
        return s;
    }
    // now s = true;
    for (int k = 0; k < P.size(); k++) {
        // System.out.println("i , k , j "+i+" "+k+" "+j); 
        if (i != k && j != k) {
            GenPolynomial<C> A = P.get(k);
            ExpVector ek = A.leadingExpVector();
            boolean m = eij.multipleOf(ek);
            if (m) {
                if (k < i) {
                    // System.out.println("k < i "+k+" "+i); 
                    s = red.get(i).get(k) || red.get(j).get(k);
                } else if (i < k && k < j) {
                    // System.out.println("i < k < j "+i+" "+k+" "+j); 
                    s = red.get(k).get(i) || red.get(j).get(k);
                } else if (j < k) {
                    //System.out.println("j < k "+j+" "+k); 
                    s = red.get(k).get(i) || red.get(k).get(j);
                }
                //System.out.println("s."+k+" = " + s); 
                if (!s) {
                    return s;
                }
            }
        }
    }
    return true;
}
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:39,代码来源:OrderedPairlist.java

示例8: criterion3

import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
 * GB criterium 3.
 * @return true if the S-polynomial(i,j) is required.
 */
public boolean criterion3(int i, int j, ExpVector eij) {  
    // assert i < j;
    boolean s;
    s = red.get( j ).get(i); 
    if ( ! s ) { 
        logger.warn("c3.s false for " + j + " " + i); 
        return s;
    }
    s = true;
    boolean m;
    GenPolynomial<C> A;
    ExpVector ek;
    for ( int k = 0; k < P.size(); k++ ) {
        A = P.get( k );
        ek = A.leadingExpVector();
        m = eij.multipleOf(ek) && eij.compareTo(ek) != 0;
        if ( m ) {
            if ( k < i ) {
                // System.out.println("k < i "+k+" "+i); 
                s =    red.get( i ).get(k) 
                    || red.get( j ).get(k); 
            }
            if ( i < k && k < j ) {
                // System.out.println("i < k < j "+i+" "+k+" "+j); 
                s =    red.get( k ).get(i) 
                    || red.get( j ).get(k); 
            }
            if ( j < k ) {
                //System.out.println("j < k "+j+" "+k); 
                s =    red.get( k ).get(i) 
                    || red.get( k ).get(j); 
            }
            //System.out.println("s."+k+" = " + s); 
            if ( ! s ) return s;
        }
    }
    return true;
}
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:43,代码来源:OrderedMinPairlist.java

示例9: isNormalform

import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
 * Is in Normalform. Is left right symmetric.
 * @param Ap polynomial.
 * @param Pp polynomial list.
 * @return true if Ap is in normalform with respect to Pp.
 */
@SuppressWarnings("unchecked")
public boolean isNormalform(List<GenSolvablePolynomial<C>> Pp, GenSolvablePolynomial<C> Ap) {
    if (Pp == null || Pp.isEmpty()) {
        return true;
    }
    if (Ap == null || Ap.isZERO()) {
        return true;
    }
    GenSolvablePolynomial<C>[] P = new GenSolvablePolynomial[0];
    synchronized (Pp) {
        P = Pp.toArray(P);
    }
    int l = P.length;
    ExpVector[] htl = new ExpVector[l];
    GenSolvablePolynomial<C>[] p = new GenSolvablePolynomial[l];
    ExpVector f;
    int i;
    int j = 0;
    for (i = 0; i < l; i++) {
        p[i] = P[i];
        f = p[i].leadingExpVector();
        if (f != null) {
            p[j] = p[i];
            htl[j] = f;
            j++;
        }
    }
    l = j;
    boolean mt = false;
    for (ExpVector e : Ap.getMap().keySet()) {
        for (i = 0; i < l; i++) {
            mt = e.multipleOf(htl[i]);
            if (mt) {
                return false;
            }
        }
    }
    return true;
}
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:46,代码来源:SolvableReductionAbstract.java

示例10: sigSemiNormalform

import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
 * Top semi-complete normalform.
 * @param A polynomial.
 * @param F polynomial list.
 * @param G polynomial list.
 * @return nf(A) with respect to F and G.
 */
public SigPoly<C> sigSemiNormalform(List<GenPolynomial<C>> F, List<SigPoly<C>> G, SigPoly<C> A) {
    if (F.isEmpty() && G.isEmpty()) {
        return A;
    }
    if (A.poly.isZERO()) {
        return A;
    }
    List<GenPolynomial<C>> ff = F; //polys(F);
    GenPolynomial<C> a = A.poly;
    GenPolynomial<C> sigma = A.sigma;
    ExpVector esig = sigma.leadingExpVector();
    if (esig == null) {
        logger.info("esig = null");
        //esig = a.ring.evzero;
    }
    //GenPolynomialRing<C> ring = a.ring;
    boolean reduced = true;
    while (!a.isZERO() && reduced) {
        reduced = false;
        a = red.normalform(ff, a);
        if (a.isZERO()) {
            continue;
        }
        ExpVector e = a.leadingExpVector();
        for (SigPoly<C> p : G) {
            if (p.poly.isZERO()) {
                continue;
            }
            ExpVector f = p.poly.leadingExpVector();
            boolean mt = e.multipleOf(f);
            if (mt) {
                ExpVector g = e.subtract(f);
                C sc = a.leadingBaseCoefficient().divide(p.poly.leadingBaseCoefficient());
                GenPolynomial<C> sigup = p.sigma.multiply(sc, g);
                ExpVector eup = sigup.leadingExpVector();
                if (eup == null) {
                    logger.info("eup = null");
                    //eup = a.ring.evzero;
                    throw new IllegalArgumentException("eup == null: " + sigup);
                }

                //wrong: boolean sigeq = (sigup.compareTo(sigma) < 0);
                boolean sigeq = (eup.compareTo(esig) < 0);
                if (sigeq) {
                    //logger.info("reduced: sigup = " + sigup + ", sigma = " + sigma);
                    reduced = true;
                    a = a.subtractMultiple(sc, g, p.poly);
                    if (a.isZERO()) {
                        break;
                    }
                    e = a.leadingExpVector();
                } else {
                    //logger.info("not reduced: a = " + a + ", p = " + p.poly);
                }
            }
        }
    }
    if (!a.isZERO()) {
        C ac = a.leadingBaseCoefficient();
        if (!ac.isONE()) {
            ac = ac.inverse();
            a = a.multiply(ac);
        }
    }
    return new SigPoly<C>(sigma, a);
}
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:74,代码来源:SigReductionSeq.java

示例11: minimalGB

import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
 * Minimal ordered groebner basis.
 * @param Fp a Groebner base.
 * @return a reduced Groebner base of Fp.
 */
@Override
public List<GenPolynomial<C>> minimalGB(List<GenPolynomial<C>> Fp) {
    GenPolynomial<C> a;
    ArrayList<GenPolynomial<C>> G;
    G = new ArrayList<GenPolynomial<C>>(Fp.size());
    ListIterator<GenPolynomial<C>> it = Fp.listIterator();
    while (it.hasNext()) {
        a = it.next();
        if (a.length() != 0) { // always true
            // already monic  a = a.monic();
            G.add(a);
        }
    }
    if (G.size() <= 1) {
        return G;
    }

    ExpVector e;
    ExpVector f;
    GenPolynomial<C> p;
    ArrayList<GenPolynomial<C>> F;
    F = new ArrayList<GenPolynomial<C>>(G.size());
    boolean mt;

    while (G.size() > 0) {
        a = G.remove(0);
        e = a.leadingExpVector();

        it = G.listIterator();
        mt = false;
        while (it.hasNext() && !mt) {
            p = it.next();
            f = p.leadingExpVector();
            mt = e.multipleOf(f);
        }
        it = F.listIterator();
        while (it.hasNext() && !mt) {
            p = it.next();
            f = p.leadingExpVector();
            mt = e.multipleOf(f);
        }
        if (!mt) {
            F.add(a);
        } else {
            // System.out.println("dropped " + a.length());
        }
    }
    G = F;
    if (G.size() <= 1) {
        return G;
    }
    Collections.reverse(G); // important for lex GB

    @SuppressWarnings("cast")
    MiReducerServer<C>[] mirs = (MiReducerServer<C>[]) new MiReducerServer[G.size()];
    int i = 0;
    F = new ArrayList<GenPolynomial<C>>(G.size());
    while (G.size() > 0) {
        a = G.remove(0);
        // System.out.println("doing " + a.length());
        List<GenPolynomial<C>> R = new ArrayList<GenPolynomial<C>>(G.size() + F.size());
        R.addAll(G);
        R.addAll(F);
        mirs[i] = new MiReducerServer<C>(R, a);
        pool.addJob(mirs[i]);
        i++;
        F.add(a);
    }
    G = F;
    F = new ArrayList<GenPolynomial<C>>(G.size());
    for (i = 0; i < mirs.length; i++) {
        a = mirs[i].getNF();
        F.add(a);
    }
    return F;
}
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:82,代码来源:GroebnerBaseDistributedHybridEC.java

示例12: minimalGB

import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
 * Minimal ordered groebner basis.
 * @param Fp a Groebner base.
 * @return a reduced Groebner base of Fp.
 */
@SuppressWarnings("cast")
@Override
public List<GenPolynomial<C>> minimalGB(List<GenPolynomial<C>> Fp) {
    GenPolynomial<C> a;
    ArrayList<GenPolynomial<C>> G;
    G = new ArrayList<GenPolynomial<C>>(Fp.size());
    ListIterator<GenPolynomial<C>> it = Fp.listIterator();
    while (it.hasNext()) {
        a = it.next();
        if (a.length() != 0) { // always true
            // already monic  a = a.monic();
            G.add(a);
        }
    }
    if (G.size() <= 1) {
        return G;
    }

    ExpVector e;
    ExpVector f;
    GenPolynomial<C> p;
    ArrayList<GenPolynomial<C>> F;
    F = new ArrayList<GenPolynomial<C>>(G.size());
    boolean mt;

    while (G.size() > 0) {
        a = G.remove(0);
        e = a.leadingExpVector();

        it = G.listIterator();
        mt = false;
        while (it.hasNext() && !mt) {
            p = it.next();
            f = p.leadingExpVector();
            mt = e.multipleOf(f);
        }
        it = F.listIterator();
        while (it.hasNext() && !mt) {
            p = it.next();
            f = p.leadingExpVector();
            mt = e.multipleOf(f);
        }
        if (!mt) {
            F.add(a);
        } else {
            // System.out.println("dropped " + a.length());
        }
    }
    G = F;
    if (G.size() <= 1) {
        return G;
    }
    Collections.reverse(G); // important for lex GB

    MiMPJReducerServer<C>[] mirs = (MiMPJReducerServer<C>[]) new MiMPJReducerServer[G.size()];
    int i = 0;
    F = new ArrayList<GenPolynomial<C>>(G.size());
    while (G.size() > 0) {
        a = G.remove(0);
        // System.out.println("doing " + a.length());
        List<GenPolynomial<C>> R = new ArrayList<GenPolynomial<C>>(G.size() + F.size());
        R.addAll(G);
        R.addAll(F);
        mirs[i] = new MiMPJReducerServer<C>(R, a);
        pool.addJob(mirs[i]);
        i++;
        F.add(a);
    }
    G = F;
    F = new ArrayList<GenPolynomial<C>>(G.size());
    for (i = 0; i < mirs.length; i++) {
        a = mirs[i].getNF();
        F.add(a);
    }
    return F;
}
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:82,代码来源:GroebnerBaseDistributedHybridMPJ.java

示例13: criterion3

import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
 * GB criterium 3 with coefficient division test.
 * @return true if the S-polynomial(i,j) is required.
 */
@Override
public boolean criterion3(int i, int j, ExpVector eij) {  
    // assert i < j;
    boolean s;
    s = red.get( j ).get(i); 
    if ( ! s ) { 
        logger.warn("c3.s false for " + j + " " + i); 
        return s;
    }
    s = true;
    boolean m;
    GenPolynomial<C> A;
    ExpVector ek;
    C ci = P.get(i).leadingBaseCoefficient();
    C cj = P.get(j).leadingBaseCoefficient();
    C c = ci.gcd(cj);
    for ( int k = 0; k < P.size(); k++ ) {
        A = P.get( k );
        ek = A.leadingExpVector();
        m = eij.multipleOf(ek);
        if ( m ) {
            C ck = A.leadingBaseCoefficient();
            C r = c.remainder(ck);
            m = r.isZERO();
        }
        if ( m ) {
            if ( k < i ) {
                // System.out.println("k < i "+k+" "+i); 
                s =    red.get( i ).get(k) 
                    || red.get( j ).get(k); 
            }
            if ( i < k && k < j ) {
                // System.out.println("i < k < j "+i+" "+k+" "+j); 
                s =    red.get( k ).get(i) 
                    || red.get( j ).get(k); 
            }
            if ( j < k ) {
                //System.out.println("j < k "+j+" "+k); 
                s =    red.get( k ).get(i) 
                    || red.get( k ).get(j); 
            }
            //System.out.println("s."+k+" = " + s); 
            if ( ! s ) return s;
        }
    }
    return true;
}
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:52,代码来源:OrderedDPairlist.java

示例14: minimalGB

import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
 * Minimal ordered groebner basis, parallel.
 * @param Fp a Groebner base.
 * @return minimalGB(F) a minimal Groebner base of Fp.
 */
@Override
public List<GenPolynomial<C>> minimalGB(List<GenPolynomial<C>> Fp) {
    GenPolynomial<C> a;
    ArrayList<GenPolynomial<C>> G;
    G = new ArrayList<GenPolynomial<C>>(Fp.size());
    ListIterator<GenPolynomial<C>> it = Fp.listIterator();
    while (it.hasNext()) {
        a = it.next();
        if (a.length() != 0) { // always true
            // already monic  a = a.monic();
            G.add(a);
        }
    }
    if (G.size() <= 1) {
        return G;
    }

    ExpVector e;
    ExpVector f;
    GenPolynomial<C> p;
    ArrayList<GenPolynomial<C>> F;
    F = new ArrayList<GenPolynomial<C>>(G.size());
    boolean mt;
    while (G.size() > 0) {
        a = G.remove(0);
        e = a.leadingExpVector();

        it = G.listIterator();
        mt = false;
        while (it.hasNext() && !mt) {
            p = it.next();
            f = p.leadingExpVector();
            mt = e.multipleOf(f);
        }
        it = F.listIterator();
        while (it.hasNext() && !mt) {
            p = it.next();
            f = p.leadingExpVector();
            mt = e.multipleOf(f);
        }
        if (!mt) {
            F.add(a); // no thread at this point
        } else {
            // System.out.println("dropped " + a.length());
        }
    }
    G = F;
    if (G.size() <= 1) {
        return G;
    }
    Collections.reverse(G); // important for lex GB

    @SuppressWarnings("cast")
    MiReducerIter<C>[] mirs = (MiReducerIter<C>[]) new MiReducerIter[G.size()];
    int i = 0;
    F = new ArrayList<GenPolynomial<C>>(G.size());
    while (G.size() > 0) {
        a = G.remove(0);
        List<GenPolynomial<C>> R = new ArrayList<GenPolynomial<C>>(G.size() + F.size());
        R.addAll(G);
        R.addAll(F);
        // System.out.println("doing " + a.length());
        mirs[i] = new MiReducerIter<C>(R, a);
        pool.addJob(mirs[i]);
        i++;
        F.add(a);
    }
    G = F;
    F = new ArrayList<GenPolynomial<C>>(G.size());
    for (i = 0; i < mirs.length; i++) {
        a = mirs[i].getNF();
        F.add(a);
    }
    return F;
}
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:81,代码来源:GroebnerBaseParIter.java

示例15: minimalGB

import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
 * Minimal ordered groebner basis.
 * @param Fp a Groebner base.
 * @return a reduced Groebner base of Fp.
 */
@SuppressWarnings("cast")
@Override
public List<GenPolynomial<C>> minimalGB(List<GenPolynomial<C>> Fp) {
    GenPolynomial<C> a;
    ArrayList<GenPolynomial<C>> G;
    G = new ArrayList<GenPolynomial<C>>(Fp.size());
    ListIterator<GenPolynomial<C>> it = Fp.listIterator();
    while (it.hasNext()) {
        a = it.next();
        if (a.length() != 0) { // always true
            // already monic  a = a.monic();
            G.add(a);
        }
    }
    if (G.size() <= 1) {
        return G;
    }

    ExpVector e;
    ExpVector f;
    GenPolynomial<C> p;
    ArrayList<GenPolynomial<C>> F;
    F = new ArrayList<GenPolynomial<C>>(G.size());
    boolean mt;

    while (G.size() > 0) {
        a = G.remove(0);
        e = a.leadingExpVector();

        it = G.listIterator();
        mt = false;
        while (it.hasNext() && !mt) {
            p = it.next();
            f = p.leadingExpVector();
            mt = e.multipleOf(f);
        }
        it = F.listIterator();
        while (it.hasNext() && !mt) {
            p = it.next();
            f = p.leadingExpVector();
            mt = e.multipleOf(f);
        }
        if (!mt) {
            F.add(a);
        } else {
            // System.out.println("dropped " + a.length());
        }
    }
    G = F;
    if (G.size() <= 1) {
        return G;
    }
    Collections.reverse(G); // important for lex GB

    MiMPIReducerServer<C>[] mirs = (MiMPIReducerServer<C>[]) new MiMPIReducerServer[G.size()];
    int i = 0;
    F = new ArrayList<GenPolynomial<C>>(G.size());
    while (G.size() > 0) {
        a = G.remove(0);
        // System.out.println("doing " + a.length());
        List<GenPolynomial<C>> R = new ArrayList<GenPolynomial<C>>(G.size() + F.size());
        R.addAll(G);
        R.addAll(F);
        mirs[i] = new MiMPIReducerServer<C>(R, a);
        pool.addJob(mirs[i]);
        i++;
        F.add(a);
    }
    G = F;
    F = new ArrayList<GenPolynomial<C>>(G.size());
    for (i = 0; i < mirs.length; i++) {
        a = mirs[i].getNF();
        F.add(a);
    }
    return F;
}
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:82,代码来源:GroebnerBaseDistributedMPI.java


注:本文中的edu.jas.poly.ExpVector.multipleOf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。