Mercurial > hg > octave-nkf
comparison src/ov-str-mat.cc @ 4643:ef3a14fb6847
[project @ 2003-11-22 12:25:44 by jwe]
author | jwe |
---|---|
date | Sat, 22 Nov 2003 12:25:45 +0000 |
parents | d44675070f1a |
children | 7849788ca4bd |
comparison
equal
deleted
inserted
replaced
4642:7a83d52d2aed | 4643:ef3a14fb6847 |
---|---|
48 static octave_value * | 48 static octave_value * |
49 default_numeric_conversion_function (const octave_value& a) | 49 default_numeric_conversion_function (const octave_value& a) |
50 { | 50 { |
51 CAST_CONV_ARG (const octave_char_matrix_str&); | 51 CAST_CONV_ARG (const octave_char_matrix_str&); |
52 | 52 |
53 Matrix m = v.matrix_value (); | 53 Matrix m = v.matrix_value (true); |
54 | 54 |
55 return error_state ? 0 : new octave_matrix (m); | 55 return error_state ? 0 : new octave_matrix (m); |
56 } | 56 } |
57 | 57 |
58 type_conv_fcn | 58 type_conv_fcn |
129 bool retval = false; | 129 bool retval = false; |
130 error ("octave_char_matrix_str::valid_as_scalar_index(): not implemented"); | 130 error ("octave_char_matrix_str::valid_as_scalar_index(): not implemented"); |
131 return retval; | 131 return retval; |
132 } | 132 } |
133 | 133 |
134 double | |
135 octave_char_matrix_str::double_value (bool force_string_conv) const | |
136 { | |
137 double retval = 0; | |
138 | |
139 if (! force_string_conv) | |
140 gripe_invalid_conversion ("string", "real scalar"); | |
141 else | |
142 { | |
143 if (Vwarn_str_to_num) | |
144 gripe_implicit_conversion ("string", "real scalar"); | |
145 | |
146 retval = octave_char_matrix::double_value (); | |
147 } | |
148 | |
149 return retval; | |
150 } | |
151 | |
134 Matrix | 152 Matrix |
135 octave_char_matrix_str::matrix_value (bool force_string_conv) const | 153 octave_char_matrix_str::matrix_value (bool force_string_conv) const |
136 { | 154 { |
137 Matrix retval; | 155 Matrix retval; |
138 | 156 |
139 if (! force_string_conv && Vwarn_str_to_num) | 157 if (! force_string_conv) |
140 gripe_implicit_conversion ("string", "real matrix"); | 158 gripe_invalid_conversion ("string", "real matrix"); |
141 | 159 else |
142 retval = Matrix (matrix.matrix_value ()); | 160 { |
161 if (Vwarn_str_to_num) | |
162 gripe_implicit_conversion ("string", "real matrix"); | |
163 | |
164 retval = octave_char_matrix::matrix_value (); | |
165 } | |
143 | 166 |
144 return retval; | 167 return retval; |
145 } | 168 } |
146 | 169 |
147 string_vector | 170 string_vector |