meta op root in func ma op

This commit is contained in:
Christian Zimmermann 2019-03-05 19:40:26 +01:00
parent 636e06bd5b
commit 948d9f58fd
3 changed files with 12 additions and 5 deletions

View file

@ -15,6 +15,7 @@ namespace MultiArrayTools
static auto mk(const std::shared_ptr<Index>& i)
-> MultiArray<typename Index::MetaType, typename Index::RangeType>
{
assert(0); // deprecated
vector<typename Index::MetaType> vv(i->range()->size());
for(Index j = (*i); j.pos() != j.max(); ++j){
vv[j.pos()] = j.meta();
@ -55,6 +56,16 @@ namespace MultiArrayTools
}
};
template <>
struct ToOpObject<false>
{
template <class Index>
static auto mk(const std::shared_ptr<Index>& ind)
-> MetaOperationRoot<typename Index::RangeType>
{
return MetaOperationRoot<typename Index::RangeType>( ind );
}
};
template <class Index>
auto mkOpObject(const std::shared_ptr<Index>& i)

View file

@ -345,7 +345,7 @@ namespace MultiArrayTools
template <class Range>
MetaOperationRoot<Range>::
MetaOperationRoot(const std::shared_ptr<IndexType>& ind) :
mWorkIndex(*ind), mIndex( ind ) { }
mWorkIndex(*ind), mIndex( ind ) {}
template <class Range>

View file

@ -87,10 +87,6 @@ namespace MultiArrayTools
virtual DataHeader dataHeader() const = 0;
virtual std::shared_ptr<RangeBase> sub(size_t num) const { return std::shared_ptr<RangeBase>(); }
//virtual bool regular() const = 0; // integer distance (e.g. 2,3,4,...)
//virtual bool linear() const = 0; // 1dim valuable (e.g. 2.45, 3.12, 3.56,...)
//virtual bool multi() const = 0; // mdim
//virtual bool maplike() const = 0; // meta type is ~ MultiArray<T,...>
friend RangeFactoryBase;