changeset 5002:d894b803ccb5

[project @ 2004-09-16 01:11:39 by jwe]
author jwe
date Thu, 16 Sep 2004 01:11:39 +0000
parents 6690d8cd9bee
children a0e7231a58eb
files src/ChangeLog src/OPERATORS/op-double-conv.cc src/OPERATORS/op-int-conv.cc
diffstat 3 files changed, 38 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Sep 16 00:31:43 2004 +0000
+++ b/src/ChangeLog	Thu Sep 16 01:11:39 2004 +0000
@@ -1,5 +1,10 @@
 2004-09-15  John W. Eaton  <jwe@octave.org>
 
+	* OPERATORS/op-int-conv.cc: Define and install bool to int
+	conversions.
+	* OPERATORS/op-double-conv.cc: Define and install bool to double
+	conversions.
+
 	* ov.cc (octave_value::assign): Handle subsref for containers.
 	* oct-lvalue.cc (octave_lvale::value): Likewise.
 
--- a/src/OPERATORS/op-double-conv.cc	Thu Sep 16 00:31:43 2004 +0000
+++ b/src/OPERATORS/op-double-conv.cc	Thu Sep 16 01:11:39 2004 +0000
@@ -39,6 +39,8 @@
 #include "ov-uint16.h"
 #include "ov-uint32.h"
 #include "ov-uint64.h"
+#include "ov-bool.h"
+#include "ov-bool-mat.h"
 #include "ov-scalar.h"
 #include "ov-re-mat.h"
 #include "ov-typeinfo.h"
@@ -66,6 +68,9 @@
 DEFDBLCONVFN (uint32_scalar_to_double_matrix, uint32_scalar, uint32_array)
 DEFDBLCONVFN (uint64_scalar_to_double_matrix, uint64_scalar, uint64_array)
 
+DEFDBLCONVFN (bool_matrix_to_double_matrix, bool_matrix, bool_array)
+DEFDBLCONVFN (bool_scalar_to_double_matrix, bool, bool_array)
+
 DEFDBLCONVFN (double_scalar_to_double_matrix, scalar, array)
 
 void
@@ -91,6 +96,9 @@
   INSTALL_CONVOP (octave_uint32_scalar, octave_matrix, uint32_scalar_to_double_matrix);
   INSTALL_CONVOP (octave_uint64_scalar, octave_matrix, uint64_scalar_to_double_matrix);
 
+  INSTALL_CONVOP (octave_bool_matrix, octave_matrix, bool_matrix_to_double_matrix);
+  INSTALL_CONVOP (octave_bool, octave_matrix, bool_scalar_to_double_matrix);
+
   INSTALL_CONVOP (octave_scalar, octave_matrix, double_scalar_to_double_matrix);
 }
 
@@ -98,4 +106,4 @@
 ;;; Local Variables: ***
 ;;; mode: C++ ***
 ;;; End: ***
-*/
+p*/
--- a/src/OPERATORS/op-int-conv.cc	Thu Sep 16 00:31:43 2004 +0000
+++ b/src/OPERATORS/op-int-conv.cc	Thu Sep 16 01:11:39 2004 +0000
@@ -40,6 +40,8 @@
 #include "ov-uint32.h"
 #include "ov-uint64.h"
 #include "ov-range.h"
+#include "ov-bool.h"
+#include "ov-bool-mat.h"
 #include "ov-scalar.h"
 #include "ov-re-mat.h"
 #include "ov-typeinfo.h"
@@ -67,6 +69,26 @@
 DEFCONVFN (matrix_to_uint32, matrix, uint32)
 DEFCONVFN (matrix_to_uint64, matrix, uint64)
 
+DEFCONVFN (bool_to_int8, bool, int8)
+DEFCONVFN (bool_to_int16, bool, int16)
+DEFCONVFN (bool_to_int32, bool, int32)
+DEFCONVFN (bool_to_int64, bool, int64)
+
+DEFCONVFN (bool_to_uint8, bool, uint8)
+DEFCONVFN (bool_to_uint16, bool, uint16)
+DEFCONVFN (bool_to_uint32, bool, uint32)
+DEFCONVFN (bool_to_uint64, bool, uint64)
+
+DEFCONVFN (bool_matrix_to_int8, bool_matrix, int8)
+DEFCONVFN (bool_matrix_to_int16, bool_matrix, int16)
+DEFCONVFN (bool_matrix_to_int32, bool_matrix, int32)
+DEFCONVFN (bool_matrix_to_int64, bool_matrix, int64)
+
+DEFCONVFN (bool_matrix_to_uint8, bool_matrix, uint8)
+DEFCONVFN (bool_matrix_to_uint16, bool_matrix, uint16)
+DEFCONVFN (bool_matrix_to_uint32, bool_matrix, uint32)
+DEFCONVFN (bool_matrix_to_uint64, bool_matrix, uint64)
+
 DEFCONVFN (range_to_int8, range, int8)
 DEFCONVFN (range_to_int16, range, int16)
 DEFCONVFN (range_to_int32, range, int32)
@@ -145,6 +167,8 @@
 {
   INSTALL_CONVOPS (scalar)
   INSTALL_CONVOPS (matrix)
+  INSTALL_CONVOPS (bool)
+  INSTALL_CONVOPS (bool_matrix)
   INSTALL_CONVOPS (range)
 
   INSTALL_INT_CONV_FUNCTIONS (int8)