From ad4b5998eaebdcd676fe20bd6614a55f9dbbcc15 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 28 Jun 2009 18:10:42 +0000 Subject: [PATCH] Add a function overload that is now necessary to disambiguate calling determinant (Tensor<2,1>) git-svn-id: https://svn.dealii.org/trunk@18979 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/tensor.h | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/deal.II/base/include/base/tensor.h b/deal.II/base/include/base/tensor.h index 63703cc944..05ee127247 100644 --- a/deal.II/base/include/base/tensor.h +++ b/deal.II/base/include/base/tensor.h @@ -1330,15 +1330,6 @@ template inline double determinant (const Tensor &t) { - // determinant of tensors of - // dimension one and arbitrary rank - // can be computed by recursion. we - // need therefore not try to access - // the number itself, which is - // difficult since it needs rank - // indirections, which is not - // computable in the general - // template return determinant(t[0]); } @@ -1360,6 +1351,22 @@ double determinant (const Tensor<1,1> &t) +/** + * Compute the determinant of a tensor of rank two and dimension + * one. Since this is a number, the return value is, of course, the + * number itself. + * + * @relates Tensor + * @author Wolfgang Bangerth, 1998 + */ +inline +double determinant (const Tensor<2,1> &t) +{ + return t[0][0]; +} + + + /** * Compute the determinant of a tensor or rank 2, here for dim==2. * -- 2.39.5