From: David Wells Date: Sun, 29 May 2016 21:26:36 +0000 (-0400) Subject: Fix SymmetricTensor::operator[]. X-Git-Tag: v8.5.0-rc1~998^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04f9d68d314482869ed0d9e71b963dfe1c27ebd9;p=dealii.git Fix SymmetricTensor::operator[]. Like elsewhere this can be defined in terms of operator(). --- 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); }