ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
d3_io.cpp
Go to the documentation of this file.
1 
5 // i/o operations for class dmatrix
6 #include "fvar.hpp"
7 
8 #ifdef __TURBOC__
9  #pragma hdrstop
10  #include <iostream.h>
11  #include <iomanip.h>
12  #include <fstream.h>
13 #endif
14 
15 #ifdef __ZTC__
16  #include <iostream.hpp>
17  #include <iomanip.hpp>
18  #include <fstream.hpp>
19 #endif
20 
26 ostream& operator<<(const ostream& output, const d3_array& arr3)
27 {
28  ostream& ostr = const_cast<ostream&>(output);
29 
30  std::streamsize new_w = ostr.width();
31  std::streamsize new_p = ostr.precision();
32 #if !defined(__cplusplus)
33  long new_form = ostr.flags();
34 #else
35  ios::fmtflags new_form = ostr.flags();
36 #endif
37  char new_fill = ostr.fill();
38 
39  ostr.width(new_w);
40  ostr.precision(new_p);
41  ostr.flags(new_form);
42  ostr.fill(new_fill);
43 
44  for (int i = arr3.slicemin(); i <= arr3.slicemax(); ++i)
45  {
46  ostr << arr3[i];
47  if (i < arr3.slicemax())
48  {
49  ostr << endl;
50  }
51  }
52  return ostr;
53 }
60 istream& operator>>(const istream& input, const d3_array& arr3)
61 {
62  istream& istr = const_cast<istream&>(input);
63  for (int i = arr3.slicemin(); i <= arr3.slicemax(); ++i)
64  {
65  istr >> arr3[i];
66  }
67  return istr;
68 }
int slicemax() const
Definition: fvar.hpp:3830
prnstream & endl(prnstream &)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
int slicemin() const
Definition: fvar.hpp:3826
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
Description not yet available.
Definition: fvar.hpp:3727