Post a reply
Username:
Note:If not registered, provide any username. For more comfort, register here.
Subject:
Message body:
Enter your message here, it may contain no more than 60000 characters. 

Smilies
:D :) :( :o :shock: :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen:
Font size:
Font colour
Options:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Confirmation of post
To prevent automated posts the board requires you to enter a confirmation code. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.
Confirmation code:
Enter the code exactly as it appears. All letters are case insensitive, there is no zero.
   

Topic review - singclap_pmod and singclap_pdivide with integer coefficients
Author Message
  Post subject:  Re: singclap_pmod and singclap_pdivide with integer coefficients  Reply with quote
We ended up using `p_Divide` and it seems to work. Thank you :)
Post Posted: Sun Jul 29, 2018 6:38 pm
  Post subject:  Re: singclap_pmod and singclap_pdivide with integer coefficients  Reply with quote
The division in factory is a division for polynomials over the rationals
(and over Z/p). It is fine to use it for polynomials over Z as long as the results are
the same, but it fails for example for (3x+3)/(2x+2): factory returns in this case 3/2
which gets converted to 3, which is obviously wrong.

One possible solution would be to use p_Divide,
which uses singclap_pdivide (polynomials over Z/p, Q) resp. idLift (otherwise).
p_Divide(p,q) for polynomials over Z will return p/q if p is divisible by q, 0 otherwise.

Another possibility would be to use factory (via a modified singclap_pdivide)
and check the result for rational coefficients.

If one is sure p is divisible by q (like computation of gcd,lcm),
the simplest solution would be,
to change singclap_pdivide and use it ONLY in this case:
Code:
@@ -564,14 +564,14 @@ poly singclap_pdivide ( poly f, poly g, const ring r )
{
   poly res=NULL;
   On(SW_RATIONAL);
-  if (rField_is_Zp(r) || rField_is_Q(r)
+  if (rField_is_Zp(r) || rField_is_Q(r) || rField_is_Z(r)
   || (rField_is_Zn(r)&&(r->cf->convSingNFactoryN!=ndConvSingNFactoryN)))
   {
+    if (rField_is_Z(r)) Off(SW_RATIONAL);
     setCharacteristic( rChar(r) );
     CanonicalForm F( convSingPFactoryP( f,r ) ), G( convSingPFactoryP( g,r ) );
     res = convFactoryPSingP( F / G,r );
   }

Post Posted: Wed Jul 25, 2018 12:26 pm
  Post subject:  singclap_pmod and singclap_pdivide with integer coefficients  Reply with quote
Hi!

The removal[1] of support for integer coefficients in `singclap_pmod` and `singclap_pdivide` with integer coefficients currently blocks[2] using the latest singular with sage.

We were using that in some places, for example computing `gcd` and `lcm` of two polynomials. We're thinking about different ways to work around this (see the comments in the ticket[2]. Could you expand on the reasoning of the removal? Do you maybe have suggestions on how to fix the problem with sage?


(apparently I'm "not allowed to post URLs")

[1] github DOT com/Singular/Sources/commit/4c1e770238d949fb0c7debc00998d507df876751
[2] trac.sagemath DOT org/ticket/24735#comment:4
Post Posted: Tue Jul 24, 2018 2:25 pm


It is currently Fri May 13, 2022 11:00 am
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group