Scippy

SCIP

Solving Constraint Integer Programs

nlpi_ipopt_dummy.c File Reference

Detailed Description

dummy Ipopt NLP interface for the case that Ipopt is not available

Author
Stefan Vigerske
Benjamin Müller

This code has been separate from nlpi_ipopt.cpp, so the SCIP build system recognizes it as pure C code, thus the linker does not need to be changed to C++.

Definition in file nlpi_ipopt_dummy.c.

#include "scip/pub_message.h"
#include "nlpi/nlpi_ipopt.h"

Go to the source code of this file.

Macros

#define ENTRY(i, j)   (N * (j) + (i))
 

Functions

SCIP_RETCODE SCIPcreateNlpSolverIpopt (BMS_BLKMEM *blkmem, SCIP_NLPI **nlpi)
 
const char * SCIPgetSolverNameIpopt (void)
 
const char * SCIPgetSolverDescIpopt (void)
 
SCIP_Bool SCIPisIpoptAvailableIpopt (void)
 
void * SCIPgetIpoptApplicationPointerIpopt (SCIP_NLPIPROBLEM *nlpiproblem)
 
void * SCIPgetNlpiOracleIpopt (SCIP_NLPIPROBLEM *nlpiproblem)
 
void SCIPsetModifiedDefaultSettingsIpopt (SCIP_NLPI *nlpi, const char *optionsstring)
 
SCIP_RETCODE LapackDsyev (SCIP_Bool computeeigenvectors, int N, SCIP_Real *a, SCIP_Real *w)
 
static SCIP_RETCODE SCIPsolveLinearProb3 (SCIP_Real *A, SCIP_Real *b, SCIP_Real *x, SCIP_Bool *success)
 
SCIP_RETCODE SCIPsolveLinearProb (int N, SCIP_Real *A, SCIP_Real *b, SCIP_Real *x, SCIP_Bool *success)
 

Macro Definition Documentation

#define ENTRY (   i,
 
)    (N * (j) + (i))

Definition at line 109 of file nlpi_ipopt_dummy.c.

Referenced by SCIPsolveLinearProb(), and SCIPsolveLinearProb3().

Function Documentation

SCIP_RETCODE SCIPcreateNlpSolverIpopt ( BMS_BLKMEM blkmem,
SCIP_NLPI **  nlpi 
)

create solver interface for Ipopt solver

Parameters
blkmemblock memory data structure
nlpipointer to buffer for nlpi address

Definition at line 31 of file nlpi_ipopt_dummy.c.

References NLPI_DESC, NLPI_NAME, NLPI_PRIORITY, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, and SCIPnlpiCreate().

const char* SCIPgetSolverNameIpopt ( void  )

gets string that identifies Ipopt (version number)

Definition at line 44 of file nlpi_ipopt_dummy.c.

const char* SCIPgetSolverDescIpopt ( void  )

gets string that describes Ipopt (version number)

Definition at line 50 of file nlpi_ipopt_dummy.c.

SCIP_Bool SCIPisIpoptAvailableIpopt ( void  )

returns whether Ipopt is available, i.e., whether it has been linked in

Definition at line 56 of file nlpi_ipopt_dummy.c.

References FALSE, and TRUE.

void* SCIPgetIpoptApplicationPointerIpopt ( SCIP_NLPIPROBLEM nlpiproblem)

gives a pointer to the IpoptApplication object stored in Ipopt-NLPI's NLPI problem data structure

Parameters
nlpiproblemNLP problem of Ipopt-NLPI

Definition at line 62 of file nlpi_ipopt_dummy.c.

References SCIP_NlpiProblem::ipopt, NULL, SCIPABORT, and SCIPerrorMessage.

void* SCIPgetNlpiOracleIpopt ( SCIP_NLPIPROBLEM nlpiproblem)

gives a pointer to the NLPIORACLE object stored in Ipopt-NLPI's NLPI problem data structure

Parameters
nlpiproblemNLP problem of Ipopt-NLPI

Definition at line 72 of file nlpi_ipopt_dummy.c.

References NULL, SCIP_NlpiProblem::oracle, SCIPABORT, and SCIPerrorMessage.

void SCIPsetModifiedDefaultSettingsIpopt ( SCIP_NLPI nlpi,
const char *  optionsstring 
)

sets modified default settings that are used when setting up an Ipopt problem

Do not forget to add a newline after the last option in optionsstring.

Parameters
nlpiIpopt NLP interface
optionsstringstring with options as in Ipopt options file

Definition at line 85 of file nlpi_ipopt_dummy.c.

References BMSallocMemoryArray, BMSclearMemoryArray, BMScopyMemoryArray, convcheck_maxiter, convcheck_minred, convcheck_nchecks, convcheck_startiter, FALSE, LINEAR, MAX, MAXPERTURB, MIN, NULL, SCIP_INVALID, SCIP_NLPSOLSTAT_FEASIBLE, SCIP_NLPSOLSTAT_LOCINFEASIBLE, SCIP_NLPSOLSTAT_LOCOPT, SCIP_NLPSOLSTAT_UNBOUNDED, SCIP_NLPSOLSTAT_UNKNOWN, SCIP_NLPTERMSTAT_EVALERR, SCIP_NLPTERMSTAT_ITLIM, SCIP_NLPTERMSTAT_MEMERR, SCIP_NLPTERMSTAT_NUMERR, SCIP_NLPTERMSTAT_OKAY, SCIP_NLPTERMSTAT_OTHER, SCIP_NLPTERMSTAT_TILIM, SCIP_NLPTERMSTAT_UOBJLIM, SCIP_OKAY, SCIP_Real, SCIPABORT, SCIPdebugMessage, SCIPdebugPrintf, SCIPerrorMessage, SCIPgetRandomReal(), SCIPinterrupted(), SCIPnlpiGetData(), SCIPnlpiOracleEvalConstraintValues(), SCIPnlpiOracleEvalHessianLag(), SCIPnlpiOracleEvalJacobian(), SCIPnlpiOracleEvalObjectiveGradient(), SCIPnlpiOracleEvalObjectiveValue(), SCIPnlpiOracleGetConstraintDegree(), SCIPnlpiOracleGetConstraintLhs(), SCIPnlpiOracleGetConstraintName(), SCIPnlpiOracleGetConstraintRhs(), SCIPnlpiOracleGetHessianLagSparsity(), SCIPnlpiOracleGetJacobianSparsity(), SCIPnlpiOracleGetNConstraints(), SCIPnlpiOracleGetNVars(), SCIPnlpiOracleGetVarDegree(), SCIPnlpiOracleGetVarLbs(), SCIPnlpiOracleGetVarNames(), SCIPnlpiOracleGetVarUbs(), and TRUE.

SCIP_RETCODE LapackDsyev ( SCIP_Bool  computeeigenvectors,
int  N,
SCIP_Real a,
SCIP_Real w 
)

Calls Lapacks Dsyev routine to compute eigenvalues and eigenvectors of a dense matrix. It's here, because Ipopt is linked against Lapack.

Parameters
computeeigenvectorsshould also eigenvectors should be computed ?
Ndimension
amatrix data on input (size N*N); eigenvectors on output if computeeigenvectors == TRUE
wbuffer to store eigenvalues (size N)

Definition at line 97 of file nlpi_ipopt_dummy.c.

References SCIP_ERROR, SCIP_OKAY, and SCIPerrorMessage.

static SCIP_RETCODE SCIPsolveLinearProb3 ( SCIP_Real A,
SCIP_Real b,
SCIP_Real x,
SCIP_Bool success 
)
static
Parameters
Amatrix data on input (size 3*3); filled column-wise
bright hand side vector (size 3)
xbuffer to store solution (size 3)
successpointer to store if the solving routine was successful

Definition at line 113 of file nlpi_ipopt_dummy.c.

References BMScopyMemoryArray, ENTRY, FALSE, NULL, SCIP_OKAY, SCIP_Real, SCIPerrorMessage, and TRUE.

Referenced by SCIPsolveLinearProb().

SCIP_RETCODE SCIPsolveLinearProb ( int  N,
SCIP_Real A,
SCIP_Real b,
SCIP_Real x,
SCIP_Bool success 
)

solves a linear problem of the form Ax = b for a regular matrix A

Calls Lapacks IpLapackDgetrf routine to calculate a LU factorization and uses this factorization to solve the linear problem Ax = b. It's here, because Ipopt is linked against Lapack.

Parameters
Ndimension
Amatrix data on input (size N*N); filled column-wise
bright hand side vector (size N)
xbuffer to store solution (size N)
successpointer to store if the solving routine was successful

Definition at line 215 of file nlpi_ipopt_dummy.c.

References BMSallocMemoryArray, BMScopyMemoryArray, BMSduplicateMemoryArray, BMSfreeMemoryArray, ENTRY, FALSE, LapackDsyev(), NULL, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_ERROR, SCIP_OKAY, SCIP_Real, SCIPerrorMessage, SCIPsolveLinearProb3(), and TRUE.