ADMB Documentation  11.5.3197
 All Classes Files Functions Variables Typedefs Friends Defines
imat_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 imatrix& z)
00038 {
00039   ostream& ostr= (ostream&) _ostr;
00040   int min=z.rowmin();
00041   int max=z.rowmax();
00042   for (int i=min;i<=max-1;i++)
00043   {
00044      ostr << z[i] << endl;
00045   }
00046   ostr << z[max];
00047   return ostr;
00048 }
00049 
00054 istream& operator>>(const istream& _istr,const imatrix& z)
00055 {
00056   istream& istr= (istream&) _istr;
00057   int min=z.rowmin();
00058   int max=z.rowmax();
00059   for (int i=min;i<=max;i++)
00060   {
00061      istr >> z[i];
00062   }
00063   return istr;
00064 }