#ifndef TENSORBASE_H #define TENSORBASE_H #include "Fastor/config/config.h" #include "Fastor/meta/tensor_meta.h" namespace Fastor { template class Tensor; template class TensorMap; template class AbstractTensor { public: constexpr FASTOR_INLINE AbstractTensor() = default; constexpr FASTOR_INLINE const Derived& self() const {return *static_cast(this);} FASTOR_INLINE Derived& self() {return *static_cast(this);} static constexpr FASTOR_INDEX Dimension = Rank; #ifndef FASTOR_DYNAMIC_MODE static constexpr FASTOR_INDEX size() {return Derived::Size;} #else FASTOR_INDEX size() const {return (*static_cast(this)).size();} #endif }; } #endif // TENSORBASE_H