ADMB Documentation  11.1.2274
 All Classes Files Functions Variables Typedefs Friends Defines
lmat_io.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: lmat_io.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  */
00012 // file: dmat_io.cpp
00013 
00014 // i/o operations for class dmatrix
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 
00032 #include <string.h>
00033 
00038 ostream& operator<<(const ostream& ostr, const lmatrix& z)
00039 {
00040   int min=z.rowmin();
00041   int max=z.rowmax();
00042   int i;
00043   for (i=min;i<=max-1;i++)
00044   {
00045      ostr << z[i] << endl;
00046   }
00047   ostr << z[i];
00048   return (ostream&)ostr;
00049 }
00050 
00055 istream& operator>>(const istream& istr, const lmatrix& z)
00056 {
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 (istream&)istr;
00064 }
00065