=================================================================== RCS file: /home/cvs/OpenXM/src/asir-doc/parts/builtin/misc.texi,v retrieving revision 1.3 retrieving revision 1.25 diff -u -p -r1.3 -r1.25 --- OpenXM/src/asir-doc/parts/builtin/misc.texi 1999/12/21 02:47:33 1.3 +++ OpenXM/src/asir-doc/parts/builtin/misc.texi 2018/03/29 02:48:36 1.25 @@ -1,4 +1,4 @@ -@comment $OpenXM$ +@comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/misc.texi,v 1.24 2018/03/28 07:44:06 takayama Exp $ \BJP @node $B$=$NB>(B,,, $BAH$_9~$_H!?t(B @section $B$=$NB>(B @@ -15,6 +15,9 @@ * help:: * time:: * cputime tstart tstop:: +* timer:: +* currenttime:: +* sleep:: * heap:: * version:: * shell:: @@ -35,6 +38,12 @@ @item ctrl("@var{switch}"[,@var{obj}]) \JP :: $B4D6-@_Dj(B \EG :: Sets the value of @var{switch}. +@item ctrl() +\JP :: $B4D6-$NI=<((B +\EG :: Show the values of @var{switch}'s. +@item ctrl(|desc=1) +JP :: $B4D6-$*$h$S$=$NC;$$@bL@$NI=<((B +\EG :: Show the values of @var{swtich}'s and short descriptions @end table @table @var @@ -72,7 +81,7 @@ on $B$N;~$OI8=`F~NO$r7+$jJV$7$F=PNO$7(B, off $B$N;~ @code{output} $B%3%^%s%I$rMQ$$$k:]$KM-8z$G$"$k(B. @item bigfloat on $B$N;~(B, $BF~NO$5$l$?IbF0>.?t$O(B @b{bigfloat} $B$KJQ49$5$l(B, $BIbF0>.?t1i;;$O(B -@b{PARI} (@xref{pari}) $B$K$h$j9T$o$l$k(B. $B%G%U%)%k%H$NM-8z7e?t$O(B 9 $B7e$G$"$k(B. +@b{PARI} (@ref{pari}) $B$K$h$j9T$o$l$k(B. $B%G%U%)%k%H$NM-8z7e?t$O(B 9 $B7e$G$"$k(B. $BM-8z7e?t$rA}$d$7$?$$;~$K$O(B @code{setprec()} $B$rMQ$$$k(B. off $B$N;~(B, $BF~NO$5$l$?IbF0>.?t$O(B, $BG\@:EYIbF0>.?t$KJQ49$5$l$k(B. @cindex PARI @@ -83,17 +92,58 @@ off $B$N;~(B, $BF~NO$5$l$?IbF0>.?t$O(B, $BG\@:EYI @xref{$B%3%^%s%I%i%$%s%*%W%7%g%s(B}. @item verbose on $B$N;~(B, $BH!?t$N:FDj5A;~$K%a%C%;!<%8$rI=<($9$k(B. +@item quiet_mode +1 $B$N$H$-(B, $B5/F0;~$KCx:n8"I=<($r9T$o$J$$(B. +@xref{$B%3%^%s%I%i%$%s%*%W%7%g%s(B}. +@item prompt +0 $B$N$H$-%W%m%s%W%H$rI=<($7$J$$(B. 1 $B$N$H$-I8=`%W%m%s%W%H$rI=<((B. +C $B%9%?%$%k$N%U%)%^%C%HJ8;zNs$r$b$A$$$k$H%f!<%6Dj5A$N%W%m%s%W%H(B. +$BNc(B(asirgui $B$G$OIT2D(B): +@code{ ctrl("prompt","\033[32m[%d]:= \033[0m")} @item hex 1 $B$N$H$-(B, $B@0?t$O(B 0x $B$G;O$^$k(B 16 $B?J?t$H$7$FI=<($5$l$k(B. -1 $B$N$H$-(B, 16 $B?J?t$O(B, $B4V$K(B @samp{|} $B$r$O$5$s$G(B 8 $B7e$4$H$K6h@Z$C$FI=<($5$l$k(B. +@item real_digit +$BG\@:EYIbF0>.?t$NI=<($N7e?t$r;XDj$9$k(B. +@item double_output +1 $B$N$H$-(B, $BG\@:EYIbF0>.?t$O$D$M$K(B ddd.ddd $B$N7A$GI=<($5$l$k(B. +@item fortran_output +1 $B$N$H$-(B, $BB?9`<0$NI=<($,(B FORTRAN $B%9%?%$%k$K$J$k(B. $B$9$J$o$AQQ$,(B +@samp{^} $B$NBe$o$j$K(B @samp{**} $B$GI=$5$l$k(B. +($B%G%U%)%k%HCM$O(B 0.) @item ox_batch 1 $B$N$H$-(B, $BAw?.%P%C%U%!$,$$$C$Q$$$K$J$C$?;~$N$_<+F0E*$K(B flush. 0 $B$N$H$-(B, $B%G!<%?(B, $B%3%^%s%IAw?.Kh$K(B flush. ($B%G%U%)%k%HCM$O(B 0.) -@xref{$BJ,;67W;;(B} +@xref{$BJ,;67W;;(B}. @item ox_check 1 $B$N$H$-(B, $BAw?.%G!<%?$rAj$^$7$$(B. +($B%G%U%)%k%HCM$O(B 0.) +@xref{$BJ,;67W;;(B}. +@item plot_by_bigfloat +N $B$N$H$-(B, 10$B?J?t$G$N@:EY$r(B N $B7e$H$7$F(B, bigfloat $B$rMQ$$$F(B plot $B$r9T$&(B. +($B%G%U%)%k%H$G$O(B double $B$rMQ$$$F(B plot $B$r9T$&(B.) +@item evalef +0 $B$N;~(B eval $B$N0z?t$,I>2A$5$l$?$H$-$=$l0J>eI>2A$G$-$J$/$J$C$?>l9g(B, $BITDj85%j%9%H$K(B +$BEPO?$5$l$k(B. $B$?$H$($P(B eval(sin(0.1)) $B$HeI>2A$G$-$J$$$?$a(B +$BITDj85%j%9%H$KEPO?$5$l$k(B. +1 $B$N;~$O(B, $BEPO?$5$l$J$$(B. +$B=iEy4X?t$N?tCMI>2A$r7+$jJV$79T$&;~$O$3$N%*%W%7%g%s$r;HMQ$9$Y$-$G$"$k(B. +($B%G%U%)%k%HCM$O(B 0.) +@xref{ord} @end table \E \BEG @@ -128,7 +178,7 @@ This command will be useful when used with command @co If `on', floating operations will be done by @b{PARI} system with arbitrary precision floating point operations. Default precision is set to 9 digits. To change the precision, use -command @code{setprec}. +command @code{setbprec setprec}. If `off', floating operations will be done by @b{Asir}'s own floating operation routines with a fixed precision operations of standard floating double. @@ -141,30 +191,105 @@ and as a result, the frequency of garbage collection d @xref{Command line options}. @item verbose If `on' a warning messages is displayed when a function is redefined. +@item quiet_mode +If 1 is set, the copyright notice has been displayed at boot time. +@item prompt +If the value is 0, then prompt is not output. +If the value is 1, then the standard prompt is output. +Asir prompt can be customized by giving a C-style format string. +Example (for unix asir); +@code{ ctrl("prompt","\033[32m[%d]:= \033[0m")} + @item hex If 1 is set, integers are displayed as hexadecimal numbers with prefix -@code{0x}. if -1 is set, hexadecimal numbers are desplayed with +@code{0x}. if -1 is set, hexadecimal numbers are displayed with @samp{|} inserted at every 8 hexadecimal digits. +@item real_digit +Sets the number of digits used to print a floating double. +@item double_output +If set to 1, any floating double is printed in the style ddd.ddd. +@item fortran_output +If `on' polynomials are displayed in FORTRAN style. That is, a power +is represented by @samp{**} instead of @samp{^}. +The default value is 'off. @item ox_batch If 'on', the OpenXM send buffer is flushed only when the buffer is full. If 'off', the buffer is always flushed at each sending of data or command. The default value is 'off'. -@xref{Distributed computation} +@xref{Distributed computation}. @item ox_check If 'on' the check by mathcap is done before sending data. The default value is 'on'. -@xref{Distributed computation} +@xref{Distributed computation}. +@item ox_exchange_mathcap +If 'on' Asir forces the exchange of mathcaps at the communication startup. +The default value is 'on'. +@xref{Distributed computation}. +@item debug_window +When 1, a debug window pops up. +(The default value is 0.) +@item fake_ox_reset +When 1, the function ox_reset sends ox_shutdown insread of ox_reset +to servers which do not implement ox_reset protocol. +It is checked by the optional argument (the fourth argument) +containing the string "no_ox_reset" +of mathcap if ox_reset is implemented or not. +When you use ox_pari, it is recommended to set this flag 1. +(The default value is 0.) +@xref{Distributed computation}. +@item plot_by_bigfloat +If its value N is not equal to zero, then plotting is done by bigfloat. +(The double numbers are used as the default.) +@item evalef +When it is set to 0, the arguments of eval are registered to the list of +indeterminants when arguments are no longer to be simplified. +For example, when this flag is 0, sin(0.1) is registered to the list of +indeterminants when eval(sin(0.1)) is evaluated. +When it is set to 1, arguments are numerically evaluated. +It is recommended to turn on this option, when you repeat to evaluate elementary functions numerically. +(The default value is 0.) +@xref{ord} @end table \E @end itemize +@example +[1917] ctrl(); +[[oxpari_start,0],[oxpari_id,-1],... snip ....,[plot_by_bigfloat,0],[debug_plot,0]] +[1918] map(print,ctrl(|desc=1)); +[oxpari_start,0,oxpari starting function.] +[oxpari_id,-1,Id of ox_pari.] +... snip ... +[plot_by_bigfloat,0,If set to 1, computation is done by using MPFR bigfloat functions in ox_plot.] +[debug_plot,0,If set to 1, ox_plot is executed with the message window.] +@end example + @table @t \JP @item $B;2>H(B \EG @item References @fref{cputime tstart tstop}, @fref{output}, -@fref{pari}, @fref{setprec}, @fref{eval}. +@fref{pari}, @fref{setbprec setprec}, @fref{eval deval}. @end table +@noindent +ChangeLog +@itemize @bullet +@item @xref{ChangeLog} +\BEG +@item plot_by_bigfloat switch is added on 2017.09.04. The following files are changed. +\E +\BJP +@item plot_by_bigfloat $B%9%$%C%A$O(B 2017.09.04 $B$K2C$($i$l$?(B. $BJQ99$r(B \EG @node debug,,, Miscellaneouses @subsection @code{debug} @@ -195,7 +320,7 @@ the debugger is ready for commands. Typing in @code{quit} (Note! without a semicolon.) brings you to exit the debug-mode. @item -@xref{Debugger} for details. +See @ref{Debugger} for details. \E @end itemize @@ -313,6 +438,11 @@ return to toplevel $B$KF1L>$N%U%!%$%k$,$"$l$P(B, $B4D6-JQ?t(B @code{PAGER} $B$K@_Dj$5$l$F$$$k%3%^%s%I(B, $B$"$k$$$O(B @samp{more} $B$r8F$S=P$7$F$=$N%U%!%$%k$rI=<($9$k(B. @item +$B4D6-JQ?t(B @code{LANG} $B$,@_Dj$5$l$F$$$k>l9g(B, $B$=$NCM$,(B @code{"japan"} $B$^$?$O(B +@code{"ja_JP"} $B$G;O$^$k$J$i(B, @samp{help} $B$NBe$o$j$K(B @samp{help-ja} +$B$K$"$k%U%!%$%k$,I=<($5$l$k(B. $B$=$&$G$J$$>l9g(B, @samp{help-en} +$B$K$"$k%U%!%$%k$,I=<($5$l$k(B. +@item Windows $BHG$G$O(B, $B%3%^%s%I%i%$%s$+$i$N%X%k%W8F$S=P$7$OL$%5%]!<%H$@$,(B, $B%a%K%e!<$+$i(B HTML $B7A<0$N$b$N$r8F$S=P$7MQ$$$k$3$H$,$G$-$k(B. \E @@ -325,6 +455,12 @@ same name in the directory @samp{help} under standard the file is displayed by a command set to the environmental variable @code{PAGER} or else command @samp{more}. @item +If the @code{LANG} environment variable is set and its value +begins with @code{"japan"} or @code{"ja_JP"}, then the file in +@samp{help-ja} is displayed. If its value does not begin with +@code{"japan"} or @code{"ja_JP"}, then the file in @samp{help-en} +is displayed. +@item On Windows HTML-style help is available from the menu. \E @end itemize @@ -435,7 +571,7 @@ for a reply to interruption prompting are added to the @table @t \JP @item $B;2>H(B \EG @item References -@fref{cputime tstart tstop}. +@fref{cputime tstart tstop}, @fref{currenttime}. @end table \JP @node cputime tstart tstop,,, $B$=$NB>(B @@ -532,9 +668,137 @@ the debug-mode and execute @code{cputime(1)}. @table @t \JP @item $B;2>H(B \EG @item References -@fref{time}, @fref{ctrl}. +@fref{time}, @fref{currenttime}, @fref{ctrl}. @end table +\JP @node timer,,, $B$=$NB>(B +\EG @node timer,,, Miscellaneouses +@subsection @code{timer} +@findex timer + +@table @t +@item timer(@var{interval},@var{expr},@var{val}) +\JP :: $B@)8B;~4V$D$-$G7W;;$rl9g$=$NCM$rJV$9(B. $B;XDj;~4VFb$K7W;;$,40N;$7$J$+$C$?>l9g(B, $BBh(B 3 $B0z?t(B +$B$rJV$9(B. + +@item +$BBh(B 3 $B0z?t$NCM$O(B, $B7W;;$,40N;$7$?>l9g$NCM$H6hJL$G$-$kI,MW$,$"$k(B. +\E + +\BEG +@item +@code{timer()} computes an expression under the interval timer. +If the computation finishes within the specified interval, it +returns the result of the computation. Otherwise it returns the third +argument. + +@item +The third argument should be distinguishable from the result on success. +\E + +@end itemize + +@example +[0] load("cyclic"); +1 +[10] timer(10,dp_gr_main(cyclic(7),[c0,c1,c2,c3,c4,c5,c6],1,1,0),0); +interval timer expired (VTALRM) +0 +[11] +@end example + +\JP @node currenttime,,, $B$=$NB>(B +\EG @node currenttime,,, Miscellaneouses +@subsection @code{currenttime} +@findex currenttime + +@table @t +@item currenttime() +\JP :: $B8=:_;~9o$rl9g(B, time(3) $B$r8F$s$G$$$k$@$1$G$"$k(B. +\EG See also time(3) in UNIX manuals. + +@end itemize + +@example +[0] currenttime(); +1071639228 +[1] +@end example + +\JP @node sleep,,, $B$=$NB>(B +\EG @node sleep,,, Miscellaneouses +@subsection @code{sleep} +@findex sleep + +@table @t +@item sleep(@var{interval}) +\JP :: $B%W%m%;%9$Nl9g(B, usleep $B$r8F$s$G$$$k$@$1$G$"$k(B. +\EG See also usleep(3) in UNIX manuals. + +@end itemize + +@example +[0] sleep(1000); +1 +[1] +@end example + \JP @node heap,,, $B$=$NB>(B \EG @node heap,,, Miscellaneouses @subsection @code{heap} @@ -643,8 +907,9 @@ at the activation of @b{Asir}. (@xref{Command line opt @b{Asir} $B$N%P!<%8%g%s$r<+A3?t$GJV$9(B. \E \BEG -Command @code{version()} returns the version identification number -, an integer of @b{Asir} in use. +@item +Command @code{version()} returns the version identification number, +an integer of @b{Asir} in use. \E @end itemize @@ -688,16 +953,16 @@ as its return value. @example [0] shell("ls"); -alg da katsura ralg suit -algt defs.h kimura ratint test -alpi edet kimura3 robot texput.log -asir.o fee mfee sasa wang -asir_symtab gr mksym shira wang_data -base gr.h mp snf1 wt -bgk help msubst solve -chou hom p sp -const ifplot proot strum -cyclic is r sugar +alg da katsura ralg suit +algt defs.h kimura ratint test +alpi edet kimura3 robot texput.log +asir.o fee mfee sasa wang +asir_symtab gr mksym shira wang_data +base gr.h mp snf1 wt +bgk help msubst solve +chou hom p sp +const ifplot proot strum +cyclic is r sugar 0 [1] @end example @@ -723,7 +988,7 @@ cyclic is r sugar @item arg0 \JP $B%j%9%H(B, $B%Y%/%H%k(B, $B9TNs(B \EG list, vector or matrix -@item arg1, ... +@item arg1 ... \JP $BG$0U(B ($B;D$j$N0z?t(B) \EG arbitrary (the rest of arguments) @end table @@ -742,6 +1007,12 @@ cyclic is r sugar @var{arg0} $B$,%j%9%H(B, $B%Y%/%H%k(B, $B9TNs0J30$N>l9g(B, $BC1$K(B @var{arg0}, @var{arg1}, ... $B$r0z?t$H$7$F(B @var{function} $B$r8F$S=P$7$=$N(B $B7k2L$rJV$9(B. +@item +@code{map} $B$N0z?t(B @var{function} $B$GM?$($i$l$kH!?t$O(B, $BFbItE*$K$bH!?t$H(B +$B$7$F$rJ8;zNs%j%9%H$H$7$FJV$9(B. \EG :: Returns the list of function names currently defined. +@item mname +\JP $B%b%8%e!<%kL>(B +\EG a module name @end table @table @var @@ -787,7 +1061,8 @@ returns the value of @var{function}(@var{arg0},@var{ar \BJP @item $B8=:_Dj5A$5$l$F$$$kAH$_9~$_H!?t(B, $B%f!<%6Dj5AH!?t$NH!?tL>$rJ8;zNs%j%9%H(B -$B$H$7$FJV$9(B. +$B$H$7$FJV$9(B. $B%b%8%e!<%kL>$,;XDj$5$l$?>l9g(B, $B$=$N%b%8%e!<%k$GDj5A$5$l$F$$$k(B +$B4X?tL>$N$_$rJV$9(B. @item $B%7%9%F%`H!?t$N8e$K%f!<%6Dj5AH!?t$,B3$/(B. \E @@ -795,6 +1070,8 @@ returns the value of @var{function}(@var{arg0},@var{ar @item Returns the list of names of built-in functions and user defined functions currently defined. The return value is a list of character strings. +If a module name is specified, only the names of functions defined in the module +are returned. @item The names of built-in functions are followed by those of user defined functions. @@ -914,7 +1191,7 @@ of the install directory. @findex getopt @table @t -@item getopt(@var{key}) +@item getopt([@var{key}]) \JP :: $B%*%W%7%g%s$NCM$rJV$9(B. \EG :: Returns the value of an option. @end table @@ -933,6 +1210,11 @@ of the install directory. $B$,$"$k(B (@pxref{$B%*%W%7%g%s;XDj(B}). $B;XDj$5$l$?%*%W%7%g%s$r4X?tFb$G(B $Bl9g(B, @code{getopt()} $B$O(B +@code{[[key1,value1],[key2,value2],...]} $B$J$k%j%9%H$rJV$9(B. +$B$3$3$G(B, @code{key} $B$O4X?t8F$S=P$7;~$K;XDj$5$l$?%*%W%7%g%s(B, @code{value} +$B$O$=$NCM$G$"$k(B. +@item $B4X?t8F$S=P$7$N:]$K(B @var{key} $B$,%*%W%7%g%s$H$7$F;XDj$5$l$F$$$k(B $B>l9g$K$O(B, $B$=$NCM$rJV$9(B. $B$b$7;XDj$,$J$$>l9g$K$O(B, VOID $B7?%*%V%8%'%/%H(B ($B7?<1JL;R(B -1) $B$rJV$9(B. @code{getopt()} $B$,JV$7$?CM$N7?$r(B @code{type()} @@ -954,6 +1236,12 @@ must be equal to that in the declaration of the functi A function with indefinite number of arguments can be realized by using @var{options} (@pxref{option}). The value of a specified option is retrieved by @code{getopt}. +@item +If @code{getopt()} is called with no argument, then it returns a list +@code{[[key1,value1],} @code{[key2,value2],@dots{}]}. +In the list, each @code{key} +is an option which was specified when the function executing @code{getopt} +was invoked, and @code{value} is the value of the option. @item If an option @var{key} is specified upon a function call, @code{getopt} return the value of the option. If such an option is not specified,