CNORXZ
Container with Native Operation Routines and Expressions
Loading...
Searching...
No Matches
crange.cc.h
Go to the documentation of this file.
1// -*- C++ -*-
12#ifndef __cxz_crange_cc_h__
13#define __cxz_crange_cc_h__
14
15#include "crange.h"
16#include "index_mul.h"
17
18namespace CNORXZ
19{
20 template <SizeT I>
21 decltype(auto) CIndex::stepSize(const IndexId<I>& id) const
22 {
23 if constexpr(I != 0){
24 return SPos<0>();
25 }
26 else {
27 return UPos(id == this->id() ? 1 : 0);
28 }
29 }
30
31 template <class Xpr, class F>
32 decltype(auto) CIndex::ifor(const Xpr& xpr, F&& f) const
33 {
34 return For<0,Xpr,F>(this->pmax().val(), this->id(), xpr, std::forward<F>(f));
35 }
36
37 template <class I>
38 decltype(auto) operator*(const Sptr<CIndex>& a, const Sptr<I>& b)
39 {
40 return iptrMul(a, b);
41 }
42}
43
44#endif
decltype(auto) ifor(const Xpr &xpr, F &&f) const
Definition crange.cc.h:32
decltype(auto) stepSize(const IndexId< I > &id) const
Definition crange.cc.h:21
CRange and CIndex declaration.
Index multiplication.
decltype(auto) xpr(const Sptr< I > &i)
Sptr< Range > rangeCast(const RangePtr r)
decltype(auto) iptrMul(const Sptr< I1 > &a, const Sptr< I2 > &b)
std::shared_ptr< T > Sptr
Definition types.h:48