]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
operator - for Point improved
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 30 Oct 2000 15:12:47 +0000 (15:12 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 30 Oct 2000 15:12:47 +0000 (15:12 +0000)
git-svn-id: https://svn.dealii.org/trunk@3470 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/point.h
deal.II/base/include/base/tensor_base.h
tests/lac/Makefile.in

index 0a24d1465fe6431036307b8641dc7f9d108742f5..4015eb3eded6b2b334926f1e3f07ca5d971622c9 100644 (file)
@@ -310,7 +310,10 @@ template <int dim>
 inline
 Point<dim> Point<dim>::operator - () const 
 {
-  return (Point<dim>(*this) -(*(Tensor<1,dim>*)this));
+  Point<dim> result;
+  for (unsigned int i=0; i<dim; ++i)
+      result.values[i] = -values[i];
+  return result;
 };
 
 
index ef7900b752a630edd2994d07cfff74cf6a100293..123f16d6a295b8222050c8ed2c9860e0168782d5 100644 (file)
@@ -24,7 +24,7 @@
 #include <vector>
 
 template <typename number> class Vector;
-
+template <int dim> class Point;
 
 // general template; specialized for rank==1; the general template is in
 // tensor.h
@@ -40,7 +40,8 @@ template <int rank, int dim> class Tensor;
  * which acts as a tensor of rank one but has more functionality.
  */
 template <int dim>
-class Tensor<1,dim> {
+class Tensor<1,dim>
+{
       public:
                                     /**
                                      * Provide a way to get the
@@ -213,16 +214,6 @@ class Tensor<1,dim> {
     void unroll (Vector<double> &result) const;
 
   protected:
-                                    /**
-                                     * Store the values in a simple array.
-                                     * For @p{dim==0} store one element, because
-                                     * otherways the compiler would choke.
-                                     * We catch this case in the constructor
-                                     * to disallow the creation of such
-                                     * an object.
-                                     */
-    double values[(dim!=0) ? (dim) : 1];
-
                                     /**
                                      * Help function for unroll.
                                      */
@@ -240,6 +231,24 @@ class Tensor<1,dim> {
                                     // the function unroll_loops a friend,
                                     // but that seems to be impossible as well.
     template<int otherrank, int otherdim>  friend class Tensor;
+
+  private:
+                                    /**
+                                     * Store the values in a simple array.
+                                     * For @p{dim==0} store one element, because
+                                     * otherways the compiler would choke.
+                                     * We catch this case in the constructor
+                                     * to disallow the creation of such
+                                     * an object.
+                                     */
+    double values[(dim!=0) ? (dim) : 1];
+
+                                      /**
+                                       * Point is allowed access to
+                                       * the coordinates. This is
+                                       * supposed to improve speed.
+                                       */
+    friend class Point<dim>;
 };
 
                                 /**
index ceff9f27f6817a196fab682597460501af656295..b3e80ea0f4c0d1b10f3e9234893f0fcf728d95e9 100644 (file)
@@ -60,7 +60,10 @@ endif
        @echo =====optimized===== $<
        @$(CXX) $(flags) -c $< -o $@
 
-all: full_matrix.check solver.check mgbase.check mg.check
+
+# mgbase.check mg.check are removed until the sutructure of the
+# multigrid classes will be fixed.
+all: full_matrix.check solver.check
 exe: $(all:.check=.testcase) benchmark
 run: $(all:.check=.output)
 

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.