From 7e5a0cd75301b5113772c55b6b3a12445e012dc4 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Mon, 14 Sep 2015 23:22:32 -0500 Subject: [PATCH] Update tests to use new cross_product signature --- tests/base/tensor.cc | 7 +++---- tests/base/tensor_complex.cc | 7 +++---- tests/base/tensor_float.cc | 7 +++---- tests/codim_one/bem_integration.cc | 16 ++++++---------- 4 files changed, 15 insertions(+), 22 deletions(-) diff --git a/tests/base/tensor.cc b/tests/base/tensor.cc index e31151448b..c230cf1089 100644 --- a/tests/base/tensor.cc +++ b/tests/base/tensor.cc @@ -75,18 +75,17 @@ int main () e1[0] = 1.; e2[1] = 1.; e3[2] = 1.; - Tensor<1,3> result; - cross_product(result,e1,e2); + Tensor<1,3> result = cross_product(e1, e2); deallog << '\t' << result[0] << '\t' << result[1] << '\t' << result[2] << std::endl; - cross_product(result,e2,e3); + result = cross_product(e2, e3); deallog << '\t' << result[0] << '\t' << result[1] << '\t' << result[2] << std::endl; - cross_product(result,e3,e1); + result = cross_product(e3, e1); deallog << '\t' << result[0] << '\t' << result[1] << '\t' << result[2] << std::endl; diff --git a/tests/base/tensor_complex.cc b/tests/base/tensor_complex.cc index 068fb7e6ee..4c28b99cd0 100644 --- a/tests/base/tensor_complex.cc +++ b/tests/base/tensor_complex.cc @@ -96,18 +96,17 @@ int main () e1[0] = 1.; e2[1] = 1.; e3[2] = 1.; - Tensor<1,3,std::complex > result; - cross_product(result,e1,e2); + Tensor<1,3,std::complex > result = cross_product(e1, e2); deallog << '\t' << result[0] << '\t' << result[1] << '\t' << result[2] << std::endl; - cross_product(result,e2,e3); + result = cross_product(e2, e3); deallog << '\t' << result[0] << '\t' << result[1] << '\t' << result[2] << std::endl; - cross_product(result,e3,e1); + result = cross_product(e3, e1); deallog << '\t' << result[0] << '\t' << result[1] << '\t' << result[2] << std::endl; diff --git a/tests/base/tensor_float.cc b/tests/base/tensor_float.cc index 9d3121286e..4b617969f1 100644 --- a/tests/base/tensor_float.cc +++ b/tests/base/tensor_float.cc @@ -80,18 +80,17 @@ int main () e1[0] = 1.; e2[1] = 1.; e3[2] = 1.; - Tensor<1,3,float> result; - cross_product(result,e1,e2); + Tensor<1,3,float> result = cross_product(e1, e2); deallog << '\t' << static_cast(result[0]) << '\t' << static_cast(result[1]) << '\t' << static_cast(result[2]) << std::endl; - cross_product(result,e2,e3); + result = cross_product(e2, e3); deallog << '\t' << static_cast(result[0]) << '\t' << static_cast(result[1]) << '\t' << static_cast(result[2]) << std::endl; - cross_product(result,e3,e1); + result = cross_product(e3, e1); deallog << '\t' << static_cast(result[0]) << '\t' << static_cast(result[1]) << '\t' << static_cast(result[2]) << std::endl; diff --git a/tests/codim_one/bem_integration.cc b/tests/codim_one/bem_integration.cc index cb3e7fd05a..65491b03c5 100644 --- a/tests/codim_one/bem_integration.cc +++ b/tests/codim_one/bem_integration.cc @@ -154,11 +154,9 @@ LaplaceKernelIntegration::term_S (const Tensor<1,3> &r, const Tensor<1,3> &n, const double &rn_c) { - Point<3> ra1, ra2, a12; - - cross_product(ra1,r,a1); - cross_product(ra2,r,a2); - cross_product(a12,a1,a2); + Tensor<1, 3> ra1 = cross_product(r, a1); + Tensor<1, 3> ra2 = cross_product(r, a2); + Tensor<1, 3> a12 = cross_product(a1, a2); double integral = -1./2./numbers::PI @@ -178,11 +176,9 @@ LaplaceKernelIntegration::term_D (const Tensor<1,3> &r, const Tensor<1,3> &a1, const Tensor<1,3> &a2) { - Point<3> ra1, ra2, a12; - - cross_product(ra1,r,a1); - cross_product(ra2,r,a2); - cross_product(a12,a1,a2); + Tensor<1, 3> ra1 = cross_product(r, a1); + Tensor<1, 3> ra2 = cross_product(r, a2); + Tensor<1, 3> a12 = cross_product(a1, a2); double integral = 1./2./numbers::PI *atan2( ra1*ra2, (r.norm()* (r*a12))); -- 2.39.5