You could potentially use an unconditional multiplication likevalue = 1 - 2 ((x < 0.0) && (der % 2));to avoid the branching if statement. May be more efficient, but needs testing to find out.Am 12.04.2024 um 15:04 schrieb Michael Quellmalz @.***>:
@michaelquellmalz approved this pull request.
In applications/fastsum/kernels.c:
@@ -431,6 +431,23 @@ C laplacian_rbf(R x, int der, const R param) / K(x)=EXP(-|x|/c) */
return value;
}
+C der_laplacian_rbf(R x, int der, const R param) / K(x)=|x|/c EXP(-|x|/c) */
+{
R c = param[0];
R value = K(0.0);
switch (der)
{
case 0 : value = (FABS(x)/c)*EXP(-FABS(x)/c); break;
default:
value = (POW(K(-1.0),(R)der))((FABS(x)-(R)derc)/POW(c,(R)der+1))*EXP(-FABS(x)/c);
if (x < K(0.0))
You could also write if ((x < K(0.0)) && (der % 2)) value *= K(-1.0)
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>
You could potentially use an unconditional multiplication likevalue = 1 - 2 ((x < 0.0) && (der % 2));to avoid the branching if statement. May be more efficient, but needs testing to find out.Am 12.04.2024 um 15:04 schrieb Michael Quellmalz @.***>: @michaelquellmalz approved this pull request.
In applications/fastsum/kernels.c:
+C der_laplacian_rbf(R x, int der, const R param) / K(x)=|x|/c EXP(-|x|/c) */ +{
You could also write if ((x < K(0.0)) && (der % 2)) value *= K(-1.0)
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>