| SPEIGS 1.0.0

Macros | Typedefs | Functions
speigs.h File Reference

Header for basic types and routine list. More...

`#include <stddef.h>`

Go to the source code of this file.

## Macros
#define | id "%d"
#define | sperr(x) printf(x);
#define | SP_EIGS_OK (0)
#define | SP_EIGS_ERR (1)
#define | MATRIX_TYPE_ZERO (0)
#define | MATRIX_TYPE_SPARSE (1)
#define | MATRIX_TYPE_GENERAL (2)
#define | MATRIX_TYPE_RANKONE (3)
#define | MATRIX_TYPE_DIAG (4)
#define | MATRIX_TYPE_TWOTWO (5)
#define | SPEIG_VER (1)

## Typedefs
typedef int32_t | spint

## Functions
spint | speigs_analyze (spint *Ap, spint *Ai, double *Ax, spint *dim, spint *iwork, spint *liwork, double *work, spint *lwork, spint *type, spint *sn, double tol, double gthresh)
| Perform the analysis phase of sparse eigen-value factorization. More...
spint | speigs_factorize (spint *Ap, spint *Ai, double *Ax, spint *dim, spint *aiwork, double *awork, spint *type, spint *sn, spint *iwork, spint *liwork, double *work, spint *lwork, double *evals, double *evecs, spint *rank, double tol)
| Perform the analysis phase of sparse eigen-value factorization. More...

## Detailed Description

Header for basic types and routine list.

Implement the eigen-decomposition algorithm from DSDP5.8 by Steve Benson.

Given a real symmetric matrix A, the routine explores special structures within and computes the full eigen-decomposition of the matrix. In the backend the routine calls Lapack dsyev (or Netlib Eispack) to decompose the pre-processed system.

This routine is also employed in HDSDP solver for SDP.

Author
  Wenzhi Gao, Shanghai University of Finance and Economics

Date
  Aug, 24th, 2022

## Function Documentation

## ◆ speigs_analyze()

spint speigs_analyze | ( | spint * | Ap,
|  | spint * | Ai,
|  | double * | Ax,
|  | spint * | dim,
|  | spint * | iwork,
|  | spint * | liwork,
|  | double * | work,
|  | spint * | lwork,
|  | spint * | type,
|  | spint * | sn,
|  | double | tol,
|  | double | gthresh
| ) |  |

Perform the analysis phase of sparse eigen-value factorization.

Parameters

  [in] | Ap | CSC format column pointer
  [in] | Ai | CSC format row index
  [in] | Ax | CSC format matrix nonzero entries
  [in] | dim | Dimension of the matrix
  [out] | iwork | Integer working array for the analysis phase
  [in] | liwork | Length of "iwork" or the expected length of integer working array
  [out] | work | Double working array for the analysis phase
  [in] | lwork | Length of "lwork" or the expected length of double working array
  [out] | type | Type of the matrix
  [out] | sn | Size of the submatrix
  [in] | tol | Tolerance to classify if a matrix is rank-one by
  [in] | gthresh | Threshold of (submatrix size / dim) classifying a matrix as general or sparse

Returns
  retcode Status of the analysis phase

Perform the analysis phase of the sparse eigen-value factorization.

If all the necessary memories are allocated, on exit, "work" and "iwork" are filled by the intermediate information which can be used in the factorization phase; "type" is filled by one of the five types; "sn" is filled by size of the submatrix.

If "dim" is supplied and the rest of the working array is incomplete, "lwork" and "work" will be respectively filled by the expected length of the double and integer working arrays

## ◆ speigs_factorize()

spint speigs_factorize | ( | spint * | Ap,
|  | spint * | Ai,
|  | double * | Ax,
|  | spint * | dim,
|  | spint * | aiwork,
|  | double * | awork,
|  | spint * | type,
|  | spint * | sn,
|  | spint * | iwork,
|  | spint * | liwork,
|  | double * | work,
|  | spint * | lwork,
|  | double * | evals,
|  | double * | evecs,
|  | spint * | rank,
|  | double | tol
| ) |  |

Perform the analysis phase of sparse eigen-value factorization.

Parameters

  [in] | Ap | CSC format column pointer
  [in] | Ai | CSC format row index
  [in] | Ax | CSC format matrix nonzero entries
  [in] | dim | Dimension of the matrix
  [in] | aiwork | Integer working array from the analysis phase
  [in] | awork | Double working array from the analysis phase
  [in] | type | "type" from the analysis phase
  [in] | sn | "sn" from the analysis phase
  [in] | iwork | Integer working array for the factorization phase
  [in] | liwork | Length of "iwork" or the expected length of integer working array
  [in] | work | Double working array for the factorization phase
  [in] | lwork | Length of "lwork" or the expected length of double working array
  [out] | evals | Eigen-values after factorization
  [out] | evecs | Eigen-vectors after factorization
  [out] | rank | Rank of the factorized matrix
  [in] | tol | Tolerance to tell if an eigen-value is 0

Returns
  retcode Status of the factorization phase

Perform the analysis phase of the sparse eigen-value factorization.

If all the necessary memories are allocated, on exit, "work" and "iwork" are filled by the intermediate information which can be used in the factorization phase; "type" is filled by one of the five types; "sn" is filled by size of the submatrix.

If "dim" is supplied and the rest of the working array is incomplete, "lwork" and "work" will be respectively filled by the expected length of the double and integer working arrays