1    	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2    	/*                                                                           */
3    	/*                  This file is part of the program and library             */
4    	/*         SCIP --- Solving Constraint Integer Programs                      */
5    	/*                                                                           */
6    	/*  Copyright (c) 2002-2023 Zuse Institute Berlin (ZIB)                      */
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   heur_subnlp.h
26   	 * @ingroup PRIMALHEURISTICS
27   	 * @brief  NLP local search primal heuristic using sub-SCIPs
28   	 * @author Stefan Vigerske
29   	 *
30   	 * This heuristic applies a NLP local search to a nonlinear CIP after fixing all discrete variables.
31   	 * That is, the CIP is copied, all discrete variables are fixed, presolving is applied,
32   	 * and if the resulting CIP has a nonlinear relaxation, then it is tried to solve this relaxation
33   	 * by an NLP solver.
34   	 * The heuristic only runs if continuous nonlinearities are present (@ref SCIPhasNLPContinuousNonlinearity()).
35   	 *
36   	 * Fixing values for discrete values are either taken from a solution of the LP relaxation which
37   	 * satisfies all integrality constraints, or are provided by SCIPupdateStartpointHeurSubNlp().
38   	 *
39   	 * This heuristic is orthogonal to the undercover heuristic (@ref heur_undercover.h), which fixes
40   	 * variables in a nonlinear CIP in a way that a (possibly mixed-integer) linear subproblem is obtained.
41   	 */
42   	
43   	/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
44   	
45   	#ifndef HEUR_SUBNLP_H_
46   	#define HEUR_SUBNLP_H_
47   	
48   	#include "scip/def.h"
49   	#include "scip/type_heur.h"
50   	#include "scip/type_result.h"
51   	#include "scip/type_retcode.h"
52   	#include "scip/type_scip.h"
53   	#include "scip/type_sol.h"
54   	#include "scip/type_var.h"
55   	
56   	#ifdef __cplusplus
57   	extern "C" {
58   	#endif
59   	
60   	/** creates the NLP local search primal heuristic and includes it in SCIP
61   	 *
62   	 *  @ingroup PrimalHeuristicIncludes
63   	 */
64   	SCIP_EXPORT
65   	SCIP_RETCODE SCIPincludeHeurSubNlp(
66   	   SCIP*                 scip                /**< SCIP data structure */
67   	   );
68   	
69   	/**@addtogroup PRIMALHEURISTICS
70   	  *
71   	  * @{
72   	  */
73   	
74   	/** main procedure of the subNLP heuristic */
75   	SCIP_EXPORT
76   	SCIP_RETCODE SCIPapplyHeurSubNlp(
77   	   SCIP*                 scip,               /**< original SCIP data structure                                   */
78   	   SCIP_HEUR*            heur,               /**< heuristic data structure                                       */
79   	   SCIP_RESULT*          result,             /**< pointer to store result of: solution found, no solution found, or fixing is infeasible (cutoff) */
80   	   SCIP_SOL*             refpoint,           /**< point to take fixation of discrete variables from, and startpoint for NLP solver; if NULL, then LP solution is used */
81   	   SCIP_SOL*             resultsol           /**< a solution where to store found solution values, if any, or NULL if to try adding to SCIP */
82   	   );
83   	
84   	/** updates the starting point for the NLP heuristic
85   	 *
86   	 * Is called, for example, by a constraint handler that handles nonlinear constraints when a check on feasibility of a solution fails.
87   	 */
88   	SCIP_EXPORT
89   	SCIP_RETCODE SCIPupdateStartpointHeurSubNlp(
90   	   SCIP*                 scip,               /**< SCIP data structure */
91   	   SCIP_HEUR*            heur,               /**< subNLP heuristic */
92   	   SCIP_SOL*             solcand,            /**< solution candidate */
93   	   SCIP_Real             violation           /**< constraint violation of solution candidate */
94   	   );
95   	
96   	/** gets startpoint candidate to be used in next call to NLP heuristic, or NULL if none */
97   	SCIP_EXPORT
98   	SCIP_SOL* SCIPgetStartCandidateHeurSubNlp(
99   	   SCIP*                 scip,               /**< original SCIP data structure                                   */
100  	   SCIP_HEUR*            heur                /**< heuristic data structure                                       */
101  	   );
102  	
103  	/** @} */
104  	
105  	#ifdef __cplusplus
106  	}
107  	#endif
108  	
109  	#endif /*HEUR_SUBNLP_H_*/
110