Mercurial > octave-nkf
comparison src/DLD-FUNCTIONS/minmax.cc @ 5275:23b37da9fd5b
[project @ 2005-04-08 16:07:35 by jwe]
author | jwe |
---|---|
date | Fri, 08 Apr 2005 16:07:37 +0000 |
parents | b92d59213e63 |
children | 4c8a2e4e0717 |
comparison
equal
deleted
inserted
replaced
5274:eae7b40388e9 | 5275:23b37da9fd5b |
---|---|
125 else \ | 125 else \ |
126 gripe_wrong_type_arg (#FCN, arg1); \ | 126 gripe_wrong_type_arg (#FCN, arg1); \ |
127 } \ | 127 } \ |
128 else if (single_arg && nargout == 2) \ | 128 else if (single_arg && nargout == 2) \ |
129 { \ | 129 { \ |
130 ArrayN<int> index; \ | 130 ArrayN<octave_idx_type> index; \ |
131 \ | 131 \ |
132 if (arg1.is_real_type ()) \ | 132 if (arg1.is_real_type ()) \ |
133 { \ | 133 { \ |
134 NDArray m = arg1.array_value (); \ | 134 NDArray m = arg1.array_value (); \ |
135 \ | 135 \ |
150 } \ | 150 } \ |
151 } \ | 151 } \ |
152 else \ | 152 else \ |
153 gripe_wrong_type_arg (#FCN, arg1); \ | 153 gripe_wrong_type_arg (#FCN, arg1); \ |
154 \ | 154 \ |
155 int len = index.numel (); \ | 155 octave_idx_type len = index.numel (); \ |
156 \ | 156 \ |
157 if (len > 0) \ | 157 if (len > 0) \ |
158 { \ | 158 { \ |
159 double nan_val = lo_ieee_nan_value (); \ | 159 double nan_val = lo_ieee_nan_value (); \ |
160 \ | 160 \ |
161 NDArray idx (index.dims ()); \ | 161 NDArray idx (index.dims ()); \ |
162 \ | 162 \ |
163 for (int i = 0; i < len; i++) \ | 163 for (octave_idx_type i = 0; i < len; i++) \ |
164 { \ | 164 { \ |
165 OCTAVE_QUIT; \ | 165 OCTAVE_QUIT; \ |
166 int tmp = index.elem (i) + 1; \ | 166 int tmp = index.elem (i) + 1; \ |
167 idx.elem (i) = (tmp <= 0) \ | 167 idx.elem (i) = (tmp <= 0) \ |
168 ? nan_val : static_cast<double> (tmp); \ | 168 ? nan_val : static_cast<double> (tmp); \ |