SPEIGS 1.0.0
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]ApCSC format column pointer
[in]AiCSC format row index
[in]AxCSC format matrix nonzero entries
[in]dimDimension of the matrix
[out]iworkInteger working array for the analysis phase
[in]liworkLength of "iwork" or the expected length of integer working array
[out]workDouble working array for the analysis phase
[in]lworkLength of "lwork" or the expected length of double working array
[out]typeType of the matrix
[out]snSize of the submatrix
[in]tolTolerance to classify if a matrix is rank-one by $||A - a a^T||_F \leq tol$
[in]gthreshThreshold 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]ApCSC format column pointer
[in]AiCSC format row index
[in]AxCSC format matrix nonzero entries
[in]dimDimension of the matrix
[in]aiworkInteger working array from the analysis phase
[in]aworkDouble working array from the analysis phase
[in]type"type" from the analysis phase
[in]sn"sn" from the analysis phase
[in]iworkInteger working array for the factorization phase
[in]liworkLength of "iwork" or the expected length of integer working array
[in]workDouble working array for the factorization phase
[in]lworkLength of "lwork" or the expected length of double working array
[out]evalsEigen-values after factorization
[out]evecsEigen-vectors after factorization
[out]rankRank of the factorized matrix
[in]tolTolerance 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