Octave 2.1.47 available for ftp

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Octave 2.1.47 available for ftp

John W. Eaton-6
Octave 2.1.46 is now available for ftp from ftp.octave.org in the
directory /pub/octave/bleeding-edge:

  -rw-r--r--  1 506  103  4720192 May  3 02:06 octave-2.1.47.tar.gz
  -rw-r--r--  1 506  103  3693094 May  3 02:06 octave-2.1.47.tar.bz2
  -rw-r--r--  1 506  103    66507 May  3 02:15 octave-2.1.46-2.1.47.patch.gz
  -rw-r--r--  1 506  103    59508 May  3 02:15 octave-2.1.46-2.1.47.patch.bz2

The big change since 21.1.46 is that Octave no longer includes the
entire kpathsearch library.  Instead, I've extracted the kpathsearch
code that Octave needs and placed it all inside one file in liboctave,
which is now included in pathsearch.cc with all the kpathsearch
functions static inside that file.  I've also converted the functions
that we do need to use the C++ string and other STL classes as much as
possible (no calls to malloc now).  I hope that this will eliminate
the potential for memory leaks that have been a problem with this code
in the past.  I also hope that it will be easier to adapt this smaller
piece of code to the specialized types of searches that Octave needs
(for example, Matlab-compatible private functions)

As always, if your favorite bug is still not fixed, please let me know
about it.

Thanks,

jwe

--
www.octave.org        | Unfortunately we were hopelessly optimistic in 1954
www.che.wisc.edu/~jwe | about the problems of debugging FORTRAN programs.
                      |                                       -- J. Backus


Reply | Threaded
Open this post in threaded view
|

Re: Octave 2.1.47 available for ftp

Dirk Eddelbuettel

Debian packages for 2.1.47 have been uploaded, as well as updated packages
of octave-forge and semidef-oct [ which depend on the actual octave version
due to the hardcoded path for .oct files ]

With this release, and per discussions with John, 'octave' on Debian
defaults to octave2.1.  An updated 2.0.17 package has also been released.

Dirk

--
Don't drink and derive. Alcohol and algebra don't mix.


Reply | Threaded
Open this post in threaded view
|

Re: Octave 2.1.47 available for ftp

Andy Adler
I'm still campaining to have a new version of hist.m
incorporated into octave.

The attached patch combines the best of my and Paul Kienzle's
code (The efficiency break is at n=30 bins).

Here is a table of timing comparisons:

n     ORIGINAL   AAversion  PKversion ThisVersion
  3    0.287      0.1920     1.7170     0.1910
 10    1.125      0.4880     1.7290     0.4900
 20    2.278      0.9460     1.7140     0.9480
 30    3.823      1.5690     1.7650     1.4000
 40    5.116      2.0880     1.7770     1.4020
 50    6.572      2.6100     1.7600     1.3930
 60    7.743      3.1220     1.7800     1.4030
100   12.881      5.1770     1.7710     1.4010

Test Code:
jnk=rand(400);
for n=[3,10,20,30,40,50,60,100];
    disp(n);
    tic; x1=hist1(jnk(:),n); toc,
    tic; x2=hist2(jnk(:),n); toc,
    tic; x3=hist3(jnk(:),n); toc,
    tic; x4=hist4(jnk(:),n); toc,
    if ~( all(x1==x2) && all(x2==x3) && all(x3==x4));error('bad');end;
end

PATCH:
--- hist.m.orig 2003-05-03 11:24:48.000000000 -0400
+++ hist.m      2003-05-03 11:24:38.000000000 -0400
@@ -42,6 +42,7 @@
 ## @seealso{bar}

 ## Author: jwe
+## Modifications May 2003 by A.Adler, using code from P.Kienzle

 function [nn, xx] = hist (y, x, norm)

@@ -78,21 +79,28 @@
         x = tmp;
       endif
       n = length (x);
-      cutoff = zeros (1, n-1);
-      for i = 1:n-1
-        cutoff (i) = (x (i) + x (i+1)) / 2;
-      endfor
+      cutoff = ( x(1:n-1) + x(2:n) ) / 2;
     else
       error ("hist: second argument must be a scalar or a vector");
     endif
   endif

-  freq = zeros (1, n);
-  freq (1) = sum (y < cutoff (1));
-  for i = 2:n-1
-    freq (i) = sum (y >= cutoff (i-1) & y < cutoff (i));
-  endfor
-  freq (n) = sum (y >= cutoff (n-1));
+if n < 30
+    % algorithm works fastest for n<30
+    chist = [zeros(n,1); length(y) ];
+    for i = 1:n-1
+      chist (i+1) = sum (y < cutoff (i));
+    end
+else
+    % algorithm works fastest for n>30
+    % put cutoff elements between boundaries
+    % integrate over all elements, keep totals at boundaries
+
+    [s, idx] = sort ( [cutoff(:); y(:)] );
+    chist = cumsum(idx>n);
+    chist = [0; chist(idx<n); chist(length(chist))];
+end
+    freq= diff(chist)';

   if (nargin == 3)
     ## Normalise the histogram.






Reply | Threaded
Open this post in threaded view
|

Re: Octave 2.1.47 available for ftp

John W. Eaton-6
On  3-May-2003, Andy Adler <[hidden email]> wrote:

| I'm still campaining to have a new version of hist.m
| incorporated into octave.

I made these changes.

| Test Code:
| jnk=rand(400);
| for n=[3,10,20,30,40,50,60,100];
|     disp(n);
|     tic; x1=hist1(jnk(:),n); toc,
|     tic; x2=hist2(jnk(:),n); toc,
|     tic; x3=hist3(jnk(:),n); toc,
|     tic; x4=hist4(jnk(:),n); toc,
|     if ~( all(x1==x2) && all(x2==x3) && all(x3==x4));error('bad');end;
| end

What do hist1, hist2, hist3, and hist4 do?

|  ## Author: jwe
| +## Modifications May 2003 by A.Adler, using code from P.Kienzle

It would be better to provide ChangeLog entries instead of comments
like these.

Thanks,

jwe


Reply | Threaded
Open this post in threaded view
|

Re: Octave 2.1.47 available for ftp

Andy Adler
On Mon, 5 May 2003, John W. Eaton wrote:

> On  3-May-2003, Andy Adler <[hidden email]> wrote:
> | Test Code:
> | jnk=rand(400);
> | for n=[3,10,20,30,40,50,60,100];
> |     disp(n);
> |     tic; x1=hist1(jnk(:),n); toc,
> |     tic; x2=hist2(jnk(:),n); toc,
> |     tic; x3=hist3(jnk(:),n); toc,
> |     tic; x4=hist4(jnk(:),n); toc,
> |     if ~( all(x1==x2) && all(x2==x3) && all(x3==x4));error('bad');end;
> | end
>
> What do hist1, hist2, hist3, and hist4 do?

Sorry:
   hist1 = original code
   hist2 = my first modification
   hist3 = Paul Kienzle's version
   hist4 = Combination version

> It would be better to provide ChangeLog entries instead of comments
> like these.

ok.

Andy