From c5fb2fa0be2e43684aad607ceda72b9711c6f3ce Mon Sep 17 00:00:00 2001 From: guido Date: Mon, 30 Oct 2000 15:12:47 +0000 Subject: [PATCH] operator - for Point improved git-svn-id: https://svn.dealii.org/trunk@3470 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/point.h | 5 +++- deal.II/base/include/base/tensor_base.h | 33 ++++++++++++++++--------- tests/lac/Makefile.in | 5 +++- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/deal.II/base/include/base/point.h b/deal.II/base/include/base/point.h index 0a24d1465f..4015eb3ede 100644 --- a/deal.II/base/include/base/point.h +++ b/deal.II/base/include/base/point.h @@ -310,7 +310,10 @@ template inline Point Point::operator - () const { - return (Point(*this) -(*(Tensor<1,dim>*)this)); + Point result; + for (unsigned int i=0; i template class Vector; - +template class Point; // general template; specialized for rank==1; the general template is in // tensor.h @@ -40,7 +40,8 @@ template class Tensor; * which acts as a tensor of rank one but has more functionality. */ template -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 &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 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; }; /** diff --git a/tests/lac/Makefile.in b/tests/lac/Makefile.in index ceff9f27f6..b3e80ea0f4 100644 --- a/tests/lac/Makefile.in +++ b/tests/lac/Makefile.in @@ -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) -- 2.39.5