Skip to content

Instantly share code, notes, and snippets.

@fracek
Created March 4, 2014 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fracek/9343824 to your computer and use it in GitHub Desktop.
Save fracek/9343824 to your computer and use it in GitHub Desktop.
template <typename OperatorType,
typename SignalType>
unsigned int rl(OperatorType &op, SignalType &gn, SignalType &bg, SignalType &x, unsigned int maxit) {
unsigned int it = 0;
SignalType temp = x;
SignalType temp2 = x;
while (it < maxit) {
op.blur(x, temp);
temp += bg;
SignalType::transform(gn.begin(), gn.end(), temp.begin(), temp2.begin(), typename SignalType::div_op());
op.blurT(temp2, temp);
x *= temp;
++it;
}
return it;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment