diff --git a/pub/lib/fit.cpp b/pub/lib/fit.cpp index 3037d6ed98cb56a6bfacba16582bc688aef37eb3..e4715918b4b64c704c1eed976cd2996fcba9126f 100644 --- a/pub/lib/fit.cpp +++ b/pub/lib/fit.cpp @@ -221,7 +221,7 @@ void NCurveFit::fit( bool _allow_slow_conv ) control.patience = nCall; control.verbosity = verbosity; - #pragma omp parallel for ordered +#pragma omp parallel for ordered for ( int j=0; j<fc->nJ(); j++ ) { try { if ( fc->V[j]->frozen ) diff --git a/pub/lib/node.cpp b/pub/lib/node.cpp index d13ba39682f38e2b930a436587662ed688e9cc70..9c8977292c9d073934bd41ae169032f0f871655c 100644 --- a/pub/lib/node.cpp +++ b/pub/lib/node.cpp @@ -735,10 +735,19 @@ void CNodePConv::convolve( CResult& ret, const CContext& ctx, // now convolve resolution with differential of primitive for ( int i=0; i<n; ++i ){ ret.v[i] = 0; - for ( int iv=0; iv<nv; ++iv ) - ret.v[i] += (res_theory.to_r(nv +i-iv)- - res_theory.to_r(nv-1+i-iv)) * sv->y[iv]; + if( with_error ) + ret.dv[i] = 0; + for ( int iv=0; iv<nv; ++iv ) { + double igral = + res_theory.to_r(nv +i-iv)- + res_theory.to_r(nv-1+i-iv); + ret.v[i] += igral * sv->y[iv]; + if( with_error ) + ret.dv[i] += igral * sv->dy[iv]; + } ret.v[i] /= conv_norm; + if( with_error ) + ret.dv[i] /= conv_norm; } } else { // simplest version: non-equidistant x_out and x_res. ret.v.assign( n, 0. );