Scippy

SCIP

Solving Constraint Integer Programs

pub_nlp.h File Reference

Detailed Description

public methods for NLP management

Author
Thorsten Gellermann
Stefan Vigerske

Definition in file pub_nlp.h.

#include <stdio.h>
#include "scip/def.h"
#include "scip/type_message.h"
#include "blockmemshell/memory.h"
#include "scip/type_set.h"
#include "scip/type_stat.h"
#include "scip/type_nlp.h"
#include "scip/type_var.h"
#include "scip/type_sol.h"
#include "nlpi/type_expr.h"
#include "nlpi/type_nlpi.h"

Go to the source code of this file.

Functions

Expressions and Expression tree methods
SCIP_VAR ** SCIPexprtreeGetVars (SCIP_EXPRTREE *tree)
 
SCIP_RETCODE SCIPexprtreeSetVars (SCIP_EXPRTREE *tree, int nvars, SCIP_VAR **vars)
 
SCIP_RETCODE SCIPexprtreeAddVars (SCIP_EXPRTREE *tree, int nvars, SCIP_VAR **vars)
 
SCIP_RETCODE SCIPexprtreePrintWithNames (SCIP_EXPRTREE *tree, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
 
int SCIPexprtreeFindVar (SCIP_EXPRTREE *tree, SCIP_VAR *var)
 
Nonlinear row methods
SCIP_Real SCIPnlrowGetConstant (SCIP_NLROW *nlrow)
 
int SCIPnlrowGetNLinearVars (SCIP_NLROW *nlrow)
 
SCIP_VAR ** SCIPnlrowGetLinearVars (SCIP_NLROW *nlrow)
 
SCIP_RealSCIPnlrowGetLinearCoefs (SCIP_NLROW *nlrow)
 
int SCIPnlrowGetNQuadVars (SCIP_NLROW *nlrow)
 
SCIP_VAR ** SCIPnlrowGetQuadVars (SCIP_NLROW *nlrow)
 
int SCIPnlrowSearchQuadVar (SCIP_NLROW *nlrow, SCIP_VAR *var)
 
int SCIPnlrowGetNQuadElems (SCIP_NLROW *nlrow)
 
SCIP_QUADELEMSCIPnlrowGetQuadElems (SCIP_NLROW *nlrow)
 
void SCIPnlrowGetQuadData (SCIP_NLROW *nlrow, int *nquadvars, SCIP_VAR ***quadvars, int *nquadelems, SCIP_QUADELEM **quadelems)
 
SCIP_EXPRTREESCIPnlrowGetExprtree (SCIP_NLROW *nlrow)
 
SCIP_Real SCIPnlrowGetLhs (SCIP_NLROW *nlrow)
 
SCIP_Real SCIPnlrowGetRhs (SCIP_NLROW *nlrow)
 
const char * SCIPnlrowGetName (SCIP_NLROW *nlrow)
 
int SCIPnlrowGetNLPPos (SCIP_NLROW *nlrow)
 
SCIP_Bool SCIPnlrowIsInNLP (SCIP_NLROW *nlrow)
 
SCIP_Real SCIPnlrowGetDualsol (SCIP_NLROW *nlrow)
 

Function Documentation

SCIP_VAR** SCIPexprtreeGetVars ( SCIP_EXPRTREE tree)

returns variables of expression tree

Parameters
treeexpression tree

Definition at line 101 of file nlp.c.

References NULL, and SCIP_ExprTree::vars.

Referenced by addConcaveEstimatorBivariate(), addConcaveEstimatorMultivariate(), addConcaveEstimatorUnivariate(), addIntervalGradientEstimator(), addLinearization(), checkCurvature(), computeViolation(), consdataAddExprtrees(), generate1ConvexIndefiniteUnderestimator(), generate1ConvexIndefiniteUnderestimatorAtBoundary(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternA(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternB(), generateConvexConcaveEstimator(), generateConvexConcaveUnderestimator(), generateCut(), generateEstimatingHyperplane(), generateLinearizationCut(), generateOrthogonal_lx_ly_Underestimator(), generateOrthogonal_lx_uy_Underestimator(), generateOverestimatingHyperplaneCut(), generateUnderestimatorParallelYFacets(), getGradientMaxElement(), getLinearAndQuadraticCoefs(), initSepaData(), isConvexLocal(), nlpAddNlRows(), nlpSetupNlpiIndices(), nlrowCalcActivityBounds(), nlrowExprtreeChanged(), printNonlinearRow(), printRowNl(), processNlRow(), readObjective(), registerBranchingVariables(), registerLargeLPValueVariableForBranching(), removeFixedVariables(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSCOPY(), SCIP_DECL_CONSENFOPS(), SCIP_DECL_CONSEXITPRE(), SCIP_DECL_CONSGETVARS(), SCIP_DECL_CONSINITLP(), SCIP_DECL_CONSTRANS(), SCIP_DECL_EVENTEXEC(), SCIPcreateConsBivariate(), SCIPevalExprtreeGlobalBounds(), SCIPevalExprtreeLocalBounds(), SCIPevalExprtreeSol(), SCIPgetExprtreeTransformedVars(), SCIPnlpGetVarsNonlinearity(), SCIPnlpHasContinuousNonlinearity(), SCIPnlrowGetSolActivity(), SCIPnlrowRecalcNLPActivity(), SCIPnlrowRecalcPseudoActivity(), and SCIPwritePip().

SCIP_RETCODE SCIPexprtreeAddVars ( SCIP_EXPRTREE tree,
int  nvars,
SCIP_VAR **  vars 
)

adds variables to the expression tree variables array

Parameters
treeexpression tree
nvarsnumber of variables
varsvariables

Definition at line 143 of file nlp.c.

References SCIP_ExprTree::blkmem, BMScopyMemoryArray, BMSduplicateBlockMemoryArray, BMSreallocBlockMemoryArray, NULL, SCIP_ExprTree::nvars, SCIP_ALLOC, SCIP_OKAY, and SCIP_ExprTree::vars.

Referenced by createNlRow(), and SCIPexprtreeRemoveFixedVars().

int SCIPexprtreeFindVar ( SCIP_EXPRTREE tree,
SCIP_VAR var 
)

searches the variables array of an expression tree for a variable and returns its position, or -1 if not found Note that this is an O(n) operation!

Parameters
treeexpression tree
varvariable to search for

Definition at line 205 of file nlp.c.

References NULL, SCIP_ExprTree::nvars, and SCIP_ExprTree::vars.

Referenced by nlpDelVarPos(), and nlrowRemoveFixedVar().

SCIP_Real SCIPnlrowGetConstant ( SCIP_NLROW nlrow)

gets constant

Parameters
nlrowNLP row

Definition at line 3225 of file nlp.c.

References SCIP_NlRow::constant, and NULL.

int SCIPnlrowGetNLinearVars ( SCIP_NLROW nlrow)

gets number of variables of linear part

Parameters
nlrowNLP row

Definition at line 3235 of file nlp.c.

References SCIP_NlRow::nlinvars, and NULL.

SCIP_VAR** SCIPnlrowGetLinearVars ( SCIP_NLROW nlrow)

gets array with variables of linear part

Parameters
nlrowNLP row

Definition at line 3245 of file nlp.c.

References SCIP_NlRow::linvars, and NULL.

SCIP_Real* SCIPnlrowGetLinearCoefs ( SCIP_NLROW nlrow)

gets array with coefficients in linear part

Parameters
nlrowNLP row

Definition at line 3255 of file nlp.c.

References SCIP_NlRow::lincoefs, and NULL.

int SCIPnlrowGetNQuadVars ( SCIP_NLROW nlrow)

gets number of quadratic variables in quadratic part

Parameters
nlrowNLP row

Definition at line 3265 of file nlp.c.

References SCIP_NlRow::nquadvars, and NULL.

Referenced by SCIP_DECL_HEUREXEC(), and SCIPaddQuadVarsToNlRow().

SCIP_VAR** SCIPnlrowGetQuadVars ( SCIP_NLROW nlrow)

gets quadratic variables in quadratic part

Parameters
nlrowNLP row

Definition at line 3275 of file nlp.c.

References NULL, and SCIP_NlRow::quadvars.

Referenced by processNlRow().

int SCIPnlrowSearchQuadVar ( SCIP_NLROW nlrow,
SCIP_VAR var 
)

gives position of variable in quadvars array of row, or -1 if not found

Parameters
nlrownonlinear row
varvariable to search for

Definition at line 3285 of file nlp.c.

References SCIP_NlRow::nquadvars, NULL, SCIP_NlRow::quadvars, SCIP_NlRow::quadvarshash, SCIPhashmapExists(), and SCIPhashmapGetImage().

Referenced by createNlRow(), nlpDelVarPos(), nlrowRemoveFixedQuadVars(), nlrowRemoveFixedVar(), and SCIPnlrowAddQuadVar().

int SCIPnlrowGetNQuadElems ( SCIP_NLROW nlrow)

gets number of quadratic elements in quadratic part

Parameters
nlrowNLP row

Definition at line 3312 of file nlp.c.

References SCIP_NlRow::nquadelems, and NULL.

Referenced by processNlRow(), and SCIPaddQuadElementsToNlRow().

SCIP_QUADELEM* SCIPnlrowGetQuadElems ( SCIP_NLROW nlrow)

gets quadratic elements in quadratic part

Parameters
nlrowNLP row

Definition at line 3322 of file nlp.c.

References NULL, and SCIP_NlRow::quadelems.

Referenced by processNlRow().

void SCIPnlrowGetQuadData ( SCIP_NLROW nlrow,
int *  nquadvars,
SCIP_VAR ***  quadvars,
int *  nquadelems,
SCIP_QUADELEM **  quadelems 
)

gets array with coefficients in linear part

Parameters
nlrowNLP row
nquadvarsbuffer to store number of variables in quadratic term, or NULL if not of interest
quadvarsbuffer to store pointer to array of variables in quadratic term, or NULL if not of interest
nquadelemsbuffer to store number of entries in quadratic term, or NULL if not of interest
quadelemsbuffer to store pointer to array of entries in quadratic term, or NULL if not of interest

Definition at line 3332 of file nlp.c.

References SCIP_NlRow::nquadelems, SCIP_NlRow::nquadvars, NULL, SCIP_NlRow::quadelems, and SCIP_NlRow::quadvars.

SCIP_EXPRTREE* SCIPnlrowGetExprtree ( SCIP_NLROW nlrow)

gets expression tree

Parameters
nlrowNLP row

Definition at line 3353 of file nlp.c.

References SCIP_NlRow::exprtree, and NULL.

Referenced by processNlRow(), and SCIP_DECL_HEUREXEC().

SCIP_Real SCIPnlrowGetLhs ( SCIP_NLROW nlrow)

returns the left hand side of a nonlinear row

Parameters
nlrowNLP row

Definition at line 3363 of file nlp.c.

References SCIP_NlRow::lhs, and NULL.

Referenced by processNlRow().

SCIP_Real SCIPnlrowGetRhs ( SCIP_NLROW nlrow)

returns the right hand side of a nonlinear row

Parameters
nlrowNLP row

Definition at line 3373 of file nlp.c.

References NULL, and SCIP_NlRow::rhs.

Referenced by processNlRow().

const char* SCIPnlrowGetName ( SCIP_NLROW nlrow)

returns the name of a nonlinear row

Parameters
nlrowNLP row

Definition at line 3383 of file nlp.c.

References SCIP_NlRow::name, and NULL.

Referenced by processNlRow().

int SCIPnlrowGetNLPPos ( SCIP_NLROW nlrow)

gets position of a nonlinear row in current NLP, or -1 if not in NLP

Parameters
nlrowNLP row

Definition at line 3393 of file nlp.c.

References SCIP_NlRow::nlpindex, and NULL.

SCIP_Bool SCIPnlrowIsInNLP ( SCIP_NLROW nlrow)

returns TRUE iff row is member of current NLP

Parameters
nlrowNLP row

Definition at line 3403 of file nlp.c.

References SCIP_NlRow::nlpindex, and NULL.

SCIP_Real SCIPnlrowGetDualsol ( SCIP_NLROW nlrow)

gets the dual NLP solution of a nlrow for a ranged constraint, the dual value is positive if the right hand side is active and negative if the left hand side is active

Parameters
nlrowNLP row

Definition at line 3415 of file nlp.c.

References SCIP_NlRow::dualsol, SCIP_NlRow::nlpiindex, and NULL.

Referenced by SCIPapplyHeurDualval().