Do more. Code less. Free software for GPU computing.
<scroll to top>

dim4 Class Reference

#include <dims.h>

List of all members.

Public Member Functions

 dim4 ()
 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)
 dim4 (const dim4 &)
unsigned elements () const
 Number of elements (product of dimensions)
unsigned rest (unsigned i) const
 Product of dimension i and following.
unsigned ndims () const
 Number of dimensions.
bool isempty () const
 Is empty array?
bool isscalar () const
 Is scalar array (one element)?
bool isvector () const
 Is array vector (row or column or scalar)?
bool iscolumn () const
 Is column vector?
bool isrow () const
 Is row vector?
unsigned & operator[] (unsigned)
 Get specified dimension.
unsigned operator[] (unsigned) const
bool operator== (const dim4 &) const
bool operator!= (const dim4 &) const
dim4operator= (const dim4 &)

Friends

std::ostream & operator<< (std::ostream &, const dim4 &)

Detailed Description


Constructor & Destructor Documentation

dim4 ( )
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 
)
dim4 ( const dim4 )

Member Function Documentation

unsigned elements ( ) const

Number of elements (product of dimensions)

unsigned rest ( unsigned  i) const

Product of dimension i and following.

unsigned ndims ( ) const

Number of dimensions.

bool isempty ( ) const [inline]

Is empty array?

bool isscalar ( ) const [inline]

Is scalar array (one element)?

bool isvector ( ) const [inline]

Is array vector (row or column or scalar)?

bool iscolumn ( ) const [inline]

Is column vector?

bool isrow ( ) const [inline]

Is row vector?

unsigned& operator[] ( unsigned  )

Get specified dimension.

unsigned operator[] ( unsigned  ) const
bool operator== ( const dim4 ) const
bool operator!= ( const dim4 ) const
dim4& operator= ( const dim4 )

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  ,
const dim4  
) [friend]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines