Scippy

SCIP

Solving Constraint Integer Programs

pub_nlpi.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-2022 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 pub_nlpi.h
17  * @ingroup PUBLICCOREAPI
18  * @brief public methods for NLP solver interfaces
19  * @author Thorsten Gellermann
20  * @author Stefan Vigerske
21  */
22 
23 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
24 
25 #ifndef __SCIP_PUB_NLPI_H__
26 #define __SCIP_PUB_NLPI_H__
27 
28 #include "scip/def.h"
29 #include "scip/type_nlpi.h"
30 #include "scip/type_misc.h"
31 
32 #ifdef NDEBUG
33 #include "scip/struct_nlpi.h"
34 #endif
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 /**@addtogroup PublicNLPIInterfaceMethods
41  *
42  * @{
43  */
44 
45 /** compares two NLPIs w.r.t. their priority */
46 SCIP_DECL_SORTPTRCOMP(SCIPnlpiComp);
47 
48 /** gets data of an NLPI */
49 SCIP_EXPORT
51  SCIP_NLPI* nlpi /**< NLP interface structure */
52  );
53 
54 /** gets NLP solver name */
55 SCIP_EXPORT
56 const char* SCIPnlpiGetName(
57  SCIP_NLPI* nlpi /**< NLP interface structure */
58  );
59 
60 /** gets NLP solver description */
61 SCIP_EXPORT
62 const char* SCIPnlpiGetDesc(
63  SCIP_NLPI* nlpi /**< NLP interface structure */
64  );
65 
66 /** gets NLP solver priority */
67 SCIP_EXPORT
69  SCIP_NLPI* nlpi /**< NLP interface structure */
70  );
71 
72 /**@name Statistics */
73 /**@{ */
74 
75 /** gives number of problems created for NLP solver so far */
76 SCIP_EXPORT
78  SCIP_NLPI* nlpi /**< NLP interface structure */
79  );
80 
81 /** gives total time spend in problem creation/modification/freeing */
82 SCIP_EXPORT
84  SCIP_NLPI* nlpi /**< NLP interface structure */
85  );
86 
87 /** total number of NLP solves so far */
88 SCIP_EXPORT
90  SCIP_NLPI* nlpi /**< NLP interface structure */
91  );
92 
93 /** gives total time spend in NLP solves (as reported by solver) */
94 SCIP_EXPORT
96  SCIP_NLPI* nlpi /**< NLP interface structure */
97  );
98 
99 /** gives total time spend in function evaluation during NLP solves
100  *
101  * If parameter `timing/nlpieval` is off (the default), depending on the NLP solver, this may just return 0.
102  */
103 SCIP_EXPORT
105  SCIP_NLPI* nlpi /**< NLP interface structure */
106  );
107 
108 /** gives total number of iterations spend by NLP solver so far */
109 SCIP_EXPORT
111  SCIP_NLPI* nlpi /**< NLP interface structure */
112  );
113 
114 /** gives number of times a solve ended with a specific termination status */
115 SCIP_EXPORT
117  SCIP_NLPI* nlpi, /**< NLP interface structure */
118  SCIP_NLPTERMSTAT termstatus /**< the termination status to query for */
119  );
120 
121 /** gives number of times a solve ended with a specific solution status */
122 SCIP_EXPORT
124  SCIP_NLPI* nlpi, /**< NLP interface structure */
125  SCIP_NLPSOLSTAT solstatus /**< the solution status to query for */
126  );
127 
128 /** adds statistics from one NLPI to another */
129 SCIP_EXPORT
131  SCIP_NLPI* targetnlpi, /**< NLP interface where to add statistics */
132  SCIP_NLPI* sourcenlpi, /**< NLP interface from which to add statistics */
133  SCIP_Bool reset /**< whether to reset statistics in sourcescip */
134  );
135 
136 #ifdef NDEBUG
137 /* If NDEBUG is defined, the function calls are overwritten by defines to reduce the number of function calls and
138  * speed up the algorithms.
139  */
140 #define SCIPnlpiGetData(nlpi) (nlpi)->nlpidata
141 #define SCIPnlpiGetName(nlpi) (nlpi)->name
142 #define SCIPnlpiGetDesc(nlpi) (nlpi)->description
143 #define SCIPnlpiGetPriority(nlpi) (nlpi)->priority
144 #define SCIPnlpiGetNProblems(nlpi) (nlpi)->nproblems
145 #define SCIPnlpiGetProblemTime(nlpi) SCIPclockGetTime((nlpi)->problemtime)
146 #define SCIPnlpiGetNSolves(nlpi) (nlpi)->nsolves
147 #define SCIPnlpiGetSolveTime(nlpi) (nlpi)->solvetime
148 #define SCIPnlpiGetEvalTime(nlpi) (nlpi)->evaltime
149 #define SCIPnlpiGetNIterations(nlpi) (nlpi)->niter
150 #define SCIPnlpiGetNTermStat(nlpi, termstatus) (nlpi)->ntermstat[termstatus]
151 #define SCIPnlpiGetNSolStat(nlpi, solstatus) (nlpi)->nsolstat[solstatus]
152 #endif
153 
154 /**@} */ /* Statistics */
155 
156 /**@} */ /* PublicNLPIMethods */
157 
158 #ifdef __cplusplus
159 }
160 #endif
161 
162 #endif /* __SCIP_PUB_NLPI_H__ */
int SCIPnlpiGetPriority(SCIP_NLPI *nlpi)
Definition: nlpi.c:713
enum SCIP_NlpTermStat SCIP_NLPTERMSTAT
Definition: type_nlpi.h:185
SCIP_Real SCIPnlpiGetProblemTime(SCIP_NLPI *nlpi)
Definition: nlpi.c:736
SCIP_NLPIDATA * SCIPnlpiGetData(SCIP_NLPI *nlpi)
Definition: nlpi.c:683
int SCIPnlpiGetNSolves(SCIP_NLPI *nlpi)
Definition: nlpi.c:745
type definitions for miscellaneous datastructures
data definitions for an NLP solver interface
int SCIPnlpiGetNProblems(SCIP_NLPI *nlpi)
Definition: nlpi.c:727
void SCIPnlpiMergeStatistics(SCIP_NLPI *targetnlpi, SCIP_NLPI *sourcenlpi, SCIP_Bool reset)
Definition: nlpi.c:804
const char * SCIPnlpiGetName(SCIP_NLPI *nlpi)
Definition: nlpi.c:693
const char * SCIPnlpiGetDesc(SCIP_NLPI *nlpi)
Definition: nlpi.c:703
int SCIPnlpiGetNSolStat(SCIP_NLPI *nlpi, SCIP_NLPSOLSTAT solstatus)
Definition: nlpi.c:794
SCIP_Real SCIPnlpiGetEvalTime(SCIP_NLPI *nlpi)
Definition: nlpi.c:766
SCIP_Real SCIPnlpiGetSolveTime(SCIP_NLPI *nlpi)
Definition: nlpi.c:754
SCIP_DECL_SORTPTRCOMP(SCIPnlpiComp)
Definition: nlpi.c:38
struct SCIP_NlpiData SCIP_NLPIDATA
Definition: type_nlpi.h:43
enum SCIP_NlpSolStat SCIP_NLPSOLSTAT
Definition: type_nlpi.h:159
SCIP_Longint SCIPnlpiGetNIterations(SCIP_NLPI *nlpi)
Definition: nlpi.c:775
#define SCIP_Bool
Definition: def.h:84
#define SCIP_Real
Definition: def.h:177
#define SCIP_Longint
Definition: def.h:162
int SCIPnlpiGetNTermStat(SCIP_NLPI *nlpi, SCIP_NLPTERMSTAT termstatus)
Definition: nlpi.c:784
common defines and data types used in all packages of SCIP
type definitions for NLP solver interfaces