fieker-DuValspielwiese
Last change
on this file since a1ef3a2 was
f16c7da,
checked in by Oleksandr Motsak <motsak@…>, 12 years ago
|
fix the test Manual/laguerre_solve.tst to work in SW and legacy Singular
CHG: in the legacy Singular (real, ??, i) is a (real) complex (!) field with parameter i (but not in SW!?)
TODO: needs to be clarified in documentation!!!
|
-
Property mode set to
100644
|
File size:
627 bytes
|
Line | |
---|
1 | LIB "tst.lib"; tst_init(); |
---|
2 | LIB "solve.lib"; |
---|
3 | // Find all roots of an univariate polynomial using Laguerre's method: |
---|
4 | ring rs1= 0,(x,y),lp; |
---|
5 | poly f = 15x5 + x3 + x2 - 10; |
---|
6 | // 10 digits precision |
---|
7 | laguerre_solve(f,10); |
---|
8 | // Now with complex coefficients, |
---|
9 | // internal precision is 30 digits (default) |
---|
10 | printlevel=2; |
---|
11 | ring rsc= (complex,10,i),x,lp; |
---|
12 | poly f = (15.4+i*5)*x^5 + (25.0e-2+i*2)*x^3 + x2 - 10*i; |
---|
13 | list l = laguerre_solve(f); |
---|
14 | l; |
---|
15 | // check result, value of substituted polynomial should be near to zero |
---|
16 | // remember that l contains a list of strings |
---|
17 | // in the case of a different ring |
---|
18 | subst(f,x,l[1]); |
---|
19 | subst(f,x,l[2]); |
---|
20 | tst_status(1);$ |
---|
Note: See
TracBrowser
for help on using the repository browser.