GALAHAD gls package#

purpose#

The gls package solves sparse unsymmetric systems of linear equations using a variant of Gaussian elimination. Given a sparse symmetric matrix \(A = \{ a_{ij} \}_{m \times n}\), and an \(n\)-vector \(b\), this function solves the system \(A x = b\). If instead \(b\) is an \(m\)-vector, the function may solve instead \(A^T x = b\). gls is based upon a modern fortran interface to the HSL Archive fortran 77 package MA28, which itself relies on MA33. To obtain HSL Archive packages, see

Currently only the options and info dictionaries are exposed; these are provided and used by other GALAHAD packages with Python interfaces. Extended functionality is available with the uls function.

See Section 4 of $GALAHAD/doc/gls.pdf for a brief description of the method employed and other details.

callable functions#

overview of functions provided#

// typedefs

typedef float spc_;
typedef double rpc_;
typedef int ipc_;

// structs

struct gls_ainfo_type;
struct gls_control_type;
struct gls_finfo_type;
struct gls_sinfo_type;

// global functions

void gls_initialize(void **data, struct gls_control_type* control);
void gls_read_specfile(struct gls_control_type* control, const char specfile[]);
void gls_import(struct gls_control_type* control, void **data, ipc_ *status);
void gls_reset_control(struct gls_control_type* control, void **data, ipc_ *status);

void gls_information(
    void **data,
    struct gls_ainfo_type* ainfo,
    struct gls_finfo_type* finfo,
    struct gls_sinfo_type* sinfo,
    ipc_ *status
);

void gls_finalize(void **data, struct gls_contro_typel* control, ipc_ *status);

typedefs#

typedef float spc_

spc_ is real single precision

typedef double rpc_

rpc_ is the real working precision used, but may be changed to float by defining the preprocessor variable REAL_32 or (if supported) to __real128 using the variable REAL_128.

typedef int ipc_

ipc_ is the default integer word length used, but may be changed to int64_t by defining the preprocessor variable INTEGER_64.

function calls#

void gls_initialize(void **data, struct gls_control_type* control)

Set default control values and initialize private data

Parameters:

data

holds private internal data

control

is a struct containing control information (see gls_control_type)

void gls_read_specfile(struct gls_control_type* control, const char specfile[])

Read the content of a specification file, and assign values associated with given keywords to the corresponding control parameters. An in-depth discussion of specification files is available, and a detailed list of keywords with associated default values is provided in $GALAHAD/src/gls/GLS.template. See also Table 2.1 in the Fortran documentation provided in $GALAHAD/doc/gls.pdf for a list of how these keywords relate to the components of the control structure.

Parameters:

control

is a struct containing control information (see gls_control_type)

specfile

is a character string containing the name of the specification file

void gls_import(struct gls_control_type* control, void **data, ipc_ *status)

Import problem data into internal storage prior to solution.

Parameters:

control

is a struct whose members provide control paramters for the remaining prcedures (see gls_control_type)

data

holds private internal data

status

is a scalar variable of type ipc_, that gives the exit status from the package. Possible values are:

  • 1

    The import was successful, and the package is ready for the solve phase

  • -1

    An allocation error occurred. A message indicating the offending array is written on unit control.error, and the returned allocation status and a string containing the name of the offending array are held in inform.alloc_status and inform.bad_alloc respectively.

  • -2

    A deallocation error occurred. A message indicating the offending array is written on unit control.error and the returned allocation status and a string containing the name of the offending array are held in inform.alloc_status and inform.bad_alloc respectively.

  • -3

    The restriction n > 0 or requirement that type contains its relevant string ‘dense’, ‘coordinate’, ‘sparse_by_rows’, ‘diagonal’ or ‘absent’ has been violated.

void gls_reset_control(struct gls_control_type* control, void **data, ipc_ *status)

Reset control parameters after import if required.

Parameters:

control

is a struct whose members provide control paramters for the remaining prcedures (see gls_control_type)

data

holds private internal data

status

is a scalar variable of type ipc_, that gives the exit status from the package. Possible values are:

  • 1 The import was successful, and the package is

    ready for the solve phase

void gls_information(
    void **data,
    struct gls_ainfo_type* ainfo,
    struct gls_finfo_type* finfo,
    struct gls_sinfo_type* sinfo,
    ipc_ *status
)

Provides output information

Parameters:

data

holds private internal data

ainfo

is a struct containing analysis output information (see gls_ainfo_type)

finfo

is a struct containing factorization output information (see gls_finfo_type)

sinfo

is a struct containing solver output information (see gls_sinfo_type)

status

is a scalar variable of type ipc_, that gives the exit status from the package. Possible values are (currently):

    1. The values were recorded successfully

void gls_finalize(void **data, struct gls_control_type* control, ipc_ *status)

Deallocate all internal private storage

Parameters:

data

holds private internal data

control

is a struct containing control information (see gls_control_type)

status

is a scalar variable of type ipc_, that gives the exit status from the package. Possible values are (currently):

  • 0

    The values were recorded successfully

available structures#