]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add a function overload that is now necessary to disambiguate calling
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 28 Jun 2009 18:10:42 +0000 (18:10 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 28 Jun 2009 18:10:42 +0000 (18:10 +0000)
  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

index 63703cc944adf57e3a299b1ccfc36dcefaffe219..05ee127247b8b760458fb09dd202264a19ee27fa 100644 (file)
@@ -1330,15 +1330,6 @@ 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. we
-                                  // need therefore not try to access
-                                  // the number itself, which is
-                                  // difficult since it needs <tt>rank</tt>
-                                  // 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 <tt>dim==2</tt>.
  *

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.