changeset 5032:3361e0846469

[project @ 2004-09-24 03:56:41 by jwe]
author jwe
date Fri, 24 Sep 2004 03:57:04 +0000
parents 5d1e2102d447
children 3dcc3824b732
files src/ChangeLog src/OPERATORS/op-double-conv.cc src/OPERATORS/op-int-conv.cc src/ops.h
diffstat 4 files changed, 37 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri Sep 24 03:50:58 2004 +0000
+++ b/src/ChangeLog	Fri Sep 24 03:57:04 2004 +0000
@@ -1,5 +1,14 @@
 2004-09-23  John W. Eaton  <jwe@octave.org>
 
+	* ops.h	(DEFSTRDBLCONVFN): New macro.
+	* OPERATORS/op-double-conv.cc: Use it to define new conversion op.
+	Define new range to double matrix conversion.
+	(install_int_conv_ops): Install new ops.	
+
+	* ops.h	(DEFSTRINTCONVFN): New macro.
+	* OPERATORS/op-int-conv.cc: Use it to define new conversion ops.
+	(install_int_conv_ops): Install them.
+
 	* (OCTAVE_SS_INT_OPS2, OCTAVE_SM_INT_OPS2, OCTAVE_MM_INT_OPS2,
 	OCTAVE_INSTALL_SS_INT_OPS2, OCTAVE_INSTALL_SM_INT_OPS2,
 	OCTAVE_INSTALL_MS_INT_OPS2, OCTAVE_INSTALL_MM_INT_OPS2):
--- a/src/OPERATORS/op-double-conv.cc	Fri Sep 24 03:50:58 2004 +0000
+++ b/src/OPERATORS/op-double-conv.cc	Fri Sep 24 03:57:04 2004 +0000
@@ -41,8 +41,10 @@
 #include "ov-uint64.h"
 #include "ov-bool.h"
 #include "ov-bool-mat.h"
+#include "ov-range.h"
 #include "ov-scalar.h"
 #include "ov-re-mat.h"
+#include "ov-str-mat.h"
 #include "ov-typeinfo.h"
 #include "ops.h"
 
@@ -71,6 +73,10 @@
 DEFDBLCONVFN (bool_matrix_to_double_matrix, bool_matrix, bool_array)
 DEFDBLCONVFN (bool_scalar_to_double_matrix, bool, bool_array)
 
+DEFDBLCONVFN (range_to_double_matrix, range, array)
+
+DEFSTRDBLCONVFN(char_matrix_str_to_double_matrix)
+
 DEFDBLCONVFN (double_scalar_to_double_matrix, scalar, array)
 
 void
@@ -99,6 +105,10 @@
   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_range, octave_matrix, range_to_double_matrix);
+
+  INSTALL_CONVOP (octave_char_matrix_str, octave_matrix, char_matrix_str_to_double_matrix);
+
   INSTALL_CONVOP (octave_scalar, octave_matrix, double_scalar_to_double_matrix);
 }
 
--- a/src/OPERATORS/op-int-conv.cc	Fri Sep 24 03:50:58 2004 +0000
+++ b/src/OPERATORS/op-int-conv.cc	Fri Sep 24 03:57:04 2004 +0000
@@ -44,6 +44,7 @@
 #include "ov-bool-mat.h"
 #include "ov-scalar.h"
 #include "ov-re-mat.h"
+#include "ov-str-mat.h"
 #include "ov-typeinfo.h"
 #include "ops.h"
 
@@ -89,6 +90,16 @@
 DEFCONVFN (bool_matrix_to_uint32, bool_matrix, uint32)
 DEFCONVFN (bool_matrix_to_uint64, bool_matrix, uint64)
 
+DEFSTRINTCONVFN (char_matrix_str_to_int8, int8)
+DEFSTRINTCONVFN (char_matrix_str_to_int16, int16)
+DEFSTRINTCONVFN (char_matrix_str_to_int32, int32)
+DEFSTRINTCONVFN (char_matrix_str_to_int64, int64)
+
+DEFSTRINTCONVFN (char_matrix_str_to_uint8, uint8)
+DEFSTRINTCONVFN (char_matrix_str_to_uint16, uint16)
+DEFSTRINTCONVFN (char_matrix_str_to_uint32, uint32)
+DEFSTRINTCONVFN (char_matrix_str_to_uint64, uint64)
+
 DEFCONVFN (range_to_int8, range, int8)
 DEFCONVFN (range_to_int16, range, int16)
 DEFCONVFN (range_to_int32, range, int32)
@@ -170,6 +181,7 @@
   INSTALL_CONVOPS (bool)
   INSTALL_CONVOPS (bool_matrix)
   INSTALL_CONVOPS (range)
+  INSTALL_CONVOPS (char_matrix_str)
 
   INSTALL_INT_CONV_FUNCTIONS (int8)
   INSTALL_INT_CONV_FUNCTIONS (int16)
--- a/src/ops.h	Fri Sep 24 03:50:58 2004 +0000
+++ b/src/ops.h	Fri Sep 24 03:57:04 2004 +0000
@@ -208,6 +208,12 @@
     return new octave_matrix (NDArray (v.e ## _value ())); \
   }
 
+#define DEFSTRINTCONVFN(name, tto) \
+  DEFCONVFNX(name, char_matrix_str, tto ## _matrix, tto, char_)
+
+#define DEFSTRDBLCONVFN(name) \
+  DEFCONVFNX(name, char_matrix_str, matrix, , char_)
+
 #define DEFCONVFN(name, tfrom, tto) \
   DEFCONVFNX (name, tfrom, tto ## _matrix, tto, )