Mercurial > hg > octave-max
changeset 377:1d3dbdfd0d19
[project @ 1994-03-03 20:13:03 by jwe]
author | jwe |
---|---|
date | Thu, 03 Mar 1994 20:14:00 +0000 |
parents | 63237a8f5725 |
children | e04b38065c55 |
files | liboctave/ColVector.cc liboctave/RowVector.cc |
diffstat | 2 files changed, 85 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ColVector.cc +++ b/liboctave/ColVector.cc @@ -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++ ***
--- a/liboctave/RowVector.cc +++ b/liboctave/RowVector.cc @@ -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++ ***