Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factorization stops after some time #18

Closed
axkr opened this issue Jan 2, 2021 · 4 comments
Closed

Factorization stops after some time #18

axkr opened this issue Jan 2, 2021 · 4 comments

Comments

@axkr
Copy link
Contributor

axkr commented Jan 2, 2021

Maybe related to #12 ?

This example stops (or gets very slow?) after random throughput.

Every run it uses the same polynomial example as above.

import java.util.SortedMap;

import edu.jas.poly.GenPolynomial;
import edu.jas.poly.GenPolynomialRing;
import edu.jas.poly.TermOrder;
import edu.jas.ufd.FactorAbstract;
import edu.jas.ufd.FactorFactory;

public class TestFactor {

  public static void main(String[] args) { 
    String str =
        "-2*m1*m2*u1*u2+m1*m2*u2^2-m2^2*u2^2+2*m1*m2*u1*v2+2*m2^2*u2*v2-m1*m2*v2^2-m2^2*v2^2";

    String[] vars = new String[] {"m1", "m2", "u1", "u2", "v2"};
    GenPolynomialRing<edu.jas.arith.BigInteger> fac;
    fac =
        new GenPolynomialRing<edu.jas.arith.BigInteger>(
            edu.jas.arith.BigInteger.ZERO, vars.length, new TermOrder(TermOrder.INVLEX), vars);

    GenPolynomial<edu.jas.arith.BigInteger> poly = fac.parse(str);
    for (int i = 0; i < 100000; i++) {
      System.out.println("Run: " + i + " -" + poly.toString());
      FactorAbstract<edu.jas.arith.BigInteger> factorAbstract =
          FactorFactory.getImplementation(edu.jas.arith.BigInteger.ZERO);
      SortedMap<GenPolynomial<edu.jas.arith.BigInteger>, Long> map = factorAbstract.factors(poly);
      System.out.println("Factors: " + map.toString());
    }
  }
}
@kredel
Copy link
Owner

kredel commented Feb 1, 2021

With JAS 2.7.20 the situation has improved. Please keep an eye on it.

@axkr
Copy link
Contributor Author

axkr commented Feb 1, 2021

The problem seems to be still the same, if I run the TestFactor program?
Any option I must switch on?

@kredel
Copy link
Owner

kredel commented Feb 1, 2021

Yes for this example the problem is still there. Continue with searching ...

@kredel
Copy link
Owner

kredel commented Jul 2, 2021

After the latest improvements this problem did not occur again.

@kredel kredel closed this as completed Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants