Package edu.jas.poly

Class GenSolvablePolynomial<C extends RingElem<C>>

java.lang.Object
edu.jas.poly.GenPolynomial<C>
edu.jas.poly.GenSolvablePolynomial<C>
Type Parameters:
C - coefficient type
All Implemented Interfaces:
AbelianGroupElem<GenPolynomial<C>>, Element<GenPolynomial<C>>, MonoidElem<GenPolynomial<C>>, RingElem<GenPolynomial<C>>, Serializable, Comparable<GenPolynomial<C>>, Iterable<Monomial<C>>
Direct Known Subclasses:
LocalSolvablePolynomial, QLRSolvablePolynomial, QuotSolvablePolynomial, RecSolvablePolynomial, RecSolvableWordPolynomial, ResidueSolvablePolynomial, ResidueSolvableWordPolynomial

public class GenSolvablePolynomial<C extends RingElem<C>> extends GenPolynomial<C>
GenSolvablePolynomial generic solvable polynomials implementing RingElem. n-variate ordered solvable polynomials over C. Objects of this class are intended to be immutable. The implementation is based on TreeMap respectively SortedMap from exponents to coefficients by extension of GenPolybomial. Only the coefficients are modeled with generic types, the exponents are fixed to ExpVector with long, int, short entries (@see edu.jas.poly.ExpVector StorUnit).
See Also:
  • Field Details

    • logger

      private static final org.apache.logging.log4j.Logger logger
    • ring

      public final GenSolvablePolynomialRing<C extends RingElem<C>> ring
      The factory for the solvable polynomial ring. Hides super.ring.
  • Constructor Details

    • GenSolvablePolynomial

      public GenSolvablePolynomial(GenSolvablePolynomialRing<C> r)
      Constructor for zero GenSolvablePolynomial.
      Parameters:
      r - solvable polynomial ring factory.
    • GenSolvablePolynomial

      public GenSolvablePolynomial(GenSolvablePolynomialRing<C> r, C c, ExpVector e)
      Constructor for GenSolvablePolynomial.
      Parameters:
      r - solvable polynomial ring factory.
      c - coefficient.
      e - exponent.
    • GenSolvablePolynomial

      public GenSolvablePolynomial(GenSolvablePolynomialRing<C> r, C c)
      Constructor for GenSolvablePolynomial.
      Parameters:
      r - solvable polynomial ring factory.
      c - coefficient.
    • GenSolvablePolynomial

      protected GenSolvablePolynomial(GenSolvablePolynomialRing<C> r, SortedMap<ExpVector,C> v)
      Constructor for GenSolvablePolynomial.
      Parameters:
      r - solvable polynomial ring factory.
      v - the SortedMap of some other (solvable) polynomial.
  • Method Details

    • factory

      public GenSolvablePolynomialRing<C> factory()
      Get the corresponding element factory.
      Specified by:
      factory in interface Element<C extends RingElem<C>>
      Overrides:
      factory in class GenPolynomial<C extends RingElem<C>>
      Returns:
      factory for this Element.
      See Also:
    • copy

      public GenSolvablePolynomial<C> copy()
      Clone this GenSolvablePolynomial.
      Specified by:
      copy in interface Element<C extends RingElem<C>>
      Overrides:
      copy in class GenPolynomial<C extends RingElem<C>>
      Returns:
      copy of this.
      See Also:
    • equals

      public boolean equals(Object B)
      Comparison with any other object.
      Specified by:
      equals in interface Element<C extends RingElem<C>>
      Overrides:
      equals in class GenPolynomial<C extends RingElem<C>>
      Parameters:
      B -
      Returns:
      true if this is equal to b, else false.
      See Also:
    • hashCode

      public int hashCode()
      Hash code for this polynomial.
      Specified by:
      hashCode in interface Element<C extends RingElem<C>>
      Overrides:
      hashCode in class GenPolynomial<C extends RingElem<C>>
      Returns:
      the hashCode.
      See Also:
    • multiply

      GenSolvablePolynomial multiplication.
      Parameters:
      Bp - GenSolvablePolynomial.
      Returns:
      this*Bp, where * denotes solvable multiplication.
    • multiply

      GenSolvablePolynomial left and right multiplication. Product with two polynomials.
      Parameters:
      S - GenSolvablePolynomial.
      T - GenSolvablePolynomial.
      Returns:
      S*this*T.
    • multiply

      public GenSolvablePolynomial<C> multiply(C b)
      GenSolvablePolynomial multiplication. Product with coefficient ring element.
      Overrides:
      multiply in class GenPolynomial<C extends RingElem<C>>
      Parameters:
      b - coefficient.
      Returns:
      this*b, where * is coefficient multiplication.
    • multiply

      public GenSolvablePolynomial<C> multiply(C b, C c)
      GenSolvablePolynomial left and right multiplication. Product with coefficient ring element.
      Parameters:
      b - coefficient.
      c - coefficient.
      Returns:
      b*this*c, where * is coefficient multiplication.
    • multiply

      public GenSolvablePolynomial<C> multiply(ExpVector e)
      GenSolvablePolynomial multiplication. Product with exponent vector.
      Overrides:
      multiply in class GenPolynomial<C extends RingElem<C>>
      Parameters:
      e - exponent.
      Returns:
      this * xe, where * denotes solvable multiplication.
    • multiply

      public GenSolvablePolynomial<C> multiply(ExpVector e, ExpVector f)
      GenSolvablePolynomial left and right multiplication. Product with exponent vector.
      Parameters:
      e - exponent.
      f - exponent.
      Returns:
      xe * this * xf, where * denotes solvable multiplication.
    • multiply

      public GenSolvablePolynomial<C> multiply(C b, ExpVector e)
      GenSolvablePolynomial multiplication. Product with ring element and exponent vector.
      Overrides:
      multiply in class GenPolynomial<C extends RingElem<C>>
      Parameters:
      b - coefficient.
      e - exponent.
      Returns:
      this * b xe, where * denotes solvable multiplication.
    • multiply

      public GenSolvablePolynomial<C> multiply(C b, ExpVector e, C c, ExpVector f)
      GenSolvablePolynomial left and right multiplication. Product with ring element and exponent vector.
      Parameters:
      b - coefficient.
      e - exponent.
      c - coefficient.
      f - exponent.
      Returns:
      b xe * this * c xf, where * denotes solvable multiplication.
    • multiplyLeft

      public GenSolvablePolynomial<C> multiplyLeft(C b, ExpVector e)
      GenSolvablePolynomial multiplication. Left product with ring element and exponent vector.
      Parameters:
      b - coefficient.
      e - exponent.
      Returns:
      b xe * this, where * denotes solvable multiplication.
    • multiplyLeft

      public GenSolvablePolynomial<C> multiplyLeft(ExpVector e)
      GenSolvablePolynomial multiplication. Left product with exponent vector.
      Parameters:
      e - exponent.
      Returns:
      xe * this, where * denotes solvable multiplication.
    • multiplyLeft

      public GenSolvablePolynomial<C> multiplyLeft(C b)
      GenSolvablePolynomial multiplication. Left product with coefficient ring element.
      Overrides:
      multiplyLeft in class GenPolynomial<C extends RingElem<C>>
      Parameters:
      b - coefficient.
      Returns:
      b*this, where * is coefficient multiplication.
    • multiplyLeft

      public GenSolvablePolynomial<C> multiplyLeft(Map.Entry<ExpVector,C> m)
      GenSolvablePolynomial multiplication. Left product with 'monomial'.
      Parameters:
      m - 'monomial'.
      Returns:
      m * this, where * denotes solvable multiplication.
    • multiply

      public GenSolvablePolynomial<C> multiply(Map.Entry<ExpVector,C> m)
      GenSolvablePolynomial multiplication. Product with 'monomial'.
      Overrides:
      multiply in class GenPolynomial<C extends RingElem<C>>
      Parameters:
      m - 'monomial'.
      Returns:
      this * m, where * denotes solvable multiplication.
    • subtractMultiple

      public GenSolvablePolynomial<C> subtractMultiple(C a, GenSolvablePolynomial<C> S)
      GenSolvablePolynomial subtract a multiple.
      Parameters:
      a - coefficient.
      S - GenSolvablePolynomial.
      Returns:
      this - a * S.
    • subtractMultiple

      public GenSolvablePolynomial<C> subtractMultiple(C a, ExpVector e, GenSolvablePolynomial<C> S)
      GenSolvablePolynomial subtract a multiple.
      Parameters:
      a - coefficient.
      e - exponent.
      S - GenSolvablePolynomial.
      Returns:
      this - a * xe * S.
    • scaleSubtractMultiple

      public GenSolvablePolynomial<C> scaleSubtractMultiple(C b, C a, GenSolvablePolynomial<C> S)
      GenSolvablePolynomial scale and subtract a multiple.
      Parameters:
      b - scale factor.
      a - coefficient.
      S - GenSolvablePolynomial.
      Returns:
      b * this - a * S.
    • scaleSubtractMultiple

      public GenSolvablePolynomial<C> scaleSubtractMultiple(C b, C a, ExpVector e, GenSolvablePolynomial<C> S)
      GenSolvablePolynomial scale and subtract a multiple.
      Parameters:
      b - scale factor.
      a - coefficient.
      e - exponent.
      S - GenSolvablePolynomial.
      Returns:
      b * this - a * xe * S.
    • scaleSubtractMultiple

      public GenSolvablePolynomial<C> scaleSubtractMultiple(C b, ExpVector g, C a, ExpVector e, GenSolvablePolynomial<C> S)
      GenSolvablePolynomial scale and subtract a multiple.
      Parameters:
      b - scale factor.
      g - scale exponent.
      a - coefficient.
      e - exponent.
      S - GenSolvablePolynomial.
      Returns:
      a * xg * this - a * xe * S.
    • monic

      public GenSolvablePolynomial<C> monic()
      GenSolvablePolynomial left monic, i.e. leadingCoefficient == 1. If leadingCoefficient is not invertible returns this abs value.
      Overrides:
      monic in class GenPolynomial<C extends RingElem<C>>
      Returns:
      ldcf(this)**(-1) * this.
    • leftMonic

      public GenSolvablePolynomial<C> leftMonic()
      GenSolvablePolynomial left monic, i.e. leadingCoefficient == 1. If leadingCoefficient is not invertible returns this abs value.
      Returns:
      ldcf(this)**(-1) * this.
    • rightMonic

      public GenSolvablePolynomial<C> rightMonic()
      GenSolvablePolynomial right monic, i.e. leadingCoefficient == 1. If leadingCoefficient is not invertible returns this abs value.
      Returns:
      this * ldcf(this)**(-1).
    • divide

      GenSolvablePolynomial left division. Fails, if exact division by leading base coefficient is not possible. Meaningful only for univariate polynomials over fields, but works in any case.
      Parameters:
      S - nonzero GenSolvablePolynomial with invertible leading coefficient.
      Returns:
      quotient with this = quotient * S + remainder and deg(remainder) < deg(S) or remainder = 0.
      See Also:
    • remainder

      GenSolvablePolynomial remainder by left division. Fails, if exact division by leading base coefficient is not possible. Meaningful only for univariate polynomials over fields, but works in any case.
      Parameters:
      S - nonzero GenSolvablePolynomial with invertible leading coefficient.
      Returns:
      remainder with this = quotient * S + remainder and deg(remainder) < deg(S) or remainder = 0.
      See Also:
    • quotientRemainder

      public GenSolvablePolynomial<C>[] quotientRemainder(GenSolvablePolynomial<C> S)
      GenSolvablePolynomial left division with remainder. Fails, if exact division by leading base coefficient is not possible. Meaningful only for univariate polynomials over fields, but works in any case.
      Parameters:
      S - nonzero GenSolvablePolynomial with invertible leading coefficient.
      Returns:
      [ quotient , remainder ] with this = quotient * S + remainder and deg(remainder) < deg(S) or remainder = 0.
      See Also:
    • rightDivide

      public GenSolvablePolynomial<C> rightDivide(GenSolvablePolynomial<C> S)
      GenSolvablePolynomial right division. Fails, if exact division by leading base coefficient is not possible. Meaningful only for univariate polynomials over fields, but works in any case.
      Parameters:
      S - nonzero GenSolvablePolynomial with invertible leading coefficient.
      Returns:
      quotient with this = S * quotient + remainder and deg(remainder) < deg(S) or remainder = 0.
      See Also:
    • rightRemainder

      public GenSolvablePolynomial<C> rightRemainder(GenSolvablePolynomial<C> S)
      GenSolvablePolynomial remainder by right division. Fails, if exact division by leading base coefficient is not possible. Meaningful only for univariate polynomials over fields, but works in any case.
      Parameters:
      S - nonzero GenSolvablePolynomial with invertible leading coefficient.
      Returns:
      remainder with this = S * quotient + remainder and deg(remainder) < deg(S) or remainder = 0.
      See Also:
    • rightQuotientRemainder

      public GenSolvablePolynomial<C>[] rightQuotientRemainder(GenSolvablePolynomial<C> S)
      GenSolvablePolynomial right division with remainder. Fails, if exact division by leading base coefficient is not possible. Meaningful only for univariate polynomials over fields, but works in any case.
      Parameters:
      S - nonzero GenSolvablePolynomial with invertible leading coefficient.
      Returns:
      [ quotient , remainder ] with this = S * quotient + remainder and deg(remainder) < deg(S) or remainder = 0.
      See Also:
    • rightRecursivePolynomial

      public GenSolvablePolynomial<C> rightRecursivePolynomial()
      RecSolvablePolynomial right coefficients from left coefficients. Note: R is represented as a polynomial with left coefficients, the implementation can at the moment not distinguish between left and right coefficients.
      Returns:
      R = sum( Xi bi ), with P = sum(ai Xi ) and eval(sum(Xi bi)) == sum(ai Xi)
    • evalAsRightRecursivePolynomial

      public GenSolvablePolynomial<C> evalAsRightRecursivePolynomial()
      Evaluate RecSolvablePolynomial as right coefficients polynomial. Note: R is represented as a polynomial with left coefficients, the implementation can at the moment not distinguish between left and right coefficients.
      Returns:
      this as evaluated polynomial R. R = sum( Xi bi ), this = sum(ai Xi ) = eval(sum(Xi bi))
    • isRightRecursivePolynomial

      public boolean isRightRecursivePolynomial(GenSolvablePolynomial<C> R)
      Test RecSolvablePolynomial right coefficients polynomial. Note: R is represented as a polynomial with left coefficients, the implementation can at the moment not distinguish between left and right coefficients.
      Parameters:
      R - GenSolvablePolynomial with right coefficients.
      Returns:
      true, if R is polynomial with right coefficients of this. R = sum( Xi bi ), with this = sum(ai Xi ) and eval(sum(Xi bi)) == sum(ai Xi)