diff --git a/TODO b/TODO index 0c525226b4c21c5341d2de5e8ce7472aa7d31269..6abc705896152228c4d9a5d2d07ac95231c1b3c6 100644 --- a/TODO +++ b/TODO @@ -4,6 +4,8 @@ - convolutand must not be defined over full energy range - when include file is not found: "terminate called after throwing an instance of 'std::string'" +- fc funzt nicht für Kurven +- ignore op on data file == TO CHECK == diff --git a/distrib/HOWTO b/distrib/HOWTO index cc6dc758a6247a57f28b400cb16074a17621a5cc..6be4e935ad91f89384ac80a61aa49afded6cbaa4 100755 --- a/distrib/HOWTO +++ b/distrib/HOWTO @@ -5,7 +5,7 @@ cd pub vi configure.ac # version vi CHANGELOG make maintainer-clean -autoreconf -f -i +autoreconf -f -i # if dependencies have changed ### resynchronize cd ~/f2 diff --git a/pub/CHANGELOG b/pub/CHANGELOG index deb7ddb96aee3e43d0d15232ff97b32493e00d68..160186149317cff9e511b5c2ea90263c8ba42d31 100644 --- a/pub/CHANGELOG +++ b/pub/CHANGELOG @@ -1,4 +1,12 @@ -Release 2.1.0a of 11may10: +Release 2.1.0b of 15may10: + +- fix bugs introduced by release 100511: + - enable ody + - repair oio when nJ=1 + - oy was setting nonsense dy when expr yielded no error + - severe errors in error handling within expr + +Release 2.1.0a of 11may10 (including new frida2lib release): - fix bug in configure.ac introduced in previous release - new release numbering scheme: diff --git a/pub/configure.ac b/pub/configure.ac index 9d14a29bcb95749353ffb1b6b90b2254dcf174de..2ccfb795fd62833eb5bd5a5a1713199501f88c9c 100644 --- a/pub/configure.ac +++ b/pub/configure.ac @@ -9,7 +9,7 @@ ## Generic initialization ## ############################################################################### -AC_INIT([frida],[2.1.0a],[j.wuttke@fz-juelich.de]) +AC_INIT([frida],[2.1.0b],[j.wuttke@fz-juelich.de]) # project name must be "frida"; this determines the installation directories AC_PREREQ(2.65) diff --git a/pub/src/expr.cpp b/pub/src/expr.cpp index 3779df67717fc8a04b4e4bcfcbaba3ca6865b863..d1bbdc1935e90a5a621ae191521102911baf658a 100644 --- a/pub/src/expr.cpp +++ b/pub/src/expr.cpp @@ -701,6 +701,14 @@ void CTree::tree_op( CResult& ret, const CContext& ctx ) const continue; is_scalar = false; } + // some input has errors ? + bool err_input = false; + for ( uint iarg=0; iarg<narg; ++iarg ) { + if ( a[iarg].has_err() ){ + err_input = true; + break; + } + } // size of vectorial arguments int n=0; if( !is_scalar ) { @@ -716,7 +724,7 @@ void CTree::tree_op( CResult& ret, const CContext& ctx ) const } // now evaluate the function if ( narg==1 ) { - if( ctx.want_error && fun->d1 && ( is_scalar || a[0].dv.size() ) ) { + if( ctx.want_error && fun->d1 && err_input ) { if ( is_scalar ) { (*(fun->d1))( ret.r, ret.dr, a[0].r, a[0].dr ); } else { @@ -732,7 +740,8 @@ void CTree::tree_op( CResult& ret, const CContext& ctx ) const ret.v[i] = (*(fun->f1))( a[0].v[i] ); } } else if ( narg==2 ) { - if( ctx.want_error && fun->d2 ) { + if( ctx.want_error && ( ( fun->d2 && err_input ) || + fun->txt=="+-" ) ) { if ( is_scalar ) { (*(fun->d2))( ret.r, ret.dr, a[0].r, a[0].dr, a[1].r, a[1].dr ); } else { @@ -757,7 +766,7 @@ void CTree::tree_op( CResult& ret, const CContext& ctx ) const } } } else if ( narg==3 ) { - if( ctx.want_error && fun->d3 ) { + if( ctx.want_error && fun->d3 && err_input ) { if ( is_scalar ) { (*(fun->d3))( ret.r, ret.dr, a[0].r, a[0].dr, a[1].r, a[1].dr, a[2].r, a[2].dr ); diff --git a/pub/src/expr.h b/pub/src/expr.h index 828d96f4d86818d4a13843f180181841a393e08d..81b75bdfda4ef387d8ec05a6c126953bb4eac240 100644 --- a/pub/src/expr.h +++ b/pub/src/expr.h @@ -34,14 +34,15 @@ class CResult { vector<double> v; vector<double> dv; -CResult() : vectorial(false), dr(0) {}; + CResult() : vectorial(false), dr(0) {}; void set_r( double _r ) { vectorial = false; r = _r; }; void preset_v( int n ) { vectorial = true; v.resize(n); }; void set_v( const vector<double>& v_ ) { vectorial = true; v = v_; }; - double to_r( int i ) const { return vectorial ? v[i] : r; } + double to_r( int i ) const { return vectorial ? v[i] : r; }; double to_dr( int i ) const - { return vectorial ? ( v.size() ? v[i] : 0 ) : r; } + { return vectorial ? ( v.size() ? v[i] : 0 ) : dr; }; + bool has_err() const { return vectorial ? dv.size() : dr; }; }; diff --git a/pub/src/frida2.cpp b/pub/src/frida2.cpp index 331f54f876c31b182e30370671e94da08e179a19..df6d4a212f21a79d86f79dd3cd2f10e4efb2ce99 100644 --- a/pub/src/frida2.cpp +++ b/pub/src/frida2.cpp @@ -497,7 +497,7 @@ int main() " oixy choose two columns, save them as x and y\n" ; - } else if (cmd[0]=='o' && strchr("xyzp", cmd[1])) { + } else if (cmd[0]=='o' && strchr("xydzp", cmd[1])) { NOperate::Pointwise( cmd.substr(1) ); } else if (cmd.substr(0,2) == "of") { NOperate::Functional( cmd.substr(2) ); diff --git a/pub/src/opr.cpp b/pub/src/opr.cpp index 0559d25eb237f3f0aa3a57de02e22f94c4a7ae6b..d2a02ad3eeef72f9ed45b25de7c7e1d980f20938 100644 --- a/pub/src/opr.cpp +++ b/pub/src/opr.cpp @@ -207,14 +207,15 @@ void NOperate::Pointwise( string llabel ) if ( lref.typ==CVariable::_X ) (P2D(fout))->VS(j)->x = vout; else if ( lref.typ==CVariable::_DY ) - (P2D(fout))->VS(j)->x = vout; + (P2D(fout))->VS(j)->dy = vout; else throw string( "BUG: unexpected lref" ); } else if ( lref.typ==CVariable::_Y ) { - vector<double> dvout( fd->nPts(j) ); + vector<double> dvout; T->tree_vec_val( &vout, &dvout, k, j ); (P2D(fout))->VS(j)->y = vout; - (P2D(fout))->VS(j)->dy = dvout; + if( dvout.size() ) + (P2D(fout))->VS(j)->dy = dvout; } else throw string( "BUG: unexpected lref" ); } else if ( lref.typ==CVariable::_Z ) { @@ -414,66 +415,68 @@ void NIntOld::Opr() POld fout( fin->new_old() ); - fout->ZCo.pop_back(); - fout->xco = fin->ZCo.back(); - - if (mod== 2) { - fout->yco.name = fin->yco.name + " (#" - + strg(iarg2) + ")"; - } else if (mod== 3) { - fout->yco.name = "<" + fin->yco.name + ">"; - fout->yco.unit = fin->yco.unit; - } else if (mod== 4) { - fout->yco.name = "sigma(" + fin->yco.name + ")"; - fout->yco.unit = "" ; - } else if (mod== 5) { - fout->yco.name = fin->xco.name + "_max"; - fout->yco.unit = fin->xco.unit; - } else if (mod== 6) { - fout->yco.name = fin->yco.name + "_max"; - fout->yco.unit = fin->yco.unit; - } else if (mod== 7) { - fout->yco.name = fin->xco.name + "_min"; - fout->yco.unit = fin->xco.unit; - } else if (mod== 8) { - fout->yco.name = fin->yco.name + "_min"; - fout->yco.unit = fin->yco.unit; - } else if (mod== 9) { - fout->yco.name = "sum " + fin->yco.name; - fout->yco.unit = fin->yco.unit; - } else if (mod==10) { - fout->yco.name = - "I d" + fin->xco.name + " " + fin->yco.name; - if( fin->yco.unit==fin->xco.unit+"-1" || - fin->xco.unit==fin->yco.unit+"-1" ) - fout->yco.unit = ""; - else - fout->yco.unit = fin->yco.unit + "*" + fin->xco.unit; - } else if (mod==11) { - fout->yco.name = fin->xco.name + - string("[integral{") + - fin->yco.name + "} < " + strg(arg2) + "]"; - fout->yco.unit = fin->xco.unit; - } else if (mod==13) { - fout->yco.name = "max " + fin->xco.name + - " with positive " + fin->yco.name; - fout->yco.unit = fin->xco.unit; - } else if (mod==15) { - fout->yco.name = fin->xco.name + - "[center of gravity of " + - fin->yco.name + "]"; - fout->yco.unit = fin->xco.unit; - } else if (mod==16) { - fout->yco.name = "sigma(" + fin->xco.name + ")"; - fout->yco.unit = "" ; - } else if (mod==17) { - fout->yco.name = "rho(" + fin->xco.name + - "|" + fin->yco.name + ")"; - fout->yco.unit = "" ; - } else { - throw string( "invalid mode" ); + if( savable ) { + fout->ZCo.pop_back(); + fout->xco = fin->ZCo.back(); + + if (mod== 2) { + fout->yco.name = fin->yco.name + " (#" + + strg(iarg2) + ")"; + } else if (mod== 3) { + fout->yco.name = "<" + fin->yco.name + ">"; + fout->yco.unit = fin->yco.unit; + } else if (mod== 4) { + fout->yco.name = "sigma(" + fin->yco.name + ")"; + fout->yco.unit = "" ; + } else if (mod== 5) { + fout->yco.name = fin->xco.name + "_max"; + fout->yco.unit = fin->xco.unit; + } else if (mod== 6) { + fout->yco.name = fin->yco.name + "_max"; + fout->yco.unit = fin->yco.unit; + } else if (mod== 7) { + fout->yco.name = fin->xco.name + "_min"; + fout->yco.unit = fin->xco.unit; + } else if (mod== 8) { + fout->yco.name = fin->yco.name + "_min"; + fout->yco.unit = fin->yco.unit; + } else if (mod== 9) { + fout->yco.name = "sum " + fin->yco.name; + fout->yco.unit = fin->yco.unit; + } else if (mod==10) { + fout->yco.name = + "I d" + fin->xco.name + " " + fin->yco.name; + if( fin->yco.unit==fin->xco.unit+"-1" || + fin->xco.unit==fin->yco.unit+"-1" ) + fout->yco.unit = ""; + else + fout->yco.unit = fin->yco.unit + "*" + fin->xco.unit; + } else if (mod==11) { + fout->yco.name = fin->xco.name + + string("[integral{") + + fin->yco.name + "} < " + strg(arg2) + "]"; + fout->yco.unit = fin->xco.unit; + } else if (mod==13) { + fout->yco.name = "max " + fin->xco.name + + " with positive " + fin->yco.name; + fout->yco.unit = fin->xco.unit; + } else if (mod==15) { + fout->yco.name = fin->xco.name + + "[center of gravity of " + + fin->yco.name + "]"; + fout->yco.unit = fin->xco.unit; + } else if (mod==16) { + fout->yco.name = "sigma(" + fin->xco.name + ")"; + fout->yco.unit = "" ; + } else if (mod==17) { + fout->yco.name = "rho(" + fin->xco.name + + "|" + fin->yco.name + ")"; + fout->yco.unit = "" ; + } else { + throw string( "invalid mode" ); + } + fout->lDoc.push_back( "oio "+strg(mod)+" # y = "+fout->yco.name ); } - fout->lDoc.push_back( "oio "+strg(mod)+" # y = "+fout->yco.name ); PSpec eout( new CSpec ); eout->z = fin->V[0]->z;