changeset 4906:6754342ef7ad

[project @ 2004-06-23 11:11:50 by jwe]
author jwe
date Wed, 23 Jun 2004 11:11:51 +0000
parents f7a337f3fd9e
children 102f199a9a9e
files ChangeLog configure.in liboctave/Makefile.in liboctave/oct-inttypes.h scripts/ChangeLog scripts/general/ind2sub.m src/ChangeLog src/Makefile.in src/ov-base.cc src/ov-base.h src/ov.h
diffstat 11 files changed, 161 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jun 17 04:14:36 2004 +0000
+++ b/ChangeLog	Wed Jun 23 11:11:51 2004 +0000
@@ -1,3 +1,8 @@
+2004-06-22  David Bateman  <dbateman@free.fr>
+
+	* configure.in: Use -Wl,-Bsymbolic for MKOCTFILE_DL_LDFLAGS on
+	GNU/Linux systems but not for SH_LDFLAGS.
+    
 2004-04-22  John W. Eaton  <jwe@octave.org>
 
 	* configure.in: Add -Wl,-Bsymbolic to SH_LDFLAGS for GNU/Linux
--- a/configure.in	Thu Jun 17 04:14:36 2004 +0000
+++ b/configure.in	Wed Jun 23 11:11:51 2004 +0000
@@ -29,7 +29,7 @@
 EXTERN_CXXFLAGS="$CXXFLAGS"
 
 AC_INIT
-AC_REVISION($Revision: 1.453 $)
+AC_REVISION($Revision: 1.454 $)
 AC_PREREQ(2.57)
 AC_CONFIG_SRCDIR([src/octave.cc])
 AC_CONFIG_HEADER(config.h)
@@ -698,7 +698,7 @@
     library_path_var=PATH
   ;;
   *-*-linux* | *-*-gnu*)
-    SH_LDFLAGS="-shared -Wl,-Bsymbolic"
+    MKOCTFILE_DL_LDFLAGS="-shared -Wl,-Bsymbolic"
     SONAME_FLAGS='-Wl,-soname -Wl,$@'
     RLD_FLAG='-Wl,-rpath -Wl,$(octlibdir)'
   ;;
--- a/liboctave/Makefile.in	Thu Jun 17 04:14:36 2004 +0000
+++ b/liboctave/Makefile.in	Wed Jun 23 11:11:51 2004 +0000
@@ -34,7 +34,8 @@
 	dNDArray.h dRowVector.h dbleAEPBAL.h dbleCHOL.h dbleDET.h \
 	dbleHESS.h dbleLU.h dbleQR.h dbleQRP.h dbleSCHUR.h dbleSVD.h \
 	int8NDArray.h uint8NDArray.h int16NDArray.h uint16NDArray.h \
-	int32NDArray.h uint32NDArray.h int64NDArray.h uint64NDArray.h 
+	int32NDArray.h uint32NDArray.h int64NDArray.h uint64NDArray.h \
+	intNDArray.h
 
 MX_OP_INC := $(shell $(AWK) -f $(srcdir)/mk-ops.awk prefix=mx list_h_files=1 $(srcdir)/mx-ops)
 
@@ -55,11 +56,11 @@
 	glob-match.h idx-vector.h kpse-xfns.h \
 	lo-ieee.h lo-mappers.h lo-specfun.h lo-sstream.h \
 	lo-sysdep.h lo-utils.h mach-info.h oct-alloc.h oct-cmplx.h \
-	oct-env.h oct-fftw.h oct-getopt.h oct-group.h oct-passwd.h \
-	oct-rand.h oct-rl-edit.h oct-rl-hist.h oct-shlib.h oct-sort.h \
-	oct-syscalls.h oct-time.h pathlen.h pathsearch.h \
-	prog-args.h so-array.h statdefs.h str-vec.h sun-utils.h sysdir.h \
-	systime.h syswait.h \
+	oct-env.h oct-fftw.h oct-getopt.h oct-group.h oct-inttypes.h \
+	oct-passwd.h oct-rand.h oct-rl-edit.h oct-rl-hist.h \
+	oct-shlib.h oct-sort.h oct-syscalls.h oct-time.h pathlen.h \
+	pathsearch.h prog-args.h so-array.h statdefs.h str-vec.h \
+	sun-utils.h sysdir.h systime.h syswait.h \
 	$(OPTS_INC) \
 	$(MATRIX_INC) \
 	$(MX_OP_INC) \
--- a/liboctave/oct-inttypes.h	Thu Jun 17 04:14:36 2004 +0000
+++ b/liboctave/oct-inttypes.h	Wed Jun 23 11:11:51 2004 +0000
@@ -180,9 +180,9 @@
 
   bool operator ! (void) const { return ! ival; }
 
-  T operator + (void) const { return ival; }
+  octave_int<T> operator + (void) const { return *this; }
 
-  T operator - (void) const
+  octave_int<T> operator - (void) const
   {
     return std::numeric_limits<T>::is_signed ? -ival : 0;
   }
@@ -205,6 +205,9 @@
     return *this;
   }
 
+  octave_int<T> min (void) const { return std::numeric_limits<T>::min (); }
+  octave_int<T> max (void) const { return std::numeric_limits<T>::max (); }
+
 private:
 
   T ival;
@@ -248,13 +251,38 @@
     double ty = static_cast<double> (y.value ()); \
     double r = tx OP ty; \
     return OCTAVE_INT_FIT_TO_RANGE2 (r, T1, T2); \
-  } \
+  }
 
 OCTAVE_INT_BIN_OP(+)
 OCTAVE_INT_BIN_OP(-)
 OCTAVE_INT_BIN_OP(*)
 OCTAVE_INT_BIN_OP(/)
 
+#define OCTAVE_INT_BITCMP_OP(OP) \
+ \
+  template <class T> \
+  octave_int<T> \
+  operator OP (const octave_int<T>& x, const octave_int<T>& y) \
+  { \
+    return x.value () OP y.value (); \
+  }
+
+OCTAVE_INT_BITCMP_OP (&)
+OCTAVE_INT_BITCMP_OP (|)
+OCTAVE_INT_BITCMP_OP (^)
+
+#define OCTAVE_INT_BITSHIFT_OP(OP) \
+ \
+  template <class T1, class T2> \
+  octave_int<T1> \
+  operator OP (const octave_int<T1>& x, const T2& y) \
+  { \
+    return x.value () OP y; \
+  }
+
+OCTAVE_INT_BITSHIFT_OP (<<)
+OCTAVE_INT_BITSHIFT_OP (>>)
+
 #define OCTAVE_INT_CMP_OP(OP) \
  \
   template <class T1, class T2> \
@@ -262,7 +290,7 @@
   operator OP (const octave_int<T1>& x, const octave_int<T2>& y) \
   { \
     return x.value () OP y.value (); \
-  } \
+  }
 
 OCTAVE_INT_CMP_OP (<)
 OCTAVE_INT_CMP_OP (<=)
--- a/scripts/ChangeLog	Thu Jun 17 04:14:36 2004 +0000
+++ b/scripts/ChangeLog	Wed Jun 23 11:11:51 2004 +0000
@@ -1,3 +1,7 @@
+2004-06-22  Etienne Grossmann  <etienne@cs.uky.edu>
+
+	* general/ind2sub.m: Doc fix.
+
 2004-06-08  John W. Eaton  <jwe@octave.org>
 
 	* statistics/tests/kolmogorov_smirnov_test.m: Use func2str to
--- a/scripts/general/ind2sub.m	Thu Jun 17 04:14:36 2004 +0000
+++ b/scripts/general/ind2sub.m	Wed Jun 23 11:11:51 2004 +0000
@@ -18,7 +18,7 @@
 ## 02111-1307, USA.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {[@var{s1}, @var{s2}, @dots{}, @var{sN}] =} sub2ind (@var{dims}, @var{ind})
+## @deftypefn {Function File} {[@var{s1}, @var{s2}, @dots{}, @var{sN}] =} ind2sub (@var{dims}, @var{ind})
 ## Convert a linear index into subscripts.
 ## @end deftypefn
 ## @seealso{sub2ind}
--- a/src/ChangeLog	Thu Jun 17 04:14:36 2004 +0000
+++ b/src/ChangeLog	Wed Jun 23 11:11:51 2004 +0000
@@ -1,3 +1,8 @@
+2004-06-17  John W. Eaton  <jwe@octave.org>
+
+	* bitfcns.cc (bitfcns): New file.
+	* Makefile.in (DIST_SRC): Add it to the list.
+
 2004-06-16  John W. Eaton  <jwe@octave.org>
 
 	* OPERATORS/op-int.h: New file.
--- a/src/Makefile.in	Thu Jun 17 04:14:36 2004 +0000
+++ b/src/Makefile.in	Wed Jun 23 11:11:51 2004 +0000
@@ -136,7 +136,7 @@
 	pt-idx.cc pt-jump.cc pt-loop.cc pt-mat.cc pt-misc.cc \
 	pt-plot.cc pt-pr-code.cc pt-select.cc pt-stmt.cc pt-unop.cc
 
-DIST_SRC := Cell.cc c-file-ptr-stream.cc comment-list.cc \
+DIST_SRC := Cell.cc bitfcns.cc c-file-ptr-stream.cc comment-list.cc \
 	cutils.c data.cc debug.cc defaults.cc defun.cc dirfns.cc \
 	dynamic-ld.cc error.cc file-io.cc fn-cache.cc gripes.cc \
 	help.cc input.cc lex.l load-save.cc ls-hdf5.cc \
--- a/src/ov-base.cc	Thu Jun 17 04:14:36 2004 +0000
+++ b/src/ov-base.cc	Wed Jun 23 11:11:51 2004 +0000
@@ -409,6 +409,70 @@
   return retval;
 }
 
+int8NDArray
+octave_base_value::int8_array_value (void) const
+{
+  int8NDArray retval;
+  gripe_wrong_type_arg ("octave_base_value::int8_array_value()",
+			type_name ());
+}
+
+int16NDArray
+octave_base_value::int16_array_value (void) const
+{
+  int16NDArray retval;
+  gripe_wrong_type_arg ("octave_base_value::int16_array_value()",
+			type_name ());
+}
+
+int32NDArray
+octave_base_value::int32_array_value (void) const
+{
+  int32NDArray retval;
+  gripe_wrong_type_arg ("octave_base_value::int32_array_value()",
+			type_name ());
+}
+
+int64NDArray
+octave_base_value::int64_array_value (void) const
+{
+  int64NDArray retval;
+  gripe_wrong_type_arg ("octave_base_value::int64_array_value()",
+			type_name ());
+}
+
+uint8NDArray
+octave_base_value::uint8_array_value (void) const
+{
+  uint8NDArray retval;
+  gripe_wrong_type_arg ("octave_base_value::uint8_array_value()",
+			type_name ());
+}
+
+uint16NDArray
+octave_base_value::uint16_array_value (void) const
+{
+  uint16NDArray retval;
+  gripe_wrong_type_arg ("octave_base_value::uint16_array_value()",
+			type_name ());
+}
+
+uint32NDArray
+octave_base_value::uint32_array_value (void) const
+{
+  uint32NDArray retval;
+  gripe_wrong_type_arg ("octave_base_value::uint32_array_value()",
+			type_name ());
+}
+
+uint64NDArray
+octave_base_value::uint64_array_value (void) const
+{
+  uint64NDArray retval;
+  gripe_wrong_type_arg ("octave_base_value::uint64_array_value()",
+			type_name ());
+}
+
 string_vector
 octave_base_value::all_strings (bool pad, bool force) const
 {
--- a/src/ov-base.h	Thu Jun 17 04:14:36 2004 +0000
+++ b/src/ov-base.h	Wed Jun 23 11:11:51 2004 +0000
@@ -216,6 +216,22 @@
 
   charNDArray char_array_value (bool = false) const;
 
+  int8NDArray int8_array_value (void) const;
+
+  int16NDArray int16_array_value (void) const;
+
+  int32NDArray int32_array_value (void) const;
+
+  int64NDArray int64_array_value (void) const;
+
+  uint8NDArray uint8_array_value (void) const;
+
+  uint16NDArray uint16_array_value (void) const;
+
+  uint32NDArray uint32_array_value (void) const;
+
+  uint64NDArray uint64_array_value (void) const;
+
   string_vector all_strings (bool pad = false, bool force = false) const;
 
   std::string string_value (bool force = false) const;
--- a/src/ov.h	Thu Jun 17 04:14:36 2004 +0000
+++ b/src/ov.h	Wed Jun 23 11:11:51 2004 +0000
@@ -557,6 +557,30 @@
   virtual charNDArray char_array_value (bool frc_str_conv = false) const
     { return rep->char_array_value (frc_str_conv); }
 
+  virtual int8NDArray int8_array_value (void) const
+    { return rep->int8_array_value (); }
+
+  virtual int16NDArray int16_array_value (void) const
+    { return rep->int16_array_value (); }
+
+  virtual int32NDArray int32_array_value (void) const
+    { return rep->int32_array_value (); }
+
+  virtual int64NDArray int64_array_value (void) const
+    { return rep->int64_array_value (); }
+
+  virtual uint8NDArray uint8_array_value (void) const
+    { return rep->uint8_array_value (); }
+
+  virtual uint16NDArray uint16_array_value (void) const
+    { return rep->uint16_array_value (); }
+
+  virtual uint32NDArray uint32_array_value (void) const
+    { return rep->uint32_array_value (); }
+
+  virtual uint64NDArray uint64_array_value (void) const
+    { return rep->uint64_array_value (); }
+
   virtual string_vector all_strings (bool pad = false,
 				     bool force = false) const
     { return rep->all_strings (pad, force); }