ADMB Documentation  11.1.1920
 All Classes Files Functions Variables Typedefs Friends Defines
f4_io.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: f4_io.cpp 1112 2013-07-12 21:41:41Z 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 #include "d4arr.hpp"
00016 
00017 #ifdef __TURBOC__
00018   #pragma hdrstop
00019   #include <iostream.h>
00020   #include <iomanip.h>
00021   #include <fstream.h>
00022   #define __USE_IOSTREAM__
00023 #endif
00024 
00025 #ifdef __ZTC__
00026   #include <iostream.hpp>
00027   #include <iomanip.hpp>
00028   #include <fstream.hpp>
00029   #define __USE_IOSTREAM__
00030 #endif
00031 
00032 #include <string.h>
00033 
00038 ostream& operator<<(const ostream& _ostr, const dvar4_array &z)
00039 {
00040   ostream& ostr= (ostream&) _ostr;
00041   for (int i=z.hslicemin();i<=z.hslicemax();i++)
00042   {
00043     ostr << z[i];
00044     if (i<z.hslicemax()) ostr << endl;
00045   }
00046   return (ostream&) ostr;
00047 }
00048 
00053 istream& operator>>(const istream& istr, const dvar4_array &z)
00054 {
00055   for (int i=z.hslicemin();i<=z.hslicemax();i++)
00056   {
00057     istr >> z[i];
00058   }
00059   return (istream&) istr;
00060 }
00061 
00066 ostream& operator<<(const ostream& ostr, const dvar5_array &z)
00067 {
00068   for (int i=z.indexmin();i<=z.indexmax();i++)
00069   {
00070     ostr << z[i];
00071   }
00072   return (ostream&) ostr;
00073 }
00074 
00079 istream& operator>>(const istream& istr, const dvar5_array &z)
00080 {
00081   for (int i=z.indexmin();i<=z.indexmax();i++)
00082   {
00083     istr >> z[i];
00084   }
00085   return (istream&) istr;
00086 }
00087 
00092 ostream& operator<<(const ostream& ostr, const dvar6_array &z)
00093 {
00094   for (int i=z.indexmin();i<=z.indexmax();i++)
00095   {
00096     ostr << z[i];
00097   }
00098   return (ostream&) ostr;
00099 }
00100 
00105 istream& operator>>(const istream& istr, const dvar6_array &z)
00106 {
00107   for (int i=z.indexmin();i<=z.indexmax();i++)
00108   {
00109     istr >> z[i];
00110   }
00111   return (istream&) istr;
00112 }