STARS-H
Software for Testing Accuracy, Reliability and Scalability of Hierarchical computations
Problem

Routines for STARSH_problem. More...

Data Structures

struct  starsh_problem
 Matrix/tensor in matrix/tensor-free form. More...
 

Typedefs

typedef struct starsh_problem STARSH_problem
 

Functions

int starsh_problem_new (STARSH_problem **problem, int ndim, STARSH_int *shape, char symm, char dtype, void *row_data, void *col_data, STARSH_kernel *kernel, char *name)
 Init STARSH_problem object. More...
 
void starsh_problem_free (STARSH_problem *problem)
 
void starsh_problem_info (STARSH_problem *problem)
 
int starsh_problem_get_block (STARSH_problem *problem, int nrows, int ncols, STARSH_int *irow, STARSH_int *icol, Array **A)
 Get submatrix on given rows and columns. More...
 
int starsh_problem_from_array (STARSH_problem **problem, Array *A, char symm)
 Create STARSH_problem instance, based on dense array. More...
 
int starsh_problem_to_array (STARSH_problem *problem, Array **A)
 Generate dense array by a given problem. More...
 

Detailed Description

Routines for STARSH_problem.

Typedef Documentation

◆ STARSH_problem

Typedef for problem

Function Documentation

◆ starsh_problem_free()

void starsh_problem_free ( STARSH_problem problem)

Free STARSH_problem object.

◆ starsh_problem_from_array()

int starsh_problem_from_array ( STARSH_problem **  problem,
Array A,
char  symm 
)

Create STARSH_problem instance, based on dense array.

If Array A is sorted in C order, then temporary Array object will be created as a copy of input A, but in Fortran order. There will be no way to free that temporary Array object.

Parameters
[out]problemAddress of pointer to STARSH_problem object.
[in]AArray.
[in]symm'S' if Array A is symmetric or 'N' otherwise.
Returns
Error code STARSH_ERRNO.

◆ starsh_problem_get_block()

int starsh_problem_get_block ( STARSH_problem problem,
int  nrows,
int  ncols,
STARSH_int irow,
STARSH_int icol,
Array **  A 
)

Get submatrix on given rows and columns.

Rows correspond to the first dimension and columns correspond to the last dimension.

Parameters
[in]problemPointer to STARSH_problem object.
[in]nrowsNumber of rows.
[in]ncolsNumber of columns.
[in]irowIndexes of rows.
[in]icolIndexes of columns.
[out]AAddress of pointer to Array object.
Returns
Error code STARSH_ERRNO.

◆ starsh_problem_info()

void starsh_problem_info ( STARSH_problem problem)

Print short info about STARSH_problem object.

◆ starsh_problem_new()

int starsh_problem_new ( STARSH_problem **  problem,
int  ndim,
STARSH_int shape,
char  symm,
char  dtype,
void *  row_data,
void *  col_data,
STARSH_kernel kernel,
char *  name 
)

Init STARSH_problem object.

Unlike all other *_new() functions, this function creates copy of shape to store internally. This is done to avoid clearing memory of static objects, defined like STARSH_int shape[2] = {10, 20}. Number of dimensions must be 2 or greater. If ndim = 2, then corresponding kernel is scalar. If ndim > 2, then corresponding kernel returns (ndim-2)-dimensional tensor.

Parameters
[out]problemAddress of pointer to STARSH_problem object.
[in]ndimDimensionality of corresponding array. Equal to 2 plus dimensionality of kernel.
[in]shapeShape of corresponding array. Subarray shape[1:ndim-2] is equal to shape of kernel.
[in]symm'S' for summetric problem, 'N' for nonsymmetric. Symmetric problem requires symmetric kernel and equality of row_data and col_data.
[in]dtypeData type of the problem. Equal to 's', 'd', 'c' or 'z' as in LAPACK routines.
[in]row_dataPointer to some structure of physical data for rows.
[in]col_dataPointer to some structure of physical data for columns.
[in]kernelPointer to a function of interaction.
[in]nameString, containing name of the problem.
Returns
Error code STARSH_ERRNO.

◆ starsh_problem_to_array()

int starsh_problem_to_array ( STARSH_problem problem,
Array **  A 
)

Generate dense array by a given problem.

Dense matrix will be created. This function makes it easier to check kernel.

Parameters
[in]problemPointer to STARSH_problem object.
[out]AAddress of pointer to Array object.
Returns
Error code STARSH_ERRNO.