hypercube.h
long getProd(long d) const
product of sizes of dimensions d, d+1, ...
Definition: hypercube.h:392
ConstCubeSlice(const NTL::Vec< T > &_data, const CubeSignature &_sig)
Definition: hypercube.h:357
const CubeSignature & getSig() const
const ref to signature
Definition: hypercube.h:380
const T & at(long i) const
read-only reference to element at position i, with bounds check
Definition: hypercube.h:430
long getProd(long from, long to) const
product of sizes of dimensions from, from+1, ..., to-1
Definition: hypercube.h:395
const T & operator[](long i) const
read-only reference to element at position i, without bounds check
Definition: hypercube.h:440
long getCoord(long i, long d) const
get coordinate in dimension d of index i
Definition: hypercube.h:401
long getDim(long d) const
size of dimension d
Definition: hypercube.h:389
long numSlices(long d=1) const
number of slices
Definition: hypercube.h:421
ConstCubeSlice(const HyperCube< T > &_cube)
initialize the slice to the full cube
Definition: hypercube.h:349
long addCoord(long i, long d, long offset) const
add offset to coordinate in dimension d of index i
Definition: hypercube.h:411
long sliceSize(long d=1) const
size of one slice
Definition: hypercube.h:424
long getNumDims() const
number of dimensions
Definition: hypercube.h:386
Holds a vector of dimensions for a hypercube and some additional data.
Definition: hypercube.h:28
bool incrementCoords(VecType &v) const
Definition: hypercube.h:138
CubeSignature(const std::vector< long > &_dims)
Definition: hypercube.h:69
long getProd(long d) const
product of sizes of dimensions d, d+1, ...
Definition: hypercube.h:95
CubeSignature(const NTL::Vec< long > &_dims)
Definition: hypercube.h:68
long addCoord(long i, long d, long offset) const
add offset to coordinate in dimension d of index i
Definition: hypercube.h:115
long assembleCoords(VecType &v) const
Definition: hypercube.h:176
std::pair< long, long > breakIndexByDim(long idx, long dim) const
Definition: hypercube.cpp:20
void initSignature(const long _dims[], long _ndims)
Definition: hypercube.h:36
friend std::ostream & operator<<(std::ostream &s, const CubeSignature &sig)
Definition: hypercube.h:208
long assembleIndexByDim(std::pair< long, long > idx, long dim) const
The inverse of breakIndexByDim.
Definition: hypercube.cpp:29
long getCoord(long i, long d) const
get coordinate in dimension d of index i
Definition: hypercube.h:104
long getProd(long from, long to) const
product of sizes of dimensions from, from+1, ..., to-1
Definition: hypercube.h:98
void initSignature(const VecType &_dims)
Definition: hypercube.h:59
void getAllCoords(VecType &v, long i) const
Definition: hypercube.h:159
long getNumDims() const
number of dimensions
Definition: hypercube.h:86
long numSlices(long d=1) const
number of slices
Definition: hypercube.h:190
CubeSignature(const long _dims[], long _ndims)
Definition: hypercube.h:64
long sliceSize(long d=1) const
size of one slice
Definition: hypercube.h:193
CubeSlice(const CubeSlice< T > &bigger, long i, long _dimOffset=1)
Definition: hypercube.h:460
void copy(const ConstCubeSlice< T > &other) const
Definition: hypercube.cpp:152
CubeSlice(NTL::Vec< T > &_data, const CubeSignature &_sig)
Definition: hypercube.h:454
CubeSlice(HyperCube< T > &_cube, long i, long _dimOffset=1)
Definition: hypercube.h:464
const CubeSignature & getSig() const
const ref to signature
Definition: hypercube.h:262
HyperCube & operator=(const HyperCube< T > &other)
assignment: signatures must be the same
Definition: hypercube.h:241
T & at(long i)
reference to element at position i, with bounds check
Definition: hypercube.h:306
long numSlices(long d=1) const
number of slices
Definition: hypercube.h:297
bool operator==(const HyperCube< T > &other) const
equality testing: signatures must be the same
Definition: hypercube.h:251
long getCoord(long i, long d) const
get coordinate in dimension d of index i
Definition: hypercube.h:288
long sliceSize(long d=1) const
size of one slice
Definition: hypercube.h:300
const NTL::Vec< T > & getData() const
read-only ref to data vector
Definition: hypercube.h:270
bool operator!=(const HyperCube< T > &other) const
Definition: hypercube.h:259
long getProd(long from, long to) const
product of sizes of dimensions from, from+1, ..., to-1
Definition: hypercube.h:285
HyperCube(const CubeSignature &_sig)
initialize a HyperCube with a CubeSignature
Definition: hypercube.h:233
long addCoord(long i, long d, long offset) const
add offset to coordinate in dimension d of index i
Definition: hypercube.h:291
const T & at(long i) const
read-only reference to element at position i, with bounds check
Definition: hypercube.h:312
void shift1D(long i, long k)
Shift k positions along the i'th dimension with zero fill.
Definition: hypercube.cpp:67
HyperCube(const HyperCube &other)=default
T & operator[](long i)
reference to element at position i, without bounds check
Definition: hypercube.h:309
long getProd(long d) const
product of sizes of dimensions d, d+1, ...
Definition: hypercube.h:282
const T & operator[](long i) const
read-only reference to element at position i, without bounds check
Definition: hypercube.h:315
void rotate1D(long i, long k)
rotate k positions along the i'th dimension
Definition: hypercube.cpp:42
Definition: apiAttributes.h:21
void assertInRange(const T &elem, const T &min, const T &max, const std::string &message, bool right_inclusive=false)
Definition: assertions.h:183
void setHyperColumn(const NTL::Vec< T > &v, const CubeSlice< T > &s, long pos)
Definition: hypercube.cpp:193
void getHyperColumn(NTL::Vec< T > &v, const ConstCubeSlice< T > &s, long pos)
Definition: hypercube.cpp:174
std::ostream & operator<<(std::ostream &os, const ContextBuilder< SCHEME > &cb)
ostream operator for serializing the ContextBuilder object.
long lsize(const std::vector< T > &v)
Size of STL vector as a long (rather than unsigned long)
Definition: NumbTh.h:701
void assertEq(const T &a, const T &b, const std::string &message)
Definition: assertions.h:108