ADMB Documentation  11.5.3197
 All Classes Files Functions Variables Typedefs Friends Defines
f4_io.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id$
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  */
00011 // file: dmat_io.cpp
00012 
00013 // i/o operations for class dmatrix
00014 #include "fvar.hpp"
00015 
00016 #ifdef __TURBOC__
00017   #pragma hdrstop
00018   #include <iostream.h>
00019   #include <iomanip.h>
00020   #include <fstream.h>
00021   #define __USE_IOSTREAM__
00022 #endif
00023 
00024 #ifdef __ZTC__
00025   #include <iostream.hpp>
00026   #include <iomanip.hpp>
00027   #include <fstream.hpp>
00028   #define __USE_IOSTREAM__
00029 #endif
00030 
00031 #include <string.h>
00032 
00037 ostream& operator<<(const ostream& _ostr, const dvar4_array &z)
00038 {
00039   ostream& ostr= (ostream&) _ostr;
00040   for (int i=z.hslicemin();i<=z.hslicemax();i++)
00041   {
00042     ostr << z[i];
00043     if (i<z.hslicemax()) ostr << endl;
00044   }
00045   return (ostream&) ostr;
00046 }
00047 
00052 istream& operator>>(const istream& istr, const dvar4_array &z)
00053 {
00054   for (int i=z.hslicemin();i<=z.hslicemax();i++)
00055   {
00056     istr >> z[i];
00057   }
00058   return (istream&) istr;
00059 }
00063 ostream& operator<<(ostream& ostr, const dvar5_array& z)
00064 {
00065   for (int i = z.indexmin(); i <= z.indexmax(); i++)
00066   {
00067     ostr << z[i];
00068     if (i < z.indexmax())
00069     {
00070       ostr << '\n';
00071     }
00072   }
00073   return ostr;
00074 }
00078 ostream& operator<<(const ostream& ostr, const dvar5_array& z)
00079 {
00080   return operator<<((ostream&)ostr, z);
00081 }
00082 
00087 istream& operator>>(const istream& istr, const dvar5_array &z)
00088 {
00089   for (int i=z.indexmin();i<=z.indexmax();i++)
00090   {
00091     istr >> z[i];
00092   }
00093   return (istream&) istr;
00094 }
00095 
00100 ostream& operator<<(const ostream& ostr, const dvar6_array &z)
00101 {
00102   for (int i=z.indexmin();i<=z.indexmax();i++)
00103   {
00104     ostr << z[i];
00105   }
00106   return (ostream&) ostr;
00107 }
00108 
00113 istream& operator>>(const istream& istr, const dvar6_array &z)
00114 {
00115   for (int i=z.indexmin();i<=z.indexmax();i++)
00116   {
00117     istr >> z[i];
00118   }
00119   return (istream&) istr;
00120 }