Mercurial > octave-nkf
comparison src/ov-class.cc @ 9792:384616240a8f
fix internal numel on classes
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 10 Nov 2009 10:58:39 +0100 |
parents | 9d9f858849c7 |
children | b3089dba88bf |
comparison
equal
deleted
inserted
replaced
9791:6e425f6be618 | 9792:384616240a8f |
---|---|
295 } | 295 } |
296 | 296 |
297 Matrix | 297 Matrix |
298 octave_class::size (void) | 298 octave_class::size (void) |
299 { | 299 { |
300 if (in_class_method () || called_from_builtin ()) | |
301 return octave_base_value::size (); | |
302 | |
300 Matrix retval (1, 2, 1.0); | 303 Matrix retval (1, 2, 1.0); |
301 octave_value meth = symbol_table::find_method ("size", class_name ()); | 304 octave_value meth = symbol_table::find_method ("size", class_name ()); |
302 | 305 |
303 if (meth.is_defined ()) | 306 if (meth.is_defined ()) |
304 { | 307 { |
316 } | 319 } |
317 | 320 |
318 octave_idx_type | 321 octave_idx_type |
319 octave_class::numel (const octave_value_list& idx) | 322 octave_class::numel (const octave_value_list& idx) |
320 { | 323 { |
324 if (in_class_method () || called_from_builtin ()) | |
325 return octave_base_value::numel (idx); | |
326 | |
321 octave_idx_type retval = -1; | 327 octave_idx_type retval = -1; |
322 const std::string cn = class_name (); | 328 const std::string cn = class_name (); |
323 | 329 |
324 octave_value meth = symbol_table::find_method ("numel", cn); | 330 octave_value meth = symbol_table::find_method ("numel", cn); |
325 | 331 |