22 const string str_vlevel = params.
get_string(
"verbose_level");
31 err += params.
fetch_int(
"number_of_poles", Np);
32 err += params.
fetch_int(
"exponent_numerator", n_exp);
33 err += params.
fetch_int(
"exponent_denominator", d_exp);
48 const double x_min,
const double x_max)
87 std::vector<double>& pole)
89 if (res.size() !=
m_Np) {
94 if (pole.size() !=
m_Np) {
100 for (
int i = 0; i <
m_Np; ++i) {
120 char filename[FILENAME_MAX];
122 snprintf(filename, FILENAME_MAX,
123 "parameter_rational.%1d_%1d%s_%02d_%010.8f_%07.3f",
131 int Np, n_exp, d_exp;
135 std::fstream parameter_file;
136 parameter_file.open(filename, std::ios::in);
137 if (!parameter_file.is_open()) {
138 vout.
crucial(
m_vl,
"Error at %s: failed to open parameter file. %s(%d)\n",
143 parameter_file >> Np >> n_exp >> d_exp;
144 parameter_file >> x_min >> x_max;
147 for (
int i = 0; i < Np; i++) {
150 parameter_file.close();
173 assert(fabs((
m_x_min - x_min) / x_min) < sqrt_eps);
174 assert(fabs((
m_x_max - x_max) / x_max) < sqrt_eps);
183 for (
int k = 0; k <
m_Np; ++k) {
void get_parameters(double &norm, std::vector< double > &res, std::vector< double > &pole)
static double epsilon_criterion()
static const std::string class_name
void general(const char *format,...)
void set_parameters(const Parameters ¶ms)
int fetch_double(const string &key, double &value) const
std::vector< double > m_pole
int fetch_int(const string &key, int &value) const
Bridge::VerboseLevel m_vl
void crucial(const char *format,...)
int non_zero(const double v)
std::vector< double > m_res
string get_string(const string &key) const
static VerboseLevel set_verbose_level(const std::string &str)
double func(const double x)