02.04.2013 Views

Welcome to Adams/Solver Subroutines - Kxcad.net

Welcome to Adams/Solver Subroutines - Kxcad.net

Welcome to Adams/Solver Subroutines - Kxcad.net

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

36<br />

<strong>Adams</strong>/<strong>Solver</strong><br />

Calling Sequence<br />

GET_SPARSE_MATRIX_DATA(id, rows, cols, vals, size, ierr)<br />

Input Arguments<br />

id An integer variable that specifies the ID of the corresponding MATRIX<br />

statement.<br />

size An integer variable that specifies the size of the MATRIX.<br />

GET_SPARSE_MATRIX_DATA uses this value <strong>to</strong> compare against the<br />

MATRIX’s true size; a check for a valid call.<br />

Output Arguments<br />

rows An integer array of size size that contains the row indices corresponding <strong>to</strong> the<br />

MATRIX values s<strong>to</strong>red in vals.<br />

cols An integer array of size size that contains the column indices corresponding<br />

<strong>to</strong> the MATRIX values s<strong>to</strong>red in vals.<br />

vals A double-precision array of size size that contains the values from the<br />

MATRIX statement in sparse form.<br />

ierr An integer variable that indicates the success of the call <strong>to</strong><br />

GET_SPARSE_MATRIX_DATA:<br />

Extended Definition<br />

GET_SPARSE_MATRIX_DATA returns the values entered in a dataset MATRIX statement in sparse<br />

matrix form. It can be used with any matrix type, but may be inefficient for a large MATRIX of type full.<br />

Sparse matrix form is a compact way of s<strong>to</strong>ring matrix data when many data entries are zero; only the<br />

non-zero values are s<strong>to</strong>red. The rows and cols arrays provides the row and column matrix locations for<br />

the corresponding data in the vals array. When using GET_SPARSE_MATRIX_DATA <strong>to</strong> get data of a<br />

matrix type full, all values are returned. GET_SPARSE_MATRIX_DATA makes no attempt <strong>to</strong> reduce<br />

the size of the data by eliminating zero entries.<br />

GETCPU<br />

• ierr=0 Successful<br />

• ierr=1 Failed, no MATRIX having an identifier of ID<br />

exists in the dataset<br />

• ierr=2 Failed, the value of size’ does not match the<br />

size of the MATRIX<br />

Tip: Call GET_MATRIX_INFO <strong>to</strong> get the size and type of the MATRIX.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!