# HG changeset patch # User Jaroslav Hajek # Date 1263471369 -3600 # Node ID fd262afea1d15c1ce77ef797191ea91c191e0fa6 # Parent edbe47bc0f8827ccdd0389ce11440794891c621f optimize bsxfun for chars diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,8 @@ +2010-01-14 Jaroslav Hajek + + * chNDArray.h: Declare relational bsxfun ops. + * chNDArray.cc: Define them. + 2010-01-14 John W. Eaton * CMatrix.cc: Fix prototype for zherk. diff --git a/liboctave/chNDArray.cc b/liboctave/chNDArray.cc --- a/liboctave/chNDArray.cc +++ b/liboctave/chNDArray.cc @@ -32,6 +32,8 @@ #include "lo-mappers.h" #include "mx-op-defs.h" +#include "bsxfun-defs.cc" + // FIXME -- this is not quite the right thing. boolNDArray @@ -161,6 +163,8 @@ NDND_CMP_OPS (charNDArray, charNDArray) NDND_BOOL_OPS (charNDArray, charNDArray) +BSXFUN_STDREL_DEFS_MXLOOP (charNDArray) + /* ;;; Local Variables: *** ;;; mode: C++ *** diff --git a/liboctave/chNDArray.h b/liboctave/chNDArray.h --- a/liboctave/chNDArray.h +++ b/liboctave/chNDArray.h @@ -28,6 +28,7 @@ #include "mx-defs.h" #include "mx-op-decl.h" +#include "bsxfun-decl.h" class OCTAVE_API @@ -111,6 +112,8 @@ MARRAY_FORWARD_DEFS (MArrayN, charNDArray, char) +BSXFUN_STDREL_DECLS (charNDArray, OCTAVE_API) + #endif /* diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-01-14 Jaroslav Hajek + + * DLD-FUNCTIONS/bsxfun.cc (maybe_fill_table): register relational + handlers for char arrays. + 2010-01-14 Jaroslav Hajek * ov-class.cc (octave_class::numel (const octave_value_list&)): Don't diff --git a/src/DLD-FUNCTIONS/bsxfun.cc b/src/DLD-FUNCTIONS/bsxfun.cc --- a/src/DLD-FUNCTIONS/bsxfun.cc +++ b/src/DLD-FUNCTIONS/bsxfun.cc @@ -175,6 +175,14 @@ REGISTER_OP_HANDLER (bsxfun_builtin_power, btyp_complex, ComplexNDArray, bsxfun_pow); REGISTER_OP_HANDLER (bsxfun_builtin_power, btyp_float_complex, FloatComplexNDArray, bsxfun_pow); + // For chars, we want just relational handlers. + REGISTER_REL_HANDLER (bsxfun_builtin_eq, btyp_char, charNDArray, bsxfun_eq); + REGISTER_REL_HANDLER (bsxfun_builtin_ne, btyp_char, charNDArray, bsxfun_ne); + REGISTER_REL_HANDLER (bsxfun_builtin_lt, btyp_char, charNDArray, bsxfun_lt); + REGISTER_REL_HANDLER (bsxfun_builtin_le, btyp_char, charNDArray, bsxfun_le); + REGISTER_REL_HANDLER (bsxfun_builtin_gt, btyp_char, charNDArray, bsxfun_gt); + REGISTER_REL_HANDLER (bsxfun_builtin_ge, btyp_char, charNDArray, bsxfun_ge); + filled = true; }