Introduction

Purpose

Given matrices $A$ and (diagonal) $D$, build the "Schur complement" $S=A D A^T$ in sparse co-ordinate (and optionally sparse column) format(s). Full advantage is taken of any zero coefficients in the matrix $A$.

Currently, only the control and inform parameters are exposed; these are provided and used by other GALAHAD packages with C interfaces.

Authors

N. I. M. Gould, STFC-Rutherford Appleton Laboratory, England.

C interface, additionally J. Fowkes, STFC-Rutherford Appleton Laboratory.

Julia interface, additionally A. Montoison and D. Orban, Polytechnique Montréal.

Originally released

October 2013, C interface January 2022.

Call order

To solve a given problem, functions from the bsc package must be called in the following order:

  • bsc_initialize - provide default control parameters and set up initial data structures
  • bsc_read_specfile (optional) - override control values by reading replacement values from a file
  • bsc_import - set up matrix data structures for $A$.
  • bsc_reset_control (optional) - possibly change control parameters if a sequence of problems are being solved
  • bsc_form - form the Schur complement $S$
  • bsc_information (optional) - recover information about

the process

  • bsc_terminate - deallocate data structures

main_topics Further topics

Unsymmetric matrix storage formats

An unsymmetric $m$ by $n$ matrix $A$ may be presented and stored in a variety of convenient input formats.

Both C-style (0 based)and fortran-style (1-based) indexing is allowed. Choose control.f_indexing as false for C style and true for fortran style; the discussion below presumes C style, but add 1 to indices for the corresponding fortran version.

Wrappers will automatically convert between 0-based (C) and 1-based (fortran) array indexing, so may be used transparently from C. This conversion involves both time and memory overheads that may be avoided by supplying data that is already stored using 1-based indexing.

Dense storage format

The matrix $A$ is stored as a compactdense matrix by rows, that is, the values of the entries of each row in turn are stored in order within an appropriate real one-dimensional array. In this case, component $n \ast i + j$of the storage array Aval will hold the value A{ij}$ for $0 \leq i \leq m-1$, $0 \leq j \leq n-1$.

Dense by columns storage format

The matrix $A$ is stored as a compactdense matrix by columns, that is, the values of the entries of each column in turn are stored in order within an appropriate real one-dimensional array. In this case, component $m \ast j + i$of the storage array Aval will hold the value A{ij}$ for $0 \leq i \leq m-1$, $0 \leq j \leq n-1$.

Sparse co-ordinate storage format

Only the nonzero entries of the matrices are stored. For the $l$-th entry, $0 \leq l \leq ne-1$, of $A$, its row index i, column index j and value $A_{ij}$, $0 \leq i \leq m-1$,$0 \leq j \leq n-1$,are stored as the $l$-th components of the integer arrays Arow and Acol and real array Aval, respectively, while the number of nonzeros is recorded as Ane = $ne$.

Sparse row-wise storage format

Again only the nonzero entries are stored, but this time they are ordered so that those in row i appear directly before those in row i+1. For the i-th row of $A$ the i-th component of the integer array Aptr holds the position of the first entry in this row, while Aptr(m) holds the total number of entries plus one. The column indices j, $0 \leq j \leq n-1$, and values $A_{ij}$ of thenonzero entries in the i-th row are stored in components l = Aptr(i), $\ldots$, Aptr(i+1)-1,$0 \leq i \leq m-1$, of the integer array Acol, and real array Aval, respectively. For sparse matrices, this scheme almost always requires less storage than its predecessor.

unsymmetric_matrixcolumnwise Sparse column-wise storage format

Once again only the nonzero entries are stored, but this time they are ordered so that those in column j appear directly before those in column j+1. For the j-th column of $A$ the j-th component of the integer array Aptr holds the position of the first entry in this column, while Aptr(n) holds the total number of entries plus one. The row indices i, $0 \leq i \leq m-1$, and values $A_{ij}$ of thenonzero entries in the j-th columnsare stored in components l = Aptr(j), $\ldots$, Aptr(j+1)-1, $0 \leq j \leq n-1$, of the integer array Arow, and real array Aval, respectively. As before, for sparse matrices, this scheme almost always requires less storage than the co-ordinate format.