=================================================================== RCS file: /home/cvs/OpenXM/src/asir-doc/parts/builtin/misc.texi,v retrieving revision 1.13 retrieving revision 1.28 diff -u -p -r1.13 -r1.28 --- OpenXM/src/asir-doc/parts/builtin/misc.texi 2003/08/22 00:44:57 1.13 +++ OpenXM/src/asir-doc/parts/builtin/misc.texi 2019/06/06 04:33:11 1.28 @@ -1,4 +1,4 @@ -@comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/misc.texi,v 1.12 2003/04/20 08:01:29 noro Exp $ +@comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/misc.texi,v 1.27 2019/03/29 01:57:46 noro Exp $ \BJP @node その他,,, 組み込み函数 @section その他 @@ -16,6 +16,8 @@ * time:: * cputime tstart tstop:: * timer:: +* currenttime:: +* sleep:: * heap:: * version:: * shell:: @@ -36,6 +38,12 @@ @item ctrl("@var{switch}"[,@var{obj}]) \JP :: 環境設定 \EG :: Sets the value of @var{switch}. +@item ctrl() +\JP :: 環境の表示 +\EG :: Show the values of @var{switch}'s. +@item ctrl(|desc=1) +\JP :: 環境およびその短い説明の表示 +\EG :: Show the values of @var{swtich}'s and short descriptions @end table @table @var @@ -59,54 +67,169 @@ @item スイッチは文字列として入力する. すなわちダブルクォートで囲む. @item -スイッチは次の通り. 以下で, on は 1, off は 0 を意味する. +スイッチは次の通り. + @table @code -@item cputime -on の時 CPU time および GC time を表示, off の時 表示しない. @code{cputime()} -を参照. -@code{ctrl("cputime",@var{onoff})} は @code{cputime(@var{onoff})} と同じである. -@item nez -EZGCD のアルゴリズムの切替え. デフォルトで 1 であり, とくに切替える必要 -はない. -@item echo -on の時は標準入力を繰り返して出力し, off の時は標準入力を繰り返さない. -@code{output} コマンドを用いる際に有効である. -@item bigfloat -on の時, 入力された浮動小数は @b{bigfloat} に変換され, 浮動小数演算は -@b{PARI} (@ref{pari}) により行われる. デフォルトの有効桁数は 9 桁である. -有効桁数を増やしたい時には @code{setprec()} を用いる. -off の時, 入力された浮動小数は, 倍精度浮動小数に変換される. -@cindex PARI @item adj ガーベッジコレクションの頻度の変更. 1 以上の有理数が指定できる. デフォルト値は 3. 1 に近い程, ガーベッジコレクションせずにヒープを 大きくとるようになる. 整数値はコマンドラインで指定できる. @xref{コマンドラインオプション}. -@item verbose -on の時, 函数の再定義時にメッセージを表示する. -@item hex -1 のとき, 整数は 0x で始まる 16 進数として表示される. -1 のとき, 16 進数は, -間に @samp{|} をはさんで 8 桁ごとに区切って表示される. -@item real_digit -倍精度浮動小数の表示の桁数を指定する. + +@item allow_laurent +1 の時, 単項式の指数に負の整数を許す. + +@item bigfloat +1 の時, 入力された浮動小数は @b{bigfloat} に変換され, 浮動小数演算は +@b{PARI} (@ref{pari}) により行われる. デフォルトの有効桁数は 9 桁である. +有効桁数を増やしたい時には @code{setprec()} を用いる. +0 の時, 入力された浮動小数は, 倍精度浮動小数に変換される. +@cindex PARI + +@item cputime +1 の時 CPU time および GC time を表示, 0 の時表示しない. @code{cputime()} +を参照. +@code{ctrl("cputime",@var{onoff})} は @code{cputime(@var{onoff})} と同じである. + +@item debug_plot +1 の時, @code{ox_plot} がメッセージウィンドウつきで起動される. + +@item debug_up +1の時, 1変数専用多項式環関数(@code{umul()}など)実行時にメッセージを表示する. + +@item debug_window +1 の時 debug_window がポップアップして開く. +(デフォルト値は 0.) + +@item diag_period +@code{nd_gr()}, @code{nd_gr_trace()} を斉次イデアルに対して実行する際, 途中で実行される中間基底間の相互簡約 +の頻度を指定する. 値が @code{n} なら, 新しく基底が @code{n}個生成されるたびに相互簡約が +実行される. + @item double_output -1 のとき, 倍精度浮動小数はつねに ddd.ddd の形で表示される. +1 の時, 倍精度浮動小数はつねに ddd.ddd の形で表示される. + +@item echo +1 の時は標準入力を繰り返して出力し, 0 の時は標準入力を繰り返さない. +@code{output} コマンドを用いる際に有効である. + +@item evalef +0 の時 eval の引数が評価されたときそれ以上評価できなくなった場合, 不定元リストに +登録される. たとえば eval(sin(0.1)) と実行すると sin(0.1) がそれ以上評価できないため +不定元リストに登録される. +1 の時は, 登録されない. +初等関数の数値評価を繰り返し行う時はこのオプションを使用すべきである. +(デフォルト値は 0.) +@xref{ord} + +@item error_in_timer +1 の時, タイマー終了時に通常のエラー処理が実行される. + +@item f4_nocheck +1の時, @code{nd_f4}, @code{nd_f4_trace} における行列の簡約をCRTで行う際に, 結果の +チェックを行わない. + +@item fake_ox_reset +@itemx no_ox_reset +1 のとき, ox_reset を実装してないサーバーには代わりに ox_shutdown を送信する. +ox_reset の実装の有無は mathcap の optional argument (第四引数) +に文字列 no_ox_reset が設定されているかどうかで判断する. +ox_pari を利用するときはこのフラグを1にしておくことが望ましい. +(デフォルト値は 0.) +@xref{分散計算}. + @item fortran_output -1 のとき, 多項式の表示が FORTRAN スタイルになる. すなわち冪が +1 の時, 多項式の表示が FORTRAN スタイルになる. すなわち冪が @samp{^} の代わりに @samp{**} で表される. (デフォルト値は 0.) + +@item hex +1 の時, 整数は 0x で始まる 16 進数として表示される. -1 のとき, 16 進数は, +間に @samp{|} をはさんで 8 桁ごとに区切って表示される. + +@item hideargs +1の時, 関数呼び出しを表示する際に引数が表示されない. + +@item loadpath +@code{ASIRLOADPATH} を上書きする. + +@item message +1 の時, @code{ox_asir}, @code{ox_plot} 実行時に開始メッセージを表示する. + +@item new_hensel +1 の時, 有理数体上の1変数多項式の因数分解において, 関数 @code{hensel2()} が用いられる. + +@item nez +EZGCD のアルゴリズムの切替え. デフォルトで 1 であり, とくに切替える必要 +はない. + +@item no_debug_on_error +1 の時, エラー時にデバッグモードに入らない. + +@item no_prompt +1の時, プロンプトが表示されない. + +@item outputstyle +1 の時, 行列, ベクトルが @code{mat(...)}, @code{vect(...)} の形で表示される. + @item ox_batch 1 のとき, 送信バッファがいっぱいになった時のみ自動的に flush. 0 のとき, データ, コマンド送信毎に flush. (デフォルト値は 0.) @xref{分散計算}. + @item ox_check 1 のとき, 送信データを相手プロセスが受け取れるかどうかチェックする. 0 のときしない. (デフォルト値は 1.) @xref{分散計算}. + @item ox_exchange_mathcap 1 のとき, OX server との接続開始時に, 自動的に mathcap の交換を行う. (デフォルト値は 1.) @xref{分散計算}. + +@item plot_by_bigfloat +N のとき, 10進数での精度を N 桁として, bigfloat を用いて plot を行う. +(デフォルトでは double を用いて plot を行う.) + +@item print_quote +quote データの表示方法を指定する. +0 の時, quote データは単に @code{<...quoted...>}と表示される. 1 の時, リスト形式で表示される. +2 の時, 自然な数式の形で表示される. + +@item prompt +0 のときプロンプトを表示しない. 1 のとき標準プロンプトを表示. +C スタイルのフォマット文字列をもちいるとユーザ定義のプロンプト. +例(asirgui では不可): +@code{ ctrl("prompt","\033[32m[%d]:= \033[0m")} + +@item quiet_mode +1 のとき, 起動時に著作権表示を行わない. +@xref{コマンドラインオプション}. + +@item real_binary +1の時, 倍精度浮動小数を2進表示する. + +@item real_digit +倍精度浮動小数の表示の桁数を指定する. + +@item show_crossref +1 の時, 関数定義を読み込む際に, クロスリファレンスが表示される. + +@item show_orderspec +1 の時, dp 系関数によるグレブナー基底計算関数に対する複合的な項順序の指定時に +その詳細を表示する. + +@item StrassenSize +Strassen-Winograd による行列の高速乗算アルゴリズム実行におけるパラメタの値を設定する. + +@item terse +1 の時, ユーザ定義 callback 実行時にメッセージを表示しない. + +@item weight_check +1 の時, nd 系関数によるグレブナー基底において, 指定された weight を用いたweight のoverflow チェックを行う. +@item verbose +1 の時, 函数の再定義時にメッセージを表示する. + @end table \E \BEG @@ -141,7 +264,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. @@ -154,6 +277,15 @@ 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 displayed with @@ -179,17 +311,74 @@ The default value is 'on'. 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 no_debug_on_error +When 1, asir or ox_asir do not get into the debug mode. +@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 参照 \EG @item References @fref{cputime tstart tstop}, @fref{output}, -@fref{pari}, @fref{setprec}, @fref{eval deval}. +@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 欠けていたスイッチの説明を追加した (2018.3.29). +@item plot_by_bigfloat スイッチは 2017.09.04 に加えられた. 変更を受けたファイルは下記のとおり. +\E +@item 1.54 ctrl.c, + 1.14 bf.c, + 1.75 tcpf.c, + 1.13 calc.c, + 1.36 if.c, + 1.25 ifplot.h, + 1.33 plotf.c +@end itemize + \JP @node debug,,, その他 \EG @node debug,,, Miscellaneouses @subsection @code{debug} @@ -339,8 +528,8 @@ return to toplevel あるいは @samp{more} を呼び出してそのファイルを表示する. @item 環境変数 @code{LANG} が設定されている場合, その値が @code{"japan"} または -@code{"ja_JP"} で始まるなら, @samp{help} の代わりに @samp{help-jp} -にあるファイルが表示される. そうでない場合, @samp{help-eg} +@code{"ja_JP"} で始まるなら, @samp{help} の代わりに @samp{help-ja} +にあるファイルが表示される. そうでない場合, @samp{help-en} にあるファイルが表示される. @item Windows 版では, コマンドラインからのヘルプ呼び出しは未サポートだが, @@ -357,8 +546,8 @@ the file is displayed by a command set to the environm @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-jp} is displayed. If its value does not begin with -@code{"japan"} or @code{"ja_JP"}, then the file in @samp{help-eg} +@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. @@ -471,7 +660,7 @@ for a reply to interruption prompting are added to the @table @t \JP @item 参照 \EG @item References -@fref{cputime tstart tstop}. +@fref{cputime tstart tstop}, @fref{currenttime}. @end table \JP @node cputime tstart tstop,,, その他 @@ -568,7 +757,7 @@ the debug-mode and execute @code{cputime(1)}. @table @t \JP @item 参照 \EG @item References -@fref{time}, @fref{ctrl}. +@fref{time}, @fref{currenttime}, @fref{ctrl}. @end table \JP @node timer,,, その他 @@ -579,9 +768,7 @@ the debug-mode and execute @code{cputime(1)}. @table @t @item timer(@var{interval},@var{expr},@var{val}) \JP :: 制限時間つきで計算を実行する. -\BEG -:: Compute an expression under the interval timer. -\E +\EG :: Compute an expression under the interval timer. @end table @table @var @@ -636,6 +823,71 @@ interval timer expired (VTALRM) [11] @end example +\JP @node currenttime,,, その他 +\EG @node currenttime,,, Miscellaneouses +@subsection @code{currenttime} +@findex currenttime + +@table @t +@item currenttime() +\JP :: 現在時刻を取得 +\EG :: Get current time. +@end table + +@table @var +@item return +\JP 1970年1月1日0時0分0秒からの経過秒数. +\EG UNIX time. +@end table + +@itemize @bullet + +@item +\JP @code{currenttime()} は現在時刻を返す. UNIX の場合, time(3) を呼んでいるだけである. +\EG See also time(3) in UNIX manuals. + +@end itemize + +@example +[0] currenttime(); +1071639228 +[1] +@end example + +\JP @node sleep,,, その他 +\EG @node sleep,,, Miscellaneouses +@subsection @code{sleep} +@findex sleep + +@table @t +@item sleep(@var{interval}) +\JP :: プロセスの実行を停止 +\EG :: Suspend computation for an interval. +@end table + +@table @var +@item return +1 + +@item interval +\JP 停止時間 (マイクロ秒) +\EG interval (micro second) +@end table + +@itemize @bullet + +@item +\JP @code{sleep()} は, プロセスの実行を停止する. UNIX の場合, usleep を呼んでいるだけである. +\EG See also usleep(3) in UNIX manuals. + +@end itemize + +@example +[0] sleep(1000); +1 +[1] +@end example + \JP @node heap,,, その他 \EG @node heap,,, Miscellaneouses @subsection @code{heap} @@ -744,8 +996,9 @@ at the activation of @b{Asir}. (@xref{Command line opt @b{Asir} のバージョンを自然数で返す. \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 @@ -843,6 +1096,12 @@ cyclic is r sugar @var{arg0} がリスト, ベクトル, 行列以外の場合, 単に @var{arg0}, @var{arg1}, ... を引数として @var{function} を呼び出しその 結果を返す. +@item +@code{map} の引数 @var{function} で与えられる函数は, 内部的にも函数と +して実装されていなければならない. そうでなければ parse error になる. +例えば @code{map} 自身や @code{car}, @code{cdr} などは内部的には函数で +はなく, Asir の文法におけるキーワードとして実装されている. したがって +@code{map} の引数に @code{map} をとることはできない. \E \BEG @item @@ -873,9 +1132,12 @@ returns the value of @var{function}(@var{arg0},@var{ar @findex flist @table @t -@item flist() +@item flist([mname]) \JP :: 現在定義されている函数名を文字列リストとして返す. \EG :: Returns the list of function names currently defined. +@item mname +\JP モジュール名 +\EG a module name @end table @table @var @@ -888,7 +1150,8 @@ returns the value of @var{function}(@var{arg0},@var{ar \BJP @item 現在定義されている組み込み函数, ユーザ定義函数の函数名を文字列リスト -として返す. +として返す. モジュール名が指定された場合, そのモジュールで定義されている +関数名のみを返す. @item システム函数の後にユーザ定義函数が続く. \E @@ -896,6 +1159,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.