[Pkg-octave-commit] rev 103 - in trunk/packages/octave-forge/debian: . patches
Rafael Laboissiere
rafael@costa.debian.org
Wed, 23 Feb 2005 15:39:13 +0100
Author: rafael
Date: 2005-02-23 15:39:12 +0100 (Wed, 23 Feb 2005)
New Revision: 103
Added:
trunk/packages/octave-forge/debian/patches/
trunk/packages/octave-forge/debian/patches/00list
trunk/packages/octave-forge/debian/patches/50_big-endian-rand-fix.dpatch
trunk/packages/octave-forge/debian/patches/50_extra-mex-configure-add.dpatch
Removed:
trunk/packages/octave-forge/debian/aurecord.1
trunk/packages/octave-forge/debian/lp.cc.patch_bug210907
trunk/packages/octave-forge/debian/tsacleanup.pl
Modified:
trunk/packages/octave-forge/debian/changelog
trunk/packages/octave-forge/debian/control
trunk/packages/octave-forge/debian/rules
Log:
Debian release octave-forge_2004.11.16-4
Deleted: trunk/packages/octave-forge/debian/aurecord.1
Modified: trunk/packages/octave-forge/debian/changelog
===================================================================
--- trunk/packages/octave-forge/debian/changelog 2005-02-23 09:10:12 UTC (rev 102)
+++ trunk/packages/octave-forge/debian/changelog 2005-02-23 14:39:12 UTC (rev 103)
@@ -1,13 +1,30 @@
octave-forge (2004.11.16-4) unstable; urgency=low
- NOT YET RELEASED !!!
-
+++ Changes by Rafael Laboissiere:
- * debian/control: Changed Maintainer to Debian Octave Group.
- * debian/changelog: Added variables for Emacs debian-changelog-mode.
+ * Rebuilt with Octave 2.1.65
+ * debian/control:
+ - Changed Maintainer to Debian Octave Group
+ - Bumped Build-Depends on octave2.1-headers to >= 2.1.65
+ - Build-Depend on dpatch
+ - Build-Depend on libreadline5-dev instead of libreadline4-dev
+ - Use automatically calculated variable ${octave:Depends}
+ * debian/rules:
+ - Include defs.make and use OCTDIR and MDIR variables
+ - Put programs in LOCALARCHLIBDIR instead LOCALVERARCHLIBDIR
+ - With the two changes above, we get rid of all versioned paths for
+ installed files
+ - In clean rule, remove several files that are automatically generated
+ by the upstream build, such that the .diff.gz file is clean
+ * Removed obsolete files in debian/: aurecord.1, lp.cc.patch_bug210907,
+ and tsacleanup.pl
+ * debian/changelog: Added variables for Emacs debian-changelog-mode
+ * debian/patches/: Added patches:
+ - 50_extra-mex-configure-add.dpatch: Add file extra/mex/configure.add
+ - 50_big-endian-rand-fix.dpatch: : Fix rand bug on some big-endian
+ architectures (taken from CVS at SourceForge)
- --
+ -- Debian Octave Group <pkg-octave-devel@lists.alioth.debian.org> Wed, 23 Feb 2005 14:52:46 +0100
octave-forge (2004.11.16-3) unstable; urgency=low
@@ -18,7 +35,7 @@
octave-forge (2004.11.16-2) unstable; urgency=low
- * extra/mex/configure.add: Added awk support from Sourceforge bug
+ * extra/mex/configure.add: Added awk support from Sourceforge bug
report number 1062239 with thanks to Dan McMahill (Closes: #281994)
-- Dirk Eddelbuettel <edd@debian.org> Thu, 18 Nov 2004 22:14:40 -0600
@@ -64,7 +81,7 @@
octave-forge (2004.09.09-1) unstable; urgency=low
* Upgraded to new upstream version released today
- * debian/control: Update both Builds-Depends and Depends to the
+ * debian/control: Update both Builds-Depends and Depends to the
matching and required Octave version 2.1.58 released a few days ago
-- Dirk Eddelbuettel <edd@debian.org> Thu, 9 Sep 2004 18:39:53 -0500
@@ -87,16 +104,16 @@
octave-forge (2004.02.12-8) unstable; urgency=low
- * Rebuild required by hdf5 library .so number change
+ * Rebuild required by hdf5 library .so number change
-- Dirk Eddelbuettel <edd@debian.org> Mon, 12 Apr 2004 16:22:34 -0500
octave-forge (2004.02.12-7) unstable; urgency=low
* main/plot/plot3.m: End for loop with endfor (Closes: #238583)
- * main/geometry/configure.add: Modify the qhull configuration test
+ * main/geometry/configure.add: Modify the qhull configuration test
program so that it no longer segfaults with libqhull5
- * main/geometry/{convhulln,delaunayn,voronoi}.cc: Change version
+ * main/geometry/{convhulln,delaunayn,voronoi}.cc: Change version
identifier declaration to `char *qh_version' to match libqhull5
* debian/control: Add libpng12-dev to Build-Depends
@@ -111,7 +128,7 @@
octave-forge (2004.02.12-5) unstable; urgency=low
* Rebuilt with Octave 2.1.57
- * main/comm/galois-def.h: Applied patch by John Eaton posted to the
+ * main/comm/galois-def.h: Applied patch by John Eaton posted to the
octave-bug list that adds definitions no longer in 2.1.57
-- Dirk Eddelbuettel <edd@debian.org> Fri, 12 Mar 2004 20:23:47 -0600
@@ -119,7 +136,7 @@
octave-forge (2004.02.12-4) unstable; urgency=low
* Rebuilt with Octave 2.1.56
- * debian/control: Enforcing stronger Depends on corresponding Octave
+ * debian/control: Enforcing stronger Depends on corresponding Octave
version which will ensure that if octave-forge is installed, an upgrade
of octave occurs only iff a matching octave-forge is available
@@ -139,8 +156,8 @@
octave-forge (2004.02.12-1) unstable; urgency=low
- * Upgraded to new upstream version released today
- * main/miscellaneous/Makefile: Added a few small corrections which
+ * Upgraded to new upstream version released today
+ * main/miscellaneous/Makefile: Added a few small corrections which
should hopefully overcome the build issues on alpha, hppa and ia64
that 2004.02.09 experienced with some of the xml*.c* files
@@ -149,7 +166,7 @@
octave-forge (2004.02.09-1) unstable; urgency=low
* New upstream CVS snapshot
-
+
* debian/rules: Applied patch by Teemu Ikonen needed for graceplot
-- Dirk Eddelbuettel <edd@debian.org> Mon, 9 Feb 2004 20:54:40 -0600
@@ -174,7 +191,7 @@
octave-forge (2004.01.18-1) unstable; urgency=low
- * Fresh CVS snapshot while octave2.1 is changing making octave-forge
+ * Fresh CVS snapshot while octave2.1 is changing making octave-forge
releases harder than usual to realize (Closes: #223955, #228188)
* debian/control: Updated to (Build-)Depends on octave2.1_2.1.52
* debian/rules: Small change to correct octave-config problem
@@ -225,20 +242,20 @@
octave-forge (2003.06.02-2) unstable; urgency=low
- * debian/control: Remove Build-Depends on libginac-dev for m68k and
+ * debian/control: Remove Build-Depends on libginac-dev for m68k and
mipsel as the package has not built there in ages, despite RC bugs
-- Dirk Eddelbuettel <edd@debian.org> Tue, 17 Jun 2003 20:18:24 -0500
octave-forge (2003.06.02-1) unstable; urgency=low
- * Upgraded to new upstream version released today
- * main/plot/gget.m: Contains improved version of patch (Closes: #194561)
+ * Upgraded to new upstream version released today
+ * main/plot/gget.m: Contains improved version of patch (Closes: #194561)
* debian/rules: After autogen.sh, run 'chmod 0755 configure' though
it remain mysterious why this is needed only on hppa (Closes: #192299)
- * debian/{rules,control}: Match settings used to successfully compile
+ * debian/{rules,control}: Match settings used to successfully compile
octave2.1_2.1.49 on all architectures: f2c on m68k, gcc 3.3 on hppa
- * debian/control: Bring ia64 Build-Depends in-line with others as
+ * debian/control: Bring ia64 Build-Depends in-line with others as
libginac-dev and libgmp3-dev are now universally available
* debian/control: (Build-)Depends on octave2.1 (>= 2.1.49)
* debian/control: Increase Standards-Version to 3.5.10
@@ -288,12 +305,12 @@
* Upgraded to new upstream version released today (Closes: #175798, #176895)
* debian/control: Build-Depends on gcc/g77/g++ (>= 3.2.2)
-
+
-- Dirk Eddelbuettel <edd@debian.org> Sat, 22 Feb 2003 13:06:20 -0600
octave-forge (2002.11.30-1) unstable; urgency=low
- * Upgraded to new upstream release
+ * Upgraded to new upstream release
-- Dirk Eddelbuettel <edd@debian.org> Sat, 30 Nov 2002 11:48:27 -0600
@@ -317,7 +334,7 @@
* Rebuilt using octave 2.1.40
* debian/control: Depends on octave2.1 (= 2.1.40)
* debian/control: Build-Depends s/xlib6g-dev/xlibs-dev/ (Closes: #170174)
-
+
-- Dirk Eddelbuettel <edd@debian.org> Thu, 28 Nov 2002 09:45:43 -0600
octave-forge (2002.05.09-6) unstable; urgency=low
@@ -354,15 +371,15 @@
octave-forge (2002.05.09-1) unstable; urgency=low
- * Upgraded to new upstream release
+ * Upgraded to new upstream release
-- Dirk Eddelbuettel <edd@debian.org> Sun, 13 Oct 2002 15:00:36 -0500
octave-forge (2002.04.23.cvs.1-1) unstable; urgency=low
- * This is really 2002.04.23.cvs-7, but because of #145526 and the
+ * This is really 2002.04.23.cvs-7, but because of #145526 and the
required scrubbing of the 0x0D character, "dpkg-source -x" and hence
- lintian could no longer deal with the old .orig.tar.gz. Katie didn't
+ lintian could no longer deal with the old .orig.tar.gz. Katie didn't
like me uploading a new .orig.tar.gz in revision -7, so here we go
with a new one. Because tsacleanup.pl has now been applied to the
upstream source, it is no longer called from debian/rules.
@@ -388,7 +405,7 @@
* debian/control: Move the ${shlibs:Depends} to Suggests. As we
Depends: octave21, the truly required C and C++ libs are already
covered but we do not want to Depends: on the dynamic library for
- some useful, but non-core, functionality.
+ some useful, but non-core, functionality.
-- Dirk Eddelbuettel <edd@debian.org> Sun, 28 Apr 2002 08:43:02 -0500
@@ -416,16 +433,16 @@
* This releases closes the open upstream bugs (Closes: #142977, #142954)
* debian/control: Added Build-Depends on libqhull-dev and libginac-dev
(and libgmp3-dev) to support the added geometry and symbolic toolboxes
- * debian/control: But for now don't use those (unavailable) libs on ia64
+ * debian/control: But for now don't use those (unavailable) libs on ia64
* debian/rules: Add a few selected .oct files as arguments to dh_shlibdeps
- call to make sure required libs are added
+ call to make sure required libs are added
-- Dirk Eddelbuettel <edd@debian.org> Thu, 25 Apr 2002 20:11:34 -0500
octave-forge (2002.04.20-1) unstable; urgency=low
* Upgraded to new upstream release [ package newer released ]
-
+
-- Dirk Eddelbuettel <edd@debian.org> Sun, 21 Apr 2002 08:01:57 -0500
octave-forge (2002.03.09-1) unstable; urgency=low
@@ -459,7 +476,7 @@
* debian/rules: Use octave-config to learn about directory locations
* debian/control: Build-Conflicts with octave2.0-headers (octave-config)
* Applied patch by LaMont Jones for gcc-3.0 support (Closes: #127023)
-
+
-- Dirk Eddelbuettel <edd@debian.org> Fri, 4 Jan 2002 21:06:42 -0600
octave-forge (2001.11.02-2) unstable; urgency=low
@@ -484,7 +501,7 @@
which replaces (and extends) this package
-- Dirk Eddelbuettel <edd@debian.org> Fri, 2 Nov 2001 18:55:10 -0600
-
+
octave-matcompat (20010225-6) unstable; urgency=low
* debian/control: Added Build-Depends on xlibs-dev (Closes: #105657)
@@ -514,7 +531,7 @@
* debian/rules: aurecord goes into /usr/lib/octave/$VERSION/site/exec/$ARCH
instead of /usr/bin where it conflicts with nas-bin (Closes: #88746)
* debian/rules: Do not install aurecord.1 into /usr/share/man/man1
-
+
-- Dirk Eddelbuettel <edd@debian.org> Wed, 7 Mar 2001 06:13:36 -0600
octave-matcompat (20010225-1) unstable; urgency=low
Modified: trunk/packages/octave-forge/debian/control
===================================================================
--- trunk/packages/octave-forge/debian/control 2005-02-23 09:10:12 UTC (rev 102)
+++ trunk/packages/octave-forge/debian/control 2005-02-23 14:39:12 UTC (rev 103)
@@ -3,27 +3,27 @@
Priority: optional
Maintainer: Debian Octave Group <pkg-octave-devel@lists.alioth.debian.org>
Standards-Version: 3.6.1.1
-Build-Depends: debhelper (>= 3.0.0), octave2.1-headers (>= 2.1.64-1), xlibs-dev, g77 [!m68k], fort77 [m68k], libqhull-dev, libginac-dev [!m68k !mipsel], libgmp3-dev, autoconf, libjpeg62-dev, libpng12-dev, libncurses5-dev, libreadline4-dev, tetex-bin, libgsl0-dev
+Build-Depends: debhelper (>= 3.0.0), octave2.1-headers (>= 2.1.65), xlibs-dev, g77 [!m68k], fort77 [m68k], libqhull-dev, libginac-dev [!m68k !mipsel], libgmp3-dev, autoconf, libjpeg62-dev, libpng12-dev, libncurses5-dev, libreadline5-dev, tetex-bin, libgsl0-dev, dpatch
Build-Conflicts: octave2.0-headers, octave2.0
Package: octave-forge
Replaces: octave-matcompat
Architecture: any
-Depends: octave2.1 (>= 2.1.64), octave2.1 (<< 2.1.65), ${shlibs:Depends}
+Depends: ${octave:Depends}, ${shlibs:Depends}
Description: Contributed functions for GNU Octave from http://octave.sf.net
- The octave-forge project contains over 500 contributed functions for
- GNU Octave which are not in the main distribution. These functions are
+ The octave-forge project contains over 500 contributed functions for
+ GNU Octave which are not in the main distribution. These functions are
grouped according to the following subdirectories: audio, comm, control,
general, geometry, ident, image, io, linear-algebra, miscellaneous, optim,
- path, plot, set, signal, sparse, specfun, special-matrix, splines,
- statistics, strings, struct, symbolic, time.
+ path, plot, set, signal, sparse, specfun, special-matrix, splines,
+ statistics, strings, struct, symbolic, time.
.
While the main Octave distribution is conservative about accepting new
functions and changes, octave-forge is very open. As a result, be prepared
for some lower quality code and more rapidly changing interfaces to the
- functions in octave-forge.
+ functions in octave-forge.
.
The octave-forge project is housed at http://sourceforge.net/projects/octave/
.
- The Debian octave-forge package replaces (and extends) the earlier
+ The Debian octave-forge package replaces (and extends) the earlier
octave-matcompat package.
Deleted: trunk/packages/octave-forge/debian/lp.cc.patch_bug210907
Added: trunk/packages/octave-forge/debian/patches/00list
===================================================================
--- trunk/packages/octave-forge/debian/patches/00list 2005-02-23 09:10:12 UTC (rev 102)
+++ trunk/packages/octave-forge/debian/patches/00list 2005-02-23 14:39:12 UTC (rev 103)
@@ -0,0 +1,2 @@
+50_extra-mex-configure-add
+50_big-endian-rand-fix
Added: trunk/packages/octave-forge/debian/patches/50_big-endian-rand-fix.dpatch
===================================================================
--- trunk/packages/octave-forge/debian/patches/50_big-endian-rand-fix.dpatch 2005-02-23 09:10:12 UTC (rev 102)
+++ trunk/packages/octave-forge/debian/patches/50_big-endian-rand-fix.dpatch 2005-02-23 14:39:12 UTC (rev 103)
@@ -0,0 +1,394 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 50_big-endian-rand-fix.dpatch by Rafael Laboissiere <rafael@debian.org>
+##
+## DP: Fix rand bug on some big-endian architectures
+## DP: Taken from CVS at SourceForge on 2005-02-23
+
+@DPATCH@
+
+--- octave-forge-2004.11.16.orig/FIXES/Makefile
++++ octave-forge-2004.11.16/FIXES/Makefile
+@@ -16,16 +16,16 @@
+ # The default is 53 bits.
+ # There are special optimizations for X86 architecture. These are turned
+ # on automatically for -Di386, which is the default for gcc and icc on x86
+-# architectures. You can override this by adding -DHAVE_X86=1 to enable or
+-# -DHAVE_X86=1 to suppress onto the RANDFLAGS. Enabling it will give incorrect
+-# results for BIG_ENDIAN architectures! Also, it is important to choose the
+-# correct optimization level and CPU type for X86 to get maximum performance.
+-# The following works well for me:
++# architectures, or for -DHAVE_X86_32. You can override this by adding
++# -DUSE_X86_32=1 to enable or -DUSE_X86_32=0 to suppress onto the RANDFLAGS.
++# Enabling it will give incorrect results for BIG_ENDIAN architectures!
++# Also, it is important to choose the correct optimization level and CPU
++# type for X86 to get maximum performance. The following works well for me:
+ # CFLAGS="-O2 -march=i686" make
+ # Note that -O3 is much slower than -O2 for me.
+ RANDFLAGS = -DALLBITS
+
+-RAND_LINKS = randn.oct rande.oct randp.oct
++RAND_LINKS = randn.oct rande.oct randp.oct randg.oct
+ PROGS = $(SORT_BUILD) rand.oct $(RAND_LINKS)
+ #fsolve.oct
+
+@@ -40,7 +40,7 @@
+ -$(RM) $@
+ $(LN_S) rand.oct $@
+
+-rand.oct : randmtzig.c randpoisson.c rand.cc
++rand.oct : randmtzig.c randpoisson.c randgamma.c rand.cc
+ $(MKOCTFILE) $(RANDFLAGS) $(HAVE_ND_ARRAYS) rand.cc
+
+ sort.oct : sort.cc oct-sort.cc oct-sort.h
+--- octave-forge-2004.11.16.orig/FIXES/rand.cc
++++ octave-forge-2004.11.16/FIXES/rand.cc
+@@ -20,7 +20,7 @@
+ // Copyright (C) 1996, 1997 John W. Eaton
+ // Copyright (C) 1998, 1999 Dirk Eddelbuettel <edd@debian.org>
+ //
+-// $Id: rand.cc,v 1.14 2004/10/15 10:05:25 adb014 Exp $
++// $Id: rand.cc,v 1.18 2005/02/22 02:27:17 pkienzle Exp $
+
+ */
+
+@@ -238,9 +238,19 @@
+ %! rand('seed',s); y=rand(1,2);
+ %! assert(x,y);
+ %!# querying 'seed' disturbs the sequence, so don't test that it doesn't
+-%!# XXX FIXME XXX tests of uniformity
+ */
+
++/*
++%!test
++%! % statistical tests may fail occasionally.
++%! x = rand(100000,1);
++%! assert(max(x)<1.); %*** Please report this!!! ***
++%! assert(min(x)>0.); %*** Please report this!!! ***
++%! assert(mean(x),0.5,0.0024);
++%! assert(var(x),1/48,0.0632);
++%! assert(skewness(x),0,0.012);
++%! assert(kurtosis(x),-6/5,0.0094);
++*/
+ DEFUN_DLD (rand, args, nargout,
+ "-*- texinfo -*-\n\
+ @deftypefn {Loadable Function} {} rand (@var{x})\n\
+@@ -352,6 +362,15 @@
+ return retval;
+ }
+
++/*
++%!test
++%! % statistical tests may fail occasionally.
++%! x = randn(100000,1);
++%! assert(mean(x),0,0.01);
++%! assert(var(x),1,0.02);
++%! assert(skewness(x),0,0.02);
++%! assert(kurtosis(x),0,0.04);
++*/
+ DEFUN_DLD (randn, args, nargout,
+ "-*- texinfo -*-\n\
+ @deftypefn {Loadable Function} {} randn (@var{x})\n\
+@@ -365,6 +384,9 @@
+ transform from U to N(0,1). The technique uses a 256 level Ziggurat\n\
+ with the Mersenne Twister from @code{rand} used to generate U.\n\
+ \n\
++To generate a normally distributed random element with mean m and standard\n\
++deviation s use s*randn+m.\n\
++\n\
+ [1] G. Marsaglia and W.W. Tsang, 'Ziggurat method for generating random\n\
+ variables', J. Statistical Software, vol 5, 2000\n\
+ (http://www.jstatsoft.org/v05/i08/)\n\
+@@ -428,6 +450,16 @@
+ return retval;
+ }
+
++/*
++%!test
++%! % statistical tests may fail occasionally
++%! x = rande(100000,1);
++%! assert(min(x)>0); % *** Please report this!!! ***
++%! assert(mean(x),1,0.01);
++%! assert(var(x),1,0.03);
++%! assert(skewness(x),2,0.06);
++%! assert(kurtosis(x),6,0.7);
++*/
+ DEFUN_DLD (rande, args, nargout,
+ "-*- texinfo -*-\n\
+ @deftypefn {Loadable Function} {} rande (@var{x})\n\
+@@ -508,12 +540,39 @@
+ }
+
+ #undef NAN
++#undef ISINF
+ #define NAN octave_NaN
++#define INFINITE lo_ieee_isinf
+ #define RUNI randu()
+ #define RNOR randn()
++#define REXP rande()
+ #define LGAMMA xlgamma
+-#include "randpoisson.c"
+
++/*
++%!assert(randp([-inf,-1,0,inf,nan]),[nan,nan,0,nan,nan]); % *** Please report
++%!test
++%! % statistical tests may fail occasionally.
++%! for a=[5 15]
++%! x = randp(a,100000,1);
++%! assert(min(x)>=0); % *** Please report this!!! ***
++%! assert(mean(x),a,0.03);
++%! assert(var(x),a,0.2);
++%! assert(skewness(x),1/sqrt(a),0.03);
++%! assert(kurtosis(x),1/a,0.08);
++%! end
++%!test
++%! % statistical tests may fail occasionally.
++%! for a=[5 15]
++%! x = randp(a*ones(100000,1),100000,1);
++%! assert(min(x)>=0); % *** Please report this!!! ***
++%! assert(mean(x),a,0.03);
++%! assert(var(x),a,0.2);
++%! assert(skewness(x),1/sqrt(a),0.03);
++%! assert(kurtosis(x),1/a,0.08);
++%! end
++*/
++
++#include "randpoisson.c"
+ DEFUN_DLD (randp, args, nargout,
+ "-*- texinfo -*-\n\
+ @deftypefn {Loadable Function} {} randp (@var{l})\n\
+@@ -564,8 +623,8 @@
+
+ if (error_state) return retval;
+
+- if ( (nr != lambda.rows() && lambda.rows() != 1)
+- || (nc != lambda.columns() && lambda.columns() != 1) )
++ if (lambda.length() != 1
++ && (nr != lambda.rows() || nc != lambda.columns()) )
+ {
+ error("randp: dimensions of lambda must match requested matrix size");
+ return retval;
+@@ -589,6 +648,126 @@
+ }
+
+ /*
++%!assert(randg([-inf,-1,0,inf,nan]),[nan,nan,nan,nan,nan]) % *** Please report
++%!test
++%! % statistical tests may fail occasionally.
++%! a=0.1; x = randg(a,100000,1);
++%! assert(mean(x), a, 0.01);
++%! assert(var(x), a, 0.01);
++%! assert(skewness(x),2/sqrt(a), 1.);
++%! assert(kurtosis(x),6/a, 50.);
++%!test
++%! % statistical tests may fail occasionally.
++%! a=0.95; x = randg(a,100000,1);
++%! assert(mean(x), a, 0.01);
++%! assert(var(x), a, 0.04);
++%! assert(skewness(x),2/sqrt(a), 0.2);
++%! assert(kurtosis(x),6/a, 2.);
++%!test
++%! % statistical tests may fail occasionally.
++%! a=1; x = randg(a,100000,1);
++%! assert(mean(x),a, 0.01);
++%! assert(var(x),a, 0.04);
++%! assert(skewness(x),2/sqrt(a), 0.2);
++%! assert(kurtosis(x),6/a, 2.);
++%!test
++%! % statistical tests may fail occasionally.
++%! a=10; x = randg(a,100000,1);
++%! assert(mean(x), a, 0.1);
++%! assert(var(x), a, 0.5);
++%! assert(skewness(x),2/sqrt(a), 0.1);
++%! assert(kurtosis(x),6/a, 0.5);
++%!test
++%! % statistical tests may fail occasionally.
++%! a=100; x = randg(a,100000,1);
++%! assert(mean(x), a, 0.2);
++%! assert(var(x), a, 2.);
++%! assert(skewness(x),2/sqrt(a), 0.05);
++%! assert(kurtosis(x),6/a, 0.2);
++*/
++#include "randgamma.c"
++DEFUN_DLD (randg, args, nargout,
++ "-*- texinfo -*-\n\
++@deftypefn {Loadable Function} {} randg (@var{a})\n\
++@deftypefnx {Loadable Function} {} randg (@var{a}, [@var{n}, @var{m}])\n\
++@deftypefnx {Loadable Function} {} randg (@var{a}, @var{n}, @var{m})\n\
++Return a matrix with gamma(A,1) distributed random elements. This can\n\
++be used to generate many distributions:\n\n\
++gamma(a,b) for a>-1, b>0 (from R)\n\
++ r = b*randg(a)\n\n\
++beta(a,b) for a>-1, b>-1\n\
++ r1 = randg(a,1)\n\
++ r = r1 / (r1 + randg(b,1))\n\n\
++Erlang(a,n)\n\
++ r = a*randg(n)\n\n\
++chisq(df) for df>0\n\
++ r = 2*randg(df/2)\n\n\
++t(df) for 0<df<inf (use randn if df is infinite)\n\
++ r = randn() / sqrt(2*randg(df/2)/df)\n\n\
++F(n1,n2) for 0<n1, 0<n2\n\
++ r1 = 2*randg(n1/2)/n1 or 1 if n1 is infinite\n\
++ r2 = 2*randg(n2/2)/n2 or 1 if n2 is infinite\n\
++ r = r1 / r2\n\n\
++negative binonial (n, p) for n>0, 0<p<=1\n\
++ r = randp((1-p)/p * randg(n))\n\
++ (from R, citing Devroye(1986), Non-Uniform Random Variate Generation)\n\n\
++non-central chisq(df,L), for df>=0 and L>0 (use chisq if L=0)\n\
++ r = randp(L/2)\n\
++ r(r>0) = 2*randg(r(r>0))\n\
++ r(df>0) += 2*randg(df(df>0)/2)\n\
++ (from R, citing formula 29.5b-c in Johnson, Kotz, Balkrishnan(1995))\n\n\
++Dirichlet(a1,...,ak)\n\
++ r = (randg(a1),...,randg(ak))\n\
++ r = r / sum(r)\n\
++ (from GSL, citing Law & Kelton(1991), Simulation Modeling and Analysis)\n\n\
++@end deftypefn\n\
++@seealso{rand, randn, rande, randp}\n")
++{
++ octave_value_list retval; // list of return values
++
++ int nargin = args.length (); // number of arguments supplied
++ if (nargin > 3 || nargin < 1)
++ {
++ print_usage("randg");
++ return retval;
++ }
++
++ Matrix alpha(args(0).matrix_value());
++ if (error_state) return retval;
++
++ int nr=0, nc=0;
++ switch (nargin) {
++ case 1: nr = alpha.rows(); nc = alpha.columns(); break;
++ case 2: get_dimensions(args(1), "randg", nr, nc); break;
++ case 3: get_dimensions(args(1), args(2), "randg", nr, nc); break;
++ }
++
++ if (error_state) return retval;
++
++ if ( (alpha.length()!=1 && (nr != alpha.rows() || nc != alpha.columns())) )
++ {
++ error("randg: dimensions of alpha must match requested matrix size");
++ return retval;
++ }
++
++ Matrix X(nr, nc);
++ double *pX = X.fortran_vec();
++
++ if (alpha.length()==1)
++ {
++ fill_randg(alpha(0,0),nr*nc,pX);
++ }
++ else
++ {
++ const double *pA = alpha.data();
++ for (int i=nr*nc-1; i >= 0; i--) pX[i] = randg(pA[i]);
++ }
++
++ retval(0) = X;
++ return retval;
++}
++
++/*
+ ;;; Local Variables: ***
+ ;;; mode: C++ ***
+ ;;; End: ***
+--- octave-forge-2004.11.16.orig/FIXES/randgamma.c
++++ octave-forge-2004.11.16/FIXES/randgamma.c
+@@ -0,0 +1,95 @@
++/* This code is in the public domain */
++
++/*
++
++double randg(a)
++void fill_randg(a,n,x)
++
++Generate a series of standard gamma distributions.
++
++See: Marsaglia G and Tsang W (2000), "A simple method for generating
++gamma variables", ACM Transactions on Mathematical Software 26(3) 363-372
++
++Needs the following defines:
++* NAN: value to return for Not-A-Number
++* RUNI: uniform generator on (0,1)
++* RNOR: normal generator
++* REXP: exponential generator, or -log(RUNI) if one isn't available
++* INFINITE: function to test whether a value is infinite
++
++Test using:
++ mean = a
++ variance = a
++ skewness = 2/sqrt(a)
++ kurtosis = 3 + 6/sqrt(a)
++
++Note that randg can be used to generate many distributions:
++
++gamma(a,b) for a>0, b>0 (from R)
++ r = b*randg(a)
++beta(a,b) for a>0, b>0
++ r1 = randg(a,1)
++ r = r1 / (r1 + randg(b,1))
++Erlang(a,n)
++ r = a*randg(n)
++chisq(df) for df>0
++ r = 2*randg(df/2)
++t(df) for 0<df<inf (use randn if df is infinite)
++ r = randn() / sqrt(2*randg(df/2)/df)
++F(n1,n2) for 0<n1, 0<n2
++ r1 = 2*randg(n1/2)/n1 or 1 if n1 is infinite
++ r2 = 2*randg(n2/2)/n2 or 1 if n2 is infinite
++ r = r1 / r2
++negative binonial (n, p) for n>0, 0<p<=1
++ r = randp((1-p)/p * randg(n))
++ (from R, citing Devroye(1986), Non-Uniform Random Variate Generation)
++non-central chisq(df,L), for df>=0 and L>0 (use chisq if L=0)
++ r = randp(L/2)
++ r(r>0) = 2*randg(r(r>0))
++ r(df>0) += 2*randg(df(df>0)/2)
++ (from R, citing formula 29.5b-c in Johnson, Kotz, Balkrishnan(1995))
++Dirichlet(a1,...,ak) for ai > 0
++ r = (randg(a1),...,randg(ak))
++ r = r / sum(r)
++ (from GSL, citing Law & Kelton(1991), Simulation Modeling and Analysis)
++*/
++
++
++void fill_randg(double a, int n, double *r)
++{
++ int i;
++ /* If a < 1, start by generating gamma(1+a) */
++ const double d = (a<1.?1.+a:a)-1./3.;
++ const double c = 1./sqrt(9.*d);
++
++ /* Handle invalid cases */
++ if (a <= 0 || INFINITE(a)) {
++ for (i=0; i < n; i++) r[i] = NAN;
++ return;
++ }
++
++ for (i=0; i < n; i++) {
++ double x, xsq, v, u;
++ restart:
++ x = RNOR;
++ v = (1+c*x);
++ v *= v*v;
++ if (v <= 0) goto restart; /* rare, so don't bother moving up */
++ u = RUNI;
++ xsq = x*x;
++ if (u >= 1.-0.0331*xsq*xsq && log(u) >= 0.5*xsq + d*(1-v+log(v)))
++ goto restart;
++ r[i] = d*v;
++ }
++ if (a < 1) { /* Use gamma(a) = gamma(1+a)*U^(1/a) */
++ /* Given REXP = -log(U) then U^(1/a) = exp(-REXP/a) */
++ for (i=0; i < n; i++) r[i] *= exp(-REXP/a);
++ }
++}
++
++double randg(double a)
++{
++ double ret;
++ fill_randg(a,1,&ret);
++ return ret;
++}
Property changes on: trunk/packages/octave-forge/debian/patches/50_big-endian-rand-fix.dpatch
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/packages/octave-forge/debian/patches/50_extra-mex-configure-add.dpatch
===================================================================
--- trunk/packages/octave-forge/debian/patches/50_extra-mex-configure-add.dpatch 2005-02-23 09:10:12 UTC (rev 102)
+++ trunk/packages/octave-forge/debian/patches/50_extra-mex-configure-add.dpatch 2005-02-23 14:39:12 UTC (rev 103)
@@ -0,0 +1,12 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 50_extra-mex-configure-add.dpatch by Rafael Laboissiere <rafael@debian.org>
+##
+## DP: Add file extra/mex/configure.add
+
+@DPATCH@
+
+--- octave-forge-2004.11.16.orig/extra/mex/configure.add
++++ octave-forge-2004.11.16/extra/mex/configure.add
+@@ -0,0 +1,2 @@
++
++AC_PROG_AWK
Property changes on: trunk/packages/octave-forge/debian/patches/50_extra-mex-configure-add.dpatch
___________________________________________________________________
Name: svn:executable
+ *
Modified: trunk/packages/octave-forge/debian/rules
===================================================================
--- trunk/packages/octave-forge/debian/rules 2005-02-23 09:10:12 UTC (rev 102)
+++ trunk/packages/octave-forge/debian/rules 2005-02-23 14:39:12 UTC (rev 103)
@@ -3,16 +3,19 @@
# debian.rules file for the Debian/GNU Linux octave-forge package
# Copyright 2000 - 2004 by Dirk Eddelbuettel <edd@debian.org>
-package = octave-forge
+PACKAGE = octave-forge
+
+include /usr/share/dpatch/dpatch.make
+include /usr/share/octave/debian/defs.make
+
altname = octave-forge-alternatives
debtmp := $(CURDIR)/debian/tmp
-debdoc := $(debtmp)/usr/share/doc/$(package)
-octdir := $(shell octave-config --oct-site-dir)
-mdir := $(shell octave-config --m-site-dir)
-altoctdir := $(shell octave-config --oct-site-dir)/$(altname)
-altmdir := $(shell octave-config --m-site-dir | \
- sed -e +"s,/m$$,,")/$(altname)/m
-octbin := $(shell octave-config -p LOCALVERARCHLIBDIR)
+debdoc := $(debtmp)/usr/share/doc/$(PACKAGE)
+octdir := $(OCTDIR)
+mdir := $(MDIR)
+altoctdir := $(OCTDIR)/$(altname)
+altmdir := $(MDIR)/$(altname)
+octbin := $(shell octave-config -p LOCALARCHLIBDIR)
mycheck:
@echo "debtmp $(debtmp)"
@@ -62,7 +65,7 @@
configure: configure-stamp
configure-stamp:
dh_testdir
- touch extra/MacOSX/NOINSTALL
+ touch extra/MacOSX/NOINSTALL
[ -f autogen.sh ] && ./autogen.sh && chmod 0755 configure
CC=$(compilerpath) \
CXX=$(cpppath) \
@@ -73,12 +76,12 @@
FFLAGS=$(compilerflags) \
./configure --prefix=/usr
# clean the tsa/ directory
- # ( cd extra/tsa && ../../debian/tsacleanup.pl )
+ # ( cd extra/tsa && ../../debian/tsacleanup.pl )
touch configure-stamp
-build: configure-stamp build-stamp
-build-stamp:
- $(MAKE)
+build: configure-stamp build-stamp
+build-stamp:
+ $(MAKE)
# $(MAKE) index.html
touch build-stamp
@@ -89,8 +92,8 @@
dh_clean -k
dh_installdirs
strip */*/*.oct
- $(MAKE) install MPATH=$(debtmp)/$(mdir)/$(package) \
- OPATH=$(debtmp)/$(octdir)/$(package) \
+ $(MAKE) install MPATH=$(debtmp)/$(mdir)/$(PACKAGE) \
+ OPATH=$(debtmp)/$(octdir)/$(PACKAGE) \
XPATH=$(debtmp)/$(octbin) \
ALTMPATH=$(debtmp)/$(altmdir) \
ALTOPATH=$(debtmp)/$(altoctdir) \
@@ -105,14 +108,17 @@
-$(MAKE) check OCTAVE=octave2.1
touch check-stamp
-clean:
+clean: unpatch
dh_testdir
dh_testroot
rm -f configure-stamp build-stamp install-stamp check-stamp
-test -f Makefile && $(MAKE) clean
-rm -rf *~ $(debtmp) debian/*~ debian/files* build \
config.status config.cache config.log conftest \
- extra/symband/*.oct
+ extra/symband/*.oct build.log \
+ main/fixed/doc/fixed.{ps,info} \
+ Makeconf octinst.sh fntests.m \
+ admin/RPM/octave-forge.spec
dh_clean
binary-indep: build install check
@@ -121,8 +127,8 @@
# dh_testversion
dh_testdir
dh_testroot
-# dh_installdebconf
- dh_installdocs AUTHORS TODO README RELEASE-NOTES
+# dh_installdebconf
+ dh_installdocs AUTHORS TODO README RELEASE-NOTES
dh_installexamples extra/pdb/bin/rasmol.sh
# dh_installmenu
# dh_installemacsen
@@ -133,18 +139,18 @@
# dh_installman debian/aurecord.1
# dh_installinfo
# dh_undocumented
- dh_installchangelogs
- dh_link $(mdir)/$(package) \
- /usr/share/doc/$(package)/scripts
+ dh_installchangelogs
+ dh_link $(mdir)/$(PACKAGE) \
+ /usr/share/doc/$(PACKAGE)/scripts
dh_strip
strip --remove-section=.comment \
--remove-section=.note \
- $(debtmp)$(octdir)/$(package)/*.oct
+ $(debtmp)$(octdir)/$(PACKAGE)/*.oct
# this only affects one file (mex.o) and it needs
# symbols (c.f. #207542)
## strip --remove-section=.comment \
## --remove-section=.note \
- ## $(debtmp)$(octdir)/$(package)/*.o
+ ## $(debtmp)$(octdir)/$(PACKAGE)/*.o
dh_compress
dh_fixperms
# dh_suidregister
@@ -152,17 +158,18 @@
dh_installdeb
# dh_perl
# call with three explicit files to cover our bases
- dh_shlibdeps $(debtmp)$(octdir)/$(package)/convhulln.oct \
- $(debtmp)$(octdir)/$(package)/jpgwrite.oct \
- $(debtmp)$(octdir)/$(package)/gsl_sf.oct \
- $(debtmp)$(octdir)/$(package)/symbols.oct
+ octave-depends
+ dh_shlibdeps $(debtmp)$(octdir)/$(PACKAGE)/convhulln.oct \
+ $(debtmp)$(octdir)/$(PACKAGE)/jpgwrite.oct \
+ $(debtmp)$(octdir)/$(PACKAGE)/gsl_sf.oct \
+ $(debtmp)$(octdir)/$(PACKAGE)/symbols.oct
dh_gencontrol
dh_md5sums
dh_builddeb
binary-arch: build
-source diff:
+source diff:
@echo >&2 'obsolete targets - use dpkg-source -b'; false
binary: binary-indep binary-arch
Deleted: trunk/packages/octave-forge/debian/tsacleanup.pl