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