Commit 37677150 authored by thomas.forbriger's avatar thomas.forbriger
Browse files

libpsdxx [WP]: provide test function for LogTaper

parent 4eba7a68
......@@ -63,9 +63,10 @@ int main(int iargc, char* argv[])
// define full help text
char help_text[]=
{
"-lf test function log_frequency"
"-li test function class LogIndex"
"-lt test function class LogTaper"
"-lf test function log_frequency\n"
"-li test function class LogIndex\n"
"-lt [i] test function class LogTaper, center taper on\n"
" frequency with index i on logarithmic scale\n"
};
// define commandline options
......@@ -80,6 +81,8 @@ int main(int iargc, char* argv[])
{"lf",arg_no,"-"},
// 3: log index
{"li",arg_no,"-"},
// 4: log taper
{"lt",arg_opt,"5"},
{NULL}
};
......@@ -105,6 +108,8 @@ int main(int iargc, char* argv[])
opt.verbose=cmdline.optset(1);
opt.logfrequency=cmdline.optset(2);
opt.logindex=cmdline.optset(3);
opt.logtaper=cmdline.optset(4);
opt.taperindex=cmdline.int_arg(4);
if (opt.logfrequency)
{
......@@ -133,6 +138,8 @@ int main(int iargc, char* argv[])
}
} // if (opt.logfrequency)
/* ---------------------------------------------------------------------- */
if (opt.logindex)
{
cout << "test class LogIndex" << endl;
......@@ -141,6 +148,22 @@ int main(int iargc, char* argv[])
testlogindex(ls1, 0);
testlogindex(ls1, 3);
} // if (opt.logindex)
/* ---------------------------------------------------------------------- */
if (opt.logtaper)
{
cout << "test class LogTaper" << endl;
CODE( psd::TDseries linf=psd::lin_frequency(0.1,100) );
CODE( psd::TDseries logf=psd::log_frequency(0.1,100,6) );
CODE( psd::helper::LogTaper logt(logf, opt.taperindex) );
cout << PSDXX_value( logf(opt.taperindex) ) << endl;
for (int i=linf.f(); i<= linf.l(); ++i)
{
cout << i << " " << linf(i) << " " << logt(linf(i)) << endl;
}
cout << PSDXX_value( logt.sum() ) << endl;
} // if (opt.logtaper)
}
/* ----- END OF testpsdxx.cc ----- */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment