Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00011
00012
00013
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 dmatrix& z)
00038 {
00039 ostream& ostr = (ostream&) _ostr;
00040 z.write_on(ostr);
00041 return ostr;
00042 }
00043
00048 void dmatrix::write_on(const ostream& _s) const
00049 {
00050 ostream& s=(ostream&) _s;
00051 #ifdef __USE_IOSTREAM__
00052 int new_w = s.width();
00053 int new_p = s.precision();
00054 #if defined(GCC3)
00055 ios::fmtflags new_form = s.flags();
00056 #else
00057 long new_form = s.flags();
00058 #endif
00059 char new_fill = s.fill();
00060 #endif
00061
00062 for (int i=rowmin(); i <= rowmax(); i++)
00063 {
00064 #ifdef __USE_IOSTREAM__
00065 s.width(new_w);
00066 s.precision(new_p);
00067 s.flags(new_form);
00068 s.fill(new_fill);
00069 #endif
00070 s << (*this)[i];
00071 if (i<rowmax())
00072 {
00073
00074
00075
00076 s << endl;
00077 }
00078 }
00079 }
00080
00085 istream& operator>>(const istream& _istr, const dmatrix& _z)
00086 {
00087 dmatrix& z= (dmatrix&) _z;
00088 istream& istr = (istream&) _istr;
00089 z.read_from(istr);
00090
00091 return istr;
00092 }
00093
00098 void dmatrix::read_from(const istream& s)
00099 {
00100 for (int i=rowmin();i <= rowmax();i++)
00101 {
00102 s >> (*this)[i];
00103 }
00104 }
00105