ADMB Documentation  11.5.3197
 All Classes Files Functions Variables Typedefs Friends Defines
fvar_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: fvar_io.cpp
00012 
00013 // i/o operations for class prevariable
00014 
00015 #include "fvar.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 
00036 ostream& operator<<(const ostream& _ostr, const prevariable& f)
00037 {
00038   ostream& ostr=(ostream&) _ostr;
00039   ostr << value(f);
00040   return ostr;
00041 }
00042 
00047 istream& operator>>(const istream& _istr, const prevariable& _f)
00048 {
00049   prevariable& f = (prevariable&)_f;
00050   istream& istr=(istream&) _istr;
00051   double tmp = 0;
00052   istr >> tmp;
00053   f=tmp;
00054   return istr;
00055 }
00056 
00057 
00058 #ifdef __USE_IOSTREAM__
00059 
00063 uostream& operator<<(const uostream& _ostr, const prevariable& f)
00064 {
00065   uostream& ostr=(uostream&) _ostr;
00066   ostr << value(f);
00067   return ostr;
00068 }
00069 
00074 uistream& operator>>(const uistream& _istr, const prevariable& _f)
00075 {
00076   prevariable& f = (prevariable&)_f;
00077   uistream& istr=(uistream&) _istr;
00078   double tmp = 0;
00079   istr >> tmp;
00080   f=tmp;
00081   return istr;
00082 }
00083 #endif