HPGCC3 Documentation 3.0 R003

Real array functions

Functions

SAT_OBJECT sat3_createrarray (SAT_OBJECT where, int rows, int cols)
 Create a real array object with the given dimensions.
void sat3_rarrayput_dbl (SAT_OBJECT array, int row, int col, double value)
 Set the element of an array to the given value (as a double).
void sat3_rarrayput_xreal (SAT_OBJECT array, int row, int col, XREAL *value)
 Set the element of an array to the given value (XREAL).
void sat3_rarrayput_int (SAT_OBJECT array, int row, int col, int value)
 Set the element of an array to the given value (int).
void sat3_rarrayput_llong (SAT_OBJECT array, int row, int col, LONGLONG value)
 Set the element of an array to the given value (long long).
void sat3_rarrayput_decn (SAT_OBJECT array, int row, int col, decNumber *value)
 Set the element of an array to the given value (as a decNumber).
double sat3_rarrayget_dbl (SAT_OBJECT array, int row, int col)
 Get the element of an array as a double.
BOOL sat3_rarrayget_xreal (SAT_OBJECT array, int row, int col, XREAL *result)
 Get the element of an array as a XREAL.
int sat3_rarrayget_int (SAT_OBJECT array, int row, int col)
 Get the element of an array as an (int).
LONGLONG sat3_rarrayget_llong (SAT_OBJECT array, int row, int col)
 Get the element of an array as an (long long).
BOOL sat3_rarrayget_decn (SAT_OBJECT array, int row, int col, decNumber *result)
 Get the element of an array as a variable precision decNumber.
BOOL sat3_rarraysize (SAT_OBJECT array, int *rowptr, int *colptr)
 Get the size of a real array object.

Detailed Description

This group includes all functions used to create/convert/manipulate real arrays.


Function Documentation

SAT_OBJECT sat3_createrarray ( SAT_OBJECT  where,
int  rows,
int  cols 
)

Create a real array object with the given dimensions.

Creates a new real array of the given dimensions. To create 1-dimensional vectors set one of the dimensions to zero. If one of the dimensions is one, it creates a 2-dimensional array with one row or one column, instead of a vector. Initially, the array is filled with zeroes.

Parameters:
whereDefines where to allocate memory from. Can be one of the following constants: ALLOC_HEAP Allocates from the C-heap using malloc() ALLOC_TEMPOB Allocates memory from the TEMPOB calculator area or... it can be an element (SAT_OBJECT) within a composite object, (array, list or any other).
rowsNumber of rows, use zero to create a one-dimensional vector.
colsNumber of columns, use zero to create a one-dimensional vector.
Returns:
SAT_OBJECT with the new array object, or zero if it fails. When a SAT_OBJECT is given to the 'where' parameter, the same SAT_OBJECT is returned or 0 if error.
See also:
Object creation and manipulation
double sat3_rarrayget_dbl ( SAT_OBJECT  array,
int  row,
int  col 
)

Get the element of an array as a double.

Get the element at the given row and column. Array coordinates are zero-based, the uppermost element is (0,0). One-dimensional vectors can be treated as either column-vectors or row-vectors. Simply set the row or column coordinate to zero.

Parameters:
arrayA real array object.
rowRow coordinate of the element,zero-based.
colColumn coordinate, zero-based.
Returns:
(double) with the requested value, zero if coordinates fall outside the array
See also:
sat3_rarrayget_xreal sat3_rarrayget_decn sat3_rarrayget_llong sat3_rarrayget_int
BOOL sat3_rarrayget_decn ( SAT_OBJECT  array,
int  row,
int  col,
decNumber result 
)

Get the element of an array as a variable precision decNumber.

Get the element at the given row and column. Array coordinates are zero-based, the uppermost element is (0,0). One-dimensional vectors can be treated as either column-vectors or row-vectors. Simply set the row or column coordinate to zero.

Parameters:
arrayA real array object.
rowRow coordinate of the element,zero-based.
colColumn coordinate, zero-based.
resultPointer to a previously allocated decNumber that will receive the value. The number should have been allocated for at least for 12 digits precision minimum.
Returns:
On return, *result contains the value, or zero if coordinates fall outside the array. The function returns FALSE if coordinates fall outside of array or the array is invalid. Otherwise returns TRUE.
See also:
sat3_rarrayget_dbl sat3_rarrayget_xreal sat3_rarrayget_llong sat3_rarrayget_int
int sat3_rarrayget_int ( SAT_OBJECT  array,
int  row,
int  col 
)

Get the element of an array as an (int).

Get the element at the given row and column. Array coordinates are zero-based, the uppermost element is (0,0). One-dimensional vectors can be treated as either column-vectors or row-vectors. Simply set the row or column coordinate to zero.

Parameters:
arrayA real array object.
rowRow coordinate of the element,zero-based.
colColumn coordinate, zero-based.
Returns:
(int) with the requested value, zero if coordinates fall outside the array. Non-integer values are truncated towards zero.
See also:
sat3_rarrayget_xreal sat3_rarrayget_decn sat3_rarrayget_llong sat3_rarrayget_dbl
LONGLONG sat3_rarrayget_llong ( SAT_OBJECT  array,
int  row,
int  col 
)

Get the element of an array as an (long long).

Get the element at the given row and column. Array coordinates are zero-based, the uppermost element is (0,0). One-dimensional vectors can be treated as either column-vectors or row-vectors. Simply set the row or column coordinate to zero.

Parameters:
arrayA real array object.
rowRow coordinate of the element,zero-based.
colColumn coordinate, zero-based.
Returns:
(long long) with the requested value, zero if coordinates fall outside the array. Non-integer values are truncated towards zero.
See also:
sat3_rarrayget_xreal sat3_rarrayget_decn sat3_rarrayget_dbl sat3_rarrayget_int
BOOL sat3_rarrayget_xreal ( SAT_OBJECT  array,
int  row,
int  col,
XREAL result 
)

Get the element of an array as a XREAL.

Get the element at the given row and column. Array coordinates are zero-based, the uppermost element is (0,0). One-dimensional vectors can be treated as either column-vectors or row-vectors. Simply set the row or column coordinate to zero.

Parameters:
arrayA real array object.
rowRow coordinate of the element,zero-based.
colColumn coordinate, zero-based.
resultPointer to a previously allocated XREAL that will receive the value.
Returns:
On return, *result contains the value, or zero if coordinates fall outside the array. The function returns FALSE if coordinates fall outside of array or the array is invalid. Otherwise returns TRUE.
See also:
sat3_rarrayget_dbl sat3_rarrayget_decn sat3_rarrayget_llong sat3_rarrayget_int
void sat3_rarrayput_dbl ( SAT_OBJECT  array,
int  row,
int  col,
double  value 
)

Set the element of an array to the given value (as a double).

Set the element at the given row and column to the specified value. Array coordinates are zero-based, the uppermost element is (0,0). One-dimensional vectors can be treated as either column-vectors or row-vectors. Simply set the row or column coordinate to zero.

Parameters:
arrayA real array object.
rowRow coordinate of the element,zero-based.
colColumn coordinate, zero-based.
valueReal value to store.
See also:
sat3_rarrayput_xreal sat3_rarrayput_int sat3_rarrayput_llong sat3_rarrayput_decn
void sat3_rarrayput_decn ( SAT_OBJECT  array,
int  row,
int  col,
decNumber value 
)

Set the element of an array to the given value (as a decNumber).

Set the element at the given row and column to the specified value. Array coordinates are zero-based, the uppermost element is (0,0). One-dimensional vectors can be treated as either column-vectors or row-vectors. Simply set the row or column coordinate to zero.

Parameters:
arrayA real array object.
rowRow coordinate of the element,zero-based.
colColumn coordinate, zero-based.
valueReal value to store (pointer to a decNumber).
See also:
sat3_rarrayput_xreal sat3_rarrayput_dbl sat3_rarrayput_llong sat3_rarrayput_int
void sat3_rarrayput_int ( SAT_OBJECT  array,
int  row,
int  col,
int  value 
)

Set the element of an array to the given value (int).

Set the element at the given row and column to the specified value. Array coordinates are zero-based, the uppermost element is (0,0). One-dimensional vectors can be treated as either column-vectors or row-vectors. Simply set the row or column coordinate to zero.

Parameters:
arrayA real array object.
rowRow coordinate of the element,zero-based.
colColumn coordinate, zero-based.
valueInteger value to store.
See also:
sat3_rarrayput_xreal sat3_rarrayput_dbl sat3_rarrayput_llong sat3_rarrayput_decn
void sat3_rarrayput_llong ( SAT_OBJECT  array,
int  row,
int  col,
LONGLONG  value 
)

Set the element of an array to the given value (long long).

Set the element at the given row and column to the specified value. Array coordinates are zero-based, the uppermost element is (0,0). One-dimensional vectors can be treated as either column-vectors or row-vectors. Simply set the row or column coordinate to zero.

Parameters:
arrayA real array object.
rowRow coordinate of the element,zero-based.
colColumn coordinate, zero-based.
valueInteger value to store.
See also:
sat3_rarrayput_xreal sat3_rarrayput_dbl sat3_rarrayput_int sat3_rarrayput_decn
void sat3_rarrayput_xreal ( SAT_OBJECT  array,
int  row,
int  col,
XREAL value 
)

Set the element of an array to the given value (XREAL).

Set the element at the given row and column to the specified value. Array coordinates are zero-based, the uppermost element is (0,0). One-dimensional vectors can be treated as either column-vectors or row-vectors. Simply set the row or column coordinate to zero.

Parameters:
arrayA real array object.
rowRow coordinate of the element,zero-based.
colColumn coordinate, zero-based.
valueReal value to store (pointer to a XREAL).
See also:
sat3_rarrayput_dbl sat3_rarrayput_int sat3_rarrayput_llong sat3_rarrayput_decn
BOOL sat3_rarraysize ( SAT_OBJECT  array,
int *  rowptr,
int *  colptr 
)

Get the size of a real array object.

Obtain the number of rows and columns in an array object. A one-dimensional array will return 0 columns (one-dimensional arrays are treated as column vectors). A two-dimensional array with a single column will return 1 column.

Parameters:
arrayAn array object.
rowptrA pointer to an integer variable that will receive the number of rows.
colptrA pointer to an integer variable that will receive the number of columns.
Returns:
TRUE on a valid real array object. When TRUE, *rowptr and *colptr contain a valid number of rows and columns respectively. It returns FALSE otherwise.
See also:
sat3_rarrayget_dbl sat3_rarrayget_decn sat3_rarrayget_llong sat3_rarrayget_xreal sat3_rarrayget_int