49 #include "blockmemshell/memory.h"
50 #include "scip/type_retcode.h"
56 #define SDPA_VERSION 738
59 #define BMS_CALL(x) do \
63 SCIPerrorMessage("No memory in function call\n"); \
64 return SCIP_NOMEMORY; \
70 #define SCIP_RealTOINT(x) ((LAPACKINTTYPE) (x + 0.5))
81 char* JOBZ,
char* RANGE,
char* UPLO,
83 SCIP_Real* VL, SCIP_Real* VU,
85 SCIP_Real* ABSTOL,
LAPACKINTTYPE* M, SCIP_Real* W, SCIP_Real* Z,
110 SCIP_Bool geteigenvectors,
114 SCIP_Real* eigenvalue,
115 SCIP_Real* eigenvector
119 #if ( SDPA_VERSION == 740 )
144 assert( bufmem != NULL );
147 assert( 0 < i && i <= n );
148 assert( eigenvalue != NULL );
149 assert( ( ! geteigenvectors) || eigenvector != NULL );
152 JOBZ = geteigenvectors ?
'V' :
'N';
167 F77_FUNC(dsyevr, DSYEVR)( &JOBZ, &RANGE, &UPLO,
171 &ABSTOL, &M, NULL, NULL,
173 &LWORK, &WISIZE, &LIWORK,
178 SCIPerrorMessage(
"There was an error when calling DSYEVR. INFO = %d\n", INFO);
186 BMS_CALL( BMSallocBufferMemoryArray(bufmem, &WORK, (
int) LWORK) );
187 BMS_CALL( BMSallocBufferMemoryArray(bufmem, &IWORK, (
int) LIWORK) );
188 BMS_CALL( BMSallocBufferMemoryArray(bufmem, &WTMP, (
int) N) );
189 BMS_CALL( BMSallocBufferMemoryArray(bufmem, &ISUPPZ, 2) );
195 F77_FUNC(dsyevr, DSYEVR)( &JOBZ, &RANGE, &UPLO,
199 &ABSTOL, &M, WTMP, eigenvector,
201 &LWORK, IWORK, &LIWORK,
206 SCIPerrorMessage(
"There was an error when calling DSYEVR. INFO = %d\n", INFO);
211 *eigenvalue = WTMP[0];
214 BMSfreeBufferMemoryArray(bufmem, &ISUPPZ);
215 BMSfreeBufferMemoryArray(bufmem, &WTMP);
216 BMSfreeBufferMemoryArray(bufmem, &IWORK);
217 BMSfreeBufferMemoryArray(bufmem, &WORK);
255 F77_FUNC(dgemv, DGEMV)(&TRANS, &M, &N, &ALPHA, A, &LDA, X, &INCX, &BETA, Y, &INCY);
long long int LAPACKINTTYPE
EXTERN SCIP_RETCODE SCIPlapackComputeIthEigenvalue(BMS_BUFMEM *bufmem, SCIP_Bool geteigenvectors, int n, SCIP_Real *A, int i, SCIP_Real *eigenvalue, SCIP_Real *eigenvector)
Macros for calling Fortran-functions.
SCIP_RETCODE SCIPlapackMatrixVectorMult(int nrows, int ncols, SCIP_Real *matrix, SCIP_Real *vector, SCIP_Real *result)
#define SCIP_RealTOINT(x)
#define F77_FUNC(name, NAME)
interface methods for eigenvector computation and matrix multiplication using different versions of L...