changeset 3444:fa0d84558faa

[project @ 2000-01-17 08:40:39 by jwe]
author jwe
date Mon, 17 Jan 2000 08:40:41 +0000
parents bf22deaf04ed
children c3eed8ac845a
files doc/interpreter/arith.txi scripts/specfun/betai.m scripts/specfun/gammai.m src/ChangeLog src/DLD-FUNCTIONS/betainc.cc src/DLD-FUNCTIONS/gammainc.cc
diffstat 6 files changed, 59 insertions(+), 67 deletions(-) [+]
line wrap: on
line diff
--- a/doc/interpreter/arith.txi
+++ b/doc/interpreter/arith.txi
@@ -164,7 +164,7 @@
 
 @DOCSTRING(beta)
 
-@DOCSTRING(betai)
+@DOCSTRING(betainc)
 
 @DOCSTRING(bincoeff)
 
@@ -176,7 +176,7 @@
 
 @DOCSTRING(gamma)
 
-@DOCSTRING(gammai)
+@DOCSTRING(gammainc)
 
 @DOCSTRING(lgamma)
 
--- a/scripts/specfun/betai.m
+++ b/scripts/specfun/betai.m
@@ -17,31 +17,10 @@
 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 
-## -*- texinfo -*-
-## @deftypefn {Mapping Function} {} betai (@var{a}, @var{b}, @var{x})
-## Return the incomplete Beta function,
-## @iftex
-## @tex
-## $$
-##  \beta (a, b, x) = B (a, b)^{-1} \int_0^x t^{(a-z)} (1-t)^{(b-1)} dt.
-## $$
-## @end tex
-## @end iftex
-## @ifinfo
+## This function is provided for compatibility with older versions of
+## Octave.  New programs should use betainc instead.
 ##
-## @smallexample
-##                                     x
-##                                    /
-## betai (a, b, x) = beta (a, b)^(-1) | t^(a-1) (1-t)^(b-1) dt.
-##                                    /
-##                                 t=0
-## @end smallexample
-## @end ifinfo
-##
-## If x has more than one component, both @var{a} and @var{b} must be
-## scalars.  If @var{x} is a scalar, @var{a} and @var{b} must be of
-## compatible dimensions.
-## @end deftypefn
+## betai (a, b, x) is the same as betainc (x, a, b).
 
 ## Author: jwe
 ## Created: 30 Jan 1998
--- a/scripts/specfun/gammai.m
+++ b/scripts/specfun/gammai.m
@@ -17,34 +17,10 @@
 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 
-## -*- texinfo -*-
-## @deftypefn {Mapping Function} {} gammai (@var{a}, @var{x})
-## Computes the incomplete gamma function,
-## @iftex
-## @tex
-## $$
-##  \gamma (a, x) = {\displaystyle\int_0^x e^{-t} t^{a-1} dt \over \Gamma (a)}
-## $$
-## @end tex
-## @end iftex
-## @ifinfo
+## This function is provided for compatibility with older versions of
+## Octave.  New programs should use gammainc instead.
 ##
-## @smallexample
-##                               x
-##                     1        /
-## gammai (a, x) = ---------    | exp (-t) t^(a-1) dt
-##                 gamma (a)    /
-##                           t=0
-## @end smallexample
-## @end ifinfo
-##
-## If @var{a} is scalar, then @code{gammai (@var{a}, @var{x})} is returned
-## for each element of @var{x} and vice versa.
-##
-## If neither @var{a} nor @var{x} is scalar, the sizes of @var{a} and
-## @var{x} must agree, and @var{gammai} is applied element-by-element.
-## @end deftypefn
-## @seealso{gamma and lgamma}
+## gammai (a, x) is the same as gammainc (x, a).
 
 ## Author: jwe
 ## Created: 30 Jan 1998
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,7 @@
 2000-01-17  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
+	* DLD-FUNCTIONS/gammainc.cc (Fgammainc): Texinfoize doc string.
+
 	* DLD-FUNCTIONS/minmax.cc (Fmax, Fmin): Texinfoize doc strings.
 
 	* pt-plot.cc (Fgraw, Fgset, Fgshow, Vgnuplot_command_plot, 
--- a/src/DLD-FUNCTIONS/betainc.cc
+++ b/src/DLD-FUNCTIONS/betainc.cc
@@ -33,13 +33,31 @@
 #include "utils.h"
 
 DEFUN_DLD (betainc, args, ,
-  "betainc (x, a, b)\n\
-\n\
-Compute the incomplete beta function\n\
+  "-*- texinfo -*-\n\
+@deftypefn {Mapping Function} {} betainc (@var{x}, @var{a}, @var{b})\n\
+Return the incomplete Beta function,\n\
+@iftex\n\
+@tex\n\
+$$\n\
+ \\beta (a, b, x) = B (a, b)^{-1} \\int_0^x t^{(a-z)} (1-t)^{(b-1)} dt.\n\
+$$\n\
+@end tex\n\
+@end iftex\n\
+@ifinfo\n\
 \n\
-  betainc(x,a,b) = beta(a,b)^(-1) \\int_0^x t^(a-1) (1-t)^(b-1) dt\n\
+@smallexample\n\
+                                    x\n\
+                                   /\n\
+betai (a, b, x) = beta (a, b)^(-1) | t^(a-1) (1-t)^(b-1) dt.\n\
+                                   /\n\
+                                t=0\n\
+@end smallexample\n\
+@end ifinfo\n\
 \n\
-The sizes of x, a, and b must agree.")
+If x has more than one component, both @var{a} and @var{b} must be\n\
+scalars.  If @var{x} is a scalar, @var{a} and @var{b} must be of\n\
+compatible dimensions.\n\
+@end deftypefn")
 {
   octave_value retval;
 
--- a/src/DLD-FUNCTIONS/gammainc.cc
+++ b/src/DLD-FUNCTIONS/gammainc.cc
@@ -33,17 +33,34 @@
 #include "utils.h"
 
 DEFUN_DLD (gammainc, args, ,
-  "gammainc (x, a)\n\
-\n\
-Compute the incomplete gamma function\n\
-\n\
-  gammainc(x,a) = (\\int_0^x exp(-t) t^(a-1) dt) / gamma(a).\n\
+  "-*- texinfo -*-
+@deftypefn {Mapping Function} {} gammainc (@var{x}, @var{a})\n\
+Computes the incomplete gamma function,\n\
+@iftex\n\
+@tex\n\
+$$\n\
+ \\gamma (a, x) = {\\displaystyle\\int_0^x e^{-t} t^{a-1} dt \\over \\Gamma (a)}\n\
+$$\n\
+@end tex\n\
+@end iftex\n\
+@ifinfo\n\
 \n\
-If a is scalar, then gammainc(x,a) is returned for each element of x\n\
-and vice versa.\n\
+@smallexample\n\
+                              x\n\
+                    1        /\n\
+gammainc (a, x) = ---------    | exp (-t) t^(a-1) dt\n\
+                gamma (a)    /\n\
+                          t=0\n\
+@end smallexample\n\
+@end ifinfo\n\
 \n\
-If neither a nor x is scalar, the sizes of a and x must agree, and\n\
-gammainc is applied for corresponding elements of x and a.")
+If @var{a} is scalar, then @code{gammainc (@var{a}, @var{x})} is returned\n\
+for each element of @var{x} and vice versa.\n\
+\n\
+If neither @var{a} nor @var{x} is scalar, the sizes of @var{a} and\n\
+@var{x} must agree, and @var{gammainc} is applied element-by-element.\n\
+@end deftypefn\n\
+@seealso{gamma and lgamma}")
 {
   octave_value retval;