ADMB Documentation  11.1x.2711
 All Classes Files Functions Variables Typedefs Friends Defines
f4_io.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: f4_io.cpp 1952 2014-04-29 21:20:31Z johnoel $
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 }
00060 
00065 ostream& operator<<(const ostream& ostr, const dvar5_array &z)
00066 {
00067   for (int i=z.indexmin();i<=z.indexmax();i++)
00068   {
00069     ostr << z[i];
00070   }
00071   return (ostream&) ostr;
00072 }
00073 
00078 istream& operator>>(const istream& istr, const dvar5_array &z)
00079 {
00080   for (int i=z.indexmin();i<=z.indexmax();i++)
00081   {
00082     istr >> z[i];
00083   }
00084   return (istream&) istr;
00085 }
00086 
00091 ostream& operator<<(const ostream& ostr, const dvar6_array &z)
00092 {
00093   for (int i=z.indexmin();i<=z.indexmax();i++)
00094   {
00095     ostr << z[i];
00096   }
00097   return (ostream&) ostr;
00098 }
00099 
00104 istream& operator>>(const istream& istr, const dvar6_array &z)
00105 {
00106   for (int i=z.indexmin();i<=z.indexmax();i++)
00107   {
00108     istr >> z[i];
00109   }
00110   return (istream&) istr;
00111 }