]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add note.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 14 Sep 2001 09:12:59 +0000 (09:12 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 14 Sep 2001 09:12:59 +0000 (09:12 +0000)
git-svn-id: https://svn.dealii.org/trunk@5000 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/fe/mapping_q.cc

index d55e0e821f4820d521c6728b2c70c3dff42bf51b..8799bb3bd902c3be0c3d801dd1d491f1abb62583 100644 (file)
@@ -83,9 +83,18 @@ MappingQ<1>::~MappingQ ()
 template<typename number>
 static number power(const number x, const unsigned int y)
 {
+                                  // since the power to which x is
+                                  // raised is usually the space
+                                  // dimension, and since this is
+                                  // rarely larger than three, the
+                                  // following code is optimal and
+                                  // cannot be further optimized by
+                                  // grouping of operands to reduce
+                                  // the number of multiplications
+                                  // from O(x) to O(log x)
   number value=1;
   for (unsigned int i=0; i<y; ++i)
-    value*=x;
+    value *= x;
   return value;
 }
 

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.