changeset 12664:48b9e8344a03

Periodic merge of stable to default.
author Rik <octave@nomad.inbox5.com>
date Tue, 10 May 2011 22:31:24 -0700
parents 0e3d7ad937fe (current diff) 2c54fde0f397 (diff)
children 72e60cf50dce
files
diffstat 7 files changed, 45 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/mkoctfile.in
+++ b/mkoctfile.in
@@ -336,8 +336,8 @@
       incflags="$incflags -I."
       output_ext=".mex"
     ;;
-    -W*)
-      pass_on_options="$pass_on_options $1"
+    -W,*)
+      pass_on_options="$pass_on_options ${1:3}"
     ;;
     *)
       echo "mkoctfile: unrecognized argument $1" 1>&2
--- a/scripts/miscellaneous/mkoctfile.m
+++ b/scripts/miscellaneous/mkoctfile.m
@@ -51,12 +51,13 @@
 ## Add the run-time path to the link command.
 ##
 ## @item -Wl,@dots{}
-## Pass flags though the linker like "-Wl,-rpath=@dots{}".
+## Pass flags through the linker e.g. "-Wl,-rpath=@dots{}".
 ## The quotes are needed since commas are interpreted as command
 ## separators.
 ##
-## @item -W@dots{}
-## Pass flags though the compiler like "-Wa,OPTION".
+## @item -W,@dots{}
+## Pass flags through the compiler, e.g. "-W,-O2". The quotes are needed
+## since commas are interpreted as command separators.
 ##
 ## @item -c
 ## Compile but do not link.
--- a/scripts/specfun/betaln.m
+++ b/scripts/specfun/betaln.m
@@ -21,16 +21,17 @@
 ## Return the natural logarithm of the Beta function,
 ## @tex
 ## $$
-##  B (a, b) = \log {\Gamma (a) \Gamma (b) \over \Gamma (a + b)}.
+##  {\rm betaln} (a, b) = \ln (B (a,b)) \equiv \ln ({\Gamma (a) \Gamma (b) \over \Gamma (a + b)}).
 ## $$
 ## @end tex
 ## @ifnottex
 ##
 ## @example
-## betaln (a, b) = gammaln (a) + gammaln (b) - gammaln (a + b)
+## betaln (a, b) = log (beta (a, b))
 ## @end example
 ##
 ## @end ifnottex
+## calculated in a way to reduce the occurrence of underflow.
 ## @seealso{beta, betainc, gammaln}
 ## @end deftypefn
 
@@ -39,14 +40,18 @@
 ## Keywords: log beta special function
 
 function retval = betaln (a, b)
+
   if (nargin != 2)
     print_usage ();
   endif
 
   retval = gammaln (a) + gammaln (b) - gammaln (a + b);
+
 endfunction
 
-%!assert (betaln(3,4),log(beta(3,4)),eps)
+
+%!assert (betaln (3,4), log (beta(3,4)),eps);
 
-%!error (betaln(1.))
-%!error (betaln(1.,1.,1.))
+%% Test input validation
+%!error (betaln (1))
+%!error (betaln (1,2,3))
--- a/scripts/statistics/distributions/gampdf.m
+++ b/scripts/statistics/distributions/gampdf.m
@@ -48,7 +48,7 @@
     pdf (k) = NaN;
   endif
 
-  k = find ((x > 0) & (a > 0) & (a <= 1) & (b > 0));
+  k = find ((x >= 0) & (a > 0) & (a <= 1) & (b > 0));
   if (any (k))
     if (isscalar(a) && isscalar(b))
       pdf(k) = (x(k) .^ (a - 1)) ...
@@ -59,7 +59,7 @@
     endif
   endif
 
-  k = find ((x > 0) & (a > 1) & (b > 0));
+  k = find ((x >= 0) & (a > 1) & (b > 0));
   if (any (k))
     if (isscalar(a) && isscalar(b))
       pdf(k) = exp (- a .* log (b) + (a-1) .* log (x(k))
--- a/src/DLD-FUNCTIONS/betainc.cc
+++ b/src/DLD-FUNCTIONS/betainc.cc
@@ -35,10 +35,10 @@
 DEFUN_DLD (betainc, args, ,
   "-*- texinfo -*-\n\
 @deftypefn {Mapping Function} {} betainc (@var{x}, @var{a}, @var{b})\n\
-Return the incomplete Beta function,\n\
+Return the regularized incomplete Beta function,\n\
 @tex\n\
 $$\n\
- \\beta (x, a, b) = B (a, b)^{-1} \\int_0^x t^{(a-z)} (1-t)^{(b-1)} dt.\n\
+ I (x, a, b) = {1 \\over {B (a, b)}} \\int_0^x t^{(a-z)} (1-t)^{(b-1)} dt.\n\
 $$\n\
 @end tex\n\
 @ifnottex\n\
@@ -46,11 +46,12 @@
 \n\
 @smallexample\n\
 @group\n\
-                                      x\n\
-                                     /\n\
-betainc (x, a, b) = beta (a, b)^(-1) | t^(a-1) (1-t)^(b-1) dt.\n\
-                                     /\n\
-                                  t=0\n\
+@c spacing appears odd here, but is correct after Makeinfo\n\
+                                     x\n\
+                          1         /\n\
+betainc (x, a, b) = -----------    | t^(a-1) (1-t)^(b-1) dt.\n\
+                     beta (a, b)    /\n\
+                                 t=0\n\
 @end group\n\
 @end smallexample\n\
 \n\
--- a/src/load-save.cc
+++ b/src/load-save.cc
@@ -1455,6 +1455,8 @@
 (@var{v1}, @dots{}) must be specified as character strings.\n\
 \n\
 @table @code\n\
+@item -append\n\
+Append to the destination instead of overwriting.\n\
 @item -ascii\n\
 Save a single matrix in a text file without header or any other information.\n\
 \n\
--- a/src/mappers.cc
+++ b/src/mappers.cc
@@ -550,11 +550,12 @@
 \n\
 @example\n\
 @group\n\
-                         z\n\
-                        /\n\
+@c spacing appears odd here, but is correct after Makeinfo\n\
+                          z\n\
+                         /\n\
 erf (z) = (2/sqrt (pi)) | e^(-t^2) dt\n\
-                        /\n\
-                     t=0\n\
+                         /\n\
+                      t=0\n\
 @end group\n\
 @end example\n\
 \n\
@@ -607,7 +608,7 @@
 Compute the inverse error function, i.e., @var{y} such that\n\
 \n\
 @example\n\
-  erf(@var{y}) == @var{x}\n\
+  erf (@var{y}) == @var{x}\n\
 @end example\n\
 @seealso{erf, erfc, erfcx}\n\
 @end deftypefn")
@@ -644,7 +645,7 @@
 $1 - {\\rm erf} (z)$.\n\
 @end tex\n\
 @ifnottex\n\
-@code{1 - erf (@var{z})}.\n\
+@w{@code{1 - erf (@var{z})}}.\n\
 @end ifnottex\n\
 @seealso{erfcx, erf, erfinv}\n\
 @end deftypefn")
@@ -671,10 +672,16 @@
 @deftypefn {Mapping Function} {} erfcx (@var{z})\n\
 Compute the scaled complementary error function,\n\
 @tex\n\
-$z^2 (1 - {\\rm erf} (z))$.\n\
+$$\n\
+ e^{z^2} {\\rm erfc} (z) \\equiv e^{z^2} (1 - {\\rm erf} (z))\n\
+$$\n\
 @end tex\n\
 @ifnottex\n\
-@code{z^2*(1 - erf (@var{z}))}.\n\
+\n\
+@example\n\
+exp (z^2) * erfc (x)\n\
+@end example\n\
+\n\
 @end ifnottex\n\
 @seealso{erfc, erf, erfinv}\n\
 @end deftypefn")
@@ -879,7 +886,8 @@
 \n\
 @example\n\
 @group\n\
-             infinity\n\
+@c spacing appears odd here, but is correct after Makeinfo\n\
+              infinity\n\
              /\n\
 gamma (z) = | t^(z-1) exp (-t) dt.\n\
              /\n\