py projection without sym
This commit is contained in:
parent
67a95c7394
commit
0a5cdd2339
3 changed files with 50 additions and 0 deletions
|
@ -144,6 +144,12 @@ namespace MultiArrayTools
|
|||
|
||||
// ma_functional.h
|
||||
class vec3d2Function;
|
||||
|
||||
// ma_functional.h
|
||||
class pyProjFunction;
|
||||
|
||||
// ma_functional.h
|
||||
class pyProjNoSymFunction;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -71,4 +71,26 @@ namespace MultiArrayTools
|
|||
zz * i.template getIndex<0>().getMetaPos()[2] ) );
|
||||
return out;
|
||||
}
|
||||
|
||||
pyProjNoSymFunction::pyProjNoSymFunction(const OutRange& outRange) : mOutRange(new OutRange( outRange )),
|
||||
out(mOutRange->begin()) {}
|
||||
|
||||
pyProjNoSymFunction::OutIndex pyProjNoSymFunction::operator()(const InIndex& i) const
|
||||
{
|
||||
DistIndex& di = out.template getIndex<0>();
|
||||
ScalProdIndex& si = out.template getIndex<1>();
|
||||
const int xx = i.template getIndex<1>().getMetaPos();
|
||||
const int yy = i.template getIndex<2>().getMetaPos();
|
||||
const int zz = i.template getIndex<3>().getMetaPos();
|
||||
if(xx == 0 or yy == 0 or zz == 0){ // anistotropy in C2
|
||||
di.atMeta(0);
|
||||
si.atMeta(0);
|
||||
}
|
||||
|
||||
di.atMeta( xx * xx + yy * yy + zz * zz );
|
||||
si.atMeta( xx * i.template getIndex<0>().getMetaPos()[0] +
|
||||
yy * i.template getIndex<0>().getMetaPos()[1] +
|
||||
zz * i.template getIndex<0>().getMetaPos()[2] );
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,6 +85,28 @@ namespace MultiArrayTools
|
|||
mutable OutIndex out;
|
||||
};
|
||||
|
||||
class pyProjNoSymFunction
|
||||
{
|
||||
public:
|
||||
typedef SingleIndex<int,RangeType::SPACE> CoordIndex;
|
||||
typedef SingleIndex<std::array<int,3>,RangeType::MOMENTUM> MomIndex;
|
||||
typedef MultiIndex<MomIndex,CoordIndex,CoordIndex,CoordIndex> InIndex;
|
||||
typedef SingleIndex<size_t,RangeType::DISTANCE> DistIndex;
|
||||
typedef SingleIndex<int,RangeType::SPACE> ScalProdIndex;
|
||||
typedef MultiIndex<DistIndex,ScalProdIndex> OutIndex;
|
||||
typedef MultiRange<SingleRange<size_t,RangeType::DISTANCE>,
|
||||
SingleRange<int,RangeType::SPACE> > OutRange;
|
||||
|
||||
DEFAULT_MEMBERS(pyProjNoSymFunction);
|
||||
|
||||
pyProjNoSymFunction(const OutRange& outRange);
|
||||
OutIndex operator()(const InIndex& i) const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<OutRange> mOutRange;
|
||||
mutable OutIndex out;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#include "ma_functional.cc"
|
||||
|
|
Loading…
Reference in a new issue