001 /*
002 * $Id: PairList.java 3372 2010-11-28 16:42:48Z kredel $
003 */
004
005 package edu.jas.gb;
006
007 import java.util.List;
008
009 import edu.jas.structure.RingElem;
010 import edu.jas.poly.ExpVector;
011 import edu.jas.poly.TermOrder;
012 import edu.jas.poly.GenPolynomial;
013 import edu.jas.poly.GenPolynomialRing;
014
015
016 /**
017 * Pair list management interface.
018 * @author Heinz Kredel
019 */
020
021 public interface PairList<C extends RingElem<C> > {
022
023
024 /**
025 * Create a new PairList.
026 * @param r polynomial ring.
027 */
028 public PairList<C> create(GenPolynomialRing<C> r);
029
030
031 /**
032 * Create a new PairList.
033 * @param m number of module variables.
034 * @param r polynomial ring.
035 */
036 public PairList<C> create(int m, GenPolynomialRing<C> r);
037
038
039 /**
040 * toString.
041 */
042 @Override
043 public String toString();
044
045
046 /**
047 * Put one Polynomial to the pairlist and reduction matrix.
048 * @param p polynomial.
049 * @return the index of the added polynomial.
050 */
051 public int put(GenPolynomial<C> p);
052
053
054 /**
055 * Put to ONE-Polynomial to the pairlist.
056 * @return the index of the last polynomial.
057 */
058 public int putOne();
059
060
061 /**
062 * Remove the next required pair from the pairlist and reduction matrix.
063 * Appy the criterions 3 and 4 to see if the S-polynomial is required.
064 * @return the next pair if one exists, otherwise null.
065 */
066 public Pair<C> removeNext();
067
068
069 /**
070 * Test if there is possibly a pair in the list.
071 * @return true if a next pair could exist, otherwise false.
072 */
073 public boolean hasNext();
074
075
076 /**
077 * Get the list of polynomials.
078 * @return the polynomial list.
079 */
080 public List<GenPolynomial<C>> getList();
081
082
083 /**
084 * Get the number of polynomials put to the pairlist.
085 * @return the number of calls to put.
086 */
087 public int putCount();
088
089
090 /**
091 * Get the number of required pairs removed from the pairlist.
092 * @return the number of non null pairs delivered.
093 */
094 public int remCount();
095
096
097 /**
098 * GB criterium 3.
099 * @return true if the S-polynomial(i,j) is required.
100 */
101 public boolean criterion3(int i, int j, ExpVector eij);
102
103 }
104