Skip to content

Commit

Permalink
[advalue] Add static assertion for non-implemented derivative order
Browse files Browse the repository at this point in the history
  • Loading branch information
cgraeser committed Nov 15, 2024
1 parent dab51e4 commit 418782f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ADOL-C/include/adolc/advalue.h
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,7 @@ auto sqrt(const X& x)
return 1./(2.*sqrt(x));
if constexpr (order==2)
return -1./(4.*x*sqrt(x));
static_assert(order <= 2, "Only derivatives up to order 2 are implemented");
});
}

Expand Down

0 comments on commit 418782f

Please sign in to comment.