From 8f560d040353a18270c1b32da484e245d6df2689 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Sun, 15 Dec 2024 20:19:43 +0000 Subject: [PATCH] Simplify CHECK clauses in tests. NFC. --- test/ErrorEstimation/BasicOps.C | 4 +- test/FirstDerivative/BuiltinDerivatives.C | 44 +++++++++--------- test/FirstDerivative/CallArguments.C | 4 +- test/FirstDerivative/FunctionCalls.C | 4 +- test/FirstDerivative/Variables.C | 4 +- test/Hessian/BuiltinDerivatives.C | 56 +++++++++++------------ test/NthDerivative/CustomDerivatives.C | 4 +- test/ROOT/TFormula.C | 16 +++---- 8 files changed, 68 insertions(+), 68 deletions(-) diff --git a/test/ErrorEstimation/BasicOps.C b/test/ErrorEstimation/BasicOps.C index 52ef2aa39..f1ddce114 100644 --- a/test/ErrorEstimation/BasicOps.C +++ b/test/ErrorEstimation/BasicOps.C @@ -137,7 +137,7 @@ float func4(float x, float y) { return std::pow(x, y); } //CHECK-NEXT: { //CHECK-NEXT: float _r0 = 0.F; //CHECK-NEXT: float _r1 = 0.F; -//CHECK-NEXT: clad::custom_derivatives{{(::std)?}}::pow_pullback(x, y, 1, &_r0, &_r1); +//CHECK-NEXT: clad::custom_derivatives::std::pow_pullback(x, y, 1, &_r0, &_r1); //CHECK-NEXT: *_d_x += _r0; //CHECK-NEXT: *_d_y += _r1; //CHECK-NEXT: } @@ -167,7 +167,7 @@ float func5(float x, float y) { //CHECK-NEXT: float _r_d0 = *_d_y; //CHECK-NEXT: *_d_y = 0.F; //CHECK-NEXT: float _r0 = 0.F; -//CHECK-NEXT: _r0 += _r_d0 * clad::custom_derivatives{{(::std)?}}::sin_pushforward(x, 1.F).pushforward; +//CHECK-NEXT: _r0 += _r_d0 * clad::custom_derivatives::std::sin_pushforward(x, 1.F).pushforward; //CHECK-NEXT: *_d_x += _r0; //CHECK-NEXT: } //CHECK-NEXT: _final_error += std::abs(*_d_x * x * {{.+}}); diff --git a/test/FirstDerivative/BuiltinDerivatives.C b/test/FirstDerivative/BuiltinDerivatives.C index 316fe51c6..8e3805925 100644 --- a/test/FirstDerivative/BuiltinDerivatives.C +++ b/test/FirstDerivative/BuiltinDerivatives.C @@ -57,7 +57,7 @@ float f2(float x) { // CHECK: float f2_darg0(float x) { // CHECK-NEXT: float _d_x = 1; -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives{{(::std)?}}::cos_pushforward(x, _d_x); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives::cos_pushforward(x, _d_x); // CHECK-NEXT: return _t0.pushforward; // CHECK-NEXT: } @@ -68,16 +68,16 @@ float f3(float x, float y) { // CHECK: float f3_darg0(float x, float y) { // CHECK-NEXT: float _d_x = 1; // CHECK-NEXT: float _d_y = 0; -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives{{(::std)?}}::sin_pushforward(x, _d_x); -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t1 = clad::custom_derivatives{{(::std)?}}::sin_pushforward(y, _d_y); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives::sin_pushforward(x, _d_x); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t1 = clad::custom_derivatives::sin_pushforward(y, _d_y); // CHECK-NEXT: return _t0.pushforward + _t1.pushforward; // CHECK-NEXT: } // CHECK: float f3_darg1(float x, float y) { // CHECK-NEXT: float _d_x = 0; // CHECK-NEXT: float _d_y = 1; -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives{{(::std)?}}::sin_pushforward(x, _d_x); -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t1 = clad::custom_derivatives{{(::std)?}}::sin_pushforward(y, _d_y); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives::sin_pushforward(x, _d_x); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t1 = clad::custom_derivatives::sin_pushforward(y, _d_y); // CHECK-NEXT: return _t0.pushforward + _t1.pushforward; // CHECK-NEXT: } @@ -88,16 +88,16 @@ float f4(float x, float y) { // CHECK: float f4_darg0(float x, float y) { // CHECK-NEXT: float _d_x = 1; // CHECK-NEXT: float _d_y = 0; -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives{{(::std)?}}::sin_pushforward(x * x, _d_x * x + x * _d_x); -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t1 = clad::custom_derivatives{{(::std)?}}::sin_pushforward(y * y, _d_y * y + y * _d_y); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives::sin_pushforward(x * x, _d_x * x + x * _d_x); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t1 = clad::custom_derivatives::sin_pushforward(y * y, _d_y * y + y * _d_y); // CHECK-NEXT: return _t0.pushforward + _t1.pushforward; // CHECK-NEXT: } // CHECK: float f4_darg1(float x, float y) { // CHECK-NEXT: float _d_x = 0; // CHECK-NEXT: float _d_y = 1; -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives{{(::std)?}}::sin_pushforward(x * x, _d_x * x + x * _d_x); -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t1 = clad::custom_derivatives{{(::std)?}}::sin_pushforward(y * y, _d_y * y + y * _d_y); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives::sin_pushforward(x * x, _d_x * x + x * _d_x); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t1 = clad::custom_derivatives::sin_pushforward(y * y, _d_y * y + y * _d_y); // CHECK-NEXT: return _t0.pushforward + _t1.pushforward; // CHECK-NEXT: } @@ -107,7 +107,7 @@ float f5(float x) { // CHECK: float f5_darg0(float x) { // CHECK-NEXT: float _d_x = 1; -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives{{(::std)?}}::exp_pushforward(x, _d_x); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives::exp_pushforward(x, _d_x); // CHECK-NEXT: return _t0.pushforward; // CHECK-NEXT: } @@ -117,7 +117,7 @@ float f6(float x) { // CHECK: float f6_darg0(float x) { // CHECK-NEXT: float _d_x = 1; -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives{{(::std)?}}::exp_pushforward(x * x, _d_x * x + x * _d_x); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives::exp_pushforward(x * x, _d_x * x + x * _d_x); // CHECK-NEXT: return _t0.pushforward; // CHECK-NEXT: } @@ -127,7 +127,7 @@ float f7(float x) { // CHECK: float f7_darg0(float x) { // CHECK-NEXT: float _d_x = 1; -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives{{(::std)?}}::pow_pushforward(x, 2., _d_x, 0.); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives::std::pow_pushforward(x, 2., _d_x, 0.); // CHECK-NEXT: return _t0.pushforward; // CHECK-NEXT: } @@ -137,7 +137,7 @@ void f7_grad(float x, float *_d_x); // CHECK-NEXT: { // CHECK-NEXT: float _r0 = 0.F; // CHECK-NEXT: double _r1 = 0.; -// CHECK-NEXT: {{(clad::)?}}custom_derivatives{{(::std)?}}::pow_pullback(x, 2., 1, &_r0, &_r1); +// CHECK-NEXT: {{(clad::)?}}custom_derivatives::std::pow_pullback(x, 2., 1, &_r0, &_r1); // CHECK-NEXT: *_d_x += _r0; // CHECK-NEXT: } // CHECK-NEXT: } @@ -148,7 +148,7 @@ double f8(float x) { // CHECK: double f8_darg0(float x) { // CHECK-NEXT: float _d_x = 1; -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives{{(::std)?}}::pow_pushforward(x, 2, _d_x, 0); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives::std::pow_pushforward(x, 2, _d_x, 0); // CHECK-NEXT: return _t0.pushforward; // CHECK-NEXT: } @@ -158,7 +158,7 @@ void f8_grad(float x, float *_d_x); // CHECK-NEXT: { // CHECK-NEXT: float _r0 = 0.F; // CHECK-NEXT: int _r1 = 0; -// CHECK-NEXT: {{(clad::)?}}custom_derivatives{{(::std)?}}::pow_pullback(x, 2, 1, &_r0, &_r1); +// CHECK-NEXT: {{(clad::)?}}custom_derivatives::std::pow_pullback(x, 2, 1, &_r0, &_r1); // CHECK-NEXT: *_d_x += _r0; // CHECK-NEXT: } // CHECK-NEXT: } @@ -170,7 +170,7 @@ float f9(float x, float y) { // CHECK: float f9_darg0(float x, float y) { // CHECK-NEXT: float _d_x = 1; // CHECK-NEXT: float _d_y = 0; -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives{{(::std)?}}::pow_pushforward(x, y, _d_x, _d_y); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives::std::pow_pushforward(x, y, _d_x, _d_y); // CHECK-NEXT: return _t0.pushforward; // CHECK-NEXT: } @@ -180,7 +180,7 @@ void f9_grad(float x, float y, float *_d_x, float *_d_y); // CHECK-NEXT: { // CHECK-NEXT: float _r0 = 0.F; // CHECK-NEXT: float _r1 = 0.F; -// CHECK-NEXT: {{(clad::)?}}custom_derivatives{{(::std)?}}::pow_pullback(x, y, 1, &_r0, &_r1); +// CHECK-NEXT: {{(clad::)?}}custom_derivatives::std::pow_pullback(x, y, 1, &_r0, &_r1); // CHECK-NEXT: *_d_x += _r0; // CHECK-NEXT: *_d_y += _r1; // CHECK-NEXT: } @@ -193,7 +193,7 @@ double f10(float x, int y) { // CHECK: double f10_darg0(float x, int y) { // CHECK-NEXT: float _d_x = 1; // CHECK-NEXT: int _d_y = 0; -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives{{(::std)?}}::pow_pushforward(x, y, _d_x, _d_y); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives::std::pow_pushforward(x, y, _d_x, _d_y); // CHECK-NEXT: return _t0.pushforward; // CHECK-NEXT: } @@ -203,7 +203,7 @@ void f10_grad(float x, int y, float *_d_x, int *_d_y); // CHECK-NEXT: { // CHECK-NEXT: float _r0 = 0.F; // CHECK-NEXT: int _r1 = 0; -// CHECK-NEXT: {{(clad::)?}}custom_derivatives{{(::std)?}}::pow_pullback(x, y, 1, &_r0, &_r1); +// CHECK-NEXT: {{(clad::)?}}custom_derivatives::std::pow_pullback(x, y, 1, &_r0, &_r1); // CHECK-NEXT: *_d_x += _r0; // CHECK-NEXT: *_d_y += _r1; // CHECK-NEXT: } @@ -218,15 +218,15 @@ double f11(double x, double y) { // CHECK-NEXT: { // CHECK-NEXT: double _r0 = 0.; // CHECK-NEXT: int _r1 = 0; -// CHECK-NEXT: {{(clad::)?}}custom_derivatives{{(::std)?}}::pow_pullback((1. - x), 2, 1, &_r0, &_r1); +// CHECK-NEXT: {{(clad::)?}}custom_derivatives::std::pow_pullback((1. - x), 2, 1, &_r0, &_r1); // CHECK-NEXT: *_d_x += -_r0; // CHECK-NEXT: double _r2 = 0.; // CHECK-NEXT: int _r5 = 0; -// CHECK-NEXT: {{(clad::)?}}custom_derivatives{{(::std)?}}::pow_pullback(y - std::pow(x, 2), 2, 100. * 1, &_r2, &_r5); +// CHECK-NEXT: {{(clad::)?}}custom_derivatives::std::pow_pullback(y - std::pow(x, 2), 2, 100. * 1, &_r2, &_r5); // CHECK-NEXT: *_d_y += _r2; // CHECK-NEXT: double _r3 = 0.; // CHECK-NEXT: int _r4 = 0; -// CHECK-NEXT: {{(clad::)?}}custom_derivatives{{(::std)?}}::pow_pullback(x, 2, -_r2, &_r3, &_r4); +// CHECK-NEXT: {{(clad::)?}}custom_derivatives::std::pow_pullback(x, 2, -_r2, &_r3, &_r4); // CHECK-NEXT: *_d_x += _r3; // CHECK-NEXT: } // CHECK-NEXT: } diff --git a/test/FirstDerivative/CallArguments.C b/test/FirstDerivative/CallArguments.C index b9219a220..716ffe607 100644 --- a/test/FirstDerivative/CallArguments.C +++ b/test/FirstDerivative/CallArguments.C @@ -32,7 +32,7 @@ float sqrt_func(float x, float y) { // CHECK: float sqrt_func_darg0(float x, float y) { // CHECK-NEXT: float _d_x = 1; // CHECK-NEXT: float _d_y = 0; -// CHECK-NEXT: ValueAndPushforward _t0 = clad::custom_derivatives{{(::std)?}}::sqrt_pushforward(x * x + y * y, _d_x * x + x * _d_x + _d_y * y + y * _d_y); +// CHECK-NEXT: ValueAndPushforward _t0 = clad::custom_derivatives::sqrt_pushforward(x * x + y * y, _d_x * x + x * _d_x + _d_y * y + y * _d_y); // CHECK-NEXT: return _t0.pushforward - _d_y; // CHECK-NEXT: } @@ -219,7 +219,7 @@ int main () { // expected-no-diagnostics // CHECK-NEXT: double _d_binWidth = ((_d_high - _d_low) * numBins - _t0 * _d_numBins) / (numBins * numBins); // CHECK-NEXT: double binWidth = _t0 / numBins; // CHECK-NEXT: double _t1 = (val - low); -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t2 = clad::custom_derivatives{{(::std)?}}::abs_pushforward(_t1 / binWidth, ((_d_val - _d_low) * binWidth - _t1 * _d_binWidth) / (binWidth * binWidth)); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t2 = clad::custom_derivatives::std::abs_pushforward(_t1 / binWidth, ((_d_val - _d_low) * binWidth - _t1 * _d_binWidth) / (binWidth * binWidth)); // CHECK-NEXT: bool _t3 = val >= high; // CHECK-NEXT: return {(unsigned int)(_t3 ? numBins - 1 : _t2.value), (unsigned int)(_t3 ? _d_numBins - 0 : _t2.pushforward)}; // CHECK-NEXT: } diff --git a/test/FirstDerivative/FunctionCalls.C b/test/FirstDerivative/FunctionCalls.C index 02c5ccfd9..e6c6a303c 100644 --- a/test/FirstDerivative/FunctionCalls.C +++ b/test/FirstDerivative/FunctionCalls.C @@ -107,8 +107,8 @@ float test_6(float x, float y) { // CHECK: float test_6_darg0(float x, float y) { // CHECK-NEXT: float _d_x = 1; // CHECK-NEXT: float _d_y = 0; -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives{{(::std)?}}::sin_pushforward(x, _d_x); -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t1 = clad::custom_derivatives{{(::std)?}}::cos_pushforward(y, _d_y); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives::std::sin_pushforward(x, _d_x); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t1 = clad::custom_derivatives::std::cos_pushforward(y, _d_y); // CHECK-NEXT: return _t0.pushforward + _t1.pushforward; // CHECK-NEXT: } diff --git a/test/FirstDerivative/Variables.C b/test/FirstDerivative/Variables.C index 040155429..72cf53f78 100644 --- a/test/FirstDerivative/Variables.C +++ b/test/FirstDerivative/Variables.C @@ -74,10 +74,10 @@ double f_sin(double x, double y) { // CHECK: double f_sin_darg0(double x, double y) { // CHECK-NEXT: double _d_x = 1; // CHECK-NEXT: double _d_y = 0; -// CHECK-NEXT: ValueAndPushforward _t0 = clad::custom_derivatives{{(::std)?}}::sin_pushforward(x, _d_x); +// CHECK-NEXT: ValueAndPushforward _t0 = clad::custom_derivatives::std::sin_pushforward(x, _d_x); // CHECK-NEXT: double _d_xsin = _t0.pushforward; // CHECK-NEXT: double xsin = _t0.value; -// CHECK-NEXT: ValueAndPushforward _t1 = clad::custom_derivatives{{(::std)?}}::sin_pushforward(y, _d_y); +// CHECK-NEXT: ValueAndPushforward _t1 = clad::custom_derivatives::std::sin_pushforward(y, _d_y); // CHECK-NEXT: double _d_ysin = _t1.pushforward; // CHECK-NEXT: double ysin = _t1.value; // CHECK-NEXT: double _d_xt = _d_xsin * xsin + xsin * _d_xsin; diff --git a/test/Hessian/BuiltinDerivatives.C b/test/Hessian/BuiltinDerivatives.C index 11f78c917..a6e926ab7 100644 --- a/test/Hessian/BuiltinDerivatives.C +++ b/test/Hessian/BuiltinDerivatives.C @@ -174,8 +174,8 @@ int main() { // CHECK: float f1_darg0(float x) { // CHECK-NEXT: float _d_x = 1; -// CHECK-NEXT: ValueAndPushforward _t0 = clad::custom_derivatives{{(::std)?}}::sin_pushforward(x, _d_x); -// CHECK-NEXT: ValueAndPushforward _t1 = clad::custom_derivatives{{(::std)?}}::cos_pushforward(x, _d_x); +// CHECK-NEXT: ValueAndPushforward _t0 = clad::custom_derivatives::sin_pushforward(x, _d_x); +// CHECK-NEXT: ValueAndPushforward _t1 = clad::custom_derivatives::cos_pushforward(x, _d_x); // CHECK-NEXT: return _t0.pushforward + _t1.pushforward; // CHECK-NEXT: } @@ -187,9 +187,9 @@ int main() { // CHECK-NEXT: float _d__d_x = 0.F; // CHECK-NEXT: float _d_x0 = 1; // CHECK-NEXT: ValueAndPushforward _d__t0 = {0.F, 0.F}; -// CHECK-NEXT: ValueAndPushforward _t00 = clad::custom_derivatives{{(::std)?}}::sin_pushforward(x, _d_x0); +// CHECK-NEXT: ValueAndPushforward _t00 = clad::custom_derivatives::sin_pushforward(x, _d_x0); // CHECK-NEXT: ValueAndPushforward _d__t1 = {0.F, 0.F}; -// CHECK-NEXT: ValueAndPushforward _t10 = clad::custom_derivatives{{(::std)?}}::cos_pushforward(x, _d_x0); +// CHECK-NEXT: ValueAndPushforward _t10 = clad::custom_derivatives::cos_pushforward(x, _d_x0); // CHECK-NEXT: { // CHECK-NEXT: _d__t0.pushforward += 1; // CHECK-NEXT: _d__t1.pushforward += 1; @@ -216,7 +216,7 @@ int main() { // CHECK: float f2_darg0(float x) { // CHECK-NEXT: float _d_x = 1; -// CHECK-NEXT: ValueAndPushforward _t0 = clad::custom_derivatives{{(::std)?}}::exp_pushforward(x, _d_x); +// CHECK-NEXT: ValueAndPushforward _t0 = clad::custom_derivatives::exp_pushforward(x, _d_x); // CHECK-NEXT: return _t0.pushforward; // CHECK-NEXT: } @@ -226,7 +226,7 @@ int main() { // CHECK-NEXT: float _d__d_x = 0.F; // CHECK-NEXT: float _d_x0 = 1; // CHECK-NEXT: ValueAndPushforward _d__t0 = {0.F, 0.F}; -// CHECK-NEXT: ValueAndPushforward _t00 = clad::custom_derivatives{{(::std)?}}::exp_pushforward(x, _d_x0); +// CHECK-NEXT: ValueAndPushforward _t00 = clad::custom_derivatives::exp_pushforward(x, _d_x0); // CHECK-NEXT: _d__t0.pushforward += 1; // CHECK-NEXT: { // CHECK-NEXT: {{.*}}ValueAndPushforward _r0 = {0.F, 0.F}; @@ -241,7 +241,7 @@ int main() { // CHECK: float f3_darg0(float x) { // CHECK-NEXT: float _d_x = 1; -// CHECK-NEXT: ValueAndPushforward _t0 = clad::custom_derivatives{{(::std)?}}::log_pushforward(x, _d_x); +// CHECK-NEXT: ValueAndPushforward _t0 = clad::custom_derivatives::log_pushforward(x, _d_x); // CHECK-NEXT: return _t0.pushforward; // CHECK-NEXT: } @@ -251,7 +251,7 @@ int main() { // CHECK-NEXT: float _d__d_x = 0.F; // CHECK-NEXT: float _d_x0 = 1; // CHECK-NEXT: ValueAndPushforward _d__t0 = {0.F, 0.F}; -// CHECK-NEXT: ValueAndPushforward _t00 = clad::custom_derivatives{{(::std)?}}::log_pushforward(x, _d_x0); +// CHECK-NEXT: ValueAndPushforward _t00 = clad::custom_derivatives::log_pushforward(x, _d_x0); // CHECK-NEXT: _d__t0.pushforward += 1; // CHECK-NEXT: { // CHECK-NEXT: {{.*}}ValueAndPushforward _r0 = {0.F, 0.F}; @@ -266,7 +266,7 @@ int main() { // CHECK: float f4_darg0(float x) { // CHECK-NEXT: float _d_x = 1; -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives{{(::std)?}}::pow_pushforward(x, 4.F, _d_x, 0.F); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives::pow_pushforward(x, 4.F, _d_x, 0.F); // CHECK-NEXT: return _t0.pushforward; // CHECK-NEXT: } @@ -276,7 +276,7 @@ int main() { // CHECK-NEXT: float _d__d_x = 0.F; // CHECK-NEXT: float _d_x0 = 1; // CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _d__t0 = {0.F, 0.F}; -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t00 = clad::custom_derivatives{{(::std)?}}::pow_pushforward(x, 4.F, _d_x0, 0.F); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t00 = clad::custom_derivatives::pow_pushforward(x, 4.F, _d_x0, 0.F); // CHECK-NEXT: _d__t0.pushforward += 1; // CHECK-NEXT: { // CHECK-NEXT: {{.*}} _r0 = {0.F, 0.F}; @@ -293,7 +293,7 @@ int main() { // CHECK: float f5_darg0(float x) { // CHECK-NEXT: float _d_x = 1; -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives{{(::std)?}}::pow_pushforward(2.F, x, 0.F, _d_x); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives::pow_pushforward(2.F, x, 0.F, _d_x); // CHECK-NEXT: return _t0.pushforward; // CHECK-NEXT: } @@ -301,7 +301,7 @@ int main() { // CHECK-NEXT: float _d__d_x = 0.F; // CHECK-NEXT: float _d_x0 = 1; // CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _d__t0 = {0.F, 0.F}; -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t00 = clad::custom_derivatives{{(::std)?}}::pow_pushforward(2.F, x, 0.F, _d_x0); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t00 = clad::custom_derivatives::pow_pushforward(2.F, x, 0.F, _d_x0); // CHECK-NEXT: _d__t0.pushforward += 1; // CHECK-NEXT: { // CHECK-NEXT: {{.*}} _r0 = {0.F, 0.F}; @@ -319,7 +319,7 @@ int main() { // CHECK: float f6_darg0(float x, float y) { // CHECK-NEXT: float _d_x = 1; // CHECK-NEXT: float _d_y = 0; -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives{{(::std)?}}::pow_pushforward(x, y, _d_x, _d_y); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives::pow_pushforward(x, y, _d_x, _d_y); // CHECK-NEXT: return _t0.pushforward; // CHECK-NEXT: } @@ -329,7 +329,7 @@ int main() { // CHECK-NEXT: float _d__d_y = 0.F; // CHECK-NEXT: float _d_y0 = 0; // CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _d__t0 = {0.F, 0.F}; -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t00 = clad::custom_derivatives{{(::std)?}}::pow_pushforward(x, y, _d_x0, _d_y0); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t00 = clad::custom_derivatives::pow_pushforward(x, y, _d_x0, _d_y0); // CHECK-NEXT: _d__t0.pushforward += 1; // CHECK-NEXT: { // CHECK-NEXT: {{.*}} _r0 = {0.F, 0.F}; @@ -349,7 +349,7 @@ int main() { // CHECK: float f6_darg1(float x, float y) { // CHECK-NEXT: float _d_x = 0; // CHECK-NEXT: float _d_y = 1; -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives{{(::std)?}}::pow_pushforward(x, y, _d_x, _d_y); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives::pow_pushforward(x, y, _d_x, _d_y); // CHECK-NEXT: return _t0.pushforward; // CHECK-NEXT: } @@ -359,7 +359,7 @@ int main() { // CHECK-NEXT: float _d__d_y = 0.F; // CHECK-NEXT: float _d_y0 = 1; // CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _d__t0 = {0.F, 0.F}; -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t00 = clad::custom_derivatives{{(::std)?}}::pow_pushforward(x, y, _d_x0, _d_y0); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t00 = clad::custom_derivatives::pow_pushforward(x, y, _d_x0, _d_y0); // CHECK-NEXT: _d__t0.pushforward += 1; // CHECK-NEXT: { // CHECK-NEXT: {{.*}} _r0 = {0.F, 0.F}; @@ -379,7 +379,7 @@ int main() { // CHECK: void f7_darg0_grad(float x, float y, float *_d_x, float *_d_y) { // CHECK-NEXT: { // CHECK-NEXT: float _r0 = 0.F; -// CHECK-NEXT: _r0 += 1 * clad::custom_derivatives{{(::std)?}}::cos_pushforward(x, 1.F).pushforward; +// CHECK-NEXT: _r0 += 1 * clad::custom_derivatives::cos_pushforward(x, 1.F).pushforward; // CHECK-NEXT: *_d_x += _r0; // CHECK-NEXT: } // CHECK-NEXT: } @@ -388,10 +388,10 @@ int main() { // CHECK-NEXT: float _t0 = ::std::cos(x); // CHECK-NEXT: { // CHECK-NEXT: float _r0 = 0.F; -// CHECK-NEXT: _r0 += _d_y.value * clad::custom_derivatives{{(::std)?}}::sin_pushforward(x, 1.F).pushforward; +// CHECK-NEXT: _r0 += _d_y.value * clad::custom_derivatives::std::sin_pushforward(x, 1.F).pushforward; // CHECK-NEXT: *_d_x += _r0; // CHECK-NEXT: float _r1 = 0.F; -// CHECK-NEXT: _r1 += _d_y.pushforward * d_x * clad::custom_derivatives{{(::std)?}}::cos_pushforward(x, 1.F).pushforward; +// CHECK-NEXT: _r1 += _d_y.pushforward * d_x * clad::custom_derivatives::std::cos_pushforward(x, 1.F).pushforward; // CHECK-NEXT: *_d_x += _r1; // CHECK-NEXT: *_d_d_x += _t0 * _d_y.pushforward; // CHECK-NEXT: } @@ -401,10 +401,10 @@ int main() { // CHECK-NEXT: float _t0 = ::std::sin(x); // CHECK-NEXT: { // CHECK-NEXT: float _r0 = 0.F; -// CHECK-NEXT: _r0 += _d_y.value * clad::custom_derivatives{{(::std)?}}::cos_pushforward(x, 1.F).pushforward; +// CHECK-NEXT: _r0 += _d_y.value * clad::custom_derivatives::std::cos_pushforward(x, 1.F).pushforward; // CHECK-NEXT: *_d_x += _r0; // CHECK-NEXT: float _r1 = 0.F; -// CHECK-NEXT: _r1 += -1 * _d_y.pushforward * d_x * clad::custom_derivatives{{(::std)?}}::sin_pushforward(x, 1.F).pushforward; +// CHECK-NEXT: _r1 += -1 * _d_y.pushforward * d_x * clad::custom_derivatives::std::sin_pushforward(x, 1.F).pushforward; // CHECK-NEXT: *_d_x += _r1; // CHECK-NEXT: *_d_d_x += -1 * _t0 * _d_y.pushforward; // CHECK-NEXT: } @@ -414,10 +414,10 @@ int main() { // CHECK-NEXT: float _t0 = ::std::exp(x); // CHECK-NEXT: { // CHECK-NEXT: float _r0 = 0.F; -// CHECK-NEXT: _r0 += _d_y.value * clad::custom_derivatives{{(::std)?}}::exp_pushforward(x, 1.F).pushforward; +// CHECK-NEXT: _r0 += _d_y.value * clad::custom_derivatives::std::exp_pushforward(x, 1.F).pushforward; // CHECK-NEXT: *_d_x += _r0; // CHECK-NEXT: float _r1 = 0.F; -// CHECK-NEXT: _r1 += _d_y.pushforward * d_x * clad::custom_derivatives{{(::std)?}}::exp_pushforward(x, 1.F).pushforward; +// CHECK-NEXT: _r1 += _d_y.pushforward * d_x * clad::custom_derivatives::std::exp_pushforward(x, 1.F).pushforward; // CHECK-NEXT: *_d_x += _r1; // CHECK-NEXT: *_d_d_x += _t0 * _d_y.pushforward; // CHECK-NEXT: } @@ -426,7 +426,7 @@ int main() { // CHECK: void log_pushforward_pullback(float x, float d_x, ValueAndPushforward _d_y, float *_d_x, float *_d_d_x) { // CHECK-NEXT: { // CHECK-NEXT: float _r0 = 0.F; -// CHECK-NEXT: _r0 += _d_y.value * clad::custom_derivatives{{(::std)?}}::log_pushforward(x, 1.F).pushforward; +// CHECK-NEXT: _r0 += _d_y.value * clad::custom_derivatives::std::log_pushforward(x, 1.F).pushforward; // CHECK-NEXT: *_d_x += _r0; // CHECK-NEXT: double _r1 = _d_y.pushforward * d_x * -(1. / (x * x)); // CHECK-NEXT: *_d_x += _r1; @@ -462,11 +462,11 @@ int main() { // CHECK-NEXT: float _r_d0 = _d_derivative; // CHECK-NEXT: float _r4 = 0.F; // CHECK-NEXT: float _r5 = 0.F; -// CHECK-NEXT: clad::custom_derivatives{{(::std)?}}::pow_pullback(x, exponent, _r_d0 * d_exponent * _t2, &_r4, &_r5); +// CHECK-NEXT: clad::custom_derivatives::std::pow_pullback(x, exponent, _r_d0 * d_exponent * _t2, &_r4, &_r5); // CHECK-NEXT: *_d_x += _r4; // CHECK-NEXT: *_d_exponent += _r5; // CHECK-NEXT: float _r6 = 0.F; -// CHECK-NEXT: _r6 += _t3 * _r_d0 * d_exponent * clad::custom_derivatives{{(::std)?}}::log_pushforward(x, 1.F).pushforward; +// CHECK-NEXT: _r6 += _t3 * _r_d0 * d_exponent * clad::custom_derivatives::std::log_pushforward(x, 1.F).pushforward; // CHECK-NEXT: *_d_x += _r6; // CHECK-NEXT: *_d_d_exponent += (_t3 * _t2) * _r_d0; // CHECK-NEXT: } @@ -474,7 +474,7 @@ int main() { // CHECK-NEXT: *_d_exponent += _d_derivative * d_x * _t0; // CHECK-NEXT: float _r2 = 0.F; // CHECK-NEXT: float _r3 = 0.F; -// CHECK-NEXT: clad::custom_derivatives{{(::std)?}}::pow_pullback(x, exponent - 1, exponent * _d_derivative * d_x, &_r2, &_r3); +// CHECK-NEXT: clad::custom_derivatives::std::pow_pullback(x, exponent - 1, exponent * _d_derivative * d_x, &_r2, &_r3); // CHECK-NEXT: *_d_x += _r2; // CHECK-NEXT: *_d_exponent += _r3; // CHECK-NEXT: *_d_d_x += (exponent * _t0) * _d_derivative; @@ -482,7 +482,7 @@ int main() { // CHECK-NEXT: { // CHECK-NEXT: float _r0 = 0.F; // CHECK-NEXT: float _r1 = 0.F; -// CHECK-NEXT: clad::custom_derivatives{{(::std)?}}::pow_pullback(x, exponent, _d_val, &_r0, &_r1); +// CHECK-NEXT: clad::custom_derivatives::std::pow_pullback(x, exponent, _d_val, &_r0, &_r1); // CHECK-NEXT: *_d_x += _r0; // CHECK-NEXT: *_d_exponent += _r1; // CHECK-NEXT: } diff --git a/test/NthDerivative/CustomDerivatives.C b/test/NthDerivative/CustomDerivatives.C index 0488a6f6c..42989c3a5 100644 --- a/test/NthDerivative/CustomDerivatives.C +++ b/test/NthDerivative/CustomDerivatives.C @@ -160,8 +160,8 @@ int main() { printf("Result is = %f\n", test_exp_d2arg0(2)); // CHECK-EXEC: Result is = 982.766663 // CHECK: clad::ValueAndPushforward, ValueAndPushforward > exp_pushforward_pushforward(float x, float d_x, float _d_x, float _d_d_x) { -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives{{(::std)?}}::exp_pushforward(x, _d_x); -// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t1 = clad::custom_derivatives{{(::std)?}}::exp_pushforward(x, _d_x); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t0 = clad::custom_derivatives::std::exp_pushforward(x, _d_x); +// CHECK-NEXT: {{(clad::)?}}ValueAndPushforward _t1 = clad::custom_derivatives::std::exp_pushforward(x, _d_x); // CHECK-NEXT: float &_t2 = _t1.value; // CHECK-NEXT: return {{[{][(]ValueAndPushforward[)][{]}}_t0.value, _t2 * d_x}, (ValueAndPushforward){_t0.pushforward, _t1.pushforward * d_x + _t2 * _d_d_x{{[}][}]}}; // CHECK-NEXT:} diff --git a/test/ROOT/TFormula.C b/test/ROOT/TFormula.C index 2c2bdad3c..57866b233 100644 --- a/test/ROOT/TFormula.C +++ b/test/ROOT/TFormula.C @@ -44,32 +44,32 @@ void TFormula_example_grad_1(Double_t* x, Double_t* p, Double_t* _d_p); //CHECK-NEXT: _d_p[1] += x[0] * 1; //CHECK-NEXT: _d_p[2] += x[0] * 1; //CHECK-NEXT: Double_t _r0 = 0.; -//CHECK-NEXT: _r0 += 1 * clad::custom_derivatives{{(::std)?}}::TMath::Exp_pushforward(-p[0], 1.).pushforward; +//CHECK-NEXT: _r0 += 1 * clad::custom_derivatives::TMath::Exp_pushforward(-p[0], 1.).pushforward; //CHECK-NEXT: _d_p[0] += -_r0; //CHECK-NEXT: Double_t _r1 = 0.; -//CHECK-NEXT: _r1 += 1 * clad::custom_derivatives{{(::std)?}}::TMath::Abs_pushforward(p[1], 1.).pushforward; +//CHECK-NEXT: _r1 += 1 * clad::custom_derivatives::TMath::Abs_pushforward(p[1], 1.).pushforward; //CHECK-NEXT: _d_p[1] += _r1; //CHECK-NEXT: } //CHECK-NEXT: } //CHECK: Double_t TFormula_example_darg1_0(Double_t *x, Double_t *p) { //CHECK-NEXT: {{double|Double_t}} _t0 = (p[0] + p[1] + p[2]); -//CHECK-NEXT: clad::ValueAndPushforward _t1 = clad::custom_derivatives{{(::std)?}}::TMath::Exp_pushforward(-p[0], -1.); -//CHECK-NEXT: clad::ValueAndPushforward _t2 = clad::custom_derivatives{{(::std)?}}::TMath::Abs_pushforward(p[1], 0.); +//CHECK-NEXT: clad::ValueAndPushforward _t1 = clad::custom_derivatives::TMath::Exp_pushforward(-p[0], -1.); +//CHECK-NEXT: clad::ValueAndPushforward _t2 = clad::custom_derivatives::TMath::Abs_pushforward(p[1], 0.); //CHECK-NEXT: return 0. * _t0 + x[0] * (1. + 0. + 0.) + _t1.pushforward + _t2.pushforward; //CHECK-NEXT: } //CHECK: Double_t TFormula_example_darg1_1(Double_t *x, Double_t *p) { //CHECK-NEXT: {{double|Double_t}} _t0 = (p[0] + p[1] + p[2]); -//CHECK-NEXT: clad::ValueAndPushforward _t1 = clad::custom_derivatives{{(::std)?}}::TMath::Exp_pushforward(-p[0], -0.); -//CHECK-NEXT: clad::ValueAndPushforward _t2 = clad::custom_derivatives{{(::std)?}}::TMath::Abs_pushforward(p[1], 1.); +//CHECK-NEXT: clad::ValueAndPushforward _t1 = clad::custom_derivatives::TMath::Exp_pushforward(-p[0], -0.); +//CHECK-NEXT: clad::ValueAndPushforward _t2 = clad::custom_derivatives::TMath::Abs_pushforward(p[1], 1.); //CHECK-NEXT: return 0. * _t0 + x[0] * (0. + 1. + 0.) + _t1.pushforward + _t2.pushforward; //CHECK-NEXT: } //CHECK: Double_t TFormula_example_darg1_2(Double_t *x, Double_t *p) { //CHECK-NEXT: {{double|Double_t}} _t0 = (p[0] + p[1] + p[2]); -//CHECK-NEXT: clad::ValueAndPushforward _t1 = clad::custom_derivatives{{(::std)?}}::TMath::Exp_pushforward(-p[0], -0.); -//CHECK-NEXT: clad::ValueAndPushforward _t2 = clad::custom_derivatives{{(::std)?}}::TMath::Abs_pushforward(p[1], 0.); +//CHECK-NEXT: clad::ValueAndPushforward _t1 = clad::custom_derivatives::TMath::Exp_pushforward(-p[0], -0.); +//CHECK-NEXT: clad::ValueAndPushforward _t2 = clad::custom_derivatives::TMath::Abs_pushforward(p[1], 0.); //CHECK-NEXT: return 0. * _t0 + x[0] * (0. + 0. + 1.) + _t1.pushforward + _t2.pushforward; //CHECK-NEXT: }