18 #ifndef __Base_Input__
19 #define __Base_Input__
21 #include "math_util.h"
26 nec_float diff(nec_float a, nec_float b)
30 if ((a < 1e-8) && (b < 1e-8))
33 nec_float sub = a - b;
34 nec_float sum = a + b;
36 nec_float ret = sub*sub;
37 if ((a != 0) && (b != 0))
42 cout <<
" diff(" << a <<
"," << b <<
") = " << ret << endl;
47 nec_float diff(nec_complex a, nec_complex b)
51 if ((abs(a) < 1e-8) && (abs(b) < 1e-8))
54 nec_float ret = norm(a - b);
55 nec_float sum = norm(a + b);
64 cout <<
" diff(" << a <<
"," << b <<
") = " << ret << endl;
73 : m_filename(filename),
74 m_stream(filename.c_str())
84 std::string m_filename;
85 std::ifstream m_stream;
89 m_stream.getline(&linec[0],512);
90 return string(&linec[0]);
93 double read_sci(std::istream& is)
96 is.setf(ios_base::skipws);
101 double read_fixed(std::istream& is)
104 is.setf(ios_base::skipws);