Muscle C/C++ API: muscle::ComplexData Class Reference

muscle::ComplexData Class Reference

#include <complex_data.hpp>


Public Member Functions

 ComplexData (muscle_complex_t type, std::vector< int > *dimensions)
 ComplexData (void *data, muscle_complex_t type, std::vector< int > *dimensions)
 ComplexData (void *data, muscle_datatype_t type, size_t len)
 ~ComplexData ()
void * getData ()
const void * getData () const
muscle_complex_t getType () const
std::vector< int > getDimensions () const
size_t length () const
size_t sizeOfPrimitive () const
int index (int x, int y) const
int index (int x, int y, int z) const
int index (int x, int y, int z, int zz) const
int fidx (int x, int y) const
int fidx (int x, int y, int z) const
int fidx (int x, int y, int z, int zz) const

Static Public Member Functions

static size_t sizeOfPrimitive (muscle_complex_t type)
static int dimensions (muscle_complex_t type)
static muscle_complex_t getType (muscle_datatype_t type)

Constructor & Destructor Documentation

muscle::ComplexData::ComplexData ( muscle_complex_t  type,
std::vector< int > *  dimensions 
)

Initialize data with given datatype and number of dimensions.

muscle::ComplexData::ComplexData ( void *  data,
muscle_complex_t  type,
std::vector< int > *  dimensions 
)

Initialize with given data and datatype, and a number of dimensions. The given data must be allocated by MUSCLE or with malloc, and will be freed by MUSCLE. If datatype is not an array or matrix, dimensions are allowed to be null.

muscle::ComplexData::ComplexData ( void *  data,
muscle_datatype_t  type,
size_t  len 
)

Initialize a ComplexData with a simple MUSCLE datatype of an array, with given length.

muscle::ComplexData::~ComplexData (  ) 


Member Function Documentation

void * muscle::ComplexData::getData (  ) 

The data as a void-pointer. It is the responsibility of the caller to do the right casting, based on the complex type. Do not delete or free the data within.

const void * muscle::ComplexData::getData (  )  const

The data as a void-pointer. It is the responsibility of the caller to do the right casting, based on the complex type. Do not delete or free the data within.

muscle_complex_t muscle::ComplexData::getType (  )  const

Type of data contained within.

std::vector< int > muscle::ComplexData::getDimensions (  )  const

Get a vector containing the dimensions of the data. This will return an empty vector if the data is not an array or matrix.

size_t muscle::ComplexData::length (  )  const

Get the total length of the data.

size_t muscle::ComplexData::sizeOfPrimitive (  )  const

Get the size of the most primitive datatype that is contained. For a double vector, that would be sizeof(double) = 8.

int muscle::ComplexData::index ( int  x,
int  y 
) const

Get the index of the returned array. This will give an exception if it is out of bounds, or the wrong number of dimensions.

int muscle::ComplexData::index ( int  x,
int  y,
int  z 
) const

int muscle::ComplexData::index ( int  x,
int  y,
int  z,
int  zz 
) const

int muscle::ComplexData::fidx ( int  x,
int  y 
) const [inline]

Fast get the index of the returned array. This is inlined and does not do any bounds checking.

int muscle::ComplexData::fidx ( int  x,
int  y,
int  z 
) const [inline]

int muscle::ComplexData::fidx ( int  x,
int  y,
int  z,
int  zz 
) const [inline]

size_t muscle::ComplexData::sizeOfPrimitive ( muscle_complex_t  type  )  [static]

Get the size of the most primitive datatype that is contained. For a double vector, that would be sizeof(double) = 8.

int muscle::ComplexData::dimensions ( muscle_complex_t  type  )  [static]

Get the number of dimensions of a given datatype. For a vector that would be 1, for a 3-D matrix, 3.

muscle_complex_t muscle::ComplexData::getType ( muscle_datatype_t  type  )  [static]

Type of complex data that represents a muscle datatype.


Generated on Thu Oct 18 14:28:28 2012 for Muscle C/C++ API by  doxygen 1.5.6