Artifact 5e34590bffcf7cec164de26c4c6edd0179a1734d:
- File modules/math/combinatorics.man — part of check-in [6910e37294] at 2003-01-19 07:58:43 on branch trunk — * More doctools changes: Command [strong] is deprecated now. Added the command [copyright]. Went through all manpages to eliminate [strong]. Partial setting of copyright information, where known. * mkInstallScripts.tcl: * Makefile.in (install-libraries): Added module specific installation code. doctools: Install message catalogs and predefined formatting engines. textutil: Install hyphenation files. * Module doctools rewritten to make it a true package + application, instead of a pure application module. This means that this module now truly installs some functionality useable by other applications and packages. ---------------------------------------------------------------- * mpformats/fmt.html: Removed 'strong' formatting. The checker * mpformats/fmt.latex: warns if used and warnings requested, it * mpformats/fmt.nroff: now also redirects the command to 'emph'. * mpformats/fmt.wiki: The option -visualwarn (doctools, and * mpformats/fmt.null: mpexpand) renamed to -deprecated. Message * mpformats/fmt.list: 'visualmarkup' removed from the catalogs, * mpformats/c.msg: and 'depr_strong' added instead. * mpformats/en.msg: * mpformats/de.msg: * checker.tcl: * doctools.tcl: * mpexpand: * doctools.man: Updated, converted [strong] to better * dtformat.man: formatting commands. Ditto for all manpages * dtformatter.man: in tcllib containing 'strong'. 'strong' is now * mpexpand.man: not present anymore. * mpformats/_common.tcl: Applied a patch by Joe English adding the * mpformats/fmt.tmml: copyright information to the appropriate place in the TMML output. This also fixes a bug in c_get_copyright where an empty string resulted in a incomplete line being given to the formatter. * mpformats/fmt.html: Removed the phrase 'All rights reserved' * mpformats/fmt.latex: from the code, on recommendation by * mpformats/fmt.nroff: Joe English. * mpformats/fmt.wiki: * mpformats/fmt.html: Changed to display copyright information in * mpformats/fmt.latex: the conversion result itself and not only * mpformats/fmt.nroff: embedded in comments. * mpformats/fmt.wiki: * doctools.tcl: Added a new formatting command, * doctools.test: 'copyright', to declare/assign copyright * doctools.man: for manpages. Updated both documentation * dtformat.man: and testsuite. Extended the common code * checker.tcl: base with convenience methods for storing * api.tcl: and retrieving such information. The * mpformats/fmt.html: retrieval operation also implements the * mpformats/fmt.latex: logic giving the information in a manpage * mpformats/fmt.list: precedence over information coming from the * mpformats/fmt.nroff: processor. Updated all predefined engines * mpformats/fmt.null: to handle the new command. TMML done only * mpformats/fmt.tmml: partially, as I don't know where the copy- * mpformats/fmt.wiki: right has to go. * mpformats/_common.tcl: * mpformats/_html.tcl: * mpformats/_nroff.tcl: * mpexpand: * mpexpand: Moved format help into the package itself. * doctools.tcl: Changed the checker. Input syntax errors are not * checker.tcl: written to stderr anymore, but reported through * doctools.man: an standard tcl error. Warnings are collected and * doctools.test: can be queried after a formatting run. Made the generic engine more robust against failures in a formatting engine. Wrote documentation for the package. Extended the configuration method to be more standard. Wrote a testsuite. * mpexpand: Nearly complete rewrite of the system. * mpformats/fmt.html: The recognized input format was _not_ * mpformats/fmt.latex: changed. The main functionality was * mpformats/fmt.list: placed into a package, doctools. This * mpformats/fmt.nroff: package allows the creation of multiple * mpformats/fmt.null: formatter objects, to be used alone or * mpformats/fmt.tmml: together. The application 'mpexpand' was * mpformats/fmt.wiki: rewritten to use that package and is now * mpformats/_common.tcl: much simpler. The communication between * mpformats/_nroff.tcl: the various stages was made simpler, and * mpformats/_xml.tcl: one slave interpreter was dropped because * mpformats/_html.tcl: of this. It might be added back if its * api.tcl: existence proves to be beneficial. The * checker.tcl: API between main systen and formatter * doctools.tcl: engine was changed, consequently all * dtformatter.man: existing engines had to be updated. They were also made simpler, especially in the area of list handling, because of the validation done by the checker subsystem. The version number is now 1.0. (user: andreas_kupries size: 2478)
[comment {-*- tcl -*- doctools manpage}] [manpage_begin combinatorics n 4.2] [moddesc {Tcl Math Library}] [titledesc {Combinatorial functions in the Tcl Math Library}] [require Tcl 8.2] [require math [opt 1.2]] [description] [para] The [package math] package contains implementations of several functions useful in combinatorial problems. [section COMMANDS] [list_begin definitions] [call [cmd ::math::ln_Gamma] [arg z]] Returns the natural logarithm of the Gamma function for the argument [arg z]. [nl] The Gamma function is defined as the improper integral from zero to positive infinity of [example { t**(x-1)*exp(-t) dt }] [nl] The approximation used in the Tcl Math Library is from Lanczos, [emph {ISIAM J. Numerical Analysis, series B,}] volume 1, p. 86. For "[var x] > 1", the absolute error of the result is claimed to be smaller than 5.5*10**-10 -- that is, the resulting value of Gamma when [example { exp( ln_Gamma( x) ) }] is computed is expected to be precise to better than nine significant figures. [call [cmd ::math::factorial] [arg x]] Returns the factorial of the argument [arg x]. [nl] For integer [arg x], 0 <= [arg x] <= 12, an exact integer result is returned. [nl] For integer [arg x], 13 <= [arg x] <= 21, an exact floating-point result is returned on machines with IEEE floating point. [nl] For integer [arg x], 22 <= [arg x] <= 170, the result is exact to 1 ULP. [nl] For real [arg x], [arg x] >= 0, the result is approximated by computing [term Gamma(x+1)] using the [cmd ::math::ln_Gamma] function, and the result is expected to be precise to better than nine significant figures. [nl] It is an error to present [arg x] <= -1 or [arg x] > 170, or a value of [arg x] that is not numeric. [call [cmd ::math::choose] [arg {n k}]] Returns the binomial coefficient [term {C(n, k)}] [example { C(n,k) = n! / k! (n-k)! }] If both parameters are integers and the result fits in 32 bits, the result is rounded to an integer. [nl] Integer results are exact up to at least [arg n] = 34. Floating point results are precise to better than nine significant figures. [call [cmd ::math::Beta] [arg {z w}]] Returns the Beta function of the parameters [arg z] and [arg w]. [example { Beta(z,w) = Beta(w,z) = Gamma(z) * Gamma(w) / Gamma(z+w) }] Results are returned as a floating point number precise to better than nine significant digits provided that [arg w] and [arg z] are both at least 1. [list_end] [manpage_end]