Mercurial > octave-nkf
comparison src/pt-loop.cc @ 3215:bc3fdfe311a3
[project @ 1998-11-10 14:06:21 by jwe]
author | jwe |
---|---|
date | Tue, 10 Nov 1998 14:12:07 +0000 |
parents | bef7b73c0724 |
children | 8b1f46ac2b64 |
comparison
equal
deleted
inserted
replaced
3214:8cc04ca5b4ca | 3215:bc3fdfe311a3 |
---|---|
213 { | 213 { |
214 bool quit = false; | 214 bool quit = false; |
215 | 215 |
216 do_for_loop_once (ult, rhs, quit); | 216 do_for_loop_once (ult, rhs, quit); |
217 } | 217 } |
218 else if (rhs.is_string ()) | |
219 { | |
220 charMatrix chm_tmp = rhs.char_matrix_value (); | |
221 int nr = chm_tmp.rows (); | |
222 int steps = chm_tmp.columns (); | |
223 | |
224 if (error_state) | |
225 return; | |
226 | |
227 if (nr == 1) | |
228 DO_LOOP (chm_tmp (0, i)); | |
229 else | |
230 { | |
231 for (int i = 0; i < steps; i++) | |
232 { | |
233 octave_value val (chm_tmp.extract (0, i, nr-1, i), true); | |
234 | |
235 bool quit = false; | |
236 | |
237 do_for_loop_once (ult, val, quit); | |
238 | |
239 if (quit) | |
240 break; | |
241 } | |
242 } | |
243 } | |
218 else if (rhs.is_matrix_type ()) | 244 else if (rhs.is_matrix_type ()) |
219 { | 245 { |
220 charMatrix chm_tmp; | |
221 Matrix m_tmp; | 246 Matrix m_tmp; |
222 ComplexMatrix cm_tmp; | 247 ComplexMatrix cm_tmp; |
223 | 248 |
224 int nr; | 249 int nr; |
225 int steps; | 250 int steps; |
226 | 251 |
227 if (rhs.is_string ()) | 252 if (rhs.is_real_matrix ()) |
228 { | |
229 chm_tmp = rhs.char_matrix_value (); | |
230 nr = chm_tmp.rows (); | |
231 steps = chm_tmp.columns (); | |
232 } | |
233 else if (rhs.is_real_matrix ()) | |
234 { | 253 { |
235 m_tmp = rhs.matrix_value (); | 254 m_tmp = rhs.matrix_value (); |
236 nr = m_tmp.rows (); | 255 nr = m_tmp.rows (); |
237 steps = m_tmp.columns (); | 256 steps = m_tmp.columns (); |
238 } | 257 } |
244 } | 263 } |
245 | 264 |
246 if (error_state) | 265 if (error_state) |
247 return; | 266 return; |
248 | 267 |
249 if (rhs.is_string ()) | 268 if (rhs.is_real_matrix ()) |
250 { | |
251 if (nr == 1) | |
252 DO_LOOP (chm_tmp (0, i)); | |
253 else | |
254 { | |
255 for (int i = 0; i < steps; i++) | |
256 { | |
257 octave_value val (chm_tmp.extract (0, i, nr-1, i), true); | |
258 | |
259 bool quit = false; | |
260 | |
261 do_for_loop_once (ult, val, quit); | |
262 | |
263 if (quit) | |
264 break; | |
265 } | |
266 } | |
267 } | |
268 else if (rhs.is_real_matrix ()) | |
269 { | 269 { |
270 if (nr == 1) | 270 if (nr == 1) |
271 DO_LOOP (m_tmp (0, i)); | 271 DO_LOOP (m_tmp (0, i)); |
272 else | 272 else |
273 DO_LOOP (m_tmp.extract (0, i, nr-1, i)); | 273 DO_LOOP (m_tmp.extract (0, i, nr-1, i)); |