freepooma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Guard PInsist with POOMA_BOUNDS_CHECK


From: Richard Guenther
Subject: [PATCH] Guard PInsist with POOMA_BOUNDS_CHECK
Date: Thu, 6 Nov 2003 22:56:20 +0100 (CET)

Hi!

The following patch removes PInsist calls from taking centering views of
Fields.  This allows for better optimized code here.

Ok?

Richard.

===== FieldCentering.h 1.6 vs edited =====
--- 1.6/r2/src/Field/FieldCentering.h   Mon Oct 27 11:25:15 2003
+++ edited/FieldCentering.h     Thu Nov  6 22:54:48 2003
@@ -244,8 +244,10 @@
   /// Return a centering with one specified value.
   const Centering<Dim> operator[](int iSubField) const
   {
+#if POOMA_BOUNDS_CHECK
     PInsist(iSubField >= 0 && iSubField < size(),
            "Illegal attempt to extract a non-existent centering.");
+#endif
     return Centering<Dim>(centering_type_m, discontinuous_m,
                          Orientations(1, orientations_m[iSubField]),
                          Positions(1, positions_m[iSubField]));
@@ -303,8 +305,10 @@

   inline int size() const
   {
+#if POOMA_BOUNDS_CHECK
     PInsist(orientations_m.size() == positions_m.size(),
            "In a centering, the number of orientations must match the number 
of positions.");
+#endif
     return orientations_m.size();
   }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]