Scippy

SCIP

Solving Constraint Integer Programs

struct_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 struct_nlpi.h
17  * @ingroup INTERNALAPI
18  * @brief data definitions for an NLP solver interface
19  * @author Stefan Vigerske
20  * @author Thorsten Gellermann
21  */
22 
23 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
24 
25 #ifndef __SCIP_STRUCT_NLPI_H__
26 #define __SCIP_STRUCT_NLPI_H__
27 
28 #include "scip/def.h"
29 #include "scip/type_nlpi.h"
30 #include "scip/type_clock.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /** NLP interface data */
37 struct SCIP_Nlpi
38 {
39  char* name; /**< name of NLP solver */
40  char* description; /**< description of NLP solver */
41  int priority; /**< priority of NLP interface */
42  SCIP_DECL_NLPICOPY ((*nlpicopy)); /**< copy an NLPI */
43  SCIP_DECL_NLPIFREE ((*nlpifree)); /**< free NLPI user data */
44  SCIP_DECL_NLPIGETSOLVERPOINTER ((*nlpigetsolverpointer)); /**< get solver pointer */
45  SCIP_DECL_NLPICREATEPROBLEM ((*nlpicreateproblem)); /**< create a new problem instance */
46  SCIP_DECL_NLPIFREEPROBLEM ((*nlpifreeproblem)); /**< free a problem instance */
47  SCIP_DECL_NLPIGETPROBLEMPOINTER ((*nlpigetproblempointer)); /**< get problem pointer */
48  SCIP_DECL_NLPIADDVARS ((*nlpiaddvars)); /**< add variables to a problem */
49  SCIP_DECL_NLPIADDCONSTRAINTS ((*nlpiaddconstraints)); /**< add constraints to a problem */
50  SCIP_DECL_NLPISETOBJECTIVE ((*nlpisetobjective)); /**< set objective of a problem */
51  SCIP_DECL_NLPICHGVARBOUNDS ((*nlpichgvarbounds)); /**< change variable bounds in a problem */
52  SCIP_DECL_NLPICHGCONSSIDES ((*nlpichgconssides)); /**< change constraint sides in a problem */
53  SCIP_DECL_NLPIDELVARSET ((*nlpidelvarset)); /**< delete a set of variables from a problem */
54  SCIP_DECL_NLPIDELCONSSET ((*nlpidelconsset)); /**< delete a set of constraints from a problem */
55  SCIP_DECL_NLPICHGLINEARCOEFS ((*nlpichglinearcoefs)); /**< change coefficients in linear part of a constraint or objective */
56  SCIP_DECL_NLPICHGEXPR ((*nlpichgexpr)); /**< change nonlinear expression a constraint or objective */
57  SCIP_DECL_NLPICHGOBJCONSTANT ((*nlpichgobjconstant)); /**< change the constant offset in the objective */
58  SCIP_DECL_NLPISETINITIALGUESS ((*nlpisetinitialguess)); /**< set initial guess */
59  SCIP_DECL_NLPISOLVE ((*nlpisolve)); /**< solve a problem */
60  SCIP_DECL_NLPIGETSOLSTAT ((*nlpigetsolstat)); /**< get solution status for a problem */
61  SCIP_DECL_NLPIGETTERMSTAT ((*nlpigettermstat)); /**< get termination status for a problem */
62  SCIP_DECL_NLPIGETSOLUTION ((*nlpigetsolution)); /**< get solution of a problem */
63  SCIP_DECL_NLPIGETSTATISTICS ((*nlpigetstatistics)); /**< get solve statistics for a problem */
64  SCIP_NLPIDATA* nlpidata; /**< NLP interface local data */
65 
66  /* statistics */
67  int nproblems; /**< number of problems created */
68  int nsolves; /**< number of solves */
69  SCIP_CLOCK* problemtime; /**< time spend in problem setup and modification */
70  SCIP_Real solvetime; /**< time spend in solve as reported by solver */
71  SCIP_Real evaltime; /**< time spend in function evaluation during solve */
72  SCIP_Longint niter; /**< total number of iterations */
73  int ntermstat[SCIP_NLPTERMSTAT_OTHER+1]; /**< number of times a specific termination status occurred */
74  int nsolstat[SCIP_NLPSOLSTAT_UNKNOWN+1]; /**< number of times a specific solution status occurred */
75 };
76 
77 #ifdef __cplusplus
78 }
79 #endif
80 
81 #endif /* __SCIP_STRUCT_NLPI_H__ */
SCIP_CLOCK * problemtime
Definition: struct_nlpi.h:69
char * name
Definition: struct_nlpi.h:39
int ntermstat[SCIP_NLPTERMSTAT_OTHER+1]
Definition: struct_nlpi.h:73
SCIP_DECL_NLPIGETSOLUTION((*nlpigetsolution))
SCIP_DECL_NLPIFREE((*nlpifree))
SCIP_DECL_NLPIFREEPROBLEM((*nlpifreeproblem))
SCIP_DECL_NLPISETOBJECTIVE((*nlpisetobjective))
SCIP_DECL_NLPIGETTERMSTAT((*nlpigettermstat))
SCIP_DECL_NLPICREATEPROBLEM((*nlpicreateproblem))
SCIP_DECL_NLPICHGCONSSIDES((*nlpichgconssides))
SCIP_DECL_NLPIADDVARS((*nlpiaddvars))
struct SCIP_NlpiData SCIP_NLPIDATA
Definition: type_nlpi.h:43
SCIP_Real solvetime
Definition: struct_nlpi.h:70
int nproblems
Definition: struct_nlpi.h:67
SCIP_DECL_NLPIGETSOLVERPOINTER((*nlpigetsolverpointer))
SCIP_DECL_NLPICHGOBJCONSTANT((*nlpichgobjconstant))
SCIP_DECL_NLPIGETPROBLEMPOINTER((*nlpigetproblempointer))
SCIP_DECL_NLPIDELCONSSET((*nlpidelconsset))
type definitions for clocks and timing issues
SCIP_DECL_NLPIADDCONSTRAINTS((*nlpiaddconstraints))
SCIP_DECL_NLPIGETSTATISTICS((*nlpigetstatistics))
SCIP_NLPIDATA * nlpidata
Definition: struct_nlpi.h:64
int nsolves
Definition: struct_nlpi.h:68
SCIP_DECL_NLPICHGEXPR((*nlpichgexpr))
#define SCIP_Real
Definition: def.h:177
SCIP_DECL_NLPICHGLINEARCOEFS((*nlpichglinearcoefs))
#define SCIP_Longint
Definition: def.h:162
SCIP_Real evaltime
Definition: struct_nlpi.h:71
int priority
Definition: struct_nlpi.h:41
SCIP_DECL_NLPICHGVARBOUNDS((*nlpichgvarbounds))
SCIP_DECL_NLPISOLVE((*nlpisolve))
char * description
Definition: struct_nlpi.h:40
common defines and data types used in all packages of SCIP
SCIP_DECL_NLPICOPY((*nlpicopy))
int nsolstat[SCIP_NLPSOLSTAT_UNKNOWN+1]
Definition: struct_nlpi.h:74
SCIP_Longint niter
Definition: struct_nlpi.h:72
SCIP_DECL_NLPIGETSOLSTAT((*nlpigetsolstat))
SCIP_DECL_NLPISETINITIALGUESS((*nlpisetinitialguess))
SCIP_DECL_NLPIDELVARSET((*nlpidelvarset))
type definitions for NLP solver interfaces