Skip to content
Snippets Groups Projects
Commit 30702d12 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

optimize

parent 7772b1e6
No related branches found
No related tags found
No related merge requests found
...@@ -581,8 +581,6 @@ void CTree::tree_val( CTOut *ret, const CContext *ctx ) const ...@@ -581,8 +581,6 @@ void CTree::tree_val( CTOut *ret, const CContext *ctx ) const
CContext cvctx(*ctx); CContext cvctx(*ctx);
vector<double> tt; vector<double> tt;
cvctx.fargs = &tt; cvctx.fargs = &tt;
for ( uint i=0; i<n; ++i )
ret->vd[i] = 0;
// Convolute theory with resolution. // Convolute theory with resolution.
if( conv_step ){ if( conv_step ){
// Accelerated version with equidistant grids // Accelerated version with equidistant grids
...@@ -592,12 +590,16 @@ void CTree::tree_val( CTOut *ret, const CContext *ctx ) const ...@@ -592,12 +590,16 @@ void CTree::tree_val( CTOut *ret, const CContext *ctx ) const
tt[ii] = (*(ctx->fargs))[0] - sv->x[0] - shift + tt[ii] = (*(ctx->fargs))[0] - sv->x[0] - shift +
(ii-(nv-1))*conv_step; (ii-(nv-1))*conv_step;
arg[0]->tree_val( &r, &cvctx ); arg[0]->tree_val( &r, &cvctx );
for ( uint iv=0; iv<nv; ++iv ) for ( uint i=0; i<n; ++i ){
for ( uint i=0; i<n; ++i ) ret->vd[i] = 0;
ret->vd[i] += r.to_d(nv-1+i-iv) * sv->y[iv] * for ( uint iv=0; iv<nv; ++iv )
conv_step / conv_norm; ret->vd[i] += r.to_d(nv-1+i-iv) * sv->y[iv];
ret->vd[i] *= conv_step / conv_norm;
}
} else { } else {
// Simplest version: non-equidistant x_out and x_res. // Simplest version: non-equidistant x_out and x_res.
for ( uint i=0; i<n; ++i )
ret->vd[i] = 0;
tt.resize(n); tt.resize(n);
for ( uint iv=0; iv<nv; ++iv ) { for ( uint iv=0; iv<nv; ++iv ) {
double dx; double dx;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment