edu.jas.ufd
Class SquarefreeFactory

java.lang.Object
  extended by edu.jas.ufd.SquarefreeFactory

public class SquarefreeFactory
extends java.lang.Object

Squarefree factorization algorithms factory. Select appropriate squarefree factorization engine based on the coefficient types.

Author:
Heinz Kredel
See Also:
Squarefree.squarefreeFactors(edu.jas.poly.GenPolynomial P)
Usage
To create objects that implement the Squarefree interface use the SquarefreeFactory. It will select an appropriate implementation based on the types of polynomial coefficients C. To obtain an implementation use getImplementation(), it returns an object of a class which extends the SquarefreeAbstract class which implements the Squarefree interface.
 Squarefree<CT> engine;
 engine = SquarefreeFactory.<CT> getImplementation(cofac);
 c = engine.squarefreeFactors(a);
 
For example, if the coefficient type is BigInteger, the usage looks like
 BigInteger cofac = new BigInteger();
 Squarefree<BigInteger> engine;
 engine = SquarefreeFactory.getImplementation(cofac);
 Sm = engine.sqaurefreeFactors(poly);
 

Constructor Summary
protected SquarefreeFactory()
          Protected factory constructor.
 
Method Summary
static
<C extends GcdRingElem<C>>
SquarefreeAbstract<AlgebraicNumber<C>>
getImplementation(AlgebraicNumberRing<C> fac)
          Determine suitable implementation of squarefree factorization algorithms, case AlgebraicNumber<C>.
static SquarefreeAbstract<BigInteger> getImplementation(BigInteger fac)
          Determine suitable implementation of squarefree factorization algorithm, case BigInteger.
static SquarefreeAbstract<BigRational> getImplementation(BigRational fac)
          Determine suitable implementation of squarefree factorization algorithms, case BigRational.
static
<C extends GcdRingElem<C>>
SquarefreeAbstract<C>
getImplementation(GenPolynomialRing<C> fac)
          Determine suitable implementation of squarefree factorization algorithms, case GenPolynomial<C>.
static SquarefreeAbstract<ModInteger> getImplementation(ModIntegerRing fac)
          Determine suitable implementation of factorization algorithm, case ModInteger.
static SquarefreeAbstract<ModLong> getImplementation(ModLongRing fac)
          Determine suitable implementation of factorization algorithm, case ModLong.
static
<C extends GcdRingElem<C>>
SquarefreeAbstract<Quotient<C>>
getImplementation(QuotientRing<C> fac)
          Determine suitable implementation of squarefree factorization algorithms, case Quotient<C>.
static
<C extends GcdRingElem<C>>
SquarefreeAbstract<C>
getImplementation(RingFactory<C> fac)
          Determine suitable implementation of squarefree factorization algorithms, other cases.
protected static
<C extends GcdRingElem<C>>
SquarefreeAbstract<C>
getImplementationPoly(GenPolynomialRing<C> fac)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SquarefreeFactory

protected SquarefreeFactory()
Protected factory constructor.

Method Detail

getImplementation

public static SquarefreeAbstract<ModInteger> getImplementation(ModIntegerRing fac)
Determine suitable implementation of factorization algorithm, case ModInteger.

Parameters:
fac - ModIntegerRing.
Returns:
squarefree factorization algorithm implementation.

getImplementation

public static SquarefreeAbstract<ModLong> getImplementation(ModLongRing fac)
Determine suitable implementation of factorization algorithm, case ModLong.

Parameters:
fac - ModLongRing.
Returns:
squarefree factorization algorithm implementation.

getImplementation

public static SquarefreeAbstract<BigInteger> getImplementation(BigInteger fac)
Determine suitable implementation of squarefree factorization algorithm, case BigInteger.

Parameters:
fac - BigInteger.
Returns:
squarefree factorization algorithm implementation.

getImplementation

public static SquarefreeAbstract<BigRational> getImplementation(BigRational fac)
Determine suitable implementation of squarefree factorization algorithms, case BigRational.

Parameters:
fac - BigRational.
Returns:
squarefree factorization algorithm implementation.

getImplementation

public static <C extends GcdRingElem<C>> SquarefreeAbstract<AlgebraicNumber<C>> getImplementation(AlgebraicNumberRing<C> fac)
Determine suitable implementation of squarefree factorization algorithms, case AlgebraicNumber<C>.

Type Parameters:
C - coefficient type, e.g. BigRational, ModInteger.
Parameters:
fac - AlgebraicNumberRing<C>.
Returns:
squarefree factorization algorithm implementation.

getImplementation

public static <C extends GcdRingElem<C>> SquarefreeAbstract<Quotient<C>> getImplementation(QuotientRing<C> fac)
Determine suitable implementation of squarefree factorization algorithms, case Quotient<C>.

Type Parameters:
C - coefficient type, e.g. BigRational, ModInteger.
Parameters:
fac - QuotientRing<C>.
Returns:
squarefree factorization algorithm implementation.

getImplementation

public static <C extends GcdRingElem<C>> SquarefreeAbstract<C> getImplementation(GenPolynomialRing<C> fac)
Determine suitable implementation of squarefree factorization algorithms, case GenPolynomial<C>.

Type Parameters:
C - coefficient type, e.g. BigRational, ModInteger.
Parameters:
fac - GenPolynomialRing<C>.
Returns:
squarefree factorization algorithm implementation.

getImplementationPoly

protected static <C extends GcdRingElem<C>> SquarefreeAbstract<C> getImplementationPoly(GenPolynomialRing<C> fac)

getImplementation

public static <C extends GcdRingElem<C>> SquarefreeAbstract<C> getImplementation(RingFactory<C> fac)
Determine suitable implementation of squarefree factorization algorithms, other cases.

Type Parameters:
C - coefficient type
Parameters:
fac - RingFactory<C>.
Returns:
squarefree factorization algorithm implementation.