Opened 14 years ago
Closed 14 years ago
#222 closed bug (fixed)
enable again: division by number for integers
Reported by: | gorzel | Owned by: | seelisch |
---|---|---|---|
Priority: | major | Milestone: | 3-1-2 and higher |
Component: | singular-kernel | Version: | 3-1-1 |
Keywords: | Cc: |
Description
Could you restore the previous behaviour of "/" for integer and related coefficient field?
Division, canceling by content, and by inverses should be allowed as before. Only division by polynomials with / which lead to a crash, should be blocked. (For division by polynomials the command division works.)
Singular 3-1-1:
> ring rZ = integer,x,dp; > poly f = 4*(x+1)^2; > f; 4x2+8x+4 > f/1; ? not implemented for rings with rings as coeffients ? error occurred in or before STDIN line 4: ` f/1;` > f/4; ? not implemented for rings with rings as coeffients ? error occurred in or before STDIN line 5: ` f/4;` > f/(x+1); ? not implemented for rings with rings as coeffients ? error occurred in or before STDIN line 6: ` f/(x+1);` > division(f,x+1); [1]: _[1,1]=4x+4 [2]: _[1]=0 [3]: _[1,1]=1
The same for
ring r = (integer,6),x,dp; > poly f = 4*(x+1)^2; > f; 4x2+2x+4 > f/1; ? not implemented for rings with rings as coeffients ? error occurred in or before STDIN line 37: ` f/1;` > f/4; ? not implemented for rings with rings as coeffients ? error occurred in or before STDIN line 38: ` f/4;` > f/(x+1); ? not implemented for rings with rings as coeffients ? error occurred in or before STDIN line 39: ` f/(x+1);` > division(f,x+1); [1]: _[1,1]=4x+4 [2]: _[1]=0 [3]: _[1,1]=1
Singular 3-1-0
Singular for ix86-Linux version 3-1-0 (3100-2009041418) Apr 14 2009 18:24:38
> ring rZ = integer,x,dp; > poly f = 4*(x+1)^2; > f; 4x2+8x+4 > f/1; 4x2+8x+4 > f/4; // OK x2+2x+1 > (f+1)/4; // Also this behavior is Okay, see (*) below: x2+2x > division(f,x+1); [1]: _[1,1]=4x+4 [2]: _[1]=0 [3]: _[1,1]=1 > f/(x+1); // Only this had to be blocked error: no more memory System 772k:776k Appl 129k/492k Malloc 110k/0k Valloc 512k/492k Pages 23/105 Regions 1:1 halt 14
Ad (*) compare with the interpration of / as div without mod.
> ring r=0,x,dp; > poly f = 4x3+x2+2x+3; > f/x2; // OK 4x+1
> ring rZ6 = (integer,6),x,dp; // ** You are using coefficients rings which are not fields. // ** Please note that only limited functionality is available // ** for these coefficients. // ** // ** The following commands are meant to work: // ** - basic polynomial arithmetic // ** - std // ** - reduce > poly f = 4*(x+1)^2; > f; 4x2+2x+4 // OK > f/1; 4x2+2x+4 > f/4; // OK x2+1 > division(f,x+1); // OK [1]: _[1,1]=4x+4 [2]: _[1]=0 [3]: _[1,1]=1 > f/(x+1); // This had to be blocked Singular : signal 8 (v: 3100/2009041418): current line:>> f/(x+1);<< Segment fault/Bus error occurred at 83c3a83 because of 0 (r:1269630750) please inform the authors trying to restart...
------------------------------------------------------- Code to be copied:
ring rZ = integer,x,dp; poly f = 4*(x+1)^2; f; f/1; f/4; division(f,x+1); f/(x+1); ring rZ6 = (integer,6),x,dp; poly f = 4*(x+1)^2; f; f/1; f/4; division(f,x+1); f/(x+1);
Change History (2)
comment:1 Changed 14 years ago by
Component: | dontKnow → singular-kernel |
---|---|
Owner: | changed from somebody to seelisch |
comment:2 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
I enabled again the division over coefficient rings which are domains. (In the moment we have just one such ring, namely Z. Over such coefficient rings, division by single-term polynomials will now work again. If the divisor consists of two or more terms, the kernel code calls factorisation routines which have not been designed for the case of coefficient domains. In this case, we therefore display a warning and do not perform the division.) Here's a screen-dump of what I just compiled and what will be included in the next minor release; please reopen this ticket if this is not ok or enough:
$ ./Singular
FB Mathematik der Universitaet, D-67653 Kaiserslautern \ executing /cygdrive/c/Work/SINGULAR-Branches/SINGULAR-for-fixes/Singular/LIB/.singularrc
You are using coefficient rings which are not fields. Please note that only limited functionality is available for these coefficients. The following commands are meant to work: - basic polynomial arithmetic - std - syz - lift - reduce
4x2+8x+4
x2+2x+1
x
0
x+2
You are using coefficient rings which are not fields. Please note that only limited functionality is available for these coefficients. The following commands are meant to work: - basic polynomial arithmetic - std - syz - lift - reduce redefining rZ
x2y+2y-3
-2
y2+2y
y