comparison src/ov-bool-mat.cc @ 4455:abbf63293766

[project @ 2003-07-11 01:01:16 by jwe]
author jwe
date Fri, 11 Jul 2003 01:01:17 +0000
parents 5719210fff4c
children d7d9ca19960a
comparison
equal deleted inserted replaced
4454:c474333062d9 4455:abbf63293766
88 double 88 double
89 octave_bool_matrix::double_value (bool) const 89 octave_bool_matrix::double_value (bool) const
90 { 90 {
91 double retval = lo_ieee_nan_value (); 91 double retval = lo_ieee_nan_value ();
92 92
93 if ((rows () == 1 && columns () == 1) 93 // XXX FIXME XXX -- maybe this should be a function, valid_as_scalar()
94 || (Vdo_fortran_indexing && rows () > 0 && columns () > 0)) 94 if (rows () > 0 && columns () > 0)
95 retval = matrix (0, 0); 95 {
96 // XXX FIXME XXX -- is warn_fortran_indexing the right variable here?
97 if (Vwarn_fortran_indexing)
98 gripe_implicit_conversion ("bool matrix", "real scalar");
99
100 retval = matrix (0, 0);
101 }
96 else 102 else
97 gripe_invalid_conversion ("bool matrix", "real scalar"); 103 gripe_invalid_conversion ("bool matrix", "real scalar");
98 104
99 return retval; 105 return retval;
100 } 106 }
104 { 110 {
105 double tmp = lo_ieee_nan_value (); 111 double tmp = lo_ieee_nan_value ();
106 112
107 Complex retval (tmp, tmp); 113 Complex retval (tmp, tmp);
108 114
109 if ((rows () == 1 && columns () == 1) 115 // XXX FIXME XXX -- maybe this should be a function, valid_as_scalar()
110 || (Vdo_fortran_indexing && rows () > 0 && columns () > 0)) 116 if (rows () > 0 && columns () > 0)
111 retval = matrix (0, 0); 117 {
118 // XXX FIXME XXX -- is warn_fortran_indexing the right variable here?
119 if (Vwarn_fortran_indexing)
120 gripe_implicit_conversion ("bool matrix", "complex scalar");
121
122 retval = matrix (0, 0);
123 }
112 else 124 else
113 gripe_invalid_conversion ("bool matrix", "complex scalar"); 125 gripe_invalid_conversion ("bool matrix", "complex scalar");
114 126
115 return retval; 127 return retval;
116 } 128 }