From 015734fa16ca8bc5492d415418325ef09dc17f71 Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Fri, 12 Jul 2019 12:45:41 +0200 Subject: [PATCH] no index synchronization in (const)operation class; directly use pos arg (makes some things thread save) --- src/include/multi_array_operation.cc.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/include/multi_array_operation.cc.h b/src/include/multi_array_operation.cc.h index fc61082..15533a3 100644 --- a/src/include/multi_array_operation.cc.h +++ b/src/include/multi_array_operation.cc.h @@ -244,16 +244,18 @@ namespace MultiArrayTools template inline ConstOperationRoot& ConstOperationRoot::set(ET pos) { - mIndex = pos.val(); - mDataPtr = mOrigDataPtr + mIndex.pos(); + //mIndex = pos.val(); + //mDataPtr = mOrigDataPtr + mIndex.pos(); + mDataPtr = mOrigDataPtr + pos.val(); return *this; } template const T* ConstOperationRoot::data() const { - auto i = mIndex; - return mOrigDataPtr + i().pos(); + //auto i = mIndex; + //return mOrigDataPtr/* + i().pos()*/; + return mDataPtr; } template @@ -457,8 +459,9 @@ namespace MultiArrayTools template inline OperationRoot& OperationRoot::set(ET pos) { - mIndex = pos.val(); - mDataPtr = mOrigDataPtr + mIndex.pos(); + //mIndex = pos.val(); + //mDataPtr = mOrigDataPtr + mIndex.pos(); + mDataPtr = mOrigDataPtr + pos.val(); return *this; } @@ -478,8 +481,9 @@ namespace MultiArrayTools template T* OperationRoot::data() const { - auto i = mIndex; - return mOrigDataPtr + i().pos(); + //auto i = mIndex; + //return mOrigDataPtr/* + i().pos()*/; + return mDataPtr; } template