#include #include #include #include #include #include "MPS_includes.hh" #include "pntsrc_appx.hh" #ifndef TOL #define TOL 1.e-7 #endif const char * sdoc[] = { "Usage: test_pntsrc_appx.x a_ord= d_ord= h= a=", NULL}; using TSOpt::pntsrc_weight; using TSOpt::trunc_fact; using RVL::valparse; int xargc; char **xargv; //----------------------------------------------------------------------------------- int main(int argc, char ** argv) { //----------------------------------------------------------------------------------- try { xargc=argc; xargv=argv; requestdoc(1); PARARRAY * par = ps_new(); if ( ps_createargs(par, argc - 1, argv + 1) ) { printf("Error parsing input data. ABORT.\n"); exit(1); } ps_printall(*par,stderr); //parameters float h = valparse(*par,"h"); float a = valparse(*par,"a"); int a_ord = valparse(*par,"a_ord"); int d_ord = valparse(*par,"d_ord"); //grid point info of approx src point int st_N = a_ord + d_ord; if(st_N<=0){ RVLException e; e << "ERROR from test_pntsrc_appx.x: stencil size of pnt appx is <=0!"; e << "st_N = " << st_N <<"\n"; throw e; } vector stencil; int j = (int)((st_N-1)/2); cerr << "j=" << j <<"\n"; for( int i=0; iTOL && order==0) order=m; } order -= d_ord; cerr << "approximation order = " << order << "\n"; } catch (RVLException & e) { e.write(cerr); exit(1); } }