WIP: rank op (concept)
This commit is contained in:
parent
6a433b237e
commit
c972a9db52
2 changed files with 9 additions and 10 deletions
|
@ -14,24 +14,20 @@ namespace CNORXZ
|
|||
template <class PosT>
|
||||
constexpr decltype(auto) CROpRoot<T,IndexT>::operator()(const PosT& pos) const
|
||||
{
|
||||
const SizeT L = mIndex->lmax().val();
|
||||
const SizeT m = mIndex->myrank();
|
||||
const SizeT dst = ( m + pos.val() ) % L;
|
||||
const SizeT src = ( m - pos.val() + L ) % L;
|
||||
|
||||
return (mData+mPos[pos.val()])[pos.next().val()];
|
||||
}
|
||||
|
||||
template <typename T, class IndexT>
|
||||
constexpr decltype(auto) CROpRoot<T,IndexT>::operator()() const
|
||||
{
|
||||
|
||||
return (mData+mPos[0])[0];
|
||||
}
|
||||
|
||||
template <typename T, class IndexT>
|
||||
template <SizeT I>
|
||||
constexpr decltype(auto) CROpRoot<T,IndexT>::rootSteps(const IndexId<I>& id) const
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*===============+
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace CNORXZ
|
|||
class CROpRoot : public COpInterface<CROpRoot<T,IndexT>>
|
||||
{
|
||||
public:
|
||||
typedef COpInterface<CROpRoot<T,IndexT>> OI;
|
||||
typedef COpInterface<CROpRoot<T,IndexT >> OI;
|
||||
|
||||
constexpr CROpRoot() = default;
|
||||
|
||||
|
@ -33,8 +33,11 @@ namespace CNORXZ
|
|||
constexpr decltype(auto) rootSteps(const IndexId<I>& id) const;
|
||||
|
||||
private:
|
||||
const T* mData;
|
||||
COpRoot
|
||||
//
|
||||
const T* mData; // must include all needed data, also that of other ranks (to be transmitted before!)
|
||||
// maps the global (!) position to mData!!
|
||||
const SizeT* mPos; // position map (needed to indicate position to data transmitted from other ranks)
|
||||
Sptr<IndexT> mIndex;
|
||||
};
|
||||
|
||||
template <typename T, class IndexT>
|
||||
|
|
Loading…
Reference in a new issue