fix compile errors -> seg fault :)
This commit is contained in:
parent
00c6cf49d5
commit
68612646fb
3 changed files with 12 additions and 12 deletions
|
@ -57,8 +57,8 @@ namespace MultiArrayTools
|
||||||
template <class MultiIndex>
|
template <class MultiIndex>
|
||||||
static size_t evaluate(const MultiIndex& index)
|
static size_t evaluate(const MultiIndex& index)
|
||||||
{
|
{
|
||||||
//const auto& subIndex = index.getIndex<N>();
|
const IndefinitIndexBase& subIndex = IndexGetter<N>::getIndex(index, N);
|
||||||
return Evaluation<N-1>::evaluate(index) * index.getIndex<N>().size() + index.getIndex<N>().pos();
|
return Evaluation<N-1>::evaluate(index) * subIndex.max() + subIndex.pos();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -68,8 +68,8 @@ namespace MultiArrayTools
|
||||||
template <class MultiIndex>
|
template <class MultiIndex>
|
||||||
static size_t evaluate(const MultiIndex& index)
|
static size_t evaluate(const MultiIndex& index)
|
||||||
{
|
{
|
||||||
//const auto& subIndex = index.getIndex<0>();
|
const IndefinitIndexBase& subIndex = IndexGetter<0>::getIndex(index, 0);
|
||||||
return index.getIndex<0>().pos();
|
return subIndex.pos();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ namespace MultiArrayTools
|
||||||
IndefinitIndexBase& MultiIndex<Indices...>::operator=(size_t pos)
|
IndefinitIndexBase& MultiIndex<Indices...>::operator=(size_t pos)
|
||||||
{
|
{
|
||||||
IIB::setPos( pos );
|
IIB::setPos( pos );
|
||||||
setIndexPack(mIPack, pos); // -> implement !!!
|
//setIndexPack(mIPack, pos); // -> implement !!!
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,11 +207,11 @@ namespace MultiArrayTools
|
||||||
template <class... Indices>
|
template <class... Indices>
|
||||||
bool MultiIndex<Indices...>::link(IndefinitIndexBase* toLink)
|
bool MultiIndex<Indices...>::link(IndefinitIndexBase* toLink)
|
||||||
{
|
{
|
||||||
if(toLink->rangeType() != IIB::rangeType() and toLink->name() == IIB::name()){
|
if(toLink->rangeType() != rangeType() and toLink->name() == IIB::name()){
|
||||||
// throw !!
|
// throw !!
|
||||||
}
|
}
|
||||||
|
|
||||||
if(toLink->rangeType() == IIB::rangeType() and toLink->name() == IIB::name()){
|
if(toLink->rangeType() == rangeType() and toLink->name() == IIB::name()){
|
||||||
if(IIB::mLinked == toLink){
|
if(IIB::mLinked == toLink){
|
||||||
return true; // dont link twice the same
|
return true; // dont link twice the same
|
||||||
}
|
}
|
||||||
|
@ -230,7 +230,7 @@ namespace MultiArrayTools
|
||||||
|
|
||||||
template <class... Indices>
|
template <class... Indices>
|
||||||
template <size_t N>
|
template <size_t N>
|
||||||
auto MultiIndex<Indices...>::getIndex() -> decltype(std::get<N>(mIPack))&
|
auto MultiIndex<Indices...>::getIndex() -> decltype(std::get<N>(mIPack))
|
||||||
{
|
{
|
||||||
return std::get<N>(mIPack);
|
return std::get<N>(mIPack);
|
||||||
}
|
}
|
||||||
|
@ -238,7 +238,7 @@ namespace MultiArrayTools
|
||||||
template <class... Indices>
|
template <class... Indices>
|
||||||
template <size_t N>
|
template <size_t N>
|
||||||
auto MultiIndex<Indices...>::getIndex() const ->
|
auto MultiIndex<Indices...>::getIndex() const ->
|
||||||
const decltype(std::get<N>(mIPack))&
|
const decltype(std::get<N>(mIPack))
|
||||||
{
|
{
|
||||||
return std::get<N>(mIPack);
|
return std::get<N>(mIPack);
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,10 +44,10 @@ namespace MultiArrayTools
|
||||||
virtual MultiRangeType rangeType() const override;
|
virtual MultiRangeType rangeType() const override;
|
||||||
|
|
||||||
template <size_t N>
|
template <size_t N>
|
||||||
auto getIndex() -> decltype(std::get<N>(mIPack))&;
|
auto getIndex() -> decltype(std::get<N>(mIPack));
|
||||||
|
|
||||||
template <size_t N>
|
template <size_t N>
|
||||||
auto getIndex() const -> const decltype(std::get<N>(mIPack))&;
|
auto getIndex() const -> const decltype(std::get<N>(mIPack));
|
||||||
|
|
||||||
IndefinitIndexBase& get(size_t n);
|
IndefinitIndexBase& get(size_t n);
|
||||||
const IndefinitIndexBase& get(size_t n) const;
|
const IndefinitIndexBase& get(size_t n) const;
|
||||||
|
|
Loading…
Reference in a new issue