array dimensions descriptor
More...
#include <dims.h>
| dim4 |
( |
unsigned |
x, |
|
|
unsigned |
y = 1, |
|
|
unsigned |
z = 1, |
|
|
unsigned |
w = 1 |
|
) |
| |
If only x is specified, constructs column vector.
| dim4 |
( |
unsigned |
ndims, |
|
|
const unsigned * |
dims |
|
) |
| |
| unsigned elements |
( |
| ) |
const |
Number of elements (product of dimensions)
cout << a.dims().elements() << endl;
| unsigned rest |
( |
unsigned |
i | ) |
const |
Product of dimensions i on.
cout << a.dims().rest(1) << endl;
| unsigned numdims |
( |
| ) |
const |
Number of dimensions set.
cout << a.dims().numdims() << endl;
| const unsigned* dims |
( |
| ) |
const |
Access underlying array.
const unsigned *d = dims.dims();
cout << dims[0] << " " << dims[1] << " " << dims[2] << " " << dims[3] << endl;
Is scalar array (one element)?
dims4 d(1);
return d.iscalar();
Is array vector (row or column or scalar)?
return c.isvector() && r.isvector();
| unsigned& operator[] |
( |
unsigned |
| ) |
|
| unsigned operator[] |
( |
unsigned |
| ) |
const |
| bool operator== |
( |
const dim4 & |
| ) |
const |
Check is dimensions are equal.
| bool operator!= |
( |
const dim4 & |
| ) |
const |
Check is dimensions are equal.
Copy constructor.
e = d;
cout << e[0] << endl;
| std::ostream& operator<< |
( |
std::ostream & |
, |
|
|
const dim4 & |
|
|
) |
| |
|
friend |
The documentation for this class was generated from the following file: