ADMB Documentation  11.1.1897
 All Classes Files Functions Variables Typedefs Friends Defines
d4_io.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: d4_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 d4_array &z)
00039 {
00040   ostream & ostr = (ostream&) _ostr;
00041   for (int i=z.hslicemin();i<=z.hslicemax();i++)
00042   {
00043     ostr << z[i] << endl;
00044   }
00045   return ostr;
00046 }
00047 
00052 istream& operator>>(const istream& _istr, const d4_array &z)
00053 {
00054   uistream & istr = (uistream&) _istr;
00055   for (int i=z.hslicemin();i<=z.hslicemax();i++)
00056   {
00057     istr >> z[i];
00058   }
00059   return istr;
00060 }
00061 
00066 ostream& operator<<(const ostream& _ostr, const d5_array &z)
00067 {
00068   ostream & ostr = (ostream&) _ostr;
00069   for (int i=z.indexmin();i<=z.indexmax();i++)
00070   {
00071     ostr << z[i] << endl;
00072   }
00073   return ostr;
00074 }
00075 
00080 istream& operator>>(const istream& _istr, const d5_array &z)
00081 {
00082   uistream & istr = (uistream&) _istr;
00083   for (int i=z.indexmin();i<=z.indexmax();i++)
00084   {
00085     istr >> z[i];
00086   }
00087   return istr;
00088 }
00089 
00094 ostream& operator<<(const ostream& _ostr, const d6_array &z)
00095 {
00096   uostream & ostr = (uostream&) _ostr;
00097   for (int i=z.indexmin();i<=z.indexmax();i++)
00098   {
00099     ostr << z[i] << endl;
00100   }
00101   return ostr;
00102 }
00103 
00108 istream& operator>>(const istream& _istr, const d6_array &z)
00109 {
00110   uistream & istr = (uistream&) _istr;
00111   for (int i=z.indexmin();i<=z.indexmax();i++)
00112   {
00113     istr >> z[i];
00114   }
00115   return istr;
00116 }