Mercurial > hg > octave-nkf
diff src/ov-re-mat.cc @ 2410:367485171742
[project @ 1996-10-15 16:50:27 by jwe]
author | jwe |
---|---|
date | Tue, 15 Oct 1996 16:50:28 +0000 |
parents | 4f55dc039a7e |
children | 1573640a9994 |
line wrap: on
line diff
--- a/src/ov-re-mat.cc +++ b/src/ov-re-mat.cc @@ -35,6 +35,8 @@ #include "gripes.h" #include "mappers.h" #include "oct-obj.h" +#include "ops.h" +#include "ov-scalar.h" #include "ov-re-mat.h" #include "pr-output.h" @@ -54,6 +56,20 @@ #include <iostream.h> +octave_value * +octave_matrix::try_narrowing_conversion (void) +{ + octave_value *retval = 0; + + int nr = matrix.rows (); + int nc = matrix.cols (); + + if (nr == 1 && nc == 1) + retval = new octave_scalar (matrix (0, 0)); + + return retval; +} + octave_value octave_matrix::index (const octave_value_list& idx) const {