ADMB Documentation  11.5.3197
 All Classes Files Functions Variables Typedefs Friends Defines
i5io.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 //#include "i3_array.h"
00033 
00038 ostream& operator<<(const ostream& _ostr, const i5_array& z)
00039 {
00040   ostream& ostr=(ostream&) _ostr;
00041   for (int i=z.indexmin();i<=z.indexmax();i++)
00042   {
00043     if (allocated(z[i]))
00044     {
00045       ostr << z[i];
00046     }
00047     if (i<z.indexmax())
00048     {
00049       ostr << endl;
00050     }
00051   }
00052   return (ostream&) ostr;
00053 }
00054 
00059 istream& operator>>(const istream& istr, const i5_array& z)
00060 {
00061   for (int i=z.indexmin();i<=z.indexmax();i++)
00062   {
00063     if (allocated(z[i]))
00064     {
00065       istr >> z[i];
00066     }
00067   }
00068   return (istream&) istr;
00069 }