ADMB Documentation  11.5.3197
 All Classes Files Functions Variables Typedefs Friends Defines
d4_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 d4_array &z)
00038 {
00039   ostream & ostr = (ostream&) _ostr;
00040   for (int i=z.hslicemin();i<=z.hslicemax();i++)
00041   {
00042     ostr << z[i] << endl;
00043   }
00044   return ostr;
00045 }
00046 
00051 istream& operator>>(const istream& _istr, const d4_array &z)
00052 {
00053   uistream & istr = (uistream&) _istr;
00054   for (int i=z.hslicemin();i<=z.hslicemax();i++)
00055   {
00056     istr >> z[i];
00057   }
00058   return istr;
00059 }
00060 
00065 ostream& operator<<(const ostream& _ostr, const d5_array &z)
00066 {
00067   ostream & ostr = (ostream&) _ostr;
00068   for (int i=z.indexmin();i<=z.indexmax();i++)
00069   {
00070     ostr << z[i] << endl;
00071   }
00072   return ostr;
00073 }
00074 
00079 istream& operator>>(const istream& _istr, const d5_array &z)
00080 {
00081   uistream & istr = (uistream&) _istr;
00082   for (int i=z.indexmin();i<=z.indexmax();i++)
00083   {
00084     istr >> z[i];
00085   }
00086   return istr;
00087 }
00088 
00093 ostream& operator<<(const ostream& _ostr, const d6_array &z)
00094 {
00095   uostream & ostr = (uostream&) _ostr;
00096   for (int i=z.indexmin();i<=z.indexmax();i++)
00097   {
00098     ostr << z[i] << endl;
00099   }
00100   return ostr;
00101 }
00102 
00107 istream& operator>>(const istream& _istr, const d6_array &z)
00108 {
00109   uistream & istr = (uistream&) _istr;
00110   for (int i=z.indexmin();i<=z.indexmax();i++)
00111   {
00112     istr >> z[i];
00113   }
00114   return istr;
00115 }