# dss_define_structure

Communicates locations of non-zero elements in the matrix to the solver.

## Syntax

dss_define_structure(handle, opt, rowIndex, nRows, nCols, columns, nNonZeros);

## Description

The routine dss_define_structure communicates the locations of the nNonZeros number of non-zero elements in a matrix of nRows by nCols size to the solver.

Note that currently the Intel MKL DSS software operates only on square matrices, so nRows must be equal to nCols.

To communicate the locations of non-zeros in the matrix, do the following:

1. Define the general non-zero structure of the matrix by specifying one of the following values for the options argument opt:

   - MKL_DSS_SYMMETRIC_STRUCTURE

   - MKL_DSS_SYMMETRIC

   - MKL_DSS_NON_SYMMETRIC

2. Provide the actual locations of the non-zeros by means of the arrays rowIndex and columns (see Sparse Matrix Storage Format).

## Input Parameters

opt

  INTEGER. Options passing argument. The default option for the matrix structure is MKL_DSS_SYMMETRIC.

rowIndex

  INTEGER. Array of size `min(nRows, nCols)+1`. Defines the location of non-zero entries in the matrix.

nRows

  INTEGER. Number of rows in the matrix.

nCols

  INTEGER. Number of columns in the matrix.

columns

  INTEGER. Array of size nNonZeros. Defines the location of non-zero entries in the matrix.

nNonZeros

  INTEGER. Number of non-zero elements in the matrix.

### Warning

Pointers to the rowIndex and columns are stored in the handle. These arrays are used when the solver runs. Do not free or delete them before calling dss_solve_real or dss_solver_complex.

## Output Parameters

handle

  Data object of the MKL_DSS_HANDLE type (see Interface Description).

## Return Values

MKL_DSS_SUCCESS

MKL_DSS_STATE_ERR

MKL_DSS_INVALID_OPTION

MKL_DSS_COL_ERR

MKL_DSS_NOT_SQUARE

MKL_DSS_TOO_FEW_VALUES

MKL_DSS_TOO_MANY_VALUES

Parent topic: Direct Sparse Solver (DSS) Interface Routines