Mercurial > octave-dspies
comparison liboctave/dColVector.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 |
---|---|
319 std::istream& | 319 std::istream& |
320 operator >> (std::istream& is, ColumnVector& a) | 320 operator >> (std::istream& is, ColumnVector& a) |
321 { | 321 { |
322 octave_idx_type len = a.length(); | 322 octave_idx_type len = a.length(); |
323 | 323 |
324 if (len < 1) | 324 if (len > 0) |
325 is.clear (std::ios::badbit); | |
326 else | |
327 { | 325 { |
328 double tmp; | 326 double tmp; |
329 for (octave_idx_type i = 0; i < len; i++) | 327 for (octave_idx_type i = 0; i < len; i++) |
330 { | 328 { |
331 is >> tmp; | 329 is >> tmp; |