Package edu.jas.ufd
Class FactorFactory
- java.lang.Object
-
- edu.jas.ufd.FactorFactory
-
- Direct Known Subclasses:
FactorFactory
public class FactorFactory extends java.lang.Object
Factorization algorithms factory. Select appropriate factorization engine based on the coefficient types.Usage: To create objects that implement the
Factorizationinterface use theFactorFactory. It will select an appropriate implementation based on the types of polynomial coefficients C. To obtain an implementation usegetImplementation(), it returns an object of a class which extends theFactorAbstractclass which implements theFactorizationinterface.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);
- Author:
- Heinz Kredel
- See Also:
Factorization.factors(edu.jas.poly.GenPolynomial P)
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFactorFactory()Protected factory constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FactorAbstract<BigInteger>getImplementation(BigInteger fac)Determine suitable implementation of factorization algorithm, case BigInteger.static FactorAbstract<BigRational>getImplementation(BigRational fac)Determine suitable implementation of factorization algorithms, case BigRational.static FactorAbstract<ModInteger>getImplementation(ModIntegerRing fac)Determine suitable implementation of factorization algorithm, case ModInteger.static FactorAbstract<ModInt>getImplementation(ModIntRing fac)Determine suitable implementation of factorization algorithm, case ModInteger.static FactorAbstract<ModLong>getImplementation(ModLongRing fac)Determine suitable implementation of factorization algorithm, case ModInteger.static <C extends GcdRingElem<C>>
FactorAbstract<AlgebraicNumber<C>>getImplementation(AlgebraicNumberRing<C> fac)Determine suitable implementation of factorization algorithms, case AlgebraicNumber<C>.static <C extends GcdRingElem<C>>
FactorAbstract<Complex<C>>getImplementation(ComplexRing<C> fac)Determine suitable implementation of factorization algorithms, case Complex<C>.static <C extends GcdRingElem<C>>
FactorAbstract<C>getImplementation(GenPolynomialRing<C> fac)Determine suitable implementation of factorization algorithms, case recursive GenPolynomial<C>.static <C extends GcdRingElem<C>>
FactorAbstract<C>getImplementation(RingFactory<C> fac)Determine suitable implementation of factorization algorithms, other cases.static <C extends GcdRingElem<C>>
FactorAbstract<Quotient<C>>getImplementation(QuotientRing<C> fac)Determine suitable implementation of factorization algorithms, case Quotient<C>.
-
-
-
Constructor Detail
-
FactorFactory
protected FactorFactory()
Protected factory constructor.
-
-
Method Detail
-
getImplementation
public static FactorAbstract<ModInteger> getImplementation(ModIntegerRing fac)
Determine suitable implementation of factorization algorithm, case ModInteger.- Parameters:
fac- ModIntegerRing.- Returns:
- factorization algorithm implementation.
-
getImplementation
public static FactorAbstract<ModLong> getImplementation(ModLongRing fac)
Determine suitable implementation of factorization algorithm, case ModInteger.- Parameters:
fac- ModIntegerRing.- Returns:
- factorization algorithm implementation.
-
getImplementation
public static FactorAbstract<ModInt> getImplementation(ModIntRing fac)
Determine suitable implementation of factorization algorithm, case ModInteger.- Parameters:
fac- ModIntegerRing.- Returns:
- factorization algorithm implementation.
-
getImplementation
public static FactorAbstract<BigInteger> getImplementation(BigInteger fac)
Determine suitable implementation of factorization algorithm, case BigInteger.- Parameters:
fac- BigInteger.- Returns:
- factorization algorithm implementation.
-
getImplementation
public static FactorAbstract<BigRational> getImplementation(BigRational fac)
Determine suitable implementation of factorization algorithms, case BigRational.- Parameters:
fac- BigRational.- Returns:
- factorization algorithm implementation.
-
getImplementation
public static <C extends GcdRingElem<C>> FactorAbstract<AlgebraicNumber<C>> getImplementation(AlgebraicNumberRing<C> fac)
Determine suitable implementation of factorization algorithms, case AlgebraicNumber<C>.- Type Parameters:
C- coefficient type, e.g. BigRational, ModInteger.- Parameters:
fac- AlgebraicNumberRing<C>.- Returns:
- factorization algorithm implementation.
-
getImplementation
public static <C extends GcdRingElem<C>> FactorAbstract<Complex<C>> getImplementation(ComplexRing<C> fac)
Determine suitable implementation of factorization algorithms, case Complex<C>.- Type Parameters:
C- coefficient type, e.g. BigRational, ModInteger.- Parameters:
fac- ComplexRing<C>.- Returns:
- factorization algorithm implementation.
-
getImplementation
public static <C extends GcdRingElem<C>> FactorAbstract<Quotient<C>> getImplementation(QuotientRing<C> fac)
Determine suitable implementation of factorization algorithms, case Quotient<C>.- Type Parameters:
C- coefficient type, e.g. BigRational, ModInteger.- Parameters:
fac- QuotientRing<C>.- Returns:
- factorization algorithm implementation.
-
getImplementation
public static <C extends GcdRingElem<C>> FactorAbstract<C> getImplementation(GenPolynomialRing<C> fac)
Determine suitable implementation of factorization algorithms, case recursive GenPolynomial<C>. UserecursiveFactors().- Type Parameters:
C- coefficient type, e.g. BigRational, ModInteger.- Parameters:
fac- GenPolynomialRing<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.
-
-