Mercurial > hg > octave-nkf
changeset 4963:573d23f9c9cf
[project @ 2004-09-03 15:43:29 by jwe]
author | jwe |
---|---|
date | Fri, 03 Sep 2004 15:43:30 +0000 |
parents | 0ab18cbe8b5f |
children | 269c3d6c0569 |
files | liboctave/ChangeLog liboctave/oct-inttypes.h src/ChangeLog src/OPERATORS/op-i16-i16.cc src/OPERATORS/op-i32-i32.cc src/OPERATORS/op-i64-i64.cc src/OPERATORS/op-i8-i8.cc src/OPERATORS/op-int.h src/OPERATORS/op-ui16-ui16.cc src/OPERATORS/op-ui32-ui32.cc src/OPERATORS/op-ui64-ui64.cc src/OPERATORS/op-ui8-ui8.cc src/ov-intx.h |
diffstat | 13 files changed, 180 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,8 @@ +2004-09-03 John W. Eaton <jwe@octave.org> + + * oct-inttypes.h (octave_fit_to_range): Use constructor instead of + static_cast for type conversion. + 2004-09-01 John W. Eaton <jwe@octave.org> * oct-inttypes.h (pow, operator +, operator -, operator *,
--- a/liboctave/oct-inttypes.h +++ b/liboctave/oct-inttypes.h @@ -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
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,40 @@ +2004-09-03 John W. Eaton <jwe@octave.org> + + * 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. + 2004-09-02 John W. Eaton <jwe@octave.org> * DLD-FUNCTIONS/quad.cc (Fquad): Pass "__quad_fcn_" instead of
--- a/src/OPERATORS/op-i16-i16.cc +++ b/src/OPERATORS/op-i16-i16.cc @@ -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); } /*
--- a/src/OPERATORS/op-i32-i32.cc +++ b/src/OPERATORS/op-i32-i32.cc @@ -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); } /*
--- a/src/OPERATORS/op-i64-i64.cc +++ b/src/OPERATORS/op-i64-i64.cc @@ -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); } /*
--- a/src/OPERATORS/op-i8-i8.cc +++ b/src/OPERATORS/op-i8-i8.cc @@ -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); } /*
--- a/src/OPERATORS/op-int.h +++ b/src/OPERATORS/op-int.h @@ -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: *** */ -
--- a/src/OPERATORS/op-ui16-ui16.cc +++ b/src/OPERATORS/op-ui16-ui16.cc @@ -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); } /*
--- a/src/OPERATORS/op-ui32-ui32.cc +++ b/src/OPERATORS/op-ui32-ui32.cc @@ -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); } /*
--- a/src/OPERATORS/op-ui64-ui64.cc +++ b/src/OPERATORS/op-ui64-ui64.cc @@ -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); } /*
--- a/src/OPERATORS/op-ui8-ui8.cc +++ b/src/OPERATORS/op-ui8-ui8.cc @@ -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); } /*
--- a/src/ov-intx.h +++ b/src/ov-intx.h @@ -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; }