1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 /* */ 3 /* This file is part of the program and library */ 4 /* SCIP --- Solving Constraint Integer Programs */ 5 /* */ 6 /* Copyright 2002-2022 Zuse Institute Berlin */ 7 /* */ 8 /* Licensed under the Apache License, Version 2.0 (the "License"); */ 9 /* you may not use this file except in compliance with the License. */ 10 /* You may obtain a copy of the License at */ 11 /* */ 12 /* http://www.apache.org/licenses/LICENSE-2.0 */ 13 /* */ 14 /* Unless required by applicable law or agreed to in writing, software */ 15 /* distributed under the License is distributed on an "AS IS" BASIS, */ 16 /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ 17 /* See the License for the specific language governing permissions and */ 18 /* limitations under the License. */ 19 /* */ 20 /* You should have received a copy of the Apache-2.0 license */ 21 /* along with SCIP; see the file LICENSE. If not visit scipopt.org. */ 22 /* */ 23 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 25 /**@file lapack_calls.h 26 * @brief interface methods for lapack functions 27 * @author Marc Pfetsch 28 */ 29 30 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/ 31 32 #ifndef __SCIP_LAPACK_CALLS_H__ 33 #define __SCIP_LAPACK_CALLS_H__ 34 35 #include "scip/def.h" 36 #include "blockmemshell/memory.h" 37 #include "scip/type_retcode.h" 38 39 #ifdef __cplusplus 40 extern "C" { 41 #endif 42 43 /** returns whether Lapack is available, i.e., whether it has been linked in */ 44 SCIP_EXPORT 45 SCIP_Bool SCIPlapackIsAvailable(void); 46 47 /** returns Lapack version if Lapack is available */ 48 SCIP_EXPORT 49 void SCIPlapackVersion( 50 int* major, /**< major version number */ 51 int* minor, /**< minor version number */ 52 int* patch /**< patch version number */ 53 ); 54 55 /** computes eigenvalues and eigenvectors of a dense symmetric matrix 56 * 57 * Calls Lapack's DSYEV function. 58 */ 59 SCIP_EXPORT 60 SCIP_RETCODE SCIPlapackComputeEigenvalues( 61 BMS_BUFMEM* bufmem, /**< buffer memory (or NULL if IPOPT is used) */ 62 SCIP_Bool geteigenvectors, /**< should also eigenvectors should be computed? */ 63 int N, /**< dimension */ 64 SCIP_Real* a, /**< matrix data on input (size N*N); eigenvectors on output if geteigenvectors == TRUE */ 65 SCIP_Real* w /**< array to store eigenvalues (size N) (or NULL) */ 66 ); 67 68 /** solves a linear problem of the form Ax = b for a regular matrix A 69 * 70 * Calls Lapack's DGETRF routine to calculate a LU factorization and uses this factorization to solve 71 * the linear problem Ax = b. 72 */ 73 SCIP_EXPORT 74 SCIP_RETCODE SCIPlapackSolveLinearEquations( 75 BMS_BUFMEM* bufmem, /**< buffer memory (or NULL if IPOPT is used) */ 76 int N, /**< dimension */ 77 SCIP_Real* A, /**< matrix data on input (size N*N); filled column-wise */ 78 SCIP_Real* b, /**< right hand side vector (size N) */ 79 SCIP_Real* x, /**< buffer to store solution (size N) */ 80 SCIP_Bool* success /**< pointer to store if the solving routine was successful */ 81 ); 82 83 #ifdef __cplusplus 84 } 85 #endif 86 87 #endif 88