
edu.jas.ufd.GreatestCommonDivisor Maven / Gradle / Ivy
The newest version!
/*
* $Id: GreatestCommonDivisor.java 3843 2011-12-29 11:56:02Z kredel $
*/
package edu.jas.ufd;
import java.util.List;
import java.io.Serializable;
import edu.jas.poly.GenPolynomial;
import edu.jas.structure.GcdRingElem;
/**
* Greatest common divisor algorithm interface.
* @param coefficient type
* @author Heinz Kredel
* @usage To create classes that implement this interface use the
* GreatestCommonDivisorFactory. It will select an appropriate
* implementation based on the types of polynomial coefficients CT.
*
*
* GreatestCommonDivisor<CT> engine = GCDFactory.<CT> getImplementation(cofac);
* c = engine.gcd(a, b);
*
*
* For example, if the coefficient type is BigInteger, the usage looks
* like
*
*
* BigInteger cofac = new BigInteger();
* GreatestCommonDivisor<BigInteger> engine = GCDFactory.getImplementation(cofac);
* c = engine.gcd(a, b);
*
*
* @see edu.jas.ufd.GCDFactory#getImplementation
*/
public interface GreatestCommonDivisor> extends Serializable {
/**
* GenPolynomial content.
* @param P GenPolynomial.
* @return cont(P).
*/
public GenPolynomial content(GenPolynomial P);
/**
* GenPolynomial primitive part.
* @param P GenPolynomial.
* @return pp(P).
*/
public GenPolynomial primitivePart(GenPolynomial P);
/**
* GenPolynomial greatest comon divisor.
* @param P GenPolynomial.
* @param S GenPolynomial.
* @return gcd(P,S).
*/
public GenPolynomial gcd(GenPolynomial P, GenPolynomial S);
/**
* GenPolynomial least comon multiple.
* @param P GenPolynomial.
* @param S GenPolynomial.
* @return lcm(P,S).
*/
public GenPolynomial lcm(GenPolynomial P, GenPolynomial S);
/**
* GenPolynomial resultant.
* The input polynomials are considered as univariate polynomials in the main variable.
* @param P GenPolynomial.
* @param S GenPolynomial.
* @return res(P,S).
* @throws UnsupportedOperationException if there is no implementation in the sub-class.
*/
public GenPolynomial resultant(GenPolynomial P, GenPolynomial S);
/**
* GenPolynomial co-prime list.
* @param A list of GenPolynomials.
* @return B with gcd(b,c) = 1 for all b != c in B and for all non-constant
* a in A there exists b in B with b|a. B does not contain zero or
* constant polynomials.
*/
public List> coPrime(List> A);
/**
* GenPolynomial test for co-prime list.
* @param A list of GenPolynomials.
* @return true if gcd(b,c) = 1 for all b != c in B, else false.
*/
public boolean isCoPrime(List> A);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy