From e77453aca28c475d556b942c53584e9c11a0b4fe Mon Sep 17 00:00:00 2001 From: Mihail Mihov Date: Tue, 19 Mar 2024 19:19:45 +0200 Subject: [PATCH] Fix Hessian/Hessians test --- test/Hessian/Hessians.C | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/test/Hessian/Hessians.C b/test/Hessian/Hessians.C index f6ced7852..f3c2b4606 100644 --- a/test/Hessian/Hessians.C +++ b/test/Hessian/Hessians.C @@ -4,7 +4,6 @@ // RUN: ./Hessians.out | FileCheck -check-prefix=CHECK-EXEC %s //CHECK-NOT: {{.*error|warning|note:.*}} -// XFAIL: target={{i586.*}} #include "clad/Differentiator/Differentiator.h" @@ -90,8 +89,8 @@ void f_cubed_add1_darg1_grad(double a, double b, clad::array_ref _d_a, c void f_cubed_add1_hessian(double a, double b, clad::array_ref hessianMatrix); //CHECK: void f_cubed_add1_hessian(double a, double b, clad::array_ref hessianMatrix) __attribute__((always_inline)) { -//CHECK-NEXT: f_cubed_add1_darg0_grad(a, b, hessianMatrix.slice(0UL, 1UL), hessianMatrix.slice(1UL, 1UL)); -//CHECK-NEXT: f_cubed_add1_darg1_grad(a, b, hessianMatrix.slice(2UL, 1UL), hessianMatrix.slice(3UL, 1UL)); +//CHECK-NEXT: f_cubed_add1_darg0_grad(a, b, hessianMatrix.slice({{0U|0UL}}, {{1U|1UL}}), hessianMatrix.slice({{1U|1UL}}, {{1U|1UL}})); +//CHECK-NEXT: f_cubed_add1_darg1_grad(a, b, hessianMatrix.slice({{2U|2UL}}, {{1U|1UL}}), hessianMatrix.slice({{3U|3UL}}, {{1U|1UL}})); //CHECK-NEXT: } double f_suvat1(double u, double t) { @@ -103,8 +102,8 @@ void f_suvat1_darg1_grad(double u, double t, clad::array_ref _d_u, clad: void f_suvat1_hessian(double u, double t, clad::array_ref hessianMatrix); //CHECK:void f_suvat1_hessian(double u, double t, clad::array_ref hessianMatrix) { -//CHECK-NEXT: f_suvat1_darg0_grad(u, t, hessianMatrix.slice(0UL, 1UL), hessianMatrix.slice(1UL, 1UL)); -//CHECK-NEXT: f_suvat1_darg1_grad(u, t, hessianMatrix.slice(2UL, 1UL), hessianMatrix.slice(3UL, 1UL)); +//CHECK-NEXT: f_suvat1_darg0_grad(u, t, hessianMatrix.slice({{0U|0UL}}, {{1U|1UL}}), hessianMatrix.slice({{1U|1UL}}, {{1U|1UL}})); +//CHECK-NEXT: f_suvat1_darg1_grad(u, t, hessianMatrix.slice({{2U|2UL}}, {{1U|1UL}}), hessianMatrix.slice({{3U|3UL}}, {{1U|1UL}})); //CHECK-NEXT:} double f_cond3(double x, double c) { @@ -121,8 +120,8 @@ void f_cond3_darg1_grad(double x, double c, clad::array_ref _d_x, clad:: void f_cond3_hessian(double x, double c, clad::array_ref hessianMatrix); //CHECK:void f_cond3_hessian(double x, double c, clad::array_ref hessianMatrix) { -//CHECK-NEXT: f_cond3_darg0_grad(x, c, hessianMatrix.slice(0UL, 1UL), hessianMatrix.slice(1UL, 1UL)); -//CHECK-NEXT: f_cond3_darg1_grad(x, c, hessianMatrix.slice(2UL, 1UL), hessianMatrix.slice(3UL, 1UL)); +//CHECK-NEXT: f_cond3_darg0_grad(x, c, hessianMatrix.slice({{0U|0UL}}, {{1U|1UL}}), hessianMatrix.slice({{1U|1UL}}, {{1U|1UL}})); +//CHECK-NEXT: f_cond3_darg1_grad(x, c, hessianMatrix.slice({{2U|2UL}}, {{1U|1UL}}), hessianMatrix.slice({{3U|3UL}}, {{1U|1UL}})); //CHECK-NEXT:} double f_power10(double x) { @@ -133,7 +132,7 @@ void f_power10_darg0_grad(double x, clad::array_ref _d_x); void f_power10_hessian(double x, clad::array_ref hessianMatrix); //CHECK: void f_power10_hessian(double x, clad::array_ref hessianMatrix) { -//CHECK-NEXT: f_power10_darg0_grad(x, hessianMatrix.slice(0UL, 1UL)); +//CHECK-NEXT: f_power10_darg0_grad(x, hessianMatrix.slice({{0U|0UL}}, {{1U|1UL}})); //CHECK-NEXT: } struct Experiment { @@ -155,9 +154,9 @@ struct Experiment { void someMethod_hessian(double x, clad::array_ref hessianMatrix); // CHECK: void someMethod_hessian(double i, double j, clad::array_ref hessianMatrix) { // CHECK-NEXT: Experiment _d_this; - // CHECK-NEXT: this->someMethod_darg0_grad(i, j, &_d_this, hessianMatrix.slice(0UL, 1UL), hessianMatrix.slice(1UL, 1UL)); + // CHECK-NEXT: this->someMethod_darg0_grad(i, j, &_d_this, hessianMatrix.slice({{0U|0UL}}, {{1U|1UL}}), hessianMatrix.slice({{1U|1UL}}, {{1U|1UL}})); // CHECK-NEXT: Experiment _d_this0; - // CHECK-NEXT: this->someMethod_darg1_grad(i, j, &_d_this0, hessianMatrix.slice(2UL, 1UL), hessianMatrix.slice(3UL, 1UL)); + // CHECK-NEXT: this->someMethod_darg1_grad(i, j, &_d_this0, hessianMatrix.slice({{2U|2UL}}, {{1U|1UL}}), hessianMatrix.slice({{3U|3UL}}, {{1U|1UL}})); // CHECK-NEXT: } }; @@ -182,9 +181,9 @@ struct Widget { clad::array_ref hessianMatrix); // CHECK: void memFn_1_hessian(double i, double j, clad::array_ref hessianMatrix) { // CHECK-NEXT: Widget _d_this; - // CHECK-NEXT: this->memFn_1_darg0_grad(i, j, &_d_this, hessianMatrix.slice(0UL, 1UL), hessianMatrix.slice(1UL, 1UL)); + // CHECK-NEXT: this->memFn_1_darg0_grad(i, j, &_d_this, hessianMatrix.slice({{0U|0UL}}, {{1U|1UL}}), hessianMatrix.slice({{1U|1UL}}, {{1U|1UL}})); // CHECK-NEXT: Widget _d_this0; - // CHECK-NEXT: this->memFn_1_darg1_grad(i, j, &_d_this0, hessianMatrix.slice(2UL, 1UL), hessianMatrix.slice(3UL, 1UL)); + // CHECK-NEXT: this->memFn_1_darg1_grad(i, j, &_d_this0, hessianMatrix.slice({{2U|2UL}}, {{1U|1UL}}), hessianMatrix.slice({{3U|3UL}}, {{1U|1UL}})); // CHECK-NEXT: } double memFn_2(double i, double j) { @@ -207,9 +206,9 @@ struct Widget { clad::array_ref hessianMatrix); // CHECK: void memFn_2_hessian(double i, double j, clad::array_ref hessianMatrix) { // CHECK-NEXT: Widget _d_this; - // CHECK-NEXT: this->memFn_2_darg0_grad(i, j, &_d_this, hessianMatrix.slice(0UL, 1UL), hessianMatrix.slice(1UL, 1UL)); + // CHECK-NEXT: this->memFn_2_darg0_grad(i, j, &_d_this, hessianMatrix.slice({{0U|0UL}}, {{1U|1UL}}), hessianMatrix.slice({{1U|1UL}}, {{1U|1UL}})); // CHECK-NEXT: Widget _d_this0; - // CHECK-NEXT: this->memFn_2_darg1_grad(i, j, &_d_this0, hessianMatrix.slice(2UL, 1UL), hessianMatrix.slice(3UL, 1UL)); + // CHECK-NEXT: this->memFn_2_darg1_grad(i, j, &_d_this0, hessianMatrix.slice({{2U|2UL}}, {{1U|1UL}}), hessianMatrix.slice({{3U|3UL}}, {{1U|1UL}})); // CHECK-NEXT: } };