cnorxz/src/include/xpr/xpr_base.cc.h

74 lines
1.4 KiB
C
Raw Normal View History

2022-10-13 19:12:23 +02:00
#ifndef __cxz_xpr_base_cc_h__
#define __cxz_xpr_base_cc_h__
#include "xpr_base.h"
namespace CNORXZ
{
/************
* VXpr *
************/
template <typename T, class Xpr>
VXpr<T,Xpr>::VXpr(const XprInterface<Xpr>& a) :
2022-10-13 19:12:23 +02:00
Xpr(a.THIS())
{}
template <typename T, class Xpr>
Uptr<VXprBase<T>> VXpr<T,Xpr>::copy() const
2022-10-13 19:12:23 +02:00
{
return std::make_unique<VXpr<T,Xpr>>(*this);
2022-10-13 19:12:23 +02:00
}
template <typename T, class Xpr>
T VXpr<T,Xpr>::vexec(const DPos& last) const
2022-10-13 19:12:23 +02:00
{
2022-10-21 00:21:47 +02:00
return (*this)(last);
2022-10-13 19:12:23 +02:00
}
template <typename T, class Xpr>
T VXpr<T,Xpr>::vexec() const
2022-10-13 19:12:23 +02:00
{
2022-10-16 00:55:14 +02:00
return (*this)();
2022-10-13 19:12:23 +02:00
}
template <typename T, class Xpr>
DPos VXpr<T,Xpr>::vrootSteps(const IndexId<0>& id) const
2022-10-13 19:12:23 +02:00
{
2022-10-16 23:05:48 +02:00
return DPos(this->rootSteps(id));
2022-10-13 19:12:23 +02:00
}
/************
* DXpr *
************/
template <typename T>
2022-10-13 19:12:23 +02:00
template <class Xpr>
DXpr<T>::DXpr(const Xpr& a) :
ObjHandle<VXprBase<T>>(std::make_unique<VXpr<T,Xpr>>(a))
2022-10-13 19:12:23 +02:00
{}
template <typename T>
inline T DXpr<T>::operator()(const DPos& last) const
2022-10-13 19:12:23 +02:00
{
return VB::mC->vexec(last);
2022-10-13 19:12:23 +02:00
}
template <typename T>
inline T DXpr<T>::operator()() const
2022-10-13 19:12:23 +02:00
{
return VB::mC->vexec();
2022-10-13 19:12:23 +02:00
}
template <typename T>
2022-10-16 18:37:14 +02:00
template <SizeT I>
inline DPos DXpr<T>::rootSteps(const IndexId<I>& id) const
2022-10-13 19:12:23 +02:00
{
return VB::mC->vrootSteps(IndexId<0>(id.id()));
2022-10-13 19:12:23 +02:00
}
}
#endif