Opened 14 years ago

Closed 14 years ago

Last modified 21 months ago

#104 closed bug (fixed)

coeffs used with three arguments

Reported by: gorzelc@… Owned by: seelisch
Priority: minor Milestone: Release 3-1-0
Component: dontKnow Version:
Keywords: coeffs Cc: seelisch

Description

Here I recall a bug concernig coeff, communicated 10-10-08

4.) Tippfehler im Handbuch bei coeffs und falscher Eintrag bei coefs

im dritten Argument.

Singular/3-1-0/html/sing_177.htm#SEC218

5.1.11 coeffs:


" Purpose:
    develops each polynomial of the first argument, say J,
    as a univariate polynomial in the given ring_variable, say z,
    and returns the coefficients as a k x d matrix M, where: "
                                           -------

    d-1 = maximum z-degree of all occurring polynomials
      k = 1 if J is a polynomial,
      k = number of generators  if J is an ideal.

If J is a vector or a module this procedure is repeated for each component
and
the resulting matrices are appended.
The third argument is used to return the matrix T of coefficients such that
 matrix(J) = T*M.

Tippfehler im Text:

Es muss im Text "d x k matrix" heissen!!

Der Text sagt also, dass fuer ein Polynom der Rueckgabewert eine 1 x d Matrix ist,

Fehler ist jedoch, dass die Reihenfolge der Elemente in der Matrix T als drittes Argument in der falschen Reihenfolge vorliegt.

Die Elemente in T muessen aufsteigend von 1,..,z(d-1) sein, und nicht absteigend. In der vorliegenden Form ist nicht matrix(J) = T*M erfuellt.

Example

> ring r=0,(x,y,z),dp;
> poly f = x4+2x2+x3y4+y5+z7;
> matrix T;
> matrix M = coeffs(f,y,T);
> M;
M[1,1]=z7+x4+2x2       // dies ist eine d x 1 matrix !!
M[2,1]=0
M[3,1]=0
M[4,1]=0
M[5,1]=x3
M[6,1]=1


> T;                  // Reihenfolge verkehrt !!
T[1,1]=y5             // der Koeffizient von y5  ist 1 == M[6,1]
T[1,2]=y4
T[1,3]=y3
T[1,4]=y2
T[1,5]=y
T[1,6]=1

// Hiermit laesst sich nicht wie gewuenscht f rekonstruieren:

> T*M;
_[1,1]=y5z7+x4y5+2x2y5+x3y+1
> f;
x3y4+z7+y5+x4+2x2

> matrix(f) == T*M;
0

hannes wrote on 10-10-2008

4.) Tippfehler im Handbuch bei coeffs und falscher Eintrag bei coefs

im dritten Argument.

vertagt.

Gruss, Hans

This has not been fixed yet,

it seems that coeffs with three arguments has never been used.

Any occurence of coeffs in the libraries seems to use only two arguments:

gorzelc@linux:~/Desktop/Singular?/3-1-0/LIB> grep "coeffs(" *.lib |less

Change History (5)

comment:1 Changed 14 years ago by seelisch

Owner: changed from somebody to seelisch

comment:2 Changed 14 years ago by seelisch

Resolution: fixed
Status: newclosed

comment:3 in reply to:  2 Changed 14 years ago by gorzel

Resolution: fixed
Status: closedreopened

Replying to seelisch:

Okay, now the typo "kxd" is fixed and changed to "dxk".

But, is the bug concerning the matrix T as third argument also fixed ?

This is a problem, that only hannes can resolve.

comment:4 Changed 14 years ago by hannes

Resolution: fixed
Status: reopenedclosed

comment:5 in reply to:  4 Changed 14 years ago by gorzel

Cc: seelisch added

Replying to hannes:

Unfortunately, the bug changed, but is not fixed.

Not all the entries in T are in increasing order, the monomial 1=y0

comes by mistake as the last one, however it has to be the first.

Checked with the latest version of Singular:

ix86-Linux version 3-1-0 (3100-2009031116) Mar 11 2009 16:51:53

> ring r=0,(x,y,z),dp;
> poly f = x4+2x2+x3y4+y5+z7;
> matrix M = coeffs(f,y,T);
> T;
T[1,1]=y
T[1,2]=y2
T[1,3]=y3
T[1,4]=y4
T[1,5]=y5
T[1,6]=1     // <-- BUG ! This must be the first entry 
> T*M == f;
0

> // Another example with ideal as first argument

> ring r=0,(x,y,z),dp;
>  ideal I = x3y4+z7+y5+x4+2x2,x2y+y3;
>  matrix TT;
> matrix MM = coeffs(I,y);
>  print (MM);
z7+x4+2x2,0, 
0,        x2,
0,        0, 
0,        1, 
x3,       0, 
1,        0  
> matrix NN = coeffs(I,y,TT);
>  TT*NN;                   
_[1,1]=x3y5+yz7+x4y+2x2y+1
_[1,2]=x2y2+y4
> I;                  // I and TT*NN are not the same
I[1]=x3y4+z7+y5+x4+2x2
I[2]=x2y+y3
> TT;
TT[1,1]=y
TT[1,2]=y2
TT[1,3]=y3
TT[1,4]=y4
TT[1,5]=y5
TT[1,6]=1     // <-- BUG

@seelisch: Put an example of this kind for coeffs into the manual!

BTW.: Before trac was used, there were collected small testfile for the detected and resolved

bugs.It seems that this strategy is longer continued.

Note: See TracTickets for help on using tickets.