# HG changeset patch # User jwe # Date 1095297099 0 # Node ID d894b803ccb5eab816bb65629cf247870da9cec8 # Parent 6690d8cd9beec8fb9701614d646bb1586696b281 [project @ 2004-09-16 01:11:39 by jwe] diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2004-09-15 John W. Eaton + * 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. diff --git a/src/OPERATORS/op-double-conv.cc b/src/OPERATORS/op-double-conv.cc --- a/src/OPERATORS/op-double-conv.cc +++ b/src/OPERATORS/op-double-conv.cc @@ -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*/ diff --git a/src/OPERATORS/op-int-conv.cc b/src/OPERATORS/op-int-conv.cc --- a/src/OPERATORS/op-int-conv.cc +++ b/src/OPERATORS/op-int-conv.cc @@ -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)