comment out formatFrom/slice ...
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Christian Zimmermann 2023-09-09 11:29:22 +02:00
parent 944db31e02
commit 7e182ded83
15 changed files with 44 additions and 30 deletions

View file

@ -100,7 +100,7 @@ namespace CNORXZ
template <class Index> template <class Index>
COpRoot<T,Index> CArrayBase<T>::operator()(const Sptr<Index>& i) const COpRoot<T,Index> CArrayBase<T>::operator()(const Sptr<Index>& i) const
{ {
this->checkFormatCompatibility(toVec(i->deepFormat())); //this->checkFormatCompatibility(toVec(i->deepFormat()));
return coproot(*this, i); return coproot(*this, i);
} }
@ -109,7 +109,7 @@ namespace CNORXZ
inline decltype(auto) CArrayBase<T>::operator()(const SPack<Indices...>& pack) const inline decltype(auto) CArrayBase<T>::operator()(const SPack<Indices...>& pack) const
{ {
auto i = mindexPtr(pack); auto i = mindexPtr(pack);
this->checkFormatCompatibility(toVec(i->deepFormat())); //this->checkFormatCompatibility(toVec(i->deepFormat()));
return coproot(*this, i); return coproot(*this, i);
} }
@ -117,7 +117,7 @@ namespace CNORXZ
inline decltype(auto) CArrayBase<T>::operator()(const DPack& pack) const inline decltype(auto) CArrayBase<T>::operator()(const DPack& pack) const
{ {
auto i = yindexPtr(pack); auto i = yindexPtr(pack);
this->checkFormatCompatibility(toVec(i->deepFormat())); //this->checkFormatCompatibility(toVec(i->deepFormat()));
return coproot(*this, i); return coproot(*this, i);
} }
@ -223,7 +223,7 @@ namespace CNORXZ
template <class Index> template <class Index>
OpRoot<T,Index> ArrayBase<T>::operator()(const Sptr<Index>& i) OpRoot<T,Index> ArrayBase<T>::operator()(const Sptr<Index>& i)
{ {
this->checkFormatCompatibility(toVec(i->deepFormat())); //this->checkFormatCompatibility(toVec(i->deepFormat()));
return oproot(*this, i); return oproot(*this, i);
} }
@ -232,7 +232,7 @@ namespace CNORXZ
inline decltype(auto) ArrayBase<T>::operator()(const SPack<Indices...>& pack) inline decltype(auto) ArrayBase<T>::operator()(const SPack<Indices...>& pack)
{ {
auto i = mindexPtr(pack); auto i = mindexPtr(pack);
this->checkFormatCompatibility(toVec(i->deepFormat())); //this->checkFormatCompatibility(toVec(i->deepFormat()));
return oproot(*this, i); return oproot(*this, i);
} }
@ -240,7 +240,7 @@ namespace CNORXZ
inline decltype(auto) ArrayBase<T>::operator()(const DPack& pack) inline decltype(auto) ArrayBase<T>::operator()(const DPack& pack)
{ {
auto i = yindexPtr(pack); auto i = yindexPtr(pack);
this->checkFormatCompatibility(toVec(i->deepFormat())); //this->checkFormatCompatibility(toVec(i->deepFormat()));
return oproot(*this, i); return oproot(*this, i);
} }

View file

@ -17,7 +17,7 @@ namespace CNORXZ
return UPos(id == this->id() ? 1 : 0); return UPos(id == this->id() ? 1 : 0);
} }
} }
/*
template <class Index> template <class Index>
decltype(auto) CIndex::formatFrom(const Index& ind) const decltype(auto) CIndex::formatFrom(const Index& ind) const
{ {
@ -34,7 +34,7 @@ namespace CNORXZ
} }
return std::make_shared<CIndex>(*this); return std::make_shared<CIndex>(*this);
} }
*/
template <class Xpr, class F> template <class Xpr, class F>
decltype(auto) CIndex::ifor(const Xpr& xpr, F&& f) const decltype(auto) CIndex::ifor(const Xpr& xpr, F&& f) const
{ {

View file

@ -47,14 +47,14 @@ namespace CNORXZ
CIndex& at(const SizeT& metaPos); CIndex& at(const SizeT& metaPos);
COpRoot<SizeT,CIndex> xpr(const Sptr<CIndex>& _this) const; COpRoot<SizeT,CIndex> xpr(const Sptr<CIndex>& _this) const;
SizeT deepFormat() const { return 1; } SizeT deepFormat() const;
/*
template <class Index> template <class Index>
decltype(auto) formatFrom(const Index& ind) const; decltype(auto) formatFrom(const Index& ind) const;
template <class Index> template <class Index>
decltype(auto) slice(const Sptr<Index>& ind) const; decltype(auto) slice(const Sptr<Index>& ind) const;
*/
template <class Xpr, class F = NoF> template <class Xpr, class F = NoF>
decltype(auto) ifor(const Xpr& xpr, F&& f) const; decltype(auto) ifor(const Xpr& xpr, F&& f) const;

View file

@ -54,8 +54,7 @@ namespace CNORXZ
DType meta() const; DType meta() const;
DIndex& at(const DType& meta); DIndex& at(const DType& meta);
DXpr<SizeT> xpr(const Sptr<DIndex>& _this) const; DXpr<SizeT> xpr(const Sptr<DIndex>& _this) const;
Vector<SizeT> deepFormat() const;
Vector<SizeT> deepFormat() const { return mI->deepFormat(); }
DXpr<SizeT> ifor(const DXpr<SizeT>& xpr, std::function<SizeT(SizeT,SizeT)>&& f) const; DXpr<SizeT> ifor(const DXpr<SizeT>& xpr, std::function<SizeT(SizeT,SizeT)>&& f) const;

View file

@ -54,7 +54,7 @@ namespace CNORXZ
decltype(auto) meta() const { return THIS().meta(); } decltype(auto) meta() const { return THIS().meta(); }
I& at(const MetaType& meta) { return THIS().at(meta); } I& at(const MetaType& meta) { return THIS().at(meta); }
decltype(auto) xpr(const Sptr<I>& _this) const { return THIS().xpr(_this); } decltype(auto) xpr(const Sptr<I>& _this) const { return THIS().xpr(_this); }
/*
template <class Index> template <class Index>
decltype(auto) formatTo(const Sptr<Index>& ind) const { return ind->formatFrom(THIS()); } decltype(auto) formatTo(const Sptr<Index>& ind) const { return ind->formatFrom(THIS()); }
@ -62,7 +62,7 @@ namespace CNORXZ
decltype(auto) formatFrom(const Index& ind) const // yes this is const, decltype(auto) formatFrom(const Index& ind) const // yes this is const,
// changes only MIndex/YIndex format, in this case we can just copy the pointers to the sub-index instances // changes only MIndex/YIndex format, in this case we can just copy the pointers to the sub-index instances
{ return THIS().formatFrom(ind); } { return THIS().formatFrom(ind); }
*/
decltype(auto) deepFormat() const { return THIS().deepFormat(); } decltype(auto) deepFormat() const { return THIS().deepFormat(); }
//template <class Index> //template <class Index>

View file

@ -382,7 +382,7 @@ namespace CNORXZ
( [&](auto i) { return mIPack[i]->stepSize(id) * format()[i]; }, ( [&](auto i) { return mIPack[i]->stepSize(id) * format()[i]; },
[](const auto&... ss) { return ( ss + ... ); }); [](const auto&... ss) { return ( ss + ... ); });
} }
/*
template <class FormatT, class... Indices> template <class FormatT, class... Indices>
template <class Index> template <class Index>
decltype(auto) GMIndex<FormatT,Indices...>::formatFrom(const Index& ind) const decltype(auto) GMIndex<FormatT,Indices...>::formatFrom(const Index& ind) const
@ -392,7 +392,7 @@ namespace CNORXZ
<< " need index of at least the same dimension, got " << ind.dim()); << " need index of at least the same dimension, got " << ind.dim());
return *this; return *this;
} }
*/
template <class FormatT, class... Indices> template <class FormatT, class... Indices>
String GMIndex<FormatT,Indices...>::stringMeta() const String GMIndex<FormatT,Indices...>::stringMeta() const
{ {

View file

@ -63,8 +63,8 @@ namespace CNORXZ
template <SizeT I> template <SizeT I>
decltype(auto) stepSize(const IndexId<I>& id) const; decltype(auto) stepSize(const IndexId<I>& id) const;
template <class Index> //template <class Index>
decltype(auto) formatFrom(const Index& ind) const; //decltype(auto) formatFrom(const Index& ind) const;
String stringMeta() const; String stringMeta() const;
MetaType meta() const; MetaType meta() const;

View file

@ -146,7 +146,7 @@ namespace CNORXZ
{ {
return 1; return 1;
} }
/*
template <typename MetaT, SizeT S> template <typename MetaT, SizeT S>
template <class Index> template <class Index>
decltype(auto) SIndex<MetaT,S>::formatFrom(const Index& ind) const decltype(auto) SIndex<MetaT,S>::formatFrom(const Index& ind) const
@ -165,7 +165,7 @@ namespace CNORXZ
} }
return std::make_shared<SIndex<MetaType,S>>(*this); return std::make_shared<SIndex<MetaType,S>>(*this);
} }
*/
template <typename MetaT, SizeT S> template <typename MetaT, SizeT S>
template <class Xpr, class F> template <class Xpr, class F>
decltype(auto) SIndex<MetaT,S>::ifor(const Xpr& xpr, F&& f) const decltype(auto) SIndex<MetaT,S>::ifor(const Xpr& xpr, F&& f) const

View file

@ -49,13 +49,13 @@ namespace CNORXZ
decltype(auto) xpr(const Sptr<SIndex<MetaType,S>>& _this) const; decltype(auto) xpr(const Sptr<SIndex<MetaType,S>>& _this) const;
SizeT deepFormat() const; SizeT deepFormat() const;
/*
template <class Index> template <class Index>
decltype(auto) formatFrom(const Index& ind) const; decltype(auto) formatFrom(const Index& ind) const;
template <class Index> template <class Index>
decltype(auto) slice(const Sptr<Index>& ind) const; decltype(auto) slice(const Sptr<Index>& ind) const;
*/
template <class Xpr, class F> template <class Xpr, class F>
decltype(auto) ifor(const Xpr& xpr, F&& f) const; decltype(auto) ifor(const Xpr& xpr, F&& f) const;

View file

@ -155,7 +155,7 @@ namespace CNORXZ
return UPos(id == this->id() ? 1 : 0); return UPos(id == this->id() ? 1 : 0);
} }
} }
/*
template <typename MetaType> template <typename MetaType>
template <class Index> template <class Index>
decltype(auto) UIndex<MetaType>::formatFrom(const Index& ind) const decltype(auto) UIndex<MetaType>::formatFrom(const Index& ind) const
@ -174,7 +174,7 @@ namespace CNORXZ
} }
return std::make_shared<UIndex<MetaType>>(*this); return std::make_shared<UIndex<MetaType>>(*this);
} }
*/
template <typename MetaType> template <typename MetaType>
template <class Xpr, class F> template <class Xpr, class F>
decltype(auto) UIndex<MetaType>::ifor(const Xpr& xpr, F&& f) const decltype(auto) UIndex<MetaType>::ifor(const Xpr& xpr, F&& f) const

View file

@ -56,13 +56,13 @@ namespace CNORXZ
decltype(auto) xpr(const Sptr<UIndex<MetaType>>& _this) const; decltype(auto) xpr(const Sptr<UIndex<MetaType>>& _this) const;
SizeT deepFormat() const; SizeT deepFormat() const;
/*
template <class Index> template <class Index>
decltype(auto) formatFrom(const Index& ind) const; decltype(auto) formatFrom(const Index& ind) const;
template <class Index> template <class Index>
decltype(auto) slice(const Sptr<Index>& ind) const; decltype(auto) slice(const Sptr<Index>& ind) const;
*/
template <class Xpr, class F> template <class Xpr, class F>
decltype(auto) ifor(const Xpr& xpr, F&& f) const; decltype(auto) ifor(const Xpr& xpr, F&& f) const;

View file

@ -51,8 +51,8 @@ namespace CNORXZ
Sptr<YRange> range() const; Sptr<YRange> range() const;
UPos stepSize(const IndexId<0> id) const; UPos stepSize(const IndexId<0> id) const;
template <class Index> //template <class Index>
YIndex formatFrom(const Index& ind) const; //YIndex formatFrom(const Index& ind) const;
String stringMeta() const; String stringMeta() const;
Vector<DType> meta() const; Vector<DType> meta() const;
@ -65,7 +65,7 @@ namespace CNORXZ
YIndex& operator()(); YIndex& operator()();
const DPack& pack() const; const DPack& pack() const;
Vector<SizeT> deepFormat() const { CXZ_ERROR("implement!!!"); return Vector<SizeT> {1}; } Vector<SizeT> deepFormat() const;
const YFormat& format() const; const YFormat& format() const;
const YFormat& lexFormat() const; const YFormat& lexFormat() const;
YIndex& setFormat(const YFormat& bs); YIndex& setFormat(const YFormat& bs);

View file

@ -116,6 +116,10 @@ namespace CNORXZ
return coproot(m.data(), _this); return coproot(m.data(), _this);
} }
SizeT CIndex::deepFormat() const
{
return 1;
}
/********************** /**********************
* CRangeFactory * * CRangeFactory *

View file

@ -167,6 +167,11 @@ namespace CNORXZ
return mI->xpr(_this->xptr()); return mI->xpr(_this->xptr());
} }
Vector<SizeT> DIndex::deepFormat() const
{
return mI->deepFormat();
}
DXpr<SizeT> DIndex::ifor(const DXpr<SizeT>& xpr, std::function<SizeT(SizeT,SizeT)>&& f) const DXpr<SizeT> DIndex::ifor(const DXpr<SizeT>& xpr, std::function<SizeT(SizeT,SizeT)>&& f) const
{ {
return DXpr<SizeT>(mI->ifor(xpr, std::forward<std::function<SizeT(SizeT,SizeT)>>(f)) ); return DXpr<SizeT>(mI->ifor(xpr, std::forward<std::function<SizeT(SizeT,SizeT)>>(f)) );

View file

@ -368,6 +368,12 @@ namespace CNORXZ
return mIs; return mIs;
} }
Vector<SizeT> YIndex::deepFormat() const
{
CXZ_ERROR("implement!!!");
return Vector<SizeT> {1};
}
const YFormat& YIndex::format() const const YFormat& YIndex::format() const
{ {
return mFormat; return mFormat;