kredel / java-algebra-system

Java Algebra System (JAS) Project
GNU General Public License v2.0
44 stars 9 forks source link

How to overwrite BigRational.gcd() ? #15

Open axkr opened 4 years ago

axkr commented 4 years ago

In the BigRational#gcd(a,b) method I would like to implement a GCD which gives the greatest rational number r for which all the a/r and b/r are integers and which should be used in the polynomial GCD methods.

Example:

GCD( 2/5, 3/7)  ==>  1/35

Is this possible? For example with a "global flag" which could be set to true?

See:

axkr commented 9 months ago

The same (derivated ?) behaviour can also be reproduced in

GreatestCommonDivisorAbstract<BigRational>#gcd(GenPolynomial<BigRational> P, GenPolynomial<BigRational> S)

GreatestCommonDivisorAbstract<BigRational>#lcm(GenPolynomial<BigRational> P, GenPolynomial<BigRational> S)

In Wolfram language