[cig-commits] commit: Add a unary minus to hier::Index.
Mercurial
hg at geodynamics.org
Fri Feb 25 14:10:12 PST 2011
changeset: 5:c23af87eaeb6
user: Walter Landry <wlandry at caltech.edu>
date: Thu Feb 10 11:12:06 2011 -0800
files: source/SAMRAI/hier/Index.I source/SAMRAI/hier/Index.h
description:
Add a unary minus to hier::Index.
diff -r 49006e096d2a -r c23af87eaeb6 source/SAMRAI/hier/Index.I
--- a/source/SAMRAI/hier/Index.I Mon Jan 03 15:09:04 2011 -0800
+++ b/source/SAMRAI/hier/Index.I Thu Feb 10 11:12:06 2011 -0800
@@ -310,6 +310,14 @@ Index Index::operator / (
}
SAMRAI_INLINE_KEYWORD
+Index Index::operator - () const
+{
+ TBOX_DIM_ASSERT_CHECK_DIM(getDim());
+
+ return IntVector::operator - ();;
+}
+
+SAMRAI_INLINE_KEYWORD
int Index::coarsen(
const int index,
const int ratio)
diff -r 49006e096d2a -r c23af87eaeb6 source/SAMRAI/hier/Index.h
--- a/source/SAMRAI/hier/Index.h Mon Jan 03 15:09:04 2011 -0800
+++ b/source/SAMRAI/hier/Index.h Thu Feb 10 11:12:06 2011 -0800
@@ -222,6 +222,12 @@ public:
operator / (
const int rhs) const;
+ /**
+ * Unary minus to negate an integer vector.
+ */
+ Index
+ operator - () const;
+
/*!
* @brief Coarsen the Index by a given ratio.
*
More information about the CIG-COMMITS
mailing list