]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add computation of determinants of tensors of dimension one.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 2 Feb 1999 13:48:21 +0000 (13:48 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 2 Feb 1999 13:48:21 +0000 (13:48 +0000)
git-svn-id: https://svn.dealii.org/trunk@748 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/tensor.h

index 13852631c85e8b275f08a70fd7d6974eaeef2a5e..4c3ad285f1306eda0359e5b983793afb394573d4 100644 (file)
@@ -487,6 +487,24 @@ void contract (Tensor<4,dim>       &dest,
 
 
 
+template <int rank>
+inline
+double determinant (const Tensor<rank,1> &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]) -

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.