Mercurial > hg > octave-lyh
comparison liboctave/fRowVector.cc @ 8999:dc07bc4157b8
allow empty matrices in stream input operators
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 20 Mar 2009 11:39:25 +0100 |
parents | eb63fbe60fab |
children | 3d6a9aea2aea |
comparison
equal
deleted
inserted
replaced
8998:a48fba01e4ac | 8999:dc07bc4157b8 |
---|---|
289 std::istream& | 289 std::istream& |
290 operator >> (std::istream& is, FloatRowVector& a) | 290 operator >> (std::istream& is, FloatRowVector& a) |
291 { | 291 { |
292 octave_idx_type len = a.length(); | 292 octave_idx_type len = a.length(); |
293 | 293 |
294 if (len < 1) | 294 if (len > 0) |
295 is.clear (std::ios::badbit); | |
296 else | |
297 { | 295 { |
298 float tmp; | 296 float tmp; |
299 for (octave_idx_type i = 0; i < len; i++) | 297 for (octave_idx_type i = 0; i < len; i++) |
300 { | 298 { |
301 is >> tmp; | 299 is >> tmp; |