|
NAG[f11zbc] NAG[nag_sparse_sym_sort] - Sparse sort (symmetric)
|
|
Calling Sequence
f11zbc(n, nnz, a, irow, icol, dup, zero, istr, 'fail'=fail)
nag_sparse_sym_sort(. . .)
Parameters
|
n - integer;
|
|
|
On entry: the order of the matrix .
|
|
Constraint: . .
|
|
|
nnz - assignable;
|
|
|
Note: On exit the variable nnz will have a value of type integer.
|
|
On entry: the number of non-zero elements in the lower triangular part of the matrix .
|
|
Constraint: . .
|
|
On exit: the number of lower triangular non-zero elements with unique row and column indices.
|
|
|
a - Vector(1.. , datatype=float[8]);
|
|
|
Note: the dimension, dim, of the array a must be at least .
|
|
On entry: the non-zero elements of the lower triangular part of the matrix . These may be in any order and there may be multiple non-zero elements with the same row and column indices.
|
|
On exit: the lower triangular non-zero elements ordered by increasing row index, and by increasing column index within each row. Each non-zero element has a unique row and column index.
|
|
|
irow - Vector(1.. , datatype=integer[kernelopts('wordsize')/8]);
|
|
|
Note: the dimension, dim, of the array irow must be at least .
|
|
On entry: the row indices of the elements supplied in array a.
|
|
Constraint: , for . .
|
|
On exit: the first nnz elements contain the row indices corresponding to the elements returned in array a.
|
|
|
icol - Vector(1.. , datatype=integer[kernelopts('wordsize')/8]);
|
|
|
Note: the dimension, dim, of the array icol must be at least .
|
|
On entry: the column indices of the elements supplied in array a
|
|
Constraint: , for . .
|
|
On exit: the first nnz elements contain the column indices corresponding to the elements returned in array a.
|
|
|
dup - String;
|
|
|
On entry: indicates how any non-zero elements with duplicate row and column indices are to be treated:
|
|
if then duplicate elements are removed;
|
|
if then duplicate elements are summed.
|
|
Constraint: "Nag_SparseSym_RemoveDups" or "Nag_SparseSym_SumDups". .
|
|
|
zero - String;
|
|
|
On entry: indicates how any elements with zero values in a are to be treated:
|
|
if then elements with zero value are removed;
|
|
if then elements with zero value are kept.
|
|
Constraint: "Nag_SparseSym_RemoveZeros" or "Nag_SparseSym_KeepZeros". .
|
|
|
istr - Vector(1.. , datatype=integer[kernelopts('wordsize')/8]);
|
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_sparse_sym_sort (f11zbc) sorts the non-zero elements of a real sparse symmetric matrix, represented in symmetric coordinate storage format.
|
|
Description
|
|
nag_sparse_sym_sort (f11zbc) takes a symmetric coordinate storage (SCS) representation (see the f11 Chapter Introduction) of a real by sparse symmetric matrix , and reorders the non-zero elements by increasing row index and increasing column index within each row. Entries with duplicate row and column indices may be removed, or the values may be summed. Any entries with zero values may optionally be removed.
nag_sparse_sym_sort (f11zbc) also returns istr which contains the starting indices of each row in .
|
|
Error Indicators and Warnings
|
|
"NE_ALLOC_FAIL"
Dynamic memory allocation failed.
"NE_BAD_PARAM"
On entry, argument dup had an illegal value.
"NE_INT_ARG_LT"
On entry, n must not be less than 1: .
"NE_SYMM_MATRIX"
A non-zero element has been supplied which does not lie in the lower triangular part of the matrix , i.e., one or more of the following constraints has been violated: , , for .
|
|
Further Comments
|
|
The time taken for a call to nag_sparse_sym_sort (f11zbc) is proportional to nnz. Note that the resulting matrix may have either rows or columns with no entries. If row has no entries then .
|
|
|
Examples
|
|
>
|
n := 4:
nnz := 9:
dup := "Nag_SparseSym_SumDups":
zero := "Nag_SparseSym_RemoveZeros":
a := Vector([1, 0, 1, 3, 4, 6, 2, 1, 1], datatype=float[8]):
irow := Vector([3, 2, 3, 4, 1, 2, 3, 3, 3], datatype=integer[kernelopts('wordsize')/8]):
icol := Vector([2, 1, 2, 4, 1, 2, 3, 2, 2], datatype=integer[kernelopts('wordsize')/8]):
istr := Vector(5, datatype=integer[kernelopts('wordsize')/8]):
NAG:-f11zbc(n, nnz, a, irow, icol, dup, zero, istr):
|
|
|