ADMB Documentation  11.1.1916
 All Classes Files Functions Variables Typedefs Friends Defines
d4_io1.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: d4_io1.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 
00015 #include "fvar.hpp"
00016 #include  "d4arr.hpp"
00017 
00018 #ifdef __TURBOC__
00019   #pragma hdrstop
00020   #include <iostream.h>
00021   #include <iomanip.h>
00022   #include <fstream.h>
00023   #define __USE_IOSTREAM__
00024 #endif
00025 
00026 #ifdef __ZTC__
00027   #include <iostream.hpp>
00028   #include <iomanip.hpp>
00029   #include <fstream.hpp>
00030   #define __USE_IOSTREAM__
00031 #endif
00032 
00033 #include <string.h>
00034 
00035 #ifdef __USE_IOSTREAM__
00036 
00041 uostream& operator<<(const uostream& _ostr, const d4_array &z)
00042 {
00043   uostream & ostr = (uostream&) _ostr;
00044   for (int i=z.hslicemin();i<=z.hslicemax();i++)
00045   {
00046     ostr << z[i];
00047   }
00048   return ostr;
00049 }
00050 
00055 uistream& operator>>(const uistream& _istr, const d4_array &z)
00056 {
00057   uistream & istr = (uistream&) _istr;
00058   for (int i=z.hslicemin();i<=z.hslicemax();i++)
00059   {
00060     istr >> z[i];
00061   }
00062   return istr;
00063 }
00064 #endif