Mercurial > octave
comparison src/data.cc @ 9505:a321a1c227c8
make ifelse an alias or merge
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Sat, 08 Aug 2009 08:41:18 +0200 |
parents | 983de84e4bf3 |
children | 9f870f73ab7d |
comparison
equal
deleted
inserted
replaced
9504:941e16338677 | 9505:a321a1c227c8 |
---|---|
6058 retval = do_merge (mask, \ | 6058 retval = do_merge (mask, \ |
6059 tval.INTX ## _array_value (), \ | 6059 tval.INTX ## _array_value (), \ |
6060 fval.INTX ## _array_value ()); \ | 6060 fval.INTX ## _array_value ()); \ |
6061 } | 6061 } |
6062 | 6062 |
6063 DEFUN (ifelse, args, , | 6063 DEFUN (merge, args, , |
6064 "-*- texinfo -*-\n\ | 6064 "-*- texinfo -*-\n\ |
6065 @deftypefn {Built-in Function} {} ifelse (@var{mask}, @var{tval}, @var{fval})\n\ | 6065 @deftypefn {Built-in Function} {} merge (@var{mask}, @var{tval}, @var{fval})\n\ |
6066 @deftypefnx {Built-in Function} {} ifelse (@var{mask}, @var{tval}, @var{fval})\n\ | |
6066 Merges elements of @var{true_val} and @var{false_val}, depending on the value of\n\ | 6067 Merges elements of @var{true_val} and @var{false_val}, depending on the value of\n\ |
6067 @var{mask}. If @var{mask} is a logical scalar, the other two arguments can be\n\ | 6068 @var{mask}. If @var{mask} is a logical scalar, the other two arguments can be\n\ |
6068 arbitrary values. Otherwise, @var{mask} must be a logical array, and @var{tval},\n\ | 6069 arbitrary values. Otherwise, @var{mask} must be a logical array, and @var{tval},\n\ |
6069 @var{fval} should be arrays of matching class, or cell arrays.\n\ | 6070 @var{fval} should be arrays of matching class, or cell arrays.\n\ |
6070 In the scalar mask case, @var{tval} is returned if @var{mask} is true, otherwise\n\ | 6071 In the scalar mask case, @var{tval} is returned if @var{mask} is true, otherwise\n\ |
6152 print_usage (); | 6153 print_usage (); |
6153 | 6154 |
6154 return retval; | 6155 return retval; |
6155 } | 6156 } |
6156 | 6157 |
6158 DEFALIAS (ifelse, merge); | |
6159 | |
6157 #undef MAKE_INT_BRANCH | 6160 #undef MAKE_INT_BRANCH |
6158 | 6161 |
6159 /* | 6162 /* |
6160 ;;; Local Variables: *** | 6163 ;;; Local Variables: *** |
6161 ;;; mode: C++ *** | 6164 ;;; mode: C++ *** |