gVar Class Reference
[Libra C++ API, programming both CPUs and GPUs.Libra C++ API, programming both CPUs and GPUs.]

List of all members.

Public Member Functions

 gVar ()
 creates a gVar object.
 gVar (gVarHandle var)
 creates a gVar object from a Libra C API gVarHandle.
 gVar (int rowCount, int columnCount, gDataType type=GDEFAULT)
 creates an MxN array.
 gVar (const gVar &var)
 creates a gVar from another Libra gVar.
gVaroperator= (const gVar &var)
 assigns a Libra object to this object.
gVaroperator= (const gVarHandle var)
 assigns a gVar object to this object.
gVar operator= (double value)
 assigns a scalar to this object.
gVar operator= (float value)
 assigns a scalar ot this object.
gVar operator= (int value)
 assigns a scalar ot this object.
gVar operator= (bool value)
 assigns a scalar ot this object.
gVar operator() (gVar &rowIndices, gVar &columnIndices)
 returns a subarray of a gVar
 operator float () const
 returns the value of a scalar
 operator int () const
 returns the value of a scalar
void setData (const int *data)
 sets the elements of an gVar from an integer array
void setData (const float *data)
 sets the elements of an gVar from an float array
void setData (const double *data)
 sets the elements of an gVar from an double array
void getData (int *data, const unsigned int byteOffset=0, const unsigned int byteCount=0, void(__cdecl *callFunc)(int *mem, void *userData)=0, void *userData=0)
 gets the elements of an gVar and writes them into an int array
void getData (float *data, const unsigned int byteOffset=0, const unsigned int byteCount=0, void(__cdecl *callFunc)(float *mem, void *userData)=0, void *userData=0)
 gets the elements of an gVar and writes them into an float array
void getData (double *data, const unsigned int byteOffset=0, const unsigned int byteCount=0, void(__cdecl *callFunc)(double *mem, void *userData)=0, void *userData=0)
 gets the elements of an gVar and writes them into an double array
const gVarHandle getHandle () const
 gets the Libra C API gVarHandle of an gVar.
void print () const
 print the elements of an object.
int rowCount () const
 returns the rowCount of an gVar.
int columnCount () const
 returns the columnCount of an gVar.
int elementCount () const
 get the number of elements from an object.
gDataType dataType () const
 get the gDataType of elements from an object.
int dimensionCount () const
 get the number of dimensions from an object.

Detailed Description

gVar is an object that represents a matrix, vector, scalar, complex matrix, complex vector or complex scalar.

When a gVar represents a matrix, the array mem will be interpreted as column major data.


Constructor & Destructor Documentation

gVar (  ) 

creates a gVar object.

Returns:
a gVar.
This function is used to create a typeless variable. A gVar object.

gVar ( gVarHandle  var  ) 

creates a gVar object from a Libra C API gVarHandle.

Returns:
a gVar.
This function is used to create a typeless variable. A gVar object.

gVar ( int  rowCount,
int  columnCount,
gDataType  type = GDEFAULT 
) [explicit]

creates an MxN array.

Parameters:
rowCount number of rows to be created.
columnCount number of columns to be created.
type specifies the data type for the elements.
Returns:
a gVar representing the created array.
This function is used to create uninitialized scalars, vectors and dense matrices.

gVar ( const gVar var  ) 

creates a gVar from another Libra gVar.

Parameters:
var gVar source object to copy from.
Returns:
a gVar.
This function is used to create a gVar object from an existing gVar object.


Member Function Documentation

gVar & operator= ( const gVar var  ) 

assigns a Libra object to this object.

Parameters:
var the source object to assign.
Returns:
an assigned gVar.
This function can be used on any type of Libra API object, such as matrices, sparse matrices, vectors, scalars...

gVar & operator= ( const gVarHandle  var  ) 

assigns a gVar object to this object.

Parameters:
var the source object to assign. The source object is represented by a Libra C API gVarHandle.
Returns:
an assigned gVar.
This function can be used on any type of Libra API object, such as matrices, sparse matrices, vectors, scalars...

gVar & operator= ( double  value  ) 

assigns a scalar to this object.

Parameters:
value the source scalar to assign.
Returns:
an assigned gVar.
This function can be used on any type of Libra API object, such as matrices, sparse matrices, vectors, scalars...

gVar & operator= ( float  value  ) 

assigns a scalar ot this object.

Parameters:
value the source scalar to assign.
Returns:
an assigned gVar.
This function can be used on any type of Libra API object, such as matrices, sparse matrices, vectors, scalars...

gVar & operator= ( int  value  ) 

assigns a scalar ot this object.

Parameters:
value the source scalar to assign.
Returns:
an assigned gVar.
This function can be used on any type of Libra API object, such as matrices, sparse matrices, vectors, scalars...

gVar & operator= ( bool  value  ) 

assigns a scalar ot this object.

Parameters:
value the source scalar to assign.
Returns:
an assigned gVar.
This function can be used on any type of Libra API object, such as matrices, sparse matrices, vectors, scalars...

gVar operator() ( gVar rowIndices,
gVar columnIndices 
)

returns a subarray of a gVar

Parameters:
rowIndices the row indices.
columnIndices the column indices.
Returns:
a scalar gVar.

operator float (  )  const

returns the value of a scalar

Returns:
a float, containing the value of var.

operator int (  )  const

returns the value of a scalar

Returns:
an int, containing the value of var.

void setData ( const int *  data  ) 

sets the elements of an gVar from an integer array

Parameters:
data adress of the memory from where to fetch the integer data.
This function can be used on matrices, vectors and scalars. If gVar represents a matrix, the array mem will be interpreted as column major data. Note that this function will not change the gDataType of the object, so if the object was created as for example a GFLOAT32 data type object this function will perform the necessary conversion.

void setData ( const float *  data  ) 

sets the elements of an gVar from an float array

Parameters:
data adress of the memory from where to fetch the floating point data.
This function can be used on matrices, vectors and scalars. If gVar represents a matrix, the array mem will be interpreted as column major data. Note that this function will not change the gDataType of the object, so if the object was created as for example a GINT32 data type object this function will perform the necessary conversion.

void setData ( const double *  data  ) 

sets the elements of an gVar from an double array

Parameters:
data adress of the memory from where to fetch the double precision data.
This function can be used on matrices, vectors and scalars. If gVar represents a matrix, the array mem will be interpreted as column major data. Note that this function will not change the gDataType of the object, so if the object was created as for example a GFLOAT32 data type object this function will perform the necessary conversion.

void getData ( int *  data,
const unsigned int  byteOffset = 0,
const unsigned int  byteCount = 0,
void(__cdecl *callFunc)(int *mem, void *userData)  = 0,
void *  userData = 0 
)

gets the elements of an gVar and writes them into an int array

Parameters:
data adress of the memory to where to put the integer data.
byteOffset a byte offset to the object's data. 0 offset is default.
byteCount a byte count defining amount of data in bytes to retrieve. 0 byte count means all object data.
userData user-supplied data passed back to callback.
Returns:
returns immediately if a callFunc is supplied otherwise blocks until data is available.
This function can be used on matrices, vectors and scalars. If gVar represents a matrix, the array mem will be interpreted as column major data. Note that this function will perform the necessary conversion if the object was created as for example a GFLOAT32 data type object.

void getData ( float *  data,
const unsigned int  byteOffset = 0,
const unsigned int  byteCount = 0,
void(__cdecl *callFunc)(float *mem, void *userData)  = 0,
void *  userData = 0 
)

gets the elements of an gVar and writes them into an float array

Parameters:
data adress of the memory to where to put the float data.
byteOffset a byte offset to the object's data. 0 offset is default.
byteCount a byte count defining amount of data in bytes to retrieve. 0 byte count means all object data.
userData user-supplied data passed back to callback.
Returns:
returns immediately if a callFunc is supplied otherwise blocks until data is available.
This function can be used on matrices, vectors and scalars. If gVar represents a matrix, the array mem will be interpreted as column major data. Note that this function will perform the necessary conversion if the object was created as for example a GINT32 data type object.

void getData ( double *  data,
const unsigned int  byteOffset = 0,
const unsigned int  byteCount = 0,
void(__cdecl *callFunc)(double *mem, void *userData)  = 0,
void *  userData = 0 
)

gets the elements of an gVar and writes them into an double array

Parameters:
data adress of the memory to where to put the double precision data.
byteOffset a byte offset to the object's data. 0 offset is default.
byteCount a byte count defining amount of data in bytes to retrieve. 0 byte count means all object data.
userData user-supplied data passed back to callback.
Returns:
returns immediately if a callFunc is supplied otherwise blocks until data is available.
This function can be used on matrices, vectors and scalars. If gVar represents a matrix, the array mem will be interpreted as column major data. Note that this function will perform the necessary conversion if the object was created as for example a GFLOAT32 data type object.

const gVarHandle getHandle (  )  const

gets the Libra C API gVarHandle of an gVar.

Returns:
a gVarHandle.
This function can be used to retrieve a gVarHandle to pass to the C API. gVar objects can also be passed themselves as gVarHandle parameters if wanted. Then an implicit gVar to gVarHandle conversion is performed by the gVar.

void print (  )  const

print the elements of an object.

Elements are printed to std::out. On Windows, also to Debugger Output Window.

int rowCount (  )  const

returns the rowCount of an gVar.

Returns:
rowCount of the object.
rowCount is the number of rows in a gVar matrix, vector or scalar.

int columnCount (  )  const

returns the columnCount of an gVar.

Returns:
columnCount of the object.
columnCount is the number of rows in a gVar matrix, vector or scalar.

int elementCount (  )  const

get the number of elements from an object.

Returns:
the number of elements the object contains.
A sparse object returns the number of non-zero elements whereas a dense object rowCount() * columnCount().

gDataType dataType (  )  const

get the gDataType of elements from an object.

Returns:
the gDataType of elements the object contains.

int dimensionCount (  )  const

get the number of dimensions from an object.

Returns:
the number of dimensions the object contains.


Generated on Mon Jun 7 18:23:27 2010 for Libra by  doxygen 1.5.2