edu.jas.application
Class FactorFactory

java.lang.Object
  extended by edu.jas.ufd.FactorFactory
      extended by edu.jas.application.FactorFactory

public class FactorFactory
extends FactorFactory

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

Author:
Heinz Kredel
See Also:
Factorization.factors(edu.jas.poly.GenPolynomial P), FactorFactory.getImplementation(edu.jas.structure.RingFactory P)
Usage
To create objects that implement the Factorization interface use the FactorFactory. 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 FactorAbstract class which implements the Factorization interface.
 Factorization<CT> engine;
 engine = FactorFactory.<CT> getImplementation(cofac);
 c = engine.factors(a);
 
For example, if the coefficient type is BigInteger, the usage looks like
 BigInteger cofac = new BigInteger();
 Factorization<BigInteger> engine;
 engine = FactorFactory.getImplementation(cofac);
 Sm = engine.factors(poly);
 

Constructor Summary
protected FactorFactory()
          Protected factory constructor.
 
Method Summary
static
<C extends GcdRingElem<C> & Rational>
FactorAbstract<RealAlgebraicNumber<C>>
getImplementation(RealAlgebraicRing<C> fac)
          Determine suitable implementation of factorization algorithms, case RealAlgebraicNumber<C>.
static
<C extends GcdRingElem<C>>
FactorAbstract<C>
getImplementation(RingFactory<C> fac)
          Determine suitable implementation of factorization algorithms, other cases.
 
Methods inherited from class edu.jas.ufd.FactorFactory
getImplementation, getImplementation, getImplementation, getImplementation, getImplementation, getImplementation, getImplementation, getImplementation, getImplementation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FactorFactory

protected FactorFactory()
Protected factory constructor.

Method Detail

getImplementation

public static <C extends GcdRingElem<C> & Rational> FactorAbstract<RealAlgebraicNumber<C>> getImplementation(RealAlgebraicRing<C> fac)
Determine suitable implementation of factorization algorithms, case RealAlgebraicNumber<C>.

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

getImplementation

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

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