changeset 6868:975fcdfb0d2d

[project @ 2007-09-06 16:34:29 by dbateman]
author dbateman
date Thu, 06 Sep 2007 16:34:30 +0000
parents 83619ae96c1d
children f9c893831e68
files doc/ChangeLog doc/interpreter/container.txi doc/interpreter/data.txi doc/interpreter/matrix.txi doc/interpreter/system.txi liboctave/Array-util.cc liboctave/ChangeLog scripts/ChangeLog scripts/general/Makefile.in scripts/miscellaneous/Makefile.in src/ChangeLog src/Makefile.in
diffstat 12 files changed, 42 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/doc/ChangeLog	Thu Sep 06 12:08:45 2007 +0000
+++ b/doc/ChangeLog	Thu Sep 06 16:34:30 2007 +0000
@@ -1,5 +1,9 @@
 2007-09-05  David Bateman  <dbateman@free.fr>
 
+        * interpreter/system.m: Document gzip.
+        * interpreter/container.txi: Document celldisp.
+        * interpreter/matrix.txi: Document bsxfun.
+        * interpreter/data.txi: Document typecast and swapbytes. 
         * interpreter/container.txi: Document struct2cell.
         * interpreter/stats.txi: Document mode.
         * interpreter/eval.txi: Document run.
--- a/doc/interpreter/container.txi	Thu Sep 06 12:08:45 2007 +0000
+++ b/doc/interpreter/container.txi	Thu Sep 06 16:34:30 2007 +0000
@@ -482,6 +482,12 @@
 @end group
 @end example
 
+In general nested cell arrays are displayed hierarchically as above. In
+some circumstances it makes sense to reference them by their index, and
+this can be performed by the @code{celldisp} function.
+
+@DOCSTRING(celldisp)
+
 @menu
 * Creating Cell Arrays::                 
 * Indexing Cell Arrays::
--- a/doc/interpreter/data.txi	Thu Sep 06 12:08:45 2007 +0000
+++ b/doc/interpreter/data.txi	Thu Sep 06 16:34:30 2007 +0000
@@ -47,6 +47,10 @@
 
 @DOCSTRING(cast)
 
+@DOCSTRING(typecast)
+
+@DOCSTRING(swapbytes)
+
 @menu
 * Numeric Objects::             
 * Missing Data::                
--- a/doc/interpreter/matrix.txi	Thu Sep 06 12:08:45 2007 +0000
+++ b/doc/interpreter/matrix.txi	Thu Sep 06 16:34:30 2007 +0000
@@ -144,6 +144,8 @@
 
 @DOCSTRING(arrayfun)
 
+@DOCSTRING(bsxfun)
+
 @node Special Utility Matrices
 @section Special Utility Matrices
 
--- a/doc/interpreter/system.txi	Thu Sep 06 12:08:45 2007 +0000
+++ b/doc/interpreter/system.txi	Thu Sep 06 16:34:30 2007 +0000
@@ -195,6 +195,8 @@
 
 @DOCSTRING(bunzip2)
 
+@DOCSTRING(gzip)
+
 @DOCSTRING(gunzip)
 
 @DOCSTRING(tar)
--- a/liboctave/Array-util.cc	Thu Sep 06 12:08:45 2007 +0000
+++ b/liboctave/Array-util.cc	Thu Sep 06 16:34:30 2007 +0000
@@ -60,10 +60,11 @@
   ra_idx(start_dimension)++;
 
   int n = ra_idx.length () - 1;
+  int nda = dimensions.length ();
 
   for (int i = start_dimension; i < n; i++)
     {
-      if (ra_idx(i) < dimensions(i))
+      if (ra_idx(i) < (i < nda ? dimensions(i) : 1))
  	break;
       else
  	{
--- a/liboctave/ChangeLog	Thu Sep 06 12:08:45 2007 +0000
+++ b/liboctave/ChangeLog	Thu Sep 06 16:34:30 2007 +0000
@@ -1,5 +1,7 @@
 2007-09-06  David Bateman  <dbateman@free.fr>
 
+        * Array-util.cc (increment_index): dimensions can have singleton
+        trailing dimensions.
         * Array.h (range_error, xelem, checkelem, elem, operator ()):
         Modify use of Array<int> to Array<octave_idx_type> and adjust
         where necessary.
--- a/scripts/ChangeLog	Thu Sep 06 12:08:45 2007 +0000
+++ b/scripts/ChangeLog	Thu Sep 06 16:34:30 2007 +0000
@@ -1,3 +1,11 @@
+2007-09-06  David Bateman  <dbateman@free.fr>
+
+        * general/celldisp.m: New function.
+        * general/Makefile.in (SOURCES): Add celldisp.m.
+        * miscellaneous/swapbytes.m: New function.
+        * miscellaneous/gzip.m: New function.
+        * miscellaneous/Makefile.in (SOURCES): Add swapbytes.m and gzip.m.
+
 2007-09-05  David Bateman  <dbateman@free.fr>
 
         * general/structfun.m: New function.
--- a/scripts/general/Makefile.in	Thu Sep 06 12:08:45 2007 +0000
+++ b/scripts/general/Makefile.in	Thu Sep 06 16:34:30 2007 +0000
@@ -22,8 +22,8 @@
 
 SOURCES = __isequal__.m __splinen__.m accumarray.m arrayfun.m bicubic.m \
   bitcmp.m bitget.m bitset.m blkdiag.m cart2pol.m cart2sph.m cell2mat.m \
-  circshift.m common_size.m cplxpair.m cumtrapz.m deal.m del2.m diff.m \
-  flipdim.m fliplr.m flipud.m gradient.m ind2sub.m int2str.m interp1.m \
+  celldisp.m circshift.m common_size.m cplxpair.m cumtrapz.m deal.m del2.m \
+  diff.m flipdim.m fliplr.m flipud.m gradient.m ind2sub.m int2str.m interp1.m \
   interp2.m interp3.m interpn.m interpft.m is_duplicate_entry.m isa.m \
   isdefinite.m isdir.m isequal.m isequalwithequalnans.m isscalar.m \
   issquare.m issymmetric.m isvector.m logical.m logspace.m lookup.m mod.m \
--- a/scripts/miscellaneous/Makefile.in	Thu Sep 06 12:08:45 2007 +0000
+++ b/scripts/miscellaneous/Makefile.in	Thu Sep 06 16:34:30 2007 +0000
@@ -24,10 +24,10 @@
   compare_versions.m computer.m copyfile.m cputime.m \
   delete.m dir.m doc.m dos.m dump_prefs.m \
   fileattrib.m fileparts.m flops.m fullfile.m getfield.m gunzip.m \
-  inputname.m ispc.m isunix.m license.m list_primes.m ls.m \
+  gzip.m inputname.m ispc.m isunix.m license.m list_primes.m ls.m \
   ls_command.m menu.m mex.m mexext.m mkoctfile.m movefile.m \
   news.m orderfields.m pack.m paren.m parseparams.m \
-  run.m semicolon.m setfield.m single.m substruct.m tar.m \
+  run.m semicolon.m setfield.m single.m substruct.m swapbytes.m tar.m \
   tempdir.m tempname.m texas_lotto.m unix.m unpack.m untar.m \
   unzip.m ver.m version.m warning_ids.m xor.m zip.m
 
--- a/src/ChangeLog	Thu Sep 06 12:08:45 2007 +0000
+++ b/src/ChangeLog	Thu Sep 06 16:34:30 2007 +0000
@@ -1,5 +1,8 @@
 2007-09-06  David Bateman  <dbateman@free.fr>
 
+        * DLD-FUNCTIONS/bsxfun.cc: New function.
+        * DLD-FUNCTIONS/typecast.cc: New function.
+        * Makefile.in (DLD_XSRC): Add bsxfun.cc and typecast.cc.
         * ov.cc (do_cat_op): Modify use of Array<int> to 
         Array<octave_idx_type> and adjust where necessary.
         * ov.h (do_cat_op): ditto.
--- a/src/Makefile.in	Thu Sep 06 12:08:45 2007 +0000
+++ b/src/Makefile.in	Thu Sep 06 16:34:30 2007 +0000
@@ -47,7 +47,7 @@
 OPT_HANDLERS := DASPK-opts.cc DASRT-opts.cc DASSL-opts.cc \
 	LSODE-opts.cc NLEqn-opts.cc Quad-opts.cc
 
-DLD_XSRC := balance.cc besselj.cc betainc.cc cellfun.cc chol.cc \
+DLD_XSRC := balance.cc besselj.cc betainc.cc bsxfun.cc cellfun.cc chol.cc \
 	ccolamd.cc colamd.cc colloc.cc conv2.cc convhulln.cc daspk.cc \
 	dasrt.cc dassl.cc det.cc dispatch.cc eig.cc expm.cc \
 	fft.cc fft2.cc fftn.cc fftw.cc filter.cc find.cc fsolve.cc \
@@ -56,10 +56,10 @@
 	lu.cc luinc.cc matrix_type.cc md5sum.cc minmax.cc pinv.cc qr.cc \
 	quad.cc qz.cc rand.cc regexp.cc schur.cc sort.cc sparse.cc \
 	spchol.cc spdet.cc spfind.cc spkron.cc splu.cc spparms.cc spqr.cc \
-	sqrtm.cc svd.cc syl.cc symrcm.cc time.cc tsearch.cc urlwrite.cc \
-	__contourc__.cc __delaunayn__.cc __dsearchn__.cc __gnuplot_raw__.l \
-	__glpk__.cc __lin_interpn__.cc __pchip_deriv__.cc __qp__.cc \
-	__voronoi__.cc
+	sqrtm.cc svd.cc syl.cc symrcm.cc time.cc tsearch.cc typecast.cc \
+	urlwrite.cc __contourc__.cc __delaunayn__.cc __dsearchn__.cc \
+	__gnuplot_raw__.l __glpk__.cc __lin_interpn__.cc __pchip_deriv__.cc \
+	__qp__.cc __voronoi__.cc
 
 DLD_SRC := $(addprefix DLD-FUNCTIONS/, $(DLD_XSRC))