Libra C++ functions
[Libra C++ API, programming both CPUs and GPUs.]


Functions

void * libra_new (const unsigned int byteCount)
 allocates count bytes of memory from computer main memory.
void libra_delete (const void *memory)
 free the memory allocated using libra_new.
gVar scalar (double value, gDataType type=GDEFAULT)
 creates a Scalar of gDataType type.
gVar scalar (float value, gDataType type=GDEFAULT)
 creates a Scalar of gDataType type.
gVar scalar (int value, gDataType type=GDEFAULT)
 creates a Scalar of gDataType type.
gVar scalar (bool value, gDataType type=GDEFAULT)
 creates a Scalar of gDataType type.
gVar complex (double realValue, double imagenaryValue=0.0, gDataType type=GDEFAULT)
 creates a Complex Scalar of gDataType type.
gVar complex (float realValue, float imagenaryValue=0.0f, gDataType type=GDEFAULT)
 creates a Complex Scalar of gDataType type.
gVar complex (int realValue, int imagenaryValue=0, gDataType type=GDEFAULT)
 creates a Complex Scalar of gDataType type.
gVar sparse (float *values, int *rows, int *columns, int nz, gDataType type=GDEFAULT)
 creates a sparse matrix, with input in Coordinate format.
gVar sparse (double *values, int *rows, int *columns, int nz, gDataType type=GDEFAULT)
 creates a sparse matrix, with input in Coordinate format.
gVar sparseCSC (float *values, int *rows, int *colIndex, int nz, gDataType type=GDEFAULT)
 creates a sparse matrix, with input in Compressed Sparse Column (CSC) format.
gVar sparseCSC (double *values, int *rows, int *colIndex, int nz, gDataType type=GDEFAULT)
 creates a sparse matrix, with input in Compressed Sparse Column (CSC) format.
gVar sparseCSR (float *values, int *columns, int *rowIndex, int nz, gDataType type=GDEFAULT)
 creates a sparse matrix, with input in Compressed Sparse Row (CSR) format.
gVar sparseCSR (double *values, int *columns, int *rowIndex, int nz, gDataType type=GDEFAULT)
 creates a sparse matrix, with input in Compressed Sparse Row (CSR) format.
gVar sparseBanded (int rowCount, int columnCount, float **values, int *positions, int bandCount, gDataType type=GDEFAULT)
 creates a sparse matrix, with input in Coordinate (Coord) format.
gVar sparseBanded (int rowCount, int columnCount, double **values, int *positions, int bandCount, gDataType type=GDEFAULT)
 creates a sparse matrix, with input in Coordinate (Coord) format.
gVar complexSparse (float *values, int *rows, int *columns, int nz, gDataType type=GDEFAULT)
 creates a sparse matrix, with input in Coordinate format.
gVar complexSparse (double *values, int *rows, int *columns, int nz, gDataType type=GDEFAULT)
 creates a sparse matrix, with input in Coordinate format.
gVar complexSparseCSC (float *values, int *rows, int *colIndex, int nz, gDataType type=GDEFAULT)
 creates a sparse matrix, with input in Compressed Sparse Column (CSC) format.
gVar complexSparseCSC (double *values, int *rows, int *colIndex, int nz, gDataType type=GDEFAULT)
 creates a sparse matrix, with input in Compressed Sparse Column (CSC) format.
gVar complexSparseCSR (float *values, int *columns, int *rowIndex, int nz, gDataType type=GDEFAULT)
 creates a sparse matrix, with input in Compressed Sparse Row (CSR) format.
gVar complexSparseCSR (double *values, int *columns, int *rowIndex, int nz, gDataType type=GDEFAULT)
 creates a sparse matrix, with input in Compressed Sparse Row (CSR) format.
gVar complexSparseBanded (int rowCount, int columnCount, float **values, int *positions, int bandCount, gDataType type=GDEFAULT)
 creates a sparse matrix, with input in Coordinate (Coord) format.
gVar complexSparseBanded (int rowCount, int columnCount, double **values, int *positions, int bandCount, gDataType type=GDEFAULT)
 creates a sparse matrix, with input in Coordinate (Coord) format.
gVar eye (int count, gDataType type=GDEFAULT)
 creates an identity matrix.
gVar eye (int rowCount, int columnCount, gDataType type=GDEFAULT)
 creates an identity matrix.
gVar complexEye (int count, gDataType type=GDEFAULT)
 creates an identity matrix.
gVar complexEye (int rowCount, int columnCount, gDataType type=GDEFAULT)
 creates an identity matrix.
gVar ones (int rowCount, int columnCount, gDataType type=GDEFAULT)
 creates a matrix whose elements are all 1.
gVar ones (int count, gDataType type=GDEFAULT)
 creates a matrix whose elements are all 1.
gVar ones (gDataType type=GDEFAULT)
 creates a scalar with value 1.
gVar zeros (int rowCount, int columnCount, gDataType type=GDEFAULT)
 creates a matrix whose elements are all 0.
gVar zeros (int count, gDataType type=GDEFAULT)
 creates a matrix whose elements are all 0.
gVar zeros (gDataType type=GDEFAULT)
 creates a scalar with value 0.
gVar complexOnes (int rowCount, int columnCount, gDataType type=GDEFAULT)
 creates a matrix whose elements are all 1.
gVar complexOnes (int count, gDataType type=GDEFAULT)
 creates a matrix whose elements are all 1.
gVar complexOnes (gDataType type=GDEFAULT)
 creates a scalar with value 1.
gVar complexZeros (int rowCount, int columnCount, gDataType type=GDEFAULT)
 creates a matrix whose elements are all 0.
gVar complexZeros (int count, gDataType type=GDEFAULT)
 creates a matrix whose elements are all 0.
gVar complexZeros (gDataType type=GDEFAULT)
 creates a scalar with value 0.
gVar indexmap (int rowCount, int columnCount, float rowCoeff, float colCoeff, float offs, gDataType type=GDEFAULT)
 creates an object where the element values are a linear function of ther row, column index.
gVar step (float from, float to, float stride=1, gDataType type=GDEFAULT)
 creates a vector which elements are in a sequence
gVar rand (int rowCount, int columnCount, gDataType type=GDEFAULT)
 creates a matrix filled with random values.
gVar rand (int count, gDataType type=GDEFAULT)
 creates a matrix filled with random values.
gVar complexRand (int count, gDataType type=GDEFAULT)
 creates a matrix filled with random values.
gVar operator * (const gVar &var1, const gVar &var2)
 perform matrix multiply.
gVaroperator *= (gVar &var1, const gVar &var2)
 perform matrix multiply and assign result to var1.
gVar operator * (double d, const gVar &var2)
 perform multiply, element by element.
gVar operator * (const gVar &var1, double d)
 perform multiply, element by element.
gVar operator * (float f, const gVar &var2)
 perform multiply, element by element.
gVar operator * (const gVar &var1, float f)
 perform multiply, element by element.
gVaroperator *= (gVar &var1, float f)
 perform multiply, element by element and assign result to var
gVaroperator *= (gVar &var1, double d)
 perform multiply, element by element and assign result to var.
gVar operator/ (const gVar &var1, const gVar &var2)
 perform right division.
gVar operator/ (const gVar &var1, double d)
 perform right division.
gVar operator/ (const gVar &var1, float f)
 perform right division.
gVar operator/ (double d, const gVar &var2)
 perform right division.
gVar operator/ (float f, const gVar &var2)
 perform right division.
gVaroperator/= (gVar &var1, const gVar &var2)
 perform right division.
gVaroperator/= (gVar &var1, double d)
 perform right division and assign result to var.
gVaroperator/= (gVar &var1, float f)
 perform right division and assign result to var.
gVar operator% (const gVar &var1, const gVar &var2)
 perform modulo operation, element by element.
gVar operator% (const gVar &var1, double d)
 perform modulo operation, element by element.
gVar operator% (const gVar &var1, float f)
 perform modulo operation, element by element.
gVar operator% (const gVar &var1, int i)
 perform modulo operation, element by element.
gVar operator% (double d, const gVar &var2)
 perform modulo operation, element by element.
gVar operator% (float f, const gVar &var2)
 perform modulo operation, element by element.
gVar operator% (int i, const gVar &var2)
 perform modulo operation, element by element.
gVaroperator%= (gVar &var1, const gVar &var2)
 perform modulo operation, element by element and assign result to var1.
gVaroperator%= (gVar &var1, double d)
 perform modulo operation, element by element and assign result to var.
gVaroperator%= (gVar &var1, float f)
 perform modulo operation, element by element and assign result to var.
gVaroperator%= (gVar &var1, int i)
 perform modulo operation, element by element and assign result to var.
gVar operator+ (const gVar &var1, const gVar &var2)
 perform addition, element by element.
gVaroperator+= (gVar &var1, const gVar &var2)
 perform addition, element by element and assign result to var1.
gVar operator+ (double d, const gVar &var2)
 perform addition, element by element.
gVar operator+ (const gVar &var1, double d)
 perform addition, element by element.
gVaroperator+= (gVar &var1, double d)
 perform addition, element by element and assign result to var.
gVar operator+ (float f, const gVar &var2)
 perform addition, element by element.
gVar operator+ (const gVar &var1, float f)
 perform addition, element by element.
gVaroperator+= (gVar &var1, float f)
 perform addition, element by element and assign result to var.
gVar operator- (const gVar &var1, const gVar &var2)
 perform subtraction, element by element.
gVaroperator-= (gVar &var1, const gVar &var2)
 perform subtraction, element by element and assign result to var1.
gVar operator- (double d, const gVar &var2)
 perform subtraction, element by element.
gVar operator- (const gVar &var1, double d)
 perform subtraction, element by element.
gVaroperator-= (gVar &var1, double d)
 perform subtraction, element by element and assign result to var.
gVar operator- (float f, const gVar &var2)
 perform subtraction, element by element.
gVar operator- (const gVar &var1, float f)
 perform subtraction, element by element.
gVaroperator-= (gVar &var1, float f)
 perform subtraction, element by element and assign result to var.
gVar operator- (const gVar &var)
 negate operand, element by element.
gVar operator== (const gVar &var1, const gVar &var2)
 compares two objects, element by element
gVar operator== (double d, const gVar &var2)
 compares two operands, element by element
gVar operator== (const gVar &var1, double d)
 compares two operands, element by element
gVar operator== (float f, const gVar &var2)
 compares two operands, element by element
gVar operator== (const gVar &var1, float f)
 compares two operands, element by element
gVar operator> (const gVar &var1, const gVar &var2)
 compares two objects, element by element
gVar operator>= (const gVar &var1, const gVar &var2)
 compares two objects, element by element and assign result to var1.
gVar operator> (double d, const gVar &var2)
 compares two operands, element by element
gVar operator>= (double d, const gVar &var2)
 compares two operands, element by element and assign result to var.
gVar operator> (const gVar &var1, double d)
 compares two operands, element by element
gVar operator>= (const gVar &var1, double d)
 compares two operands, element by element and assign result to var.
gVar operator> (float f, const gVar &var2)
 compares two operands, element by element.
gVar operator> (const gVar &var, float f)
 compares two operands, element by element.
gVar operator>= (const gVar &var1, float f)
 compares two operands, element by element and assign result to var.
gVar operator< (const gVar &var1, const gVar &var2)
 compares two objects, element by element
gVar operator<= (const gVar &var1, const gVar &var2)
 compares two objects, element by element and assign result to var1.
gVar operator< (double d, const gVar &var2)
 compares two objects, element by element.
gVar operator<= (double d, const gVar &var2)
 compares two objects, element by element and assign result to var.
gVar operator< (float f, const gVar &var2)
 compares two objects, element by element.
gVar operator<= (float f, const gVar &var2)
 compares two objects, element by element and assign result to var.
gVar operator< (const gVar &var1, double d)
 compares two objects, element by element.
gVar operator<= (const gVar &var1, double d)
 compares two objects, element by element and assign result to var.
gVar operator< (const gVar &var1, float f)
 compares two objects, element by element.
gVar operator<= (const gVar &var1, float f)
 compares two objects, element by element and assign result to var.
gVar operator!= (const gVar &var1, const gVar &var2)
 compares two objects, element by element
gVar operator!= (double d, const gVar &var2)
 compares two objects, element by element.
gVar operator!= (const gVar &var1, double d)
 compares two objects, element by element.
gVar operator!= (float f, const gVar &var2)
 compares two objects, element by element.
gVar operator!= (const gVar &var1, float f)
 compares two objects, element by element.
gVar operator! (const gVar &var)
 perform the logical not operation of an object, element by element
gVar operator & (const gVar &var1, const gVar &var2)
 perform the logical and operation of two objects, element by element
gVar operator| (const gVar &var1, const gVar &var2)
 perform the logical or operation of two objects, element by element
gVar operator^ (const gVar &var1, const gVar &var2)
 perform the logical xor operation of two objects, element by element
gVar cond (const gVar &var1, const gVar &var2, const gVar &var3)
 condition operand ? left operand : right operand.

conditionally selects elements from two operators, element by element.
gVar cond (const gVar &var1, const gVar &var2, const double d)
 condition operand ? left operand : right operand.

conditionally selects elements from two operators, element by element.
gVar cond (const gVar &var1, const double d, const gVar &var3)
 condition operand ? left operand : right operand.

conditionally selects elements from two operators, element by element.
gVar cond (const gVar &var1, const double d1, const double d2)
 condition operand ? left operand : right operand.

conditionally selects elements from two operators, element by element.
gVar cond (const gVar &var1, const gVar &var2, const float f)
 condition operand ? left operand : right operand.

conditionally selects elements from two operators, element by element.
gVar cond (const gVar &var1, const float f, const gVar &var3)
 condition operand ? left operand : right operand.

conditionally selects elements from two operators, element by element.
gVar cond (const gVar &var, const float f1, const float f2)
 condition operand ? left operand : right operand.

conditionally selects elements from two operators, element by element.
gVar dot (const gVar &var1, const gVar &var2)
 perform the inner (dot) product.
gVar mul (const gVar &var1, const gVar &var2)
 perform multiply, element by element.
gVar mul (const gVar &var, const float f)
 perform multiply, element by element.
gVar mul (const float f, const gVar &var)
 perform multiply, element by element.
gVar div (const gVar &var1, const gVar &var2)
 perform division, element by element.
gVar div (const gVar &var1, double d)
 perform division, element by element.
gVar div (double d, const gVar &var2)
 perform division, element by element.
gVar div (const gVar &var1, float f)
 perform division, element by element.
gVar div (float f, const gVar &var2)
 perform division, element by element.
gVar pow (const gVar &var1, const gVar &var2)
 performs the power function, raising base left operand to the power of right operand, element by element.
gVar pow (double d, const gVar &var2)
 performs the power function, raising base left operand to the power of right operand, element by element.
gVar pow (const gVar &var1, double d)
 performs the power function, raising base left operand to the power of right operand, element by element.
gVar pow (float f, const gVar &var2)
 performs the power function, raising base left operand to the power of right operand, element by element.
gVar pow (const gVar &var1, float f)
 performs the power function, raising base left operand to the power of right operand, element by element.
gVar max (const gVar &var)
 performs max of the elements of an object.
gVar max (const gVar &var1, const gVar &var2)
 performs max of the elements of an object.
gVar max (double d, const gVar &var2)
 performs max of the elements of an object.
gVar max (const gVar &var1, double d)
 performs max of the elements of an object.
gVar max (float f, const gVar &var2)
 performs max of the elements of an object.
gVar max (const gVar &var1, float f)
 performs max of the elements of an object.
gVar min (const gVar &var)
 performs min of the elements of an object.
gVar min (const gVar &var1, const gVar &var2)
 performs min of the elements of an object.
gVar min (double d, const gVar &var2)
 performs min of the elements of an object.
gVar min (const gVar &var1, double d)
 performs min of the elements of an object.
gVar min (float f, const gVar &var2)
 performs min of the elements of an object.
gVar min (const gVar &var1, float f)
 performs min of the elements of an object.
gVar imfilter (const gVar &var1, const gVar &var2, const char *options="")
 return the linear filtering of image var1 and filter var2.
gVar sin (const gVar &var)
 performs sine, element by element.
gVar cos (const gVar &var)
 performs cosine, element by element.
gVar tan (const gVar &var)
 performs tangent, element by element.
gVar asin (const gVar &var)
 performs arcsine (inverse of sine), element by element.
gVar acos (const gVar &var)
 performs arccosine (inverse of cosine), element by element.
gVar atan (const gVar &var)
 performs arctangent (inverse of tangent), element by element.
gVar log (const gVar &var)
 performs the natural logarithm, element by element.
gVar log2 (const gVar &var)
 performs the logarithm of base 2, element by element.
gVar log10 (const gVar &var)
 performs the logarithm of base 10, element by element.
gVar exp (const gVar &var)
 performs the exponential function of base e, element by element.
gVar exp2 (const gVar &var)
 performs the exponential function of base 2, element by element.
gVar exp10 (const gVar &var)
 performs the exponential function of base 10, element by element.
gVar sqrt (const gVar &var)
 computes the squared root, element by element.
gVar invSqrt (const gVar &var)
 computes 1.0 divided by the squared root, element by element.
gVar floor (const gVar &var)
 the input is rounded downwards (truncated) to the nearest integer, element by element.
gVar ceil (const gVar &var)
 the input is rounded upwards to nearest integer, element by element.
gVar round (const gVar &var)
 the input is rounded to the nearest integer, element by element.
gVar abs (const gVar &var)
 computes the absolute value, element by element.
gVar sign (const gVar &var)
 performs the sign (sgn) function, element by element.
gVar sum (const gVar &var)
 computes the sum of all elements in an object.
gVar transpose (const gVar &var)
 computes the transpose of an object.
gVar conj (const gVar &var)
 computes the conj of an object.
gVar cast (const gVar &var, gDataType dataType)
 casts an object into a new object with the specified gDataType.
gVar cast (float f, gDataType dataType)
 casts a float into a new object with the specified gDataType.
gVar cast (int i, gDataType dataType)
 casts an int into a new object with the specified gDataType.
gVar cast (double d, gDataType dataType)
 casts a double into a new object with the specified gDataType.
gVar sort (const gVar &var)
 return a sorted gVar.
gVar fft (const gVar &var)
 return the 1D fourier transform of a gVar.
gVar ifft (const gVar &var)
 return the inverse 1D fourier transform of a gVar.
gVar fftshift (const gVar &var)
 swaps "half-spaces" of var along each dimension.
gVar ifftshift (const gVar &var)
 inverse swaps "half-spaces" of var along each dimension.
gVar usolve (const gVar &var1, const gVar &var2)
 return the the solution of a upper triangular equation system.
gVar lsolve (const gVar &var1, const gVar &var2)
 return the the solution of a lower triangular equation system.
gVar real (const gVar &var)
 returns Real part of a var.
gVar imag (const gVar &var)
 returns Imag part of a var.
gVar complex (const gVar &var1, const gVar &var2=0)
 returns a complex var from two real vars.
gVar diag (const gVar &var)
 extracts the diagonal of an object
gVar diag (const gVar &var, int k)
 creates a gVar (typically a matrix) with the specified diagonal at position k.
gVar gather (const gVar &var1, const gVar &var2)
 gathers selected elements from a vector.
gVar gather (const gVar &var1, const gVar &var2, const gVar &var3)
 gathers selected elements from a matrix.
void scatter (const gVar &var1, const gVar &var2, gVar &var3)
 scatters elements into selected positions of a vector.
void scatter (const gVar &var1, const gVar &var2, const gVar &var3, gVar &var4)
 scatters elements into selected positions of a matrix.
void scatter (const int i, int j, float value, gVar &var)
 scatters element into selected position i,j of a matrix, vector or scalar.
void scatter (const int i, float value, gVar &var)
 scatters element into selected position i of a vector.
void scatter (const float i, float j, float value, gVar &var)
 scatters element into selected position i,j of a matrix, vector or scalar.
void scatter (const float i, float j, float re, float im, gVar &var)
 scatters complex element into selected position i,j of a matrix, vector or scalar.
gVar jacobiIter (const gVar &A, const gVar &x, const gVar &b)
 performs a jacobi iteration.
void render (const gVar &var, gRenderMode mode=GDISPLAY2D, int rowStride=0)
 when Libra is in debug or SDK mode, displays a variable graphically.
void renderText (const char *text, unsigned int posX, unsigned int posY, unsigned int byteColorRGBA)
 when Libra is in debug or SDK mode, displays a text string graphically.
gVar rows ()
 returns the rows of an gVar.
gVar columns ()
 returns the columns of an gVar.
gVar numel (const gVar &var1)
 get the number of elements from an object.
gVar ndims (const gVar &var1)
 get the number of dimensions from an object.
gVar isreal (const gVar &var)
 return 1 if the queried object is a complex object othwerwise 0.
gVar iscomplex (const gVar &var)
 return 1 if the queried object is a complex object othwerwise 0.
gVar imread (const char *fileName, gDataType type=GDEFAULT)
 creates a gVar object from an image file.

Function Documentation

gVar abs ( const gVar var  ) 

computes the absolute value, element by element.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar acos ( const gVar var  ) 

performs arccosine (inverse of cosine), element by element.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar asin ( const gVar var  ) 

performs arcsine (inverse of sine), element by element.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar atan ( const gVar var  ) 

performs arctangent (inverse of tangent), element by element.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar cast ( double  d,
gDataType  dataType 
)

casts a double into a new object with the specified gDataType.

Parameters:
d double object operand.
dataType the desired gDataType of the new object.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar cast ( int  i,
gDataType  dataType 
)

casts an int into a new object with the specified gDataType.

Parameters:
i int operand.
dataType the desired gDataType of the new object.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar cast ( float  f,
gDataType  dataType 
)

casts a float into a new object with the specified gDataType.

Parameters:
f float operand.
dataType the desired gDataType of the new object.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar cast ( const gVar var,
gDataType  dataType 
)

casts an object into a new object with the specified gDataType.

Parameters:
var gVar object operand.
dataType the desired gDataType of the new object.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar ceil ( const gVar var  ) 

the input is rounded upwards to nearest integer, element by element.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar columns (  ) 

returns the columns of an gVar.

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

gVar complex ( const gVar var1,
const gVar var2 
)

returns a complex var from two real vars.

Parameters:
var1 gVar object operand.
var2 gVar object operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar complex ( int  realValue,
int  imagenaryValue,
gDataType  type 
)

creates a Complex Scalar of gDataType type.

Parameters:
realValue the Complex integer value.
imagenaryValue the Complex imagenary value.
type the desired gDataType of the new object.
Returns:
a gVar representing a GINT32 Complex Scalar.
This function is used to create GINT32 Complex Scalars.

gVar complex ( float  realValue,
float  imagenaryValue,
gDataType  type 
)

creates a Complex Scalar of gDataType type.

Parameters:
realValue the Complex real value.
imagenaryValue the Complex imagenary value.
type the desired gDataType of the new object.
Returns:
a gVar representing a GFLOAT32 Complex Scalar.
This function is used to create GFLOAT32 Complex Scalars.

gVar complex ( double  realValue,
double  imagenaryValue,
gDataType  type 
)

creates a Complex Scalar of gDataType type.

Parameters:
realValue the Complex real value.
imagenaryValue the Complex imagenary value.
type the desired gDataType of the new object.
Returns:
a gVar representing a GFLOAT64 Complex Scalar.
This function is used to create GFLOAT64 Complex Scalars.

gVar complexEye ( int  rowCount,
int  columnCount,
gDataType  type 
)

creates an identity matrix.

Parameters:
rowCount the number of rows to be created.
columnCount the number of columns to be created.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing a matrix, vector or scalar.
Eye creates a matrix of size rowCount x columnCount, with all elements set to 0, except when i = j (main diagonal) which values are set to 1.

Depending on rowCount and columnCount, the returned gVarHandle can also represent a vector or a scalar.

gVar complexEye ( int  count,
gDataType  type 
)

creates an identity matrix.

Parameters:
count the number of rows and columns to be created.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing a matrix or a scalar.
Eye creates a matrix of size count x count, with all elements set to 0, except when i = j (main diagonal) which values are set to 1.

Depending on count, the returned gVarHandle can also represent a scalar.

gVar complexOnes ( gDataType  type  ) 

creates a scalar with value 1.

Parameters:
type the gDataType to be used for representation of elements.
Returns:
a gVar representing a scalar.
The scalar value is set to 1.

gVar complexOnes ( int  count,
gDataType  type 
)

creates a matrix whose elements are all 1.

Parameters:
count the number of rows and columns to be created.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing a matrix or a scalar.
All elements are set to the value of 1.

Depending on rowCount and columnCount, the returned gVarHandle can also represent a scalar.

gVar complexOnes ( int  rowCount,
int  columnCount,
gDataType  type 
)

creates a matrix whose elements are all 1.

Parameters:
rowCount the number of rows to be created.
columnCount the number of columns to be created.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing a matrix, vector or a scalar.
All elements are set to the value of 1.

Depending on rowCount and columnCount, the returned gVarHandle can also represent a vector or a scalar.

gVar complexRand ( int  count,
gDataType  type = GDEFAULT 
)

creates a matrix filled with random values.

Parameters:
count the number of rows and columns to be created.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing a matrix or a scalar.
All elements are set using a pseudorandom generator.

Depending on rowCount and columnCount, the returned gVarHandle can also represent a scalar.

gVar complexSparse ( double *  values,
int *  rows,
int *  columns,
int  nz,
gDataType  type 
)

creates a sparse matrix, with input in Coordinate format.

Parameters:
values A array that contains the non-zero entries of A.
rows Element i of the integer array rows contains the number of the row in A that contained the value in values(i).
columns Element i of the integer array columns contains the number of the column in A that contained the value in values(i).
nz the number of non zero elements in A.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing the created sparse matrix.

gVar complexSparse ( float *  values,
int *  rows,
int *  columns,
int  nz,
gDataType  type 
)

creates a sparse matrix, with input in Coordinate format.

Parameters:
values A array that contains the non-zero entries of A.
rows Element i of the integer array rows contains the number of the row in A that contained the value in values(i).
columns Element i of the integer array columns contains the number of the column in A that contained the value in values(i).
nz the number of non zero elements in A.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing the created sparse matrix.

gVar complexSparseBanded ( int  rowCount,
int  columnCount,
double **  values,
int *  positions,
int  bandCount,
gDataType  type 
)

creates a sparse matrix, with input in Coordinate (Coord) format.

Parameters:
rowCount number of rows
columnCount number of colums
values A array that contains pointers to the values of the band vectors
positions an array that contains each bands offset from the main diagonal
bandCount the number of bands
type the gDataType to be used for representation of elements.
Returns:
a gVar representing the created sparse matrix.

gVar complexSparseBanded ( int  rowCount,
int  columnCount,
float **  values,
int *  positions,
int  bandCount,
gDataType  type 
)

creates a sparse matrix, with input in Coordinate (Coord) format.

Parameters:
rowCount number of rows
columnCount number of colums
values A array that contains pointers to the values of the band vectors
positions an array that contains each bands offset from the main diagonal
bandCount the number of bands
type the gDataType to be used for representation of elements.
Returns:
a gVar representing the created sparse matrix.

gVar complexSparseCSC ( double *  values,
int *  rows,
int *  colIndex,
int  nz,
gDataType  type 
)

creates a sparse matrix, with input in Compressed Sparse Column (CSC) format.

Parameters:
values A array that contains the non-zero entries of A.
rows Element i of the integer array rows contains the number of the row in A that contained the value in values(i).
colIndex Element j of the integer array colIndex gives the index into the values array that contains the first non-zero element in a column j of A.
nz the number of non zero elements in A.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing the created sparse matrix.

gVar complexSparseCSC ( float *  values,
int *  rows,
int *  colIndex,
int  nz,
gDataType  type 
)

creates a sparse matrix, with input in Compressed Sparse Column (CSC) format.

Parameters:
values A array that contains the non-zero entries of A.
rows Element i of the integer array rows contains the number of the row in A that contained the value in values(i).
colIndex Element j of the integer array colIndex gives the index into the values array that contains the first non-zero element in a column j of A.
nz the number of non zero elements in A.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing the created sparse matrix.

gVar complexSparseCSR ( double *  values,
int *  columns,
int *  rowIndex,
int  nz,
gDataType  type 
)

creates a sparse matrix, with input in Compressed Sparse Row (CSR) format.

Parameters:
values A array that contains the non-zero entries of A.
columns Element i of the integer array columns contains the number of the column in A that contained the value in values(i).
rowIndex Element j of the integer array rowIndex gives the index into the values array that contains the first non-zero element in a row j of A.
nz the number of non zero elements in A.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing the created sparse matrix.

gVar complexSparseCSR ( float *  values,
int *  columns,
int *  rowIndex,
int  nz,
gDataType  type 
)

creates a sparse matrix, with input in Compressed Sparse Row (CSR) format.

Parameters:
values A array that contains the non-zero entries of A.
columns Element i of the integer array columns contains the number of the column in A that contained the value in values(i).
rowIndex Element j of the integer array rowIndex gives the index into the values array that contains the first non-zero element in a row j of A.
nz the number of non zero elements in A.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing the created sparse matrix.

gVar complexZeros ( gDataType  type  ) 

creates a scalar with value 0.

Parameters:
type the gDataType to be used for representation of elements.
Returns:
a gVar representing a scalar.
The scalar value is set to 0.

gVar complexZeros ( int  count,
gDataType  type 
)

creates a matrix whose elements are all 0.

Parameters:
count the number of rows and columns to be created.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing a matrix or a scalar.
All elements are set to the value of 0.

Depending on rowCount and columnCount, the returned gVarHandle can also represent a scalar.

gVar complexZeros ( int  rowCount,
int  columnCount,
gDataType  type 
)

creates a matrix whose elements are all 0.

Parameters:
rowCount the number of rows to be created.
columnCount the number of columns to be created.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing a matrix, vector or scalar.
All elements are set to the value of 0.

Depending on rowCount and columnCount, the returned gVarHandle can also represent a vector or a scalar.

gVar cond ( const gVar var,
const float  f1,
const float  f2 
)

condition operand ? left operand : right operand.

conditionally selects elements from two operators, element by element.

Parameters:
var gVar condition operand.
f1 float left operand.
f2 float right operand.
Returns:
a gVar representing the resulting object.
var must be of gDataType GBOOL.

gVar cond ( const gVar var1,
const float  f,
const gVar var3 
)

condition operand ? left operand : right operand.

conditionally selects elements from two operators, element by element.

Parameters:
var1 gVar condition operand.
f float left operand.
var3 gVar right operand.
Returns:
a gVar representing the resulting object.
var1 must be of gDataType GBOOL. var2 can represent either matrices, vectors or scalars.

gVar cond ( const gVar var1,
const gVar var2,
const float  f 
)

condition operand ? left operand : right operand.

conditionally selects elements from two operators, element by element.

Parameters:
var1 gVar condition operand.
var2 gVar left operand.
f float right operand.
Returns:
a gVar representing the resulting object.
var1 must be of gDataType GBOOL. var2 can represent either matrices, vectors or scalars.

gVar cond ( const gVar var1,
const double  d1,
const double  d2 
)

condition operand ? left operand : right operand.

conditionally selects elements from two operators, element by element.

Parameters:
var1 gVar condition operand.
d1 double left operand.
d2 double right operand.
Returns:
a gVar representing the resulting object.
var1 must be of gDataType GBOOL.

gVar cond ( const gVar var1,
const double  d,
const gVar var3 
)

condition operand ? left operand : right operand.

conditionally selects elements from two operators, element by element.

Parameters:
var1 gVar condition operand.
d double left operand.
var3 gVar left operand.
Returns:
a gVar representing the resulting object.
var1 must be of gDataType GBOOL. var2 can represent either matrices, vectors or scalars.

gVar cond ( const gVar var1,
const gVar var2,
const double  d 
)

condition operand ? left operand : right operand.

conditionally selects elements from two operators, element by element.

Parameters:
var1 gVar condition operand.
var2 gVar left operand.
d double right operand.
Returns:
a gVar representing the resulting object.
var1 must be of gDataType GBOOL. var2 can represent either matrices, vectors or scalars.

gVar cond ( const gVar var1,
const gVar var2,
const gVar var3 
)

condition operand ? left operand : right operand.

conditionally selects elements from two operators, element by element.

Parameters:
var1 gVar condition operand.
var2 gVar left operand.
var3 gVar right operand.
Returns:
a gVar representing the resulting object.
var1 must be of gDataType GBOOL. var2 and var3 can both represent either matrices, vectors or scalars.

gVar conj ( const gVar var  ) 

computes the conj of an object.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar cos ( const gVar var  ) 

performs cosine, element by element.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar diag ( const gVar var,
int  k 
)

creates a gVar (typically a matrix) with the specified diagonal at position k.

Parameters:
var gVar operand, i.e. a vector with the desired diagonal elements.
k the diagonal position
Returns:
a gVar representing the resulting object.
var can represent either a vector or a scalar.

gVar diag ( const gVar var  ) 

extracts the diagonal of an object

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
var can represent either a matrix or a sparse matrix.

gVar div ( float  f,
const gVar var2 
)

perform division, element by element.

Parameters:
f float left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar div ( const gVar var1,
const float  f 
)

perform division, element by element.

Parameters:
var1 gVar left operand.
f float right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar div ( double  d,
const gVar var2 
)

perform division, element by element.

Parameters:
d double left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar div ( const gVar var1,
const double  d 
)

perform division, element by element.

Parameters:
var1 gVar left operand.
d double right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar div ( const gVar var1,
const gVar var2 
)

perform division, element by element.

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. However their dimensions must match for the operation at hand.

gVar dot ( const gVar var1,
const gVar var2 
)

perform the inner (dot) product.

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
var1 and var2 must both be vectors.

gVar exp ( const gVar var  ) 

performs the exponential function of base e, element by element.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar exp10 ( const gVar var  ) 

performs the exponential function of base 10, element by element.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar exp2 ( const gVar var  ) 

performs the exponential function of base 2, element by element.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar eye ( int  rowCount,
int  columnCount,
gDataType  type 
)

creates an identity matrix.

Parameters:
rowCount the number of rows to be created.
columnCount the number of columns to be created.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing a matrix, vector or scalar.
Eye creates a matrix of size rowCount x columnCount, with all elements set to 0, except when i = j (main diagonal) which values are set to 1.

Depending on rowCount and columnCount, the returned gVarHandle can also represent a vector or a scalar.

gVar eye ( int  count,
gDataType  type 
)

creates an identity matrix.

Parameters:
count the number of rows and columns to be created.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing a matrix or a scalar.
Eye creates a matrix of size count x count, with all elements set to 0, except when i = j (main diagonal) which values are set to 1.

Depending on count, the returned gVarHandle can also represent a scalar.

gVar fft ( const gVar var  ) 

return the 1D fourier transform of a gVar.

Parameters:
var handle to the operand.
Returns:
the handle of the resulting object.
var can represent either matrices, vectors or sparse matrices.

gVar fftshift ( const gVar var  ) 

swaps "half-spaces" of var along each dimension.

Parameters:
var handle to the operand.
Returns:
the handle of the resulting object.
var can represent either matrices, vectors or sparse matrices.

gVar floor ( const gVar var  ) 

the input is rounded downwards (truncated) to the nearest integer, element by element.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar gather ( const gVar var1,
const gVar var2,
const gVar var3 
)

gathers selected elements from a matrix.

Parameters:
var1 gVar row selector operand.
var2 gVar column selector operand.
var3 gVar from which to gather.
Returns:
a gVar representing the resulting object.
If var1 and var2 is not of gDataType GINT32, necessary conversions will first be performed. var1 and var2 can both represent either matrices, vectors or scalars, but must be of the same dimension. The output will be of the same dimension as var1 and var2.

gVar gather ( const gVar var1,
const gVar var2 
)

gathers selected elements from a vector.

Parameters:
var1 gVar element selector operand.
var2 gVar from which to gather.
Returns:
a gVar representing the resulting object.
If var1 is not of gDataType GINT32, necessary conversions will first be performed. var1 acan represent either a matrix, vector or scalar. The output will be of the same dimension as var1.

gVar ifft ( const gVar var  ) 

return the inverse 1D fourier transform of a gVar.

Parameters:
var handle to the operand.
Returns:
the handle of the resulting object.
var can represent either matrices, vectors or sparse matrices.

gVar ifftshift ( const gVar var  ) 

inverse swaps "half-spaces" of var along each dimension.

Parameters:
var handle to the operand.
Returns:
the handle of the resulting object.
var can represent either matrices, vectors or sparse matrices.

gVar imag ( const gVar var  ) 

returns Imag part of a var.

Parameters:
var gVar object operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar imfilter ( const gVar var1,
const gVar var2,
const char *  options 
)

return the linear filtering of image var1 and filter var2.

Parameters:
var1 gVar image operand.
var2 gVar filter operand.
options to control the details of filtering.
Returns:
a gVar representing the resulting object.
var1 and var2 can represent either matrices, vectors or sparse matrices.

gVar imread ( const char *  fileName,
gDataType  type 
)

creates a gVar object from an image file.

Parameters:
fileName the filename of the image to be loaded relative to your binary path.
type specifies the data type for the elements.
Returns:
a gVar matrix object representing the image data.
This function is used to create dense matrices from an image file.

gVar indexmap ( int  rowCount,
int  columnCount,
float  rowCoeff,
float  colCoeff,
float  offs,
gDataType  type 
)

creates an object where the element values are a linear function of ther row, column index.

Parameters:
rowCount the number of rows to be created.
columnCount the number of columns to be created.
rowCoeff row index multiplier coefficient
colCoeff column index multiplier coefficient
offs an offset coefficient
type the gDataType to be used for representation of elements.
Returns:
a gVar representing a matrix, vector or scalar.
element (i,j) is assigned the value of i * rowCoeff + j * colCoeff + offs. Depending on rowCount and columnCount, the returned gVarHandle can also represent a vector or a scalar.

gVar invSqrt ( const gVar var  ) 

computes 1.0 divided by the squared root, element by element.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar iscomplex ( const gVar var  ) 

return 1 if the queried object is a complex object othwerwise 0.

Parameters:
var object to be queried.
Returns:
1 or 0 whether the object is a complex object.

gVar isreal ( const gVar var  ) 

return 1 if the queried object is a complex object othwerwise 0.

Parameters:
var object to be queried.
Returns:
1 or 0 whether the object is a real object.

gVar jacobiIter ( const gVar A,
const gVar x,
const gVar b 
)

performs a jacobi iteration.

Parameters:
A gVar operand.
x gVar operand.
b gVar operand.
Returns:
a gVar representing the resulting object.
Returns a better estimate than x to the equation Ax = b.

void libra_delete ( const void *  memory  ) 

free the memory allocated using libra_new.

Parameters:
memory a pointer to memory
This function is to be used for freeing memory allocated using libra_new.

void* libra_new ( const unsigned int  byteCount  ) 

allocates count bytes of memory from computer main memory.

Parameters:
byteCount byte count.
Returns:
a pointer to allocated memory or 0 if failed.
This function can be used to allocate dedicated memory for faster data transfers between compute devices.

gVar log ( const gVar var  ) 

performs the natural logarithm, element by element.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar log10 ( const gVar var  ) 

performs the logarithm of base 10, element by element.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar log2 ( const gVar var  ) 

performs the logarithm of base 2, element by element.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar lsolve ( const gVar var1,
const gVar var2 
)

return the the solution of a lower triangular equation system.

Parameters:
var1 handle to the matrix operand.
var2 handle to the vector operand.
Returns:
the handle of the resulting object.
var1 represents a matrix. var2 a right hand side vector.

gVar max ( const gVar var1,
float  f 
)

performs max of the elements of an object.

Parameters:
var1 gVar left operand.
f float right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar max ( float  f,
const gVar var2 
)

performs max of the elements of an object.

Parameters:
f float left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar max ( const gVar var1,
double  d 
)

performs max of the elements of an object.

Parameters:
var1 gVar left operand.
d double right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar max ( double  d,
const gVar var2 
)

performs max of the elements of an object.

Parameters:
d double left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar max ( const gVar var1,
const gVar var2 
)

performs max of the elements of an object.

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. However their dimensions must match for the operation at hand.

gVar max ( const gVar var  ) 

performs max of the elements of an object.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
var can represent either a matrix, vector or scalar. The resulting gVar is a scalar.

gVar min ( const gVar var1,
float  f 
)

performs min of the elements of an object.

Parameters:
var1 gVar left operand.
f float right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar min ( float  f,
const gVar var2 
)

performs min of the elements of an object.

Parameters:
f float left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar min ( const gVar var1,
double  d 
)

performs min of the elements of an object.

Parameters:
var1 gVar left operand.
d double right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar min ( double  d,
const gVar var2 
)

performs min of the elements of an object.

Parameters:
d double left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar min ( const gVar var1,
const gVar var2 
)

performs min of the elements of an object.

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. However their dimensions must match for the operation at hand.

gVar min ( const gVar var  ) 

performs min of the elements of an object.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
var can represent either a matrix, vector or scalar. The resulting gVar is a scalar.

gVar mul ( const float  f,
const gVar var 
)

perform multiply, element by element.

Parameters:
f float left operand.
var gVar object right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar mul ( const gVar var,
const float  f 
)

perform multiply, element by element.

Parameters:
var gVar object left operand.
f float right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar mul ( const gVar var1,
const gVar var2 
)

perform multiply, element by element.

Parameters:
var1 gVar representing the left operand.
var2 gVar representing the right operand.
Returns:
a gVar representing the resulting object.
var1 and var2 can both represent either matrices, vectors or scalars. however their dimensions must match for the operation at hand.

gVar ndims ( const gVar var1  ) 

get the number of dimensions from an object.

Parameters:
var1 object to be queried.
Returns:
the number of dimensions the object represents.

gVar numel ( const gVar var1  ) 

get the number of elements from an object.

Parameters:
var1 object to be queried.
Returns:
the number of elements the object contains.
A sparse object returns the number of non-zero elements whereas a dense object rows() * columns().

gVar ones ( gDataType  type  ) 

creates a scalar with value 1.

Parameters:
type the gDataType to be used for representation of elements.
Returns:
a gVar representing a scalar.
The scalar value is set to 1.

gVar ones ( int  count,
gDataType  type 
)

creates a matrix whose elements are all 1.

Parameters:
count the number of rows and columns to be created.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing a matrix or a scalar.
All elements are set to the value of 1.

Depending on rowCount and columnCount, the returned gVarHandle can also represent a scalar.

gVar ones ( int  rowCount,
int  columnCount,
gDataType  type 
)

creates a matrix whose elements are all 1.

Parameters:
rowCount the number of rows to be created.
columnCount the number of columns to be created.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing a matrix, vector or a scalar.
All elements are set to the value of 1.

Depending on rowCount and columnCount, the returned gVarHandle can also represent a vector or a scalar.

gVar operator & ( const gVar var1,
const gVar var2 
)

perform the logical and operation of two objects, element by element

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL. The input must be of gDataType GBOOL.

gVar operator * ( const gVar var1,
float  f 
)

perform multiply, element by element.

Parameters:
var1 gVar left operand.
f float right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar operator * ( float  f,
const gVar var2 
)

perform multiply, element by element.

Parameters:
f float left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar operator * ( const gVar var1,
double  d 
)

perform multiply, element by element.

Parameters:
var1 gVar left operand.
d double right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar operator * ( double  d,
const gVar var2 
)

perform multiply, element by element.

Parameters:
d double left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar operator * ( const gVar var1,
const gVar var2 
)

perform matrix multiply.

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. However their dimensions must match for the operation at hand.

gVar& operator *= ( gVar var1,
double  d 
)

perform multiply, element by element and assign result to var.

Parameters:
var1 gVar left operand.
d double right operand.
Returns:
var representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar& operator *= ( gVar var1,
float  f 
)

perform multiply, element by element and assign result to var

Parameters:
var1 gVar left operand.
f float right operand.
Returns:
var representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar& operator *= ( gVar var1,
const gVar var2 
)

perform matrix multiply and assign result to var1.

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
var1 object representing the resulting object.
A gVar can represent either a matrix, vector or scalar. However their dimensions must match for the operation at hand.

gVar operator! ( const gVar var  ) 

perform the logical not operation of an object, element by element

Parameters:
var gVar.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL. The input must be of gDataType GBOOL.

gVar operator!= ( const gVar var1,
float  f 
)

compares two objects, element by element.

Parameters:
var1 gVar left operand.
f float right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator!= ( float  f,
const gVar var2 
)

compares two objects, element by element.

Parameters:
f float left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator!= ( const gVar var1,
double  d 
)

compares two objects, element by element.

Parameters:
var1 gVar left operand.
d double right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator!= ( double  d,
const gVar var2 
)

compares two objects, element by element.

Parameters:
d double left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator!= ( const gVar var1,
const gVar var2 
)

compares two objects, element by element

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator% ( int  i,
const gVar var2 
)

perform modulo operation, element by element.

Parameters:
i int left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar operator% ( float  f,
const gVar var2 
)

perform modulo operation, element by element.

Parameters:
f float left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar operator% ( double  d,
const gVar var2 
)

perform modulo operation, element by element.

Parameters:
d double left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar operator% ( const gVar var1,
int  i 
)

perform modulo operation, element by element.

Parameters:
var1 gVar left operand.
i int right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar operator% ( const gVar var1,
float  f 
)

perform modulo operation, element by element.

Parameters:
var1 gVar left operand.
f float right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar operator% ( const gVar var1,
double  d 
)

perform modulo operation, element by element.

Parameters:
var1 gVar left operand.
d double right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar operator% ( const gVar var1,
const gVar var2 
)

perform modulo operation, element by element.

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar& operator%= ( gVar var1,
int  i 
)

perform modulo operation, element by element and assign result to var.

Parameters:
var1 gVar left operand.
i int right operand.
Returns:
var representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar& operator%= ( gVar var1,
float  f 
)

perform modulo operation, element by element and assign result to var.

Parameters:
var1 gVar left operand.
f float right operand.
Returns:
var representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar& operator%= ( gVar var1,
double  d 
)

perform modulo operation, element by element and assign result to var.

Parameters:
var1 gVar left operand.
d double right operand.
Returns:
var representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar& operator%= ( gVar var1,
const gVar var2 
)

perform modulo operation, element by element and assign result to var1.

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
var1 representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar operator+ ( const gVar var1,
float  f 
)

perform addition, element by element.

Parameters:
var1 gVar left operand.
f float right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar operator+ ( float  f,
const gVar var2 
)

perform addition, element by element.

Parameters:
f float left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar operator+ ( const gVar var1,
double  d 
)

perform addition, element by element.

Parameters:
var1 gVar left operand.
d double right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar operator+ ( double  d,
const gVar var2 
)

perform addition, element by element.

Parameters:
d double left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar operator+ ( const gVar var1,
const gVar var2 
)

perform addition, element by element.

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar& operator+= ( gVar var1,
float  f 
)

perform addition, element by element and assign result to var.

Parameters:
var1 gVar left operand.
f float right operand.
Returns:
var object representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar& operator+= ( gVar var1,
double  d 
)

perform addition, element by element and assign result to var.

Parameters:
var1 gVar left operand.
d double right operand.
Returns:
var object representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar& operator+= ( gVar var1,
const gVar var2 
)

perform addition, element by element and assign result to var1.

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
var1 representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar operator- ( const gVar var  ) 

negate operand, element by element.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar operator- ( const gVar var1,
float  f 
)

perform subtraction, element by element.

Parameters:
f float left operand.
var1 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar operator- ( float  f,
const gVar var2 
)

perform subtraction, element by element.

Parameters:
var2 gVar left operand.
f float right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar operator- ( const gVar var1,
double  d 
)

perform subtraction, element by element.

Parameters:
var1 gVar left operand.
d double right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar operator- ( double  d,
const gVar var2 
)

perform subtraction, element by element.

Parameters:
d double left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar operator- ( const gVar var1,
const gVar var2 
)

perform subtraction, element by element.

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar& operator-= ( gVar var1,
float  f 
)

perform subtraction, element by element and assign result to var.

Parameters:
var1 gVar right operand.
f float left operand.
Returns:
var object representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar& operator-= ( gVar var1,
double  d 
)

perform subtraction, element by element and assign result to var.

Parameters:
var1 gVar left operand.
d double right operand.
Returns:
var object representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar& operator-= ( gVar var1,
const gVar var2 
)

perform subtraction, element by element and assign result to var1.

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
var1 object representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar operator/ ( float  f,
const gVar var2 
)

perform right division.

Parameters:
f double left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
var must be a scalar in current version of Libra. For element by element division, use div.

gVar operator/ ( double  d,
const gVar var2 
)

perform right division.

Parameters:
d double left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar operator/ ( const gVar var1,
float  f 
)

perform right division.

Parameters:
var1 gVar left operand.
f float right operand.
Returns:
a gVar representing the resulting object.
var can represent either a matrix, vector or scalar.

gVar operator/ ( const gVar var1,
double  d 
)

perform right division.

Parameters:
var1 gVar left operand.
d double right operand.
Returns:
a gVar representing the resulting object.
var can represent either a matrix, vector or scalar.

gVar operator/ ( const gVar var1,
const gVar var2 
)

perform right division.

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
var1 can represent either a matrix, vector or scalar. var2 must be a scalar in current version of Libra. For element by element division, use div.

gVar& operator/= ( gVar var1,
float  f 
)

perform right division and assign result to var.

Parameters:
var1 gVar left operand.
f float right operand.
Returns:
var representing the resulting object.
var can represent either a matrix, vector or scalar.

gVar& operator/= ( gVar var1,
double  d 
)

perform right division and assign result to var.

Parameters:
var1 gVar left operand.
d double right operand.
Returns:
var representing the resulting object.
var can represent either a matrix, vector or scalar.

gVar& operator/= ( gVar var1,
const gVar var2 
)

perform right division.

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
var1 representing the resulting object.
var must be a scalar in current version of Libra. For element by element division, use div.

gVar operator< ( const gVar var1,
float  f 
)

compares two objects, element by element.

Parameters:
var1 gVar left operand.
f float right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator< ( const gVar var1,
double  d 
)

compares two objects, element by element.

Parameters:
var1 gVar left operand.
d double right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator< ( float  f,
const gVar var2 
)

compares two objects, element by element.

Parameters:
f float left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator< ( double  d,
const gVar var2 
)

compares two objects, element by element.

Parameters:
d double left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator< ( const gVar var1,
const gVar var2 
)

compares two objects, element by element

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator<= ( const gVar var1,
float  f 
)

compares two objects, element by element and assign result to var.

Parameters:
var1 gVar left operand.
f float right operand.
Returns:
var object representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator<= ( const gVar var1,
double  d 
)

compares two objects, element by element and assign result to var.

Parameters:
var1 gVar left operand.
d double right operand.
Returns:
var object representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator<= ( float  f,
const gVar var2 
)

compares two objects, element by element and assign result to var.

Parameters:
f float left operand.
var2 gVar right operand.
Returns:
var object representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator<= ( double  d,
const gVar var2 
)

compares two objects, element by element and assign result to var.

Parameters:
d double left operand.
var2 gVar right operand.
Returns:
var object representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator<= ( const gVar var1,
const gVar var2 
)

compares two objects, element by element and assign result to var1.

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
var1 object representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator== ( const gVar var1,
float  f 
)

compares two operands, element by element

Parameters:
var1 gVar left operand.
f float right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator== ( float  f,
const gVar var2 
)

compares two operands, element by element

Parameters:
f float left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator== ( const gVar var1,
double  d 
)

compares two operands, element by element

Parameters:
var1 gVar left operand.
d double right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator== ( double  d,
const gVar var2 
)

compares two operands, element by element

Parameters:
d double left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator== ( const gVar var1,
const gVar var2 
)

compares two objects, element by element

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator> ( const gVar var1,
float  f 
)

compares two operands, element by element.

Parameters:
var1 gVar left operand.
f float right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator> ( float  f,
const gVar var2 
)

compares two operands, element by element.

Parameters:
f float left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator> ( const gVar var1,
double  d 
)

compares two operands, element by element

Parameters:
var1 gVar left operand.
d double right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator> ( double  d,
const gVar var2 
)

compares two operands, element by element

Parameters:
d double left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator> ( const gVar var1,
const gVar var2 
)

compares two objects, element by element

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator>= ( const gVar var1,
float  f 
)

compares two operands, element by element and assign result to var.

Parameters:
var1 gVar left operand.
f float right operand.
Returns:
var object representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator>= ( const gVar var1,
double  d 
)

compares two operands, element by element and assign result to var.

Parameters:
var1 gVar left operand.
d double right operand.
Returns:
var object representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator>= ( double  d,
const gVar var2 
)

compares two operands, element by element and assign result to var.

Parameters:
d double left operand.
var2 gVar right operand.
Returns:
var object representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator>= ( const gVar var1,
const gVar var2 
)

compares two objects, element by element and assign result to var1.

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
var1 object representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL.

gVar operator^ ( const gVar var1,
const gVar var2 
)

perform the logical xor operation of two objects, element by element

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL. The input must be of gDataType GBOOL.

gVar operator| ( const gVar var1,
const gVar var2 
)

perform the logical or operation of two objects, element by element

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar. The result element is always gDataType GBOOL. The input must be of gDataType GBOOL.

gVar pow ( const gVar var1,
float  f 
)

performs the power function, raising base left operand to the power of right operand, element by element.

Parameters:
var1 gVar left operand.
f float right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar pow ( float  f,
const gVar var2 
)

performs the power function, raising base left operand to the power of right operand, element by element.

Parameters:
f float left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar pow ( const gVar var1,
double  d 
)

performs the power function, raising base left operand to the power of right operand, element by element.

Parameters:
var1 gVar left operand.
d double right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar pow ( double  d,
const gVar var2 
)

performs the power function, raising base left operand to the power of right operand, element by element.

Parameters:
d double left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar pow ( const gVar var1,
const gVar var2 
)

performs the power function, raising base left operand to the power of right operand, element by element.

Parameters:
var1 gVar left operand.
var2 gVar right operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar rand ( int  count,
gDataType  type 
)

creates a matrix filled with random values.

Parameters:
count the number of rows and columns to be created.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing a matrix or a scalar.
All elements are set using a pseudorandom generator.

Depending on rowCount and columnCount, the returned gVarHandle can also represent a scalar.

gVar rand ( int  rowCount,
int  columnCount,
gDataType  type 
)

creates a matrix filled with random values.

Parameters:
rowCount the number of rows to be created.
columnCount the number of columns to be created.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing a matrix, vector or a scalar.
All elements are set using a pseudorandom generator.

Depending on rowCount and columnCount, the returned gVarHandle can also represent a vector or a scalar.

gVar real ( const gVar var  ) 

returns Real part of a var.

Parameters:
var gVar object operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

void render ( const gVar var,
gRenderMode  mode,
int  rowStride 
)

when Libra is in debug or SDK mode, displays a variable graphically.

Parameters:
var object to be displayed.
mode determines how the object is displayed.
rowStride The logical stride of an object. For example specifying vector rowCount when displayed as 2D data.
See Libra C API libra_Init documentation for cmdLine settings to enable Debug or SDK mode.

void renderText ( const char *  text,
unsigned int  posX,
unsigned int  posY,
unsigned int  byteColorRGBA 
)

when Libra is in debug or SDK mode, displays a text string graphically.

Parameters:
text the text string to be displayed.
posX the x pixel position of the text string relative to upperleft corner of the window.
posY the y pixel position of the text string relative to upperleft corner of the window.
byteColorRGBA the byte component rgba color of the text string to be displayed.
See libra_Init documentation for cmdLine settings to enable Debug or SDK mode.

gVar round ( const gVar var  ) 

the input is rounded to the nearest integer, element by element.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar rows (  ) 

returns the rows of an gVar.

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

gVar scalar ( bool  value,
gDataType  type 
)

creates a Scalar of gDataType type.

Parameters:
value the Scalar boolean value.
type the desired gDataType of the new object.
Returns:
a gVar representing a GBOOL Scalar.
This function is used to create GBOOL Scalars.

gVar scalar ( int  value,
gDataType  type 
)

creates a Scalar of gDataType type.

Parameters:
value the Scalar integer value.
type the desired gDataType of the new object.
Returns:
a gVar representing a GINT32 Scalar.
This function is used to create GINT32 Scalars.

gVar scalar ( float  value,
gDataType  type 
)

creates a Scalar of gDataType type.

Parameters:
value the Scalar float value.
type the desired gDataType of the new object.
Returns:
a gVar representing a GFLOAT32 Scalar.
This function is used to create GFLOAT64 Scalars.

gVar scalar ( double  value,
gDataType  type 
)

creates a Scalar of gDataType type.

Parameters:
value the Scalar double value.
type the desired gDataType of the new object.
Returns:
a gVar representing a GFLOAT64 Scalar.
This function is used to create GFLOAT64 Scalars.

void scatter ( const float  i,
float  j,
float  re,
float  im,
gVar var 
)

scatters complex element into selected position i,j of a matrix, vector or scalar.

Parameters:
i to element row selector operand.
j to element column selector operand.
re value scatter value operand.
im value scatter value operand.
var gVar representing the matrix which to scatter the values into.
var can represent either a matrix, vector or scalar. The output will be the same object as var, i.e. this function changes var and does not create/return any new object.

void scatter ( const float  i,
float  j,
float  value,
gVar var 
)

scatters element into selected position i,j of a matrix, vector or scalar.

Parameters:
i to element row selector operand.
j to element column selector operand.
value scatter value operand.
var gVar representing the matrix which to scatter the values into.
var can represent either a matrix, vector or scalar. The output will be the same object as var, i.e. this function changes var and does not create/return any new object.

void scatter ( const int  i,
float  value,
gVar var 
)

scatters element into selected position i of a vector.

Parameters:
i to element row selector operand.
value scatter value operand.
var gVar representing the matrix which to scatter the values into.
var can represent either a vector or scalar. The output will be the same object as var, i.e. this function changes var and does not create/return any new object.

void scatter ( const int  i,
int  j,
float  value,
gVar var 
)

scatters element into selected position i,j of a matrix, vector or scalar.

Parameters:
i to element row selector operand.
j to element column selector operand.
value scatter value operand.
var gVar representing the matrix which to scatter the values into.
var can represent either a matrix, vector or scalar. The output will be the same object as var, i.e. this function changes var and does not create/return any new object.

void scatter ( const gVar var1,
const gVar var2,
const gVar var3,
gVar var4 
)

scatters elements into selected positions of a matrix.

Parameters:
var1 gVar element row selector operand.
var2 gVar element column selector operand.
var3 gVar values to be scattered operand.
var4 gVar representing the matrix which to scatter the values into.
If var1 and var2 is not of gDataType GINT32, necessary conversions will first be performed. var1, var2 and var3 can all represent either matrices, vectors or scalars, but must be of the same dimension. The output will be the same object as var4, i.e. this function changes var4 and does not create/return any new object.

void scatter ( const gVar var1,
const gVar var2,
gVar var3 
)

scatters elements into selected positions of a vector.

Parameters:
var1 gVar element selector operand.
var2 gVar values to be scattered operand.
var3 gVar representing the vector which to scatter the values into.
If var1 is not of gDataType GINT32, necessary conversions will first be performed. var1 and var2 can both represent either matrices, vectors or scalars, but must be of the same dimension. The output will be the same object as var3, i.e. this function changes var3 and does not create/return any new object.

gVar sign ( const gVar var  ) 

performs the sign (sgn) function, element by element.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar sin ( const gVar var  ) 

performs sine, element by element.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar sort ( const gVar var  ) 

return a sorted gVar.

Parameters:
var handle to the operand.
Returns:
the handle of the resulting object.
var can represent either matrices, vectors, scalars or sparse matrices.

gVar sparse ( double *  values,
int *  rows,
int *  columns,
int  nz,
gDataType  type 
)

creates a sparse matrix, with input in Coordinate format.

Parameters:
values A array that contains the non-zero entries of A.
rows Element i of the integer array rows contains the number of the row in A that contained the value in values(i).
columns Element i of the integer array columns contains the number of the column in A that contained the value in values(i).
nz the number of non zero elements in A.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing the created sparse matrix.

gVar sparse ( float *  values,
int *  rows,
int *  columns,
int  nz,
gDataType  type 
)

creates a sparse matrix, with input in Coordinate format.

Parameters:
values A array that contains the non-zero entries of A.
rows Element i of the integer array rows contains the number of the row in A that contained the value in values(i).
columns Element i of the integer array columns contains the number of the column in A that contained the value in values(i).
nz the number of non zero elements in A.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing the created sparse matrix.

gVar sparseBanded ( int  rowCount,
int  columnCount,
double **  values,
int *  positions,
int  bandCount,
gDataType  type 
)

creates a sparse matrix, with input in Coordinate (Coord) format.

Parameters:
rowCount number of rows
columnCount number of colums
values A array that contains pointers to the values of the band vectors
positions an array that contains each bands offset from the main diagonal
bandCount the number of bands
type the gDataType to be used for representation of elements.
Returns:
a gVar representing the created sparse matrix.

gVar sparseBanded ( int  rowCount,
int  columnCount,
float **  values,
int *  positions,
int  bandCount,
gDataType  type 
)

creates a sparse matrix, with input in Coordinate (Coord) format.

Parameters:
rowCount number of rows
columnCount number of colums
values A array that contains pointers to the values of the band vectors
positions an array that contains each bands offset from the main diagonal
bandCount the number of bands
type the gDataType to be used for representation of elements.
Returns:
a gVar representing the created sparse matrix.

gVar sparseCSC ( double *  values,
int *  rows,
int *  colIndex,
int  nz,
gDataType  type 
)

creates a sparse matrix, with input in Compressed Sparse Column (CSC) format.

Parameters:
values A array that contains the non-zero entries of A.
rows Element i of the integer array rows contains the number of the row in A that contained the value in values(i).
colIndex Element j of the integer array colIndex gives the index into the values array that contains the first non-zero element in a column j of A.
nz the number of non zero elements in A.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing the created sparse matrix.

gVar sparseCSC ( float *  values,
int *  rows,
int *  colIndex,
int  nz,
gDataType  type 
)

creates a sparse matrix, with input in Compressed Sparse Column (CSC) format.

Parameters:
values A array that contains the non-zero entries of A.
rows Element i of the integer array rows contains the number of the row in A that contained the value in values(i).
colIndex Element j of the integer array colIndex gives the index into the values array that contains the first non-zero element in a column j of A.
nz the number of non zero elements in A.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing the created sparse matrix.

gVar sparseCSR ( double *  values,
int *  columns,
int *  rowIndex,
int  nz,
gDataType  type 
)

creates a sparse matrix, with input in Compressed Sparse Row (CSR) format.

Parameters:
values A array that contains the non-zero entries of A.
columns Element i of the integer array columns contains the number of the column in A that contained the value in values(i).
rowIndex Element j of the integer array rowIndex gives the index into the values array that contains the first non-zero element in a row j of A.
nz the number of non zero elements in A.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing the created sparse matrix.

gVar sparseCSR ( float *  values,
int *  columns,
int *  rowIndex,
int  nz,
gDataType  type 
)

creates a sparse matrix, with input in Compressed Sparse Row (CSR) format.

Parameters:
values A array that contains the non-zero entries of A.
columns Element i of the integer array columns contains the number of the column in A that contained the value in values(i).
rowIndex Element j of the integer array rowIndex gives the index into the values array that contains the first non-zero element in a row j of A.
nz the number of non zero elements in A.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing the created sparse matrix.

gVar sqrt ( const gVar var  ) 

computes the squared root, element by element.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar step ( float  from,
float  to,
float  stride,
gDataType  type 
)

creates a vector which elements are in a sequence

Parameters:
from the number which the sequence starts with.
to the number which the sequence ends with
stride the difference between any two elements in the sequence next to each other
type the gDataType to be used for representation of elements.
Returns:
a gVar representing a vector or scalar.
Depending on rowCount and columnCount, the returned gVarHandle can also represent a scalar.

gVar sum ( const gVar var  ) 

computes the sum of all elements in an object.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar tan ( const gVar var  ) 

performs tangent, element by element.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar transpose ( const gVar var  ) 

computes the transpose of an object.

Parameters:
var gVar operand.
Returns:
a gVar representing the resulting object.
A gVar can represent either a matrix, vector or scalar.

gVar usolve ( const gVar var1,
const gVar var2 
)

return the the solution of a upper triangular equation system.

Parameters:
var1 handle to the matrix operand.
var2 handle to the vector operand.
Returns:
the handle of the resulting object.
var1 represents a matrix. var2 a right hand side vector.

gVar zeros ( gDataType  type  ) 

creates a scalar with value 0.

Parameters:
type the gDataType to be used for representation of elements.
Returns:
a gVar representing a scalar.
The scalar value is set to 0.

gVar zeros ( int  count,
gDataType  type 
)

creates a matrix whose elements are all 0.

Parameters:
count the number of rows and columns to be created.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing a matrix or a scalar.
All elements are set to the value of 0.

Depending on rowCount and columnCount, the returned gVarHandle can also represent a scalar.

gVar zeros ( int  rowCount,
int  columnCount,
gDataType  type 
)

creates a matrix whose elements are all 0.

Parameters:
rowCount the number of rows to be created.
columnCount the number of columns to be created.
type the gDataType to be used for representation of elements.
Returns:
a gVar representing a matrix, vector or scalar.
All elements are set to the value of 0.

Depending on rowCount and columnCount, the returned gVarHandle can also represent a vector or a scalar.


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