octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave 2.1.58 available for ftp


From: John W. Eaton
Subject: Re: Octave 2.1.58 available for ftp
Date: Fri, 3 Sep 2004 11:43:03 -0400

On  3-Sep-2004, David Bateman <address@hidden> wrote:

| Yes, my matlab R12 copy works like this... This is a bit of a pain
| though as the subsasgn function for the integer types is inherited
| from octave_base_matrix. This means that a new version of subsasgn
| need to be written for the ov-base-int.cc that check first if the
| class is double and treat it one way and if not as it is currently
| treated...

I think it can all be handled by defining appropriate type
conversions.  Please try the following patch.

After applying the patch, here are some tests to run.  They should all
print "ans = 1" for success.

  1;

  function r = check (x, t)
    r = strcmp (typeinfo (x), t);
  endfunction

  x = i; x(2) = int8(2); check (x, "complex matrix")
  x = i; x(2:3,2:3) = int8(2); check (x, "complex matrix")
  x = i; x(2:3,2:3) = eye (2, "int8"); check (x, "complex matrix")

  x = i * eye(2); x(2) = int8(2); check (x, "complex matrix")
  x = i * eye(2); x(2:3,2:3) = int8(2); check (x, "complex matrix")
  x = i * eye(2); x(2:3,2:3) = eye (2, "int8"); check (x, "complex matrix")

  x = 1; x(2) = int8(2); check (x, "matrix")
  x = 1; x(2:3,2:3) = int8(2); check (x, "matrix")
  x = 1; x(2:3,2:3) = eye (2, "int8"); check (x, "matrix")

  x = eye(2); x(2) = int8(2); check (x, "matrix")
  x = eye(2); x(2:3,2:3) = int8(2); check (x, "matrix")
  x = eye(2); x(2:3,2:3) = eye (2, "int8"); check (x, "matrix")

  x = int8(1); x(2) = 2; check (x, "int8 matrix")
  x = int8(1); x(2) = i; check (x, "complex matrix")
  x = int8(1); x(2:3,2:3) = i; check (x, "complex matrix")
  x = int8(1); x(2:3,2:3) = i * eye (2); check (x, "complex matrix")

  x = int8(1); x(2) = int16(2); check (x, "int8 matrix")
  x = int8(1); x(2:3,2:3) = int16(2); check (x, "int8 matrix")
  x = int8(1); x(2:3,2:3) = eye (2, "int16"); check (x, "int8 matrix")

  x = int8(1); x(2) = double(2); check (x, "int8 matrix")
  x = int8(1); x(2:3,2:3) = double(2); check (x, "int8 matrix")
  x = int8(1); x(2:3,2:3) = eye (2, "double"); check (x, "int8 matrix")
  x = int8(1); x(2) = 2; check (x, "int8 matrix")

  x = eye(2, "int8"); x(2) = i; check (x, "complex matrix")
  x = eye (2, "int8"); x(2:3,2:3) = i; check (x, "complex matrix")
  x = eye (2, "int8"); x(2:3,2:3) = i * eye (2); check (x, "complex matrix")

  x = eye (2, "int8"); x(2) = int16(2); check (x, "int8 matrix")
  x = eye (2, "int8"); x(2:3,2:3) = int16(2); check (x, "int8 matrix")
  x = eye (2, "int8"); x(2:3,2:3) = eye (2, "int16"); check (x, "int8 matrix")

  x = eye (2, "int8"); x(2) = double(2); check (x, "int8 matrix")
  x = eye (2, "int8"); x(2:3,2:3) = double(2); check (x, "int8 matrix")
  x = eye (2, "int8"); x(2:3,2:3) = eye (2, "double"); check (x, "int8 matrix")

Note that things like

  x = int8(1); x(2) = int16(2);

  x = int8(1); x(2) = double(2);

and

convert the wider RHS to the narrower LHS type, but

  x = int8(1); x(2) = i;

converts x to a double precision complex matrix.  This happens because
Octave has no integer complex types (Matlab does, so it converts X in
the above to a complex int8 matrix).  I thought it best to convert to
complex, even if we can't preserve the int8 attribute.

Thanks,

jwe


liboctave/ChangeLog:

2004-09-03  John W. Eaton  <address@hidden>

        * oct-inttypes.h (octave_fit_to_range): Use constructor instead of
        static_cast for type conversion.


2004-09-03  John W. Eaton  <address@hidden>

        * OPERATORS/op-int.h (OCTAVE_MS_INT_OPS): Don't define indexed int
        matrix = complex scalar assignment ops.
        (OCTAVE_MS_INT_OPS): Don't define indexed int matrix = complex
        matrix assignment ops.
        (OCTAVE_SM_CONV): New macro.
        (OCTAVE_SM_INT_OPS): Use it to define int scalar -> (int|complex)
        matrix widening ops.
        (OCTAVE_RE_INT_ASSIGN_OPS, OCTAVE_CX_INT_ASSIGN_OPS): New macros.
        (OCTAVE_INT_OPS): Use them here.
        (OCTAVE_INSTALL_SS_INT_OPS): Install indexed int scalar = scalar
        and indexed int scalar = complex scalar assignment conversions.
        (OCTAVE_INSTALL_SM_INT_OPS): Install int scalar -> (int|complex)
        matrix widening ops.  Install indexed int scalar =
        (int|real|complex) matrix assignment conversions.
        (OCTAVE_INSTALL_MS_INT_OPS): Install indexed int matrix = complex
        scalar assignment conversion.
        (OCTAVE_INSTALL_MM_INT_OPS): Install int matrix -> complex matrix
        widening op.  Install indexed int matrix = complex matrix
        assignment conversion.
        (OCTAVE_INSTALL_RE_INT_ASSIGN_OPS, OCTAVE_INSTALL_CX_INT_ASSIGN_OPS):
        New macros.
        (OCTAVE_INSTALL_INT_OPS): Use them.

        * op-int.h: (OCTAVE_INSTALL_SM_INT_ASSIGNCONV): New macro.
        * OPERATORS/op-i8-i8.cc, OPERATORS/op-i16-i16.cc,
        OPERATORS/op-i32-i32.cc, OPERATORS/op-i64-i64.cc,
        OPERATORS/op-ui8-ui8.cc, OPERATORS/op-ui16-ui16.cc,
        OPERATORS/op-ui32-ui32.cc, OPERATORS/op-ui64-ui64.cc:
        Use it to define mixed size integer scalar/integer matrix
        assignment conversions.

        * ov-intx.h (OCTAVE_VALUE_INT_MATRIX_T::complex_array_value,
        OCTAVE_VALUE_INT_SCALAR_T::complex_array_vale):
        New functions.
 

Index: liboctave/oct-inttypes.h
===================================================================
RCS file: /usr/local/cvsroot/octave/liboctave/oct-inttypes.h,v
retrieving revision 1.10
diff -u -r1.10 oct-inttypes.h
--- a/liboctave/oct-inttypes.h  1 Sep 2004 21:10:28 -0000       1.10
+++ b/liboctave/oct-inttypes.h  3 Sep 2004 15:22:02 -0000
@@ -133,7 +133,7 @@
 inline T2
 octave_int_fit_to_range (const T1& x, const T2& mn, const T2& mx)
 {
-  return (x > mx ? mx : (x < mn ? mn : static_cast<T2> (x)));
+  return (x > mx ? mx : (x < mn ? mn : T2 (x)));
 }
 
 // If X is unsigned and the new type is signed, then we only have to
Index: src/ov-intx.h
===================================================================
RCS file: /usr/local/cvsroot/octave/src/ov-intx.h,v
retrieving revision 1.5
diff -u -r1.5 ov-intx.h
--- a/src/ov-intx.h     31 Aug 2004 05:30:47 -0000      1.5
+++ b/src/ov-intx.h     3 Sep 2004 15:22:07 -0000
@@ -68,7 +68,17 @@
       NDArray retval (matrix.dims ()); 
       int nel = matrix.numel ();
       for (int i = 0; i < nel; i++)
-        retval (i) = double (matrix(i));
+        retval(i) = double (matrix(i));
+      return retval;
+    }
+
+  ComplexNDArray
+  complex_array_value (bool = false) const
+    { 
+      ComplexNDArray retval (matrix.dims ()); 
+      int nel = matrix.numel ();
+      for (int i = 0; i < nel; i++)
+        retval(i) = Complex (matrix(i));
       return retval;
     }
 
@@ -123,7 +133,15 @@
   array_value (bool = false) const
     { 
       NDArray retval (dim_vector (1,1)); 
-      retval (0) = double (scalar);
+      retval(0) = double (scalar);
+      return retval;
+    }
+
+  ComplexNDArray
+  complex_array_value (bool = false) const
+    { 
+      ComplexNDArray retval (dim_vector (1,1)); 
+      retval(0) = Complex (scalar);
       return retval;
     }
 
Index: src/OPERATORS/op-i16-i16.cc
===================================================================
RCS file: /usr/local/cvsroot/octave/src/OPERATORS/op-i16-i16.cc,v
retrieving revision 1.3
diff -u -r1.3 op-i16-i16.cc
--- a/src/OPERATORS/op-i16-i16.cc       1 Sep 2004 21:10:28 -0000       1.3
+++ b/src/OPERATORS/op-i16-i16.cc       3 Sep 2004 15:22:07 -0000
@@ -88,6 +88,14 @@
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmui32, int16_, uint32_);
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmi64, int16_, int64_);
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmui64, int16_, uint64_);
+
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int16, int8);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int16, uint8);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int16, uint16);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int16, int32);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int16, uint32);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int16, int64);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int16, uint64);
 }
 
 /*
Index: src/OPERATORS/op-i32-i32.cc
===================================================================
RCS file: /usr/local/cvsroot/octave/src/OPERATORS/op-i32-i32.cc,v
retrieving revision 1.3
diff -u -r1.3 op-i32-i32.cc
--- a/src/OPERATORS/op-i32-i32.cc       1 Sep 2004 21:10:28 -0000       1.3
+++ b/src/OPERATORS/op-i32-i32.cc       3 Sep 2004 15:22:07 -0000
@@ -88,6 +88,14 @@
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmui32, int32_, uint32_);
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmi64, int32_, int64_);
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmui64, int32_, uint64_);
+
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int32, int8);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int32, uint8);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int32, int16);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int32, uint16);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int32, uint32);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int32, int64);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int32, uint64);
 }
 
 /*
Index: src/OPERATORS/op-i64-i64.cc
===================================================================
RCS file: /usr/local/cvsroot/octave/src/OPERATORS/op-i64-i64.cc,v
retrieving revision 1.3
diff -u -r1.3 op-i64-i64.cc
--- a/src/OPERATORS/op-i64-i64.cc       1 Sep 2004 21:10:28 -0000       1.3
+++ b/src/OPERATORS/op-i64-i64.cc       3 Sep 2004 15:22:07 -0000
@@ -124,6 +124,14 @@
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmi32, int64_, int32_);
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmui32, int64_, uint32_);
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmui64, int64_, uint64_);
+
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int64, int8);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int64, uint8);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int64, int16);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int64, uint16);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int64, int32);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int64, uint32);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int64, uint64);
 }
 
 /*
Index: src/OPERATORS/op-i8-i8.cc
===================================================================
RCS file: /usr/local/cvsroot/octave/src/OPERATORS/op-i8-i8.cc,v
retrieving revision 1.3
diff -u -r1.3 op-i8-i8.cc
--- a/src/OPERATORS/op-i8-i8.cc 1 Sep 2004 21:10:28 -0000       1.3
+++ b/src/OPERATORS/op-i8-i8.cc 3 Sep 2004 15:22:07 -0000
@@ -88,6 +88,14 @@
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmui32, int8_, uint32_);
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmi64, int8_, int64_);
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmui64, int8_, uint64_);
+
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int8, uint8);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int8, int16);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int8, uint16);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int8, int32);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int8, uint32);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int8, int64);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int8, uint64);
 }
 
 /*
Index: src/OPERATORS/op-int.h
===================================================================
RCS file: /usr/local/cvsroot/octave/src/OPERATORS/op-int.h,v
retrieving revision 1.4
diff -u -r1.4 op-int.h
--- a/src/OPERATORS/op-int.h    1 Sep 2004 21:10:28 -0000       1.4
+++ b/src/OPERATORS/op-int.h    3 Sep 2004 15:22:08 -0000
@@ -215,6 +215,14 @@
     return octave_value (result); \
   }
 
+#define OCTAVE_SM_CONV(TS, TM) \
+  DEFCONV (TS ## s_ ## TM ## m_conv, TM ## scalar, TM ## matrix) \
+  { \
+    CAST_CONV_ARG (const octave_ ## TS ## scalar&); \
+ \
+    return new octave_ ## TM ## matrix (v.TM ## array_value ()); \
+  }
+
 #define OCTAVE_SM_INT_OPS(TYPE) \
   OCTAVE_SM_POW_OPS (TYPE, TYPE) \
   OCTAVE_SM_INT_ARITH_OPS (sm, TYPE ## _, TYPE ## _) \
@@ -223,13 +231,8 @@
   OCTAVE_SM_INT_CMP_OPS (xm, , TYPE ## _) \
   OCTAVE_SM_INT_BOOL_OPS (sm, TYPE ## _, TYPE ## _) \
   OCTAVE_SM_INT_BOOL_OPS (xm, , TYPE ## _) \
- \
-  /* DEFCONV (TYPE ## _matrix_conv, TYPE ## _scalar, TYPE ## _matrix) */ \
-  /* { */ \
-  /* CAST_CONV_ARG (const octave_ ## TYPE ## _scalar&); */ \
-  /* */ \
-  /* return new octave_ ## TYPE ## _matrix (v.TYPE ## _matrix_value ()); */ \
-  /* } */
+  OCTAVE_SM_CONV (TYPE ## _, TYPE ## _) \
+  OCTAVE_SM_CONV (TYPE ## _, complex_)
 
 #define OCTAVE_SM_INT_OPS2(TS, TM) \
   OCTAVE_SM_INT_ARITH_OPS (sm, TS, TM) \
@@ -323,8 +326,7 @@
   OCTAVE_MS_INT_BOOL_OPS (ms, TYPE ## _, TYPE ## _) \
   OCTAVE_MS_INT_BOOL_OPS (mx, TYPE ## _, ) \
   OCTAVE_MS_INT_ASSIGN_OPS (ms, TYPE ## _, TYPE ## _, TYPE ## _) \
-  OCTAVE_MS_INT_ASSIGN_OPS (mx, TYPE ## _, , ) \
-  OCTAVE_MS_INT_ASSIGN_OPS (mc, TYPE ## _, complex_, )
+  OCTAVE_MS_INT_ASSIGN_OPS (mx, TYPE ## _, , )
 
 #define OCTAVE_M_INT_UNOPS(TYPE) \
   /* matrix unary ops. */ \
@@ -420,20 +422,29 @@
   OCTAVE_MM_INT_CMP_OPS (TYPE, TYPE) \
   OCTAVE_MM_INT_BOOL_OPS (TYPE, TYPE) \
   OCTAVE_MM_INT_ASSIGN_OPS (mm, TYPE ## _, TYPE ## _, TYPE ## _) \
-  OCTAVE_MM_INT_ASSIGN_OPS (mmx, TYPE ## _, , ) \
-  OCTAVE_MM_INT_ASSIGN_OPS (mmc, TYPE ## _, complex_, )
+  OCTAVE_MM_INT_ASSIGN_OPS (mmx, TYPE ## _, , )
 
 #define OCTAVE_MM_INT_OPS2(T1, T2) \
   OCTAVE_MM_INT_ARITH_OPS (mm, T1, T2) \
   OCTAVE_MM_INT_CMP_OPS (mm, T1, T2) \
   OCTAVE_MM_INT_BOOL_OPS (mm, T1, T2)
 
+#define OCTAVE_RE_INT_ASSIGN_OPS(TYPE) \
+  DEFNDASSIGNOP_FN (TYPE ## ms_assign, matrix, TYPE ## _scalar, array, assign) 
\
+  DEFNDASSIGNOP_FN (TYPE ## mm_assign, matrix, TYPE ## _matrix, array, assign)
+
+#define OCTAVE_CX_INT_ASSIGN_OPS(TYPE) \
+  DEFNDASSIGNOP_FN (TYPE ## cms_assign, complex_matrix, TYPE ## _scalar, 
complex_array, assign) \
+  DEFNDASSIGNOP_FN (TYPE ## cmm_assign, complex_matrix, TYPE ## _matrix, 
complex_array, assign)
+
 #define OCTAVE_INT_OPS(TYPE) \
   OCTAVE_SS_INT_OPS (TYPE) \
   OCTAVE_SM_INT_OPS (TYPE) \
   OCTAVE_MS_INT_OPS (TYPE) \
   OCTAVE_MM_INT_OPS (TYPE) \
-  OCTAVE_CONCAT_FN (TYPE)
+  OCTAVE_CONCAT_FN (TYPE) \
+  OCTAVE_RE_INT_ASSIGN_OPS (TYPE) \
+  OCTAVE_CX_INT_ASSIGN_OPS (TYPE)
 
 #define OCTAVE_INSTALL_S_INT_UNOPS(TYPE) \
   INSTALL_UNOP (op_not, octave_ ## TYPE ## _scalar, s_not); \
@@ -479,7 +490,9 @@
   OCTAVE_INSTALL_SS_INT_BOOL_OPS (ss, TYPE ## _, TYPE ## _) \
   OCTAVE_INSTALL_SS_INT_BOOL_OPS (sx, TYPE ## _, ) \
   OCTAVE_INSTALL_SS_INT_BOOL_OPS (xs, , TYPE ## _) \
-  INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _scalar, 
octave_ ## TYPE ## _matrix)
+  INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _scalar, 
octave_ ## TYPE ## _matrix) \
+  INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_scalar, octave_ ## 
TYPE ## _matrix) \
+  INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_complex_scalar, 
octave_complex_matrix)
 
 #define OCTAVE_INSTALL_SS_INT_OPS2(T1, T2) \
   OCTAVE_INSTALL_SS_INT_ARITH_OPS (ss, T1, T2) \
@@ -517,8 +530,11 @@
   OCTAVE_INSTALL_SM_INT_CMP_OPS (xm, , TYPE ## _) \
   OCTAVE_INSTALL_SM_INT_BOOL_OPS (sm, TYPE ## _, TYPE ## _) \
   OCTAVE_INSTALL_SM_INT_BOOL_OPS (xm, , TYPE ## _) \
-  /* INSTALL_WIDENOP (octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _matrix, 
TYPE ## _matrix_conv); */ \
-  INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _matrix, 
octave_ ## TYPE ## _matrix)
+  INSTALL_WIDENOP (octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _matrix, 
TYPE ## _matrix_conv) \
+  INSTALL_WIDENOP (octave_ ## TYPE ## _scalar, octave_complex_matrix, 
complex_matrix_conv) \
+  INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _matrix, 
octave_ ## TYPE ## _matrix) \
+  INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_matrix, octave_ ## 
TYPE ## _matrix) \
+  INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_complex_matrix, 
octave_complex_matrix)
 
 #define OCTAVE_INSTALL_SM_INT_OPS2(T1, T2) \
   OCTAVE_INSTALL_SM_INT_ARITH_OPS (sm, T1, T2) \
@@ -562,7 +578,7 @@
   OCTAVE_INSTALL_MS_INT_BOOL_OPS (mx, TYPE ## _, ) \
   OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (ms, TYPE ## _, TYPE ## _) \
   OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (mx, TYPE ## _, ) \
-  OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (mc, TYPE ## _, complex_)
+  INSTALL_ASSIGNCONV (octave_ ## TYPE ## _matrix, octave_complex_scalar, 
octave_complex_matrix)
 
 #define OCTAVE_INSTALL_MS_INT_OPS2(T1, T2) \
   OCTAVE_INSTALL_MS_INT_ARITH_OPS (ms, T1, T2) \
@@ -612,23 +628,41 @@
   OCTAVE_INSTALL_MM_INT_BOOL_OPS (TYPE, TYPE) \
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mm, TYPE ## _, TYPE ## _) \
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmx, TYPE ## _, ) \
-  OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmc, TYPE ## _, complex_)
+  INSTALL_WIDENOP (octave_ ## TYPE ## _matrix, octave_complex_matrix, 
complex_matrix_conv) \
+  INSTALL_ASSIGNCONV (octave_ ## TYPE ## _matrix, octave_complex_matrix, 
octave_complex_matrix)
 
 #define OCTAVE_INSTALL_MM_INT_OPS2(T1, T2) \
   OCTAVE_INSTALL_MM_INT_ARITH_OPS (T1, T2) \
   OCTAVE_INSTALL_MM_INT_CMP_OPS (T1, T2) \
   OCTAVE_INSTALL_MM_INT_BOOL_OPS (T1, T2)
 
+#define OCTAVE_INSTALL_RE_INT_ASSIGN_OPS(TYPE) \
+  INSTALL_ASSIGNOP (op_asn_eq, octave_matrix, octave_ ## TYPE ## _scalar, TYPE 
## ms_assign) \
+  INSTALL_ASSIGNOP (op_asn_eq, octave_matrix, octave_ ## TYPE ## _matrix, TYPE 
## mm_assign) \
+  INSTALL_ASSIGNCONV (octave_scalar, octave_ ## TYPE ## _scalar, 
octave_matrix) \
+  INSTALL_ASSIGNCONV (octave_scalar, octave_ ## TYPE ## _matrix, octave_matrix)
+
+#define OCTAVE_INSTALL_CX_INT_ASSIGN_OPS(TYPE) \
+  INSTALL_ASSIGNOP (op_asn_eq, octave_complex_matrix, octave_ ## TYPE ## 
_scalar, TYPE ## cms_assign) \
+  INSTALL_ASSIGNOP (op_asn_eq, octave_complex_matrix, octave_ ## TYPE ## 
_matrix, TYPE ## cmm_assign) \
+  INSTALL_ASSIGNCONV (octave_complex_scalar, octave_ ## TYPE ## _scalar, 
octave_complex_matrix) \
+  INSTALL_ASSIGNCONV (octave_complex_scalar, octave_ ## TYPE ## _matrix, 
octave_complex_matrix)
+
 #define OCTAVE_INSTALL_INT_OPS(TYPE) \
   OCTAVE_INSTALL_SS_INT_OPS (TYPE) \
   OCTAVE_INSTALL_SM_INT_OPS (TYPE) \
   OCTAVE_INSTALL_MS_INT_OPS (TYPE) \
   OCTAVE_INSTALL_MM_INT_OPS (TYPE) \
-  OCTAVE_INSTALL_CONCAT_FN (TYPE)
+  OCTAVE_INSTALL_CONCAT_FN (TYPE) \
+  OCTAVE_INSTALL_RE_INT_ASSIGN_OPS (TYPE) \
+  OCTAVE_INSTALL_CX_INT_ASSIGN_OPS (TYPE)
+
+#define OCTAVE_INSTALL_SM_INT_ASSIGNCONV(TLHS, TRHS) \
+  INSTALL_ASSIGNCONV (octave_ ## TLHS ## _scalar, octave_ ## TRHS ## _scalar, 
octave_ ## TLHS ## _matrix) \
+  INSTALL_ASSIGNCONV (octave_ ## TLHS ## _scalar, octave_ ## TRHS ## _matrix, 
octave_ ## TLHS ## _matrix)
 
 /*
 ;;; Local Variables: ***
 ;;; mode: C++ ***
 ;;; End: ***
 */
-
Index: src/OPERATORS/op-ui16-ui16.cc
===================================================================
RCS file: /usr/local/cvsroot/octave/src/OPERATORS/op-ui16-ui16.cc,v
retrieving revision 1.3
diff -u -r1.3 op-ui16-ui16.cc
--- a/src/OPERATORS/op-ui16-ui16.cc     1 Sep 2004 21:10:28 -0000       1.3
+++ b/src/OPERATORS/op-ui16-ui16.cc     3 Sep 2004 15:22:08 -0000
@@ -88,6 +88,14 @@
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmui32, uint16_, uint32_);
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmi64, uint16_, int64_);
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmui64, uint16_, uint64_);
+
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint16, int8);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint16, uint8);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint16, int16);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint16, int32);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint16, uint32);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint16, int64);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint16, uint64);
 }
 
 /*
Index: src/OPERATORS/op-ui32-ui32.cc
===================================================================
RCS file: /usr/local/cvsroot/octave/src/OPERATORS/op-ui32-ui32.cc,v
retrieving revision 1.3
diff -u -r1.3 op-ui32-ui32.cc
--- a/src/OPERATORS/op-ui32-ui32.cc     1 Sep 2004 21:10:28 -0000       1.3
+++ b/src/OPERATORS/op-ui32-ui32.cc     3 Sep 2004 15:22:08 -0000
@@ -88,6 +88,14 @@
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmi32, uint32_, int32_);
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmi64, uint32_, int64_);
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmui64, uint32_, uint64_);
+
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint32, int8);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint32, uint8);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint32, int16);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint32, uint16);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint32, int32);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint32, int64);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint32, uint64);
 }
 
 /*
Index: src/OPERATORS/op-ui64-ui64.cc
===================================================================
RCS file: /usr/local/cvsroot/octave/src/OPERATORS/op-ui64-ui64.cc,v
retrieving revision 1.3
diff -u -r1.3 op-ui64-ui64.cc
--- a/src/OPERATORS/op-ui64-ui64.cc     1 Sep 2004 21:10:28 -0000       1.3
+++ b/src/OPERATORS/op-ui64-ui64.cc     3 Sep 2004 15:22:08 -0000
@@ -124,6 +124,14 @@
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmi32, uint64_, int32_);
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmui32, uint64_, uint32_);
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmi64, uint64_, int64_);
+
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint64, int8);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint64, uint8);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint64, int16);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint64, uint16);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint64, int32);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint64, uint32);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint64, int64);
 }
 
 /*
Index: src/OPERATORS/op-ui8-ui8.cc
===================================================================
RCS file: /usr/local/cvsroot/octave/src/OPERATORS/op-ui8-ui8.cc,v
retrieving revision 1.3
diff -u -r1.3 op-ui8-ui8.cc
--- a/src/OPERATORS/op-ui8-ui8.cc       1 Sep 2004 21:10:28 -0000       1.3
+++ b/src/OPERATORS/op-ui8-ui8.cc       3 Sep 2004 15:22:08 -0000
@@ -88,6 +88,14 @@
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmui32, uint8_, uint32_);
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmi64, uint8_, int64_);
   OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmui64, uint8_, uint64_);
+
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint8, int8);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint8, int16);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint8, uint16);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint8, int32);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint8, uint32);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint8, int64);
+  OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint8, uint64);
 }
 
 /*



reply via email to

[Prev in Thread] Current Thread [Next in Thread]