Mercurial > octave-nkf
comparison src/oct-obj.cc @ 11568:de5fba8337c5
octave_value_list::all_scalars: test for scalars, not strings
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 19 Jan 2011 05:42:37 -0500 |
parents | fd0a3ac60b0e |
children | a83bad07f7e3 |
comparison
equal
deleted
inserted
replaced
11567:5c18da80e28a | 11568:de5fba8337c5 |
---|---|
177 } | 177 } |
178 | 178 |
179 bool | 179 bool |
180 octave_value_list::all_scalars (void) const | 180 octave_value_list::all_scalars (void) const |
181 { | 181 { |
182 octave_idx_type n = length (), i; | 182 octave_idx_type n = length (); |
183 | 183 |
184 for (i = 0; i < n && elem (i).is_string (); i++) ; | 184 for (octave_idx_type i = 0; i < n; i++) |
185 { | |
186 dim_vector dv = elem(i).dims (); | |
187 if (! dv.all_ones ()) | |
188 return false; | |
189 } | |
185 | 190 |
186 return i == n; | 191 return true; |
187 } | 192 } |
188 | 193 |
189 bool | 194 bool |
190 octave_value_list::any_cell (void) const | 195 octave_value_list::any_cell (void) const |
191 { | 196 { |