# HG changeset patch # User jwe # Date 762725640 0 # Node ID 1d3dbdfd0d19cc2f222e04f74cf3bb84002d6468 # Parent 63237a8f5725ca15ec26fd81650acbcaf105ae13 [project @ 1994-03-03 20:13:03 by jwe] diff -r 63237a8f5725 -r 1d3dbdfd0d19 liboctave/ColVector.cc --- a/liboctave/ColVector.cc Thu Mar 03 00:03:30 1994 +0000 +++ b/liboctave/ColVector.cc Thu Mar 03 20:14:00 1994 +0000 @@ -1,7 +1,7 @@ // ColumnVector manipulations. -*- C++ -*- /* -Copyright (C) 1992, 1993 John W. Eaton +Copyright (C) 1992, 1993, 1994 John W. Eaton This file is part of Octave. @@ -469,6 +469,27 @@ return os; } +istream& +operator >> (istream& is, ColumnVector& a) +{ + int len = a.length(); + + if (len < 1) + is.clear (ios::badbit); + else + { + double tmp; + for (int i = 0; i < len; i++) + { + is >> tmp; + if (is) + a.elem (i) = tmp; + else + break; + } + } +} + /* * Complex Column Vector class */ @@ -1042,6 +1063,27 @@ return os; } +istream& +operator >> (istream& is, ComplexColumnVector& a) +{ + int len = a.length(); + + if (len < 1) + is.clear (ios::badbit); + else + { + double tmp; + for (int i = 0; i < len; i++) + { + is >> tmp; + if (is) + a.elem (i) = tmp; + else + break; + } + } +} + /* ;;; Local Variables: *** ;;; mode: C++ *** diff -r 63237a8f5725 -r 1d3dbdfd0d19 liboctave/RowVector.cc --- a/liboctave/RowVector.cc Thu Mar 03 00:03:30 1994 +0000 +++ b/liboctave/RowVector.cc Thu Mar 03 20:14:00 1994 +0000 @@ -491,6 +491,27 @@ return os; } +istream& +operator >> (istream& is, RowVector& a) +{ + int len = a.length(); + + if (len < 1) + is.clear (ios::badbit); + else + { + double tmp; + for (int i = 0; i < len; i++) + { + is >> tmp; + if (is) + a.elem (i) = tmp; + else + break; + } + } +} + /* * Complex Row Vector class */ @@ -1094,6 +1115,27 @@ return os; } +istream& +operator >> (istream& is, ComplexRowVector& a) +{ + int len = a.length(); + + if (len < 1) + is.clear (ios::badbit); + else + { + Complex tmp; + for (int i = 0; i < len; i++) + { + is >> tmp; + if (is) + a.elem (i) = tmp; + else + break; + } + } +} + /* ;;; Local Variables: *** ;;; mode: C++ ***