From 04f9d68d314482869ed0d9e71b963dfe1c27ebd9 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sun, 29 May 2016 17:26:36 -0400 Subject: [PATCH] Fix SymmetricTensor::operator[]. Like elsewhere this can be defined in terms of operator(). --- include/deal.II/base/symmetric_tensor.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/include/deal.II/base/symmetric_tensor.h b/include/deal.II/base/symmetric_tensor.h index 671a1c3301..81ce02ab2e 100644 --- a/include/deal.II/base/symmetric_tensor.h +++ b/include/deal.II/base/symmetric_tensor.h @@ -690,13 +690,17 @@ public: operator [] (const unsigned int row); /** - * Access to an element where you specify the entire set of indices. + * Return an element by value. + * + * Exactly the same as operator(). */ Number operator [] (const TableIndices &indices) const; /** - * Access to an element where you specify the entire set of indices. + * Return a read-write reference to the indicated element. + * + * Exactly the same as operator(). */ Number & operator [] (const TableIndices &indices); @@ -1651,7 +1655,7 @@ inline Number SymmetricTensor::operator [] (const TableIndices &indices) const { - return data[component_to_unrolled_index(indices)]; + return operator()(indices); } @@ -1661,7 +1665,7 @@ inline Number & SymmetricTensor::operator [] (const TableIndices &indices) { - return data[component_to_unrolled_index(indices)]; + return operator()(indices); } -- 2.39.5