1#ifndef CPYCPPYY_DIMENSIONS_H
2#define CPYCPPYY_DIMENSIONS_H
6#include <initializer_list>
19 fDims =
new dim_t[ndim+1];
21 if (dims) std::copy(dims, dims+ndim, fDims+1);
26 fDims =
new dim_t[
l.size()+1];
28 std::copy(
l.begin(),
l.end(), fDims+1);
32 fDims =
new dim_t[
d.fDims[0]+1];
33 std::copy(
d.fDims,
d.fDims+
d.fDims[0]+1, fDims);
45 if (!fDims || (fDims && fDims[0] !=
d.fDims[0])) {
47 fDims =
new dim_t[
d.fDims[0]+1];
49 std::copy(
d.fDims,
d.fDims+
d.fDims[0]+1, fDims);
59 operator bool()
const {
return (
bool)fDims; }
64 if (fDims[0] ==
d)
return;
#define CPYCPPYY_CLASS_EXPORT
Dimensions(std::initializer_list< dim_t > l)
Dimensions(dim_t ndim=0, dim_t *dims=nullptr)
Dimensions(const Dimensions &d)
Dimensions & operator=(const Dimensions &d)
dim_t & operator[](dim_t i)
dim_t operator[](dim_t i) const
Dimensions(Dimensions &&d)
static const dim_t UNKNOWN_SIZE