From: wolf Date: Tue, 2 Feb 1999 13:48:21 +0000 (+0000) Subject: Add computation of determinants of tensors of dimension one. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99cc1864facd629a874645f225e12a3be9c8c95b;p=dealii-svn.git Add computation of determinants of tensors of dimension one. git-svn-id: https://svn.dealii.org/trunk@748 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/tensor.h b/deal.II/base/include/base/tensor.h index 13852631c8..4c3ad285f1 100644 --- a/deal.II/base/include/base/tensor.h +++ b/deal.II/base/include/base/tensor.h @@ -487,6 +487,24 @@ void contract (Tensor<4,dim> &dest, +template +inline +double determinant (const Tensor &t) { + // determinant of tensors of + // dimension one and arbitrary rank can + // be computed by recursion + return determinant(t[0]); +}; + + +inline +double determinant (const Tensor<1,1> &t) { + return t[0]; +}; + + + + inline double determinant (const Tensor<2,2> &t) { return ((t[0][0] * t[1][1]) -