49 #include "blockmemshell/memory.h"
50 #include "scip/type_retcode.h"
58 #define BMS_CALL(x) do \
62 SCIPerrorMessage("No memory in function call\n"); \
63 return SCIP_NOMEMORY; \
69 #define SCIP_RealTOINT(x) ((LAPACKINTTYPE) (x + 0.5))
80 char* JOBZ,
char* RANGE,
char* UPLO,
82 SCIP_Real* VL, SCIP_Real* VU,
84 SCIP_Real* ABSTOL,
LAPACKINTTYPE* M, SCIP_Real* W, SCIP_Real* Z,
109 SCIP_Bool geteigenvectors,
113 SCIP_Real* eigenvalue,
114 SCIP_Real* eigenvector
139 assert( blkmem != NULL );
142 assert( 0 < i && i <= n );
143 assert( eigenvalue != NULL );
144 assert( ( ! geteigenvectors) || eigenvector != NULL );
147 JOBZ = geteigenvectors ?
'V' :
'N';
162 F77_FUNC(dsyevr, DSYEVR)( &JOBZ, &RANGE, &UPLO,
166 &ABSTOL, &M, NULL, NULL,
168 &LWORK, &WISIZE, &LIWORK,
173 SCIPerrorMessage(
"There was an error when calling DSYEVR. INFO = %d\n", INFO);
181 BMS_CALL( BMSallocBlockMemoryArray(blkmem, &WORK, (
int) LWORK) );
182 BMS_CALL( BMSallocBlockMemoryArray(blkmem, &IWORK, (
int) LIWORK) );
183 BMS_CALL( BMSallocBlockMemoryArray(blkmem, &WTMP, (
int) N) );
184 BMS_CALL( BMSallocBlockMemoryArray(blkmem, &ISUPPZ, 2) );
190 F77_FUNC(dsyevr, DSYEVR)( &JOBZ, &RANGE, &UPLO,
194 &ABSTOL, &M, WTMP, eigenvector,
196 &LWORK, IWORK, &LIWORK,
201 SCIPerrorMessage(
"There was an error when calling DSYEVR. INFO = %d\n", INFO);
206 *eigenvalue = WTMP[0];
209 BMSfreeBlockMemoryArray(blkmem, &ISUPPZ, 2);
210 BMSfreeBlockMemoryArray(blkmem, &WTMP, (
int) N);
211 BMSfreeBlockMemoryArray(blkmem, &IWORK, (
int) LIWORK);
212 BMSfreeBlockMemoryArray(blkmem, &WORK, (
int) LWORK);
250 F77_FUNC(dgemv, DGEMV)(&TRANS, &M, &N, &ALPHA, A, &LDA, X, &INCX, &BETA, Y, &INCY);
long long int LAPACKINTTYPE
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...
EXTERN SCIP_RETCODE SCIPlapackComputeIthEigenvalue(BMS_BLKMEM *blkmem, SCIP_Bool geteigenvectors, int n, SCIP_Real *A, int i, SCIP_Real *eigenvalue, SCIP_Real *eigenvector)