Holds a vector of dimensions for a hypercube and some additional data. More...
#include <hypercube.h>
Public Member Functions | |
CubeSignature () | |
void | initSignature (const long _dims[], long _ndims) |
template<typename VecType > | |
void | initSignature (const VecType &_dims) |
CubeSignature (const long _dims[], long _ndims) | |
CubeSignature (const NTL::Vec< long > &_dims) | |
CubeSignature (const std::vector< long > &_dims) | |
long | getNumDims () const |
number of dimensions More... | |
long | getSize () const |
total size of cube More... | |
long | getDim (long d) const |
size of dimension d More... | |
long | getProd (long d) const |
product of sizes of dimensions d, d+1, ... More... | |
long | getProd (long from, long to) const |
product of sizes of dimensions from, from+1, ..., to-1 More... | |
long | getCoord (long i, long d) const |
get coordinate in dimension d of index i More... | |
long | addCoord (long i, long d, long offset) const |
add offset to coordinate in dimension d of index i More... | |
template<typename VecType > | |
bool | incrementCoords (VecType &v) const |
template<typename VecType > | |
void | getAllCoords (VecType &v, long i) const |
template<typename VecType > | |
long | assembleCoords (VecType &v) const |
long | numSlices (long d=1) const |
number of slices More... | |
long | sliceSize (long d=1) const |
size of one slice More... | |
long | numCols () const |
number of columns More... | |
std::pair< long, long > | breakIndexByDim (long idx, long dim) const |
long | assembleIndexByDim (std::pair< long, long > idx, long dim) const |
The inverse of breakIndexByDim. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &s, const CubeSignature &sig) |
Detailed Description
Holds a vector of dimensions for a hypercube and some additional data.
Constructor & Destructor Documentation
◆ CubeSignature() [1/4]
|
inline |
◆ CubeSignature() [2/4]
|
inline |
◆ CubeSignature() [3/4]
|
inline |
◆ CubeSignature() [4/4]
|
inline |
Member Function Documentation
◆ addCoord()
|
inline |
add offset to coordinate in dimension d of index i
◆ assembleCoords()
|
inline |
reconstruct index from its coordinates VecType is either std::vector<intType> or NTL:Vec<intType>
◆ assembleIndexByDim()
long helib::CubeSignature::assembleIndexByDim | ( | std::pair< long, long > | idx, |
long | dim | ||
) | const |
The inverse of breakIndexByDim.
◆ breakIndexByDim()
std::pair< long, long > helib::CubeSignature::breakIndexByDim | ( | long | idx, |
long | dim | ||
) | const |
Break an index into the hypercube to index of the dimension-dim subcube and index inside that subcube.
◆ getAllCoords()
|
inline |
get the coordinates of index i in all dimensions. VecType is either std::vector<intType> or NTL:Vec<intType>
◆ getCoord()
|
inline |
get coordinate in dimension d of index i
◆ getDim()
|
inline |
size of dimension d
◆ getNumDims()
|
inline |
number of dimensions
◆ getProd() [1/2]
|
inline |
product of sizes of dimensions d, d+1, ...
◆ getProd() [2/2]
|
inline |
product of sizes of dimensions from, from+1, ..., to-1
◆ getSize()
|
inline |
total size of cube
◆ incrementCoords()
|
inline |
Increment the coordinates to point to next index, returning false if already at maximum value. VecType is either std::vector<intType> or NTL:Vec<intType>
◆ initSignature() [1/2]
|
inline |
◆ initSignature() [2/2]
|
inline |
◆ numCols()
|
inline |
number of columns
◆ numSlices()
|
inline |
number of slices
◆ sliceSize()
|
inline |
size of one slice
Friends And Related Function Documentation
◆ operator<<
|
friend |