Package edu.jas.poly

Class PolynomialList<C extends RingElem<C>>

java.lang.Object
edu.jas.poly.PolynomialList<C>
All Implemented Interfaces:
Serializable, Comparable<PolynomialList<C>>
Direct Known Subclasses:
OptimizedPolynomialList, OrderedPolynomialList

public class PolynomialList<C extends RingElem<C>> extends Object implements Comparable<PolynomialList<C>>, Serializable
List of polynomials. Mainly for storage and printing / toString and conversions to other representations.
See Also:
  • Field Details

    • ring

      public final GenPolynomialRing<C extends RingElem<C>> ring
      The factory for the solvable polynomial ring.
    • list

      public final List<GenPolynomial<C extends RingElem<C>>> list
      The data structure is a List of polynomials.
    • logger

      private static final org.apache.logging.log4j.Logger logger
  • Constructor Details

  • Method Details

    • copy

      public PolynomialList<C> copy()
      Copy this.
      Returns:
      a copy of this.
    • equals

      public boolean equals(Object p)
      Comparison with any other object.
      Overrides:
      equals in class Object
      See Also:
    • compareTo

      public int compareTo(PolynomialList<C> L)
      Polynomial list comparison.
      Specified by:
      compareTo in interface Comparable<C extends RingElem<C>>
      Parameters:
      L - other PolynomialList.
      Returns:
      lexicographical comparison, sign of first different polynomials.
    • hashCode

      public int hashCode()
      Hash code for this polynomial list.
      Overrides:
      hashCode in class Object
      See Also:
    • isEmpty

      public boolean isEmpty()
      Test if list is empty.
      Returns:
      true if this is empty, else false.
    • toString

      public String toString()
      String representation of the polynomial list.
      Overrides:
      toString in class Object
      See Also:
    • toScript

      public String toScript()
      Get a scripting compatible string representation.
      Returns:
      script compatible representation for this polynomial list.
    • getModuleList

      public ModuleList<C> getModuleList(int i)
      Get ModuleList from PolynomialList. Extract module from polynomial ring.
      Parameters:
      i - number of variables to be contract form the polynomials.
      Returns:
      module list corresponding to this.
      See Also:
    • getList

      public List<GenPolynomial<C>> getList()
      Get list.
      Returns:
      list from this.
    • castToSolvableList

      public List<GenSolvablePolynomial<C>> castToSolvableList()
      Get list as List of GenSolvablePolynomials. Required because no List casts allowed. Equivalent to cast (List<GenSolvablePolynomial<C>>) list.
      Returns:
      solvable polynomial list from this.
    • getSolvableList

      public List<GenSolvablePolynomial<C>> getSolvableList()
      Get list as List of GenSolvablePolynomials. Required because no List casts allowed. Equivalent to cast (List<GenSolvablePolynomial<C>>) list.
      Returns:
      solvable polynomial list from this.
    • getSolvableRing

      public GenSolvablePolynomialRing<C> getSolvableRing()
      Get ring as GenSolvablePolynomialRing.
      Returns:
      solvable polynomial ring list from this.
    • castToSolvableList

      public static <C extends RingElem<C>> List<GenSolvablePolynomial<C>> castToSolvableList(List<GenPolynomial<C>> list)
      Get list as List of GenSolvablePolynomials. Required because no List casts allowed. Equivalent to cast (List<GenSolvablePolynomial<C>>) list.
      Parameters:
      list - list of extensions of polynomials.
      Returns:
      solvable polynomial list from this.
    • castToSolvableMatrix

      public static <C extends RingElem<C>> List<List<GenSolvablePolynomial<C>>> castToSolvableMatrix(List<List<GenPolynomial<C>>> list)
      Get list of list as List of List of GenSolvablePolynomials. Required because no List casts allowed. Equivalent to cast (List<GenSolvablePolynomial<C>>) list.
      Parameters:
      list - list of extensions of polynomials.
      Returns:
      solvable polynomial list from this.
    • castToList

      public static <C extends RingElem<C>> List<GenPolynomial<C>> castToList(List<? extends GenPolynomial<C>> slist)
      Get list of extensions of polynomials as List of GenPolynomials. Required because no List casts allowed. Equivalent to cast (List<GenPolynomial<C>>) list. Mainly used for lists of GenSolvablePolynomials.
      Parameters:
      slist - list of extensions of polynomials.
      Returns:
      polynomial list from slist.
    • castToMatrix

      public static <C extends RingElem<C>> List<List<GenPolynomial<C>>> castToMatrix(List<List<? extends GenPolynomial<C>>> slist)
      Get list of list of extensions of polynomials as List of List of GenPolynomials. Required because no List casts allowed. Equivalent to cast (List<GenPolynomial<C>>) list. Mainly used for lists of GenSolvablePolynomials.
      Parameters:
      slist - list of extensions of polynomials.
      Returns:
      polynomial list from slist.
    • isZERO

      public boolean isZERO()
      Test if list contains only ZEROs.
      Returns:
      true, if this is the 0 list, else false
    • isONE

      public boolean isONE()
      Test if list contains a ONE.
      Returns:
      true, if this contains 1, else false
    • homogenize

      public PolynomialList<C> homogenize()
      Make homogeneous.
      Returns:
      polynomial list of homogeneous polynomials.
    • deHomogenize

      public PolynomialList<C> deHomogenize()
      Dehomogenize.
      Returns:
      polynomial list of de-homogenized polynomials.
    • isHomogeneous

      public boolean isHomogeneous()
      Test if all polynomials are homogeneous.
      Returns:
      true, if all polynomials are homogeneous, else false
    • deltaExpVectors

      public SortedSet<ExpVector> deltaExpVectors()
      Union of the delta of exponent vectors of all polynomials.
      Returns:
      list of u-v, where u = lt() and v != u in p in list.
    • deltaExpVectors

      public SortedSet<ExpVector> deltaExpVectors(List<ExpVector> mark)
      Union of the delta of exponent vectors of all polynomials.
      Parameters:
      mark - list of marked exp vectors of polynomials.
      Returns:
      list of u-v, where u in mark and v != u in p.expVectors in list.
    • leadingWeightPolynomials

      public List<GenPolynomial<C>> leadingWeightPolynomials()
      Leading weight polynomials.
      Returns:
      list of polynomials with terms of maximal weight degree.