SCIP-SDP  3.2.0
Macros | Typedefs
lapack_interface.c File Reference

interface methods for eigenvector computation and matrix multiplication using openblas More...

Go to the source code of this file.

Macros

#define BMS_CALL(x)
 
#define SCIP_RealTOINT(x)   ((LAPACKINTTYPE) (x + 0.5))
 

Typedefs

typedef int LAPACKINTTYPE
 

Functions

Functions
SCIP_RETCODE SCIPlapackComputeEigenvectorDecomposition (BMS_BUFMEM *bufmem, int n, SCIP_Real *A, SCIP_Real *eigenvalues, SCIP_Real *eigenvectors)
 
SCIP_RETCODE SCIPlapackMatrixVectorMult (int nrows, int ncols, SCIP_Real *matrix, SCIP_Real *vector, SCIP_Real *result)
 
SCIP_RETCODE SCIPlapackMatrixMatrixMult (int nrowsA, int ncolsA, SCIP_Real *matrixA, SCIP_Bool transposeA, int nrowsB, int ncolsB, SCIP_Real *matrixB, SCIP_Bool transposeB, SCIP_Real *result)
 
SCIP_RETCODE SCIPlapackLinearSolve (BMS_BUFMEM *bufmem, int m, int n, SCIP_Real *A, SCIP_Real *b, SCIP_Real *x)
 

Detailed Description

interface methods for eigenvector computation and matrix multiplication using openblas

Author
Sonja Mars
Lars Schewe
Tristan Gally
Marc Pfetsch

This file is used to call the LAPACK routine DSYEVR (double-symmetric-eigenvector computation) and the BLAS routine DGEMV (double-general-matrix-vector multiplication).

If a version of openblas/lapack with 64 bit integers is used in connection with SDPA, then one should define LAPACK_LONGLONGINT. Note that one cannot detect the precision with which openblas/lapack is compiled, so this define is essential for correct functioning (resulting in a segmentation fault otherwise).

Definition in file lapack_interface.c.

Macro Definition Documentation

#define BMS_CALL (   x)
Value:
do \
{ \
if( NULL == (x) ) \
{ \
SCIPerrorMessage("No memory in function call\n"); \
return SCIP_NOMEMORY; \
} \
} \
while( FALSE )

Checks if a BMSallocMemory-call was successfull, otherwise returns SCIP_NOMEMORY

Definition at line 73 of file lapack_interface.c.

Referenced by SCIPlapackComputeEigenvectorDecomposition(), and SCIPlapackLinearSolve().

#define SCIP_RealTOINT (   x)    ((LAPACKINTTYPE) (x + 0.5))

transforms a SCIP_Real (that should be integer, but might be off by some numerical error) to an integer by adding an epsilon and rounding down

Definition at line 84 of file lapack_interface.c.

Referenced by SCIPlapackComputeEigenvectorDecomposition(), and SCIPlapackLinearSolve().

Typedef Documentation

typedef int LAPACKINTTYPE

Definition at line 68 of file lapack_interface.c.

Function Documentation

SCIP_RETCODE SCIPlapackComputeEigenvectorDecomposition ( BMS_BUFMEM *  bufmem,
int  n,
SCIP_Real *  A,
SCIP_Real *  eigenvalues,
SCIP_Real *  eigenvectors 
)

computes the eigenvector decomposition of a symmetric matrix using LAPACK

Parameters
bufmembuffer memory
nsize of matrix
Amatrix for which the decomposition should be computed
eigenvaluespointer to store eigenvalues (should be length n)
eigenvectorspointer to store eigenvectors (should be length n*n), eigenvectors are given as rows

Definition at line 250 of file lapack_interface.c.

References BMS_CALL, F77_FUNC, and SCIP_RealTOINT.

Referenced by calcRelax(), and SCIP_DECL_CONSCHECK().

SCIP_RETCODE SCIPlapackMatrixVectorMult ( int  nrows,
int  ncols,
SCIP_Real *  matrix,
SCIP_Real *  vector,
SCIP_Real *  result 
)

performs matrix-vector-multiplication using BLAS

Parameters
nrowsnumber of rows in matrix
ncolsnumber of cols in matrix
matrixthe matrix we want to multiply
vectorvector we want to multiply with the matrix
resultpointer to store the resulting vector

Definition at line 354 of file lapack_interface.c.

References F77_FUNC.

Referenced by cutUsingEigenvector().

SCIP_RETCODE SCIPlapackMatrixMatrixMult ( int  nrowsA,
int  ncolsA,
SCIP_Real *  matrixA,
SCIP_Bool  transposeA,
int  nrowsB,
int  ncolsB,
SCIP_Real *  matrixB,
SCIP_Bool  transposeB,
SCIP_Real *  result 
)

performs matrix-matrix-multiplication A*B using BLAS

Parameters
nrowsAnumber of rows in matrix A
ncolsAnumber of cols in matrix A
matrixAmatrix A given as nrowsA * ncolsA array
transposeAShould matrix A be transposed before multiplication?
nrowsBnumber of rows in matrix B
ncolsBnumber of cols in matrix B
matrixBmatrix B given as ncolsA * ncolsB array
transposeBShould matrix B be transposed before multiplication?
resultpointer to nrowsA * nrowsB array to store the resulting matrix

Definition at line 393 of file lapack_interface.c.

References F77_FUNC.

Referenced by calcRelax(), and SCIP_DECL_CONSCHECK().

SCIP_RETCODE SCIPlapackLinearSolve ( BMS_BUFMEM *  bufmem,
int  m,
int  n,
SCIP_Real *  A,
SCIP_Real *  b,
SCIP_Real *  x 
)

computes the minimum-norm solution to a real linear least squares problem: minimize 2-norm(| b - A*x |) using LAPACK (uses singular value decomposition of A). A is an M-by-N matrix which may be rank-deficient.

Parameters
bufmembuffer memory
mnumber of rows of A
nnumber of columns of A
Acoefficient matrix of the linear system
bright-hand side of the linear system (should be length max(m,n))
xpointer to store values for x (should be length n)

Definition at line 438 of file lapack_interface.c.

References BMS_CALL, F77_FUNC, and SCIP_RealTOINT.

Referenced by SCIP_DECL_CONSCHECK().