Orbital library

orbital.math
Interface Polynomial

All Superinterfaces:
Arithmetic, Function, Functor, MathFunctor, Normed
All Known Subinterfaces:
UnivariatePolynomial

public interface Polynomial
extends Arithmetic, Function

Polynomial p∈R[S] := R(S).

R(S) := s∈S R is the R-algebra of the magma S over R.

With S=Nn these are the multivariate polynomials in n variables. Of course, the multivariate polynomials are polynomials over polynomial rings:

R[X0,...,Xn-1] = R[X0][X1]...[Xn-1]
The importance of polynomial rings comes from the fact that they are the free commutative and associative R-algebras LibascR(I) := R(N(I)) = R[(Xi)i∈I] and enjoy corresponding universal properties. Although, of course, this is usually restricted to a finite number of variables for the purpose of computation.

Author:
André Platzer
See Also:
ValueFactory.polynomial(Object), ValueFactory.asPolynomial(Tensor), "N. Bourbaki, Algebra III.2.6: Algebra of a magma, a monoid, a group.", "N. Bourbaki, Algebra III.2.7: Free algebras."

Nested Class Summary
 
Nested classes/interfaces inherited from interface orbital.math.functional.Function
Function.Composite
 
Nested classes/interfaces inherited from interface orbital.logic.functor.Functor
Functor.Specification
 
Nested classes/interfaces inherited from interface orbital.logic.functor.Functor
Functor.Specification
 
Field Summary
 
Fields inherited from interface orbital.logic.functor.Function
callTypeDeclaration
 
Method Summary
 Polynomial add(Polynomial b)
           
 java.lang.Object apply(java.lang.Object a)
          Evaluate this polynomial at a.
 Integer degree()
          Get the total degree of this polynomial.
 int[] degrees()
          Returns the multi-degree, i.e., the vector of partial degrees of this polynomial for the individual variables Xi.
 int degreeValue()
          Get the (int value of the) degree of this polynomial.
 Arithmetic get(Arithmetic i)
          Get the i-th coefficient.
 java.lang.Object indexSet()
          Describes the index magma S of our polynomial ring R[S].
 java.util.Iterator indices()
          Returns an iterator over the (relevant) indices.
 java.util.ListIterator iterator()
          Returns an iterator over all coefficients (up to degree).
 java.util.Iterator monomials()
          Returns an iterator over our (relevant) monomials, i.e., pairs of (exponent, coefficient).
 Polynomial multiply(Polynomial b)
          Multiplies two polynomials.
 int rank()
          Get the rank of this polynomial, i.e., the number of distinct variables.
 Polynomial subtract(Polynomial b)
           
 
Methods inherited from interface orbital.math.functional.Function
derive, integrate
 
Methods inherited from interface orbital.logic.functor.Functor
equals, hashCode, toString
 
Methods inherited from interface orbital.logic.functor.Functor
equals, hashCode, toString
 

Method Detail

indexSet

java.lang.Object indexSet()
Describes the index magma S of our polynomial ring R[S].

The index set specifies what form indices of coefficients have. Since there usually is no computer representation of the full index set, this method will only return a description object that can be compared to other index sets via Object.equals(Object).

The precise structure of this object is not defined but, for example, for the polynomial ring R[Nn]=R[X0,...,Xn-1] in n variables, it may simply be the integer n.

Returns:
a (memento) description of the index set S which is even a magma.
Postconditions:
RES.supports(#equals(Object)) || RES.getClass().isArray()

indices

java.util.Iterator indices()
Returns an iterator over the (relevant) indices.

The order of this iterator is not generally defined, but should be deterministic. Particularly, the iterator may - but need not - be restricted to occurring indices with coefficients ≠0.

Returns:
an iterator over a finite set of indices in S at least containing all indices of coefficients ≠0.
Postconditions:
∀i∈S∖RES get(i)=0

monomials

java.util.Iterator monomials()
Returns an iterator over our (relevant) monomials, i.e., pairs of (exponent, coefficient).

The order of this iterator is not generally defined, but should be deterministic. Particularly, the iterator may - but need not - be restricted to occurring indices with coefficients ≠0.

Returns:
an iterator over a finite set of pairs of exponents in S and coefficients in R at least containing all pairs for coefficients ≠0.
Postconditions:
∀(i,c)∈S×R∖RES get(i)=0

get

Arithmetic get(Arithmetic i)
Get the i-th coefficient. The i-th coefficient αi is the coefficient of ι(i) for i∈S. For example, if S=Nn that is the coefficient of the monomial X0i0⋅X1i1⋅...⋅Xn-1in-1, which is 0 if |i|>deg(this).

Returns:
αi.
Preconditions:
i∈S

rank

int rank()
Get the rank of this polynomial, i.e., the number of distinct variables. The rank is the number of different variables occurring in the polynomial, irrespective of their respective degree. In the polynomial ring R[X0,...,Xn-1], the rank is n.

Throws:
java.lang.UnsupportedOperationException - if R[S] is not a ring with a meaningful finite rank.
See Also:
Tensor.rank()
Postconditions:
RES≥0

degree

Integer degree()
Get the total degree of this polynomial.

For example, if S=Nn then this method returns the total degree deg(this) := max {|i| := ∑j=0,...,n-1 ij  ¦  i∈Nn ∧ ai≠0}. Further, deg(0) < 0

Throws:
java.lang.UnsupportedOperationException - if R[S] is not a graded ring with a very meaningful graduation. By providing this option, implementations are not forced to use trivial graduations if no meaningful graduation exists.
Note:
though graduations may have a more general set of degrees than Z, we restrict ourselves to that case, which is by far the most usual one.

degreeValue

int degreeValue()
Get the (int value of the) degree of this polynomial.

See Also:
degreeValue()

degrees

int[] degrees()
Returns the multi-degree, i.e., the vector of partial degrees of this polynomial for the individual variables Xi.

For example, if S=Nn then this method returns the vector of partial degrees degp(this) := (max {j  ¦  there is an i∈Nn with ik=j ∧ ai≠0})k=0,...,n-1. Further, deg_p(f)k < 0 iff Xk does not occur in f.

Returns:
an array d containing the partial degrees d[i] of variable Xi.
Throws:
java.lang.UnsupportedOperationException - if R[S] is not a ring with a meaningful finite rank.
See Also:
Tensor.dimensions()
Postconditions:
RES.length == rank()

iterator

java.util.ListIterator iterator()
Returns an iterator over all coefficients (up to degree).


apply

java.lang.Object apply(java.lang.Object a)
Evaluate this polynomial at a. Using the "Einsetzungshomomorphismus" from the universal mapping property.

Specified by:
apply in interface Function
Parameters:
a - the index embedding a:S→(E,⋅), encoded as a Function<S,E>, that determines to which element a(s) to map the index s∈S.
With S=Nn a can also be encoded as a Vector<E> a∈En≅ENn.
Returns:
f(a) = f((Xk)k)|(Xk)k=a.

add

Polynomial add(Polynomial b)

subtract

Polynomial subtract(Polynomial b)

multiply

Polynomial multiply(Polynomial b)
Multiplies two polynomials.

Returns:
(∑s∈S αs·ι(s))⋅(∑s∈S βs·ι(s)) = ∑s∈S (∑t⋅u=s αt βu)·ι(s) = ∑s∈S αs·(∑t∈S βt·ι(t))⋅ι(s) = ∑s,t∈Ss βt)·(ι(s)⋅ι(t))

Orbital library
1.3.0: 11 Apr 2009

Copyright © 1996-2009 André Platzer
All Rights Reserved.