00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef DEBUGF
00018 #define DEBUGF
00019 #include <iostream.h>
00020 #include <fstream.h>
00021 #include <complex.h>
00022 namespace SPUC {
00026 class debugf {
00027
00028 private:
00029 ofstream outf;
00030 public:
00031 debugf(const char* name) : outf(name) { ; }
00032 ~debugf() {}
00033 void out(double x) { outf << x << " "; }
00034 void out(long x) { outf << x << " "; }
00035 void newline() { outf << "\n"; }
00036 void close() { outf.close(); }
00037 template <class T> void out(cmplx<T> x) {
00038 outf << real(x) << " " << imag(x) << " ";
00039 }
00040 template <class T> void outn(T x) {
00041 out(x);
00042 outf << "\n";
00043 }
00044 template <class T> friend void operator <<(debugf r, const T x) {
00045 r.out(x);
00046 }
00047 };
00048 }
00049 #endif