CNORXZ
Container with Native Operation Routines and Expressions
Loading...
Searching...
No Matches
index_pack.h
Go to the documentation of this file.
1// -*- C++ -*-
18#ifndef __cxz_index_pack_h__
19#define __cxz_index_pack_h__
20
21#include "base/base.h"
22#include "xindex.h"
23
24namespace CNORXZ
25{
31 template <class... Indices>
32 class SPack
33 {
34 public:
40 constexpr SPack(const Sptr<Indices>&... is);
41
45 constexpr SPack(const Tuple<Sptr<Indices>...>& is);
46
50 constexpr const Tuple<Sptr<Indices>...>& all() const;
51
55 constexpr SizeT size() const;
56
62 template <SizeT I>
63 constexpr decltype(auto) get(CSizeT<I> i) const;
64
70 template <SizeT I>
71 constexpr decltype(auto) operator[](CSizeT<I> i) const;
72
77 template <class Index>
78 constexpr decltype(auto) rmul(const Sptr<Index>& i) const;
79
84 template <class Index>
85 constexpr decltype(auto) lmul(const Sptr<Index>& i) const;
86
91 template <class... Indices2>
92 constexpr decltype(auto) mul(const SPack<Indices2...>& p) const;
93
97 decltype(auto) mkRange() const;
98
102 SizeT lex() const;
103
107 SizeT pos() const;
108
109 private:
110 Tuple<Sptr<Indices>...> mIs;
111 };
112
118 template <class... Indices>
119 constexpr decltype(auto) spack(const Indices&... inds);
120
126 template <class... Indices>
127 constexpr decltype(auto) spackp(const Sptr<Indices>&... inds);
128
133 class DPack
134 {
135 public:
141 explicit DPack(const Vector<XIndexPtr>& is);
142
146 explicit DPack(Vector<XIndexPtr>&& is);
147
151 template <class... Indices>
152 explicit DPack(const SPack<Indices...>& p);
153
157 const Vector<XIndexPtr>& all() const;
158
162 SizeT size() const;
163
168 const XIndexPtr& get(SizeT i) const;
169
174 const XIndexPtr& operator[](SizeT i) const;
175
179 DPack rmul(const Sptr<DIndex>& i) const;
180
184 DPack lmul(const Sptr<DIndex>& i) const;
185
189 DPack mul(const DPack& p) const;
190
194 RangePtr mkRange() const;
195
199 SizeT lex() const;
200
204 SizeT pos() const;
205
206 private:
208 };
209
215 template <class... Indices>
216 DPack dpack(const Indices&... inds);
217
223 template <class... Indices>
224 DPack dpackp(const Sptr<Indices>&... inds);
225}
226
227#endif
basic headers
SizeT size() const
Definition index_pack.cc:29
DPack rmul(const Sptr< DIndex > &i) const
Definition index_pack.cc:44
SizeT pos() const
Definition index_pack.cc:91
const Vector< XIndexPtr > & all() const
Definition index_pack.cc:24
DPack lmul(const Sptr< DIndex > &i) const
Definition index_pack.cc:51
RangePtr mkRange() const
Definition index_pack.cc:69
SizeT lex() const
Definition index_pack.cc:77
DEFAULT_MEMBERS(DPack)
const XIndexPtr & operator[](SizeT i) const
Definition index_pack.cc:39
DPack mul(const DPack &p) const
Definition index_pack.cc:60
const XIndexPtr & get(SizeT i) const
Definition index_pack.cc:34
DPack(const Vector< XIndexPtr > &is)
Definition index_pack.cc:16
constexpr decltype(auto) rmul(const Sptr< Index > &i) const
SP_DEFAULT_MEMBERS(constexpr, SPack)
constexpr decltype(auto) get(CSizeT< I > i) const
constexpr SPack(const Sptr< Indices > &... is)
SizeT lex() const
SizeT pos() const
decltype(auto) mkRange() const
constexpr decltype(auto) lmul(const Sptr< Index > &i) const
constexpr const Tuple< Sptr< Indices >... > & all() const
constexpr decltype(auto) mul(const SPack< Indices2... > &p) const
constexpr SizeT size() const
DPack dpack(const Indices &... inds)
DPack dpackp(const Sptr< Indices > &... inds)
uint64_t SizeT
Definition types.h:38
Sptr< RangeBase > RangePtr
Definition types.h:157
Sptr< XIndexBase > XIndexPtr
Definition types.h:216
std::vector< T, Allocator< T > > Vector
Definition types.h:310
constexpr decltype(auto) spack(const Indices &... inds)
std::integral_constant< SizeT, N > CSizeT
Definition types.h:81
Sptr< Range > rangeCast(const RangePtr r)
std::tuple< T... > Tuple
Definition types.h:60
constexpr decltype(auto) spackp(const Sptr< Indices > &... inds)
std::shared_ptr< T > Sptr
Definition types.h:48
XIndexBase and XIndex template declaration.