|
D.2.3.16 watchdog
Procedure from library general.lib (see general_lib).
- Return:
- Result of cmd, if the result can be computed in i seconds.
Otherwise the computation is interrupted after i seconds,
the string "Killed" is returned and the global variable
'watchdog_interrupt' is defined.
- Note:
- * the MP package must be enabled
* the current basering should not be watchdog_rneu, since
watchdog_rneu will be killed
* if there are variable names of the structure x(i) all
polynomials have to be put into eval(...) in order to be
interpreted correctly
* a second Singular process is started by this procedure
Example:
| LIB "general.lib";
ring r=0,(x,y,z),dp;
poly f=x^30+y^30;
watchdog(1,"factorize(eval("+string(f)+"))");
==> [1]:
==> _[1]=1
==> _[2]=x16+x14y2-x10y6-x8y8-x6y10+x2y14+y16
==> _[3]=x8-x6y2+x4y4-x2y6+y8
==> _[4]=x4-x2y2+y4
==> _[5]=x2+y2
==> [2]:
==> 1,1,1,1,1
watchdog(100,"factorize(eval("+string(f)+"))");
==> [1]:
==> _[1]=1
==> _[2]=x16+x14y2-x10y6-x8y8-x6y10+x2y14+y16
==> _[3]=x8-x6y2+x4y4-x2y6+y8
==> _[4]=x4-x2y2+y4
==> _[5]=x2+y2
==> [2]:
==> 1,1,1,1,1
|
|