Class SquarefreeFactory
java.lang.Object
edu.jas.ufd.SquarefreeFactory
Squarefree factorization algorithms factory. Select appropriate squarefree
factorization engine based on the coefficient types.
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);
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SquarefreeAbstract<BigInteger> Determine suitable implementation of squarefree factorization algorithm, case BigInteger.static SquarefreeAbstract<BigRational> Determine suitable implementation of squarefree factorization algorithms, case BigRational.static SquarefreeAbstract<ModInteger> Determine suitable implementation of factorization algorithm, case ModInteger.static SquarefreeAbstract<ModInt> Determine suitable implementation of factorization algorithm, case ModInt.static SquarefreeAbstract<ModLong> Determine suitable implementation of factorization algorithm, case ModLong.static <C extends GcdRingElem<C>>
SquarefreeAbstract<AlgebraicNumber<C>> getImplementation(AlgebraicNumberRing<C> fac) Determine suitable implementation of squarefree factorization algorithms, case AlgebraicNumber<C>.static <C extends GcdRingElem<C>>
SquarefreeAbstract<C> getImplementation(GenPolynomialRing<C> fac) Determine suitable implementation of squarefree factorization algorithms, case GenPolynomial<C>.static <C extends GcdRingElem<C>>
SquarefreeAbstract<C> getImplementation(RingFactory<C> fac) Determine suitable implementation of squarefree factorization algorithms, other cases.static <C extends GcdRingElem<C>>
SquarefreeAbstract<Quotient<C>> getImplementation(QuotientRing<C> fac) Determine suitable implementation of squarefree factorization algorithms, case Quotient<C>.protected static <C extends GcdRingElem<C>>
SquarefreeAbstract<C>
-
Field Details
-
logger
private static final org.apache.logging.log4j.Logger logger
-
-
Constructor Details
-
SquarefreeFactory
protected SquarefreeFactory()Protected factory constructor.
-
-
Method Details
-
getImplementation
Determine suitable implementation of factorization algorithm, case ModInteger.- Parameters:
fac- ModIntegerRing.- Returns:
- squarefree factorization algorithm implementation.
-
getImplementation
Determine suitable implementation of factorization algorithm, case ModLong.- Parameters:
fac- ModLongRing.- Returns:
- squarefree factorization algorithm implementation.
-
getImplementation
Determine suitable implementation of factorization algorithm, case ModInt.- Parameters:
fac- ModIntRing.- Returns:
- squarefree factorization algorithm implementation.
-
getImplementation
Determine suitable implementation of squarefree factorization algorithm, case BigInteger.- Parameters:
fac- BigInteger.- Returns:
- squarefree factorization algorithm implementation.
-
getImplementation
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.
-