Scippy

SCIP

Solving Constraint Integer Programs

nlpi_ipopt.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2021 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scipopt.org. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file nlpi_ipopt.h
17  * @brief Ipopt NLP interface
18  * @ingroup NLPIS
19  * @author Stefan Vigerske
20  * @author Benjamin Müller
21  */
22 
23 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
24 
25 #ifndef __SCIP_NLPI_IPOPT_H__
26 #define __SCIP_NLPI_IPOPT_H__
27 
28 #include "nlpi/type_nlpi.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 /**@addtogroup NLPIS
35  *
36  * @{
37  */
38 
39 /** create solver interface for Ipopt solver
40  * sets *nlpi to NULL if Ipopt is not available
41  */
44  BMS_BLKMEM* blkmem, /**< block memory data structure */
45  SCIP_NLPI** nlpi /**< pointer to buffer for nlpi address */
46  );
47 
48 /** gets string that identifies Ipopt (version number) */
50 const char* SCIPgetSolverNameIpopt(void);
51 
52 /** gets string that describes Ipopt */
54 const char* SCIPgetSolverDescIpopt(void);
55 
56 /** returns whether Ipopt is available, i.e., whether it has been linked in */
59 
60 /** gives a pointer to the IpoptApplication object stored in Ipopt-NLPI's NLPI problem data structure */
63  SCIP_NLPIPROBLEM* nlpiproblem /**< NLP problem of Ipopt-NLPI */
64  );
65 
66 /** gives a pointer to the NLPIORACLE object stored in Ipopt-NLPI's NLPI problem data structure */
69  SCIP_NLPIPROBLEM* nlpiproblem /**< NLP problem of Ipopt-NLPI */
70  );
71 
72 /** sets modified default settings that are used when setting up an Ipopt problem
73  *
74  * Do not forget to add a newline after the last option in optionsstring.
75  */
78  SCIP_NLPI* nlpi, /**< Ipopt NLP interface */
79  const char* optionsstring, /**< string with options as in Ipopt options file */
80  SCIP_Bool append /**< whether to append to modified default settings or to overwrite */
81  );
82 
83 /** Calls Lapacks Dsyev routine to compute eigenvalues and eigenvectors of a dense matrix.
84  * It's here, because Ipopt is linked against Lapack.
85  */
88  SCIP_Bool computeeigenvectors,/**< should also eigenvectors should be computed ? */
89  int N, /**< dimension */
90  SCIP_Real* a, /**< matrix data on input (size N*N); eigenvectors on output if computeeigenvectors == TRUE */
91  SCIP_Real* w /**< buffer to store eigenvalues (size N) */
92  );
93 
94 /** solves a linear problem of the form Ax = b for a regular matrix A
95  *
96  * Calls Lapacks IpLapackDgetrf routine to calculate a LU factorization and uses this factorization to solve
97  * the linear problem Ax = b.
98  * It's here, because Ipopt is linked against Lapack.
99  */
102  int N, /**< dimension */
103  SCIP_Real* A, /**< matrix data on input (size N*N); filled column-wise */
104  SCIP_Real* b, /**< right hand side vector (size N) */
105  SCIP_Real* x, /**< buffer to store solution (size N) */
106  SCIP_Bool* success /**< pointer to store if the solving routine was successful */
107  );
108 
109 /** @} */
110 
111 #ifdef __cplusplus
112 }
113 #endif
114 
115 #endif /* __SCIP_NLPI_IPOPT_H__ */
SCIP_EXPORT void * SCIPgetNlpiOracleIpopt(SCIP_NLPIPROBLEM *nlpiproblem)
#define SCIP_EXPORT
Definition: def.h:100
SCIP_EXPORT void SCIPsetModifiedDefaultSettingsIpopt(SCIP_NLPI *nlpi, const char *optionsstring, SCIP_Bool append)
SCIP_EXPORT SCIP_Bool SCIPisIpoptAvailableIpopt(void)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
SCIP_EXPORT void * SCIPgetIpoptApplicationPointerIpopt(SCIP_NLPIPROBLEM *nlpiproblem)
SCIP_VAR ** x
Definition: circlepacking.c:54
SCIP_VAR * w
Definition: circlepacking.c:58
SCIP_EXPORT SCIP_RETCODE LapackDsyev(SCIP_Bool computeeigenvectors, int N, SCIP_Real *a, SCIP_Real *w)
SCIP_EXPORT const char * SCIPgetSolverDescIpopt(void)
SCIP_EXPORT const char * SCIPgetSolverNameIpopt(void)
#define SCIP_Bool
Definition: def.h:70
SCIP_VAR ** b
Definition: circlepacking.c:56
SCIP_EXPORT SCIP_RETCODE SCIPsolveLinearProb(int N, SCIP_Real *A, SCIP_Real *b, SCIP_Real *x, SCIP_Bool *success)
SCIP_VAR * a
Definition: circlepacking.c:57
#define SCIP_Real
Definition: def.h:163
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:429
SCIP_EXPORT SCIP_RETCODE SCIPcreateNlpSolverIpopt(BMS_BLKMEM *blkmem, SCIP_NLPI **nlpi)
type definitions for specific NLP solver interfaces