aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2015-12-10 22:45:10 -0800
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2015-12-10 22:45:10 -0800
commit8e00ea9a92cfbe849056bc74a1aab34ff8e8a811 (patch)
treeeec0757146aa00e74d675364bf5fd00fe74eb8f3 /unsupported/Eigen/CXX11/src/Tensor/TensorMap.h
parent9db8316c936b2d83e2b6484b681b275f9cccae95 (diff)
Fixed the coefficient accessors use for the 2d and 3d case when compiling without cxx11 support.
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorMap.h')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorMap.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h
index 4347bc2ff..5c759af09 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h
@@ -49,7 +49,7 @@ template<typename PlainObjectType, int Options_> class TensorMap : public Tensor
IsAligned = ((int(Options_)&Aligned)==Aligned),
PacketAccess = (internal::packet_traits<Scalar>::size > 1),
Layout = PlainObjectType::Layout,
- CoordAccess = true,
+ CoordAccess = true
};
EIGEN_DEVICE_FUNC
@@ -158,7 +158,7 @@ template<typename PlainObjectType, int Options_> class TensorMap : public Tensor
EIGEN_STRONG_INLINE const Scalar& operator()(Index i0, Index i1) const
{
if (PlainObjectType::Options&RowMajor) {
- const Index index = i1 + i0 * m_dimensions[0];
+ const Index index = i1 + i0 * m_dimensions[1];
return m_data[index];
} else {
const Index index = i0 + i1 * m_dimensions[0];
@@ -169,7 +169,7 @@ template<typename PlainObjectType, int Options_> class TensorMap : public Tensor
EIGEN_STRONG_INLINE const Scalar& operator()(Index i0, Index i1, Index i2) const
{
if (PlainObjectType::Options&RowMajor) {
- const Index index = i2 + m_dimensions[1] * (i1 + m_dimensions[0] * i0);
+ const Index index = i2 + m_dimensions[2] * (i1 + m_dimensions[1] * i0);
return m_data[index];
} else {
const Index index = i0 + m_dimensions[0] * (i1 + m_dimensions[1] * i2);
@@ -245,7 +245,7 @@ template<typename PlainObjectType, int Options_> class TensorMap : public Tensor
EIGEN_STRONG_INLINE Scalar& operator()(Index i0, Index i1)
{
if (PlainObjectType::Options&RowMajor) {
- const Index index = i1 + i0 * m_dimensions[0];
+ const Index index = i1 + i0 * m_dimensions[1];
return m_data[index];
} else {
const Index index = i0 + i1 * m_dimensions[0];
@@ -256,7 +256,7 @@ template<typename PlainObjectType, int Options_> class TensorMap : public Tensor
EIGEN_STRONG_INLINE Scalar& operator()(Index i0, Index i1, Index i2)
{
if (PlainObjectType::Options&RowMajor) {
- const Index index = i2 + m_dimensions[1] * (i1 + m_dimensions[0] * i0);
+ const Index index = i2 + m_dimensions[2] * (i1 + m_dimensions[1] * i0);
return m_data[index];
} else {
const Index index = i0 + m_dimensions[0] * (i1 + m_dimensions[1] * i2);