ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
f4_io.cpp
Go to the documentation of this file.
1 
5 #include "fvar.hpp"
6 
7 #ifdef __TURBOC__
8  #pragma hdrstop
9  #include <iostream.h>
10  #include <iomanip.h>
11  #include <fstream.h>
12 #endif
13 
14 #ifdef __ZTC__
15  #include <iostream.hpp>
16  #include <iomanip.hpp>
17  #include <fstream.hpp>
18 #endif
19 
26 ostream& operator<<(const ostream& output, const dvar4_array& varr4)
27 {
28  ostream& ostr = const_cast<ostream&>(output);
29  for (int i = varr4.hslicemin(); i <= varr4.hslicemax(); ++i)
30  {
31  ostr << varr4[i];
32  if (i < varr4.hslicemax())
33  {
34  ostr << endl;
35  }
36  }
37  return ostr;
38 }
45 istream& operator>>(const istream& input, const dvar4_array& varr4)
46 {
47  istream& istr = const_cast<istream&>(input);
48  for (int i = varr4.hslicemin(); i <= varr4.hslicemax(); ++i)
49  {
50  istr >> varr4[i];
51  }
52  return istr;
53 }
57 ostream& operator<<(ostream& ostr, const dvar5_array& z)
58 {
59  for (int i = z.indexmin(); i <= z.indexmax(); i++)
60  {
61  ostr << z[i];
62  if (i < z.indexmax())
63  {
64  ostr << '\n';
65  }
66  }
67  return ostr;
68 }
72 ostream& operator<<(const ostream& ostr, const dvar5_array& z)
73 {
74  return operator<<((ostream&)ostr, z);
75 }
76 
81 istream& operator>>(const istream& istr, const dvar5_array &z)
82 {
83  for (int i=z.indexmin();i<=z.indexmax();i++)
84  {
85  istr >> z[i];
86  }
87  return (istream&) istr;
88 }
89 
94 ostream& operator<<(const ostream& ostr, const dvar6_array &z)
95 {
96  for (int i=z.indexmin();i<=z.indexmax();i++)
97  {
98  ostr << z[i];
99  }
100  return (ostream&) ostr;
101 }
102 
107 istream& operator>>(const istream& istr, const dvar6_array &z)
108 {
109  for (int i=z.indexmin();i<=z.indexmax();i++)
110  {
111  istr >> z[i];
112  }
113  return (istream&) istr;
114 }
Description not yet available.
Definition: fvar.hpp:6861
Description not yet available.
Definition: fvar.hpp:5433
int indexmax() const
Definition: fvar.hpp:6650
prnstream & endl(prnstream &)
Description not yet available.
Definition: fvar.hpp:6498
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
int indexmin() const
Definition: fvar.hpp:6646
int indexmin() const
Definition: fvar.hpp:7028
const int output
Definition: fvar.hpp:9505
istream & operator>>(const istream &input, const d3_array &arr3)
Read values from input stream into arr3.
Definition: d3_io.cpp:60
ostream & operator<<(const ostream &_s, preshowpoint p)
Description not yet available.
Definition: admanip.cpp:48
int hslicemax() const
Definition: fvar.hpp:5624
int indexmax() const
Definition: fvar.hpp:7032
int hslicemin() const
Definition: fvar.hpp:5623