Scippy

SCIP

Solving Constraint Integer Programs

Detailed Description

commonly used methods for strings

Functions

SCIP_EXPORT int SCIPmemccpy (char *dest, const char *src, char stop, unsigned int cnt)
 
SCIP_EXPORT void SCIPprintSysError (const char *message)
 
SCIP_EXPORT char * SCIPstrtok (char *s, const char *delim, char **ptrptr)
 
SCIP_EXPORT void SCIPescapeString (char *t, int bufsize, const char *s)
 
SCIP_EXPORT int SCIPsnprintf (char *t, int len, const char *s,...)
 
SCIP_EXPORT int SCIPstrncpy (char *t, const char *s, int size)
 
SCIP_EXPORT SCIP_Bool SCIPstrToIntValue (const char *str, int *value, char **endptr)
 
SCIP_EXPORT SCIP_Bool SCIPstrToRealValue (const char *str, SCIP_Real *value, char **endptr)
 
SCIP_EXPORT void SCIPstrCopySection (const char *str, char startchar, char endchar, char *token, int size, char **endptr)
 

Function Documentation

◆ SCIPmemccpy()

SCIP_EXPORT int SCIPmemccpy ( char *  dest,
const char *  src,
char  stop,
unsigned int  cnt 
)

copies characters from 'src' to 'dest', copying is stopped when either the 'stop' character is reached or after 'cnt' characters have been copied, whichever comes first.

Note
undefined behaviuor on overlapping arrays

copies characters from 'src' to 'dest', copying is stopped when either the 'stop' character is reached or after 'cnt' characters have been copied, whichever comes first.

Note
undefined behavior on overlapping arrays
Parameters
destdestination pointer to copy to
srcsource pointer to copy from
stopcharacter when found stop copying
cntmaximal number of characters to copy

Definition at line 10147 of file misc.c.

References NULL.

Referenced by generateSecantCutNoCheck(), mpsinputSetObjname(), mpsinputSetProbname(), readBounds(), readCoefficients(), readCols(), readColsMop(), readRanges(), readRhs(), readSOS(), readSos(), stoinputSetProbname(), stoinputSetStochtype(), and timinputSetProbname().

◆ SCIPprintSysError()

SCIP_EXPORT void SCIPprintSysError ( const char *  message)

prints an error message containing of the given string followed by a string describing the current system error; prefers to use the strerror_r method, which is threadsafe; on systems where this method does not exist, NO_STRERROR_R should be defined (see INSTALL), in this case, srerror is used which is not guaranteed to be threadsafe (on SUN-systems, it actually is)

prints an error message containing of the given string followed by a string describing the current system error

Prefers to use the strerror_r method, which is threadsafe. On systems where this method does not exist, NO_STRERROR_R should be defined (see INSTALL). In this case, strerror is used which is not guaranteed to be threadsafe (on SUN-systems, it actually is).

Parameters
messagefirst part of the error message, e.g. the filename

Definition at line 10172 of file misc.c.

References NULL, SCIP_MAXSTRLEN, and SCIPmessagePrintError().

Referenced by LOPreadFile(), processArguments(), readBounds(), readDiffFile(), readFZNFile(), readLIBSVM(), readLPFile(), readMOP(), readMps(), readOPBFile(), readPIPFile(), readSol(), readSolFile(), readSto(), readTim(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_EVENTEXEC(), SCIP_DECL_READERREAD(), SCIPlpWriteMip(), SCIPparamsetRead(), SCIPparamsetWrite(), SCIPparamWrite(), SCIPprobdataCreate(), SCIPprocessShellArguments(), SCIPvisualInit(), SCIPvisualizeConsCumulative(), and writeProblem().

◆ SCIPstrtok()

SCIP_EXPORT char* SCIPstrtok ( char *  s,
const char *  delim,
char **  ptrptr 
)

extracts tokens from strings - wrapper method for strtok_r()

Parameters
sstring to parse
delimdelimiters for parsing
ptrptrpointer to working char pointer - must stay the same while parsing

Definition at line 10221 of file misc.c.

Referenced by findBestObjectiveValue(), getNJobs(), getNResources(), getResourcesNames(), mpsinputReadLine(), parseConstraint(), readCnf(), SCIP_DECL_CONSPARSE(), smpsinputReadLine(), stoinputReadLine(), and timinputReadLine().

◆ SCIPescapeString()

SCIP_EXPORT void SCIPescapeString ( char *  t,
int  bufsize,
const char *  s 
)

translates the given string into a string where symbols ", ', and spaces are escaped with a \ prefix

Parameters
ttarget buffer to store escaped string
bufsizesize of buffer t
sstring to transform into escaped string

Definition at line 10235 of file misc.c.

References NULL.

Referenced by SCIP_DECL_DIALOGEXEC(), and SCIPdialoghdlrAddHistory().

◆ SCIPsnprintf()

SCIP_EXPORT int SCIPsnprintf ( char *  t,
int  len,
const char *  s,
  ... 
)

safe version of snprintf

Parameters
ttarget string
lenlength of the string to copy
ssource string

Definition at line 10263 of file misc.c.

References NULL, and SCIPerrorMessage.

Referenced by ObjPricerVRP::add_tour_variable(), addAuxiliaryVariablesToMaster(), addBranchingComplementaritiesSOS1(), addCliques(), addCut(), addExtendedAsymmetricFormulation(), addExtendedFlowFormulation(), addExtraCliques(), addFixParamDialog(), addLocalBranchingConstraint(), addLocalConss(), addPathCuts(), addRelaxation(), addScenarioVarsAndConsToProb(), addSetParamDialog(), addSplitcons(), addSubtourCuts(), addSymresackConss(), addSymresackInequality(), addTourCuts(), addVarbound(), addVarCardinality(), addVariable(), adjustOversizedJobBounds(), alnsIncludeNeighborhood(), appendVarCardinality(), applyCliqueFixings(), applyFixings(), applyRepair(), assignAuxiliaryVariables(), BENDERS_CUTORACLE(), branchBalancedCardinality(), branchOnVertex(), btPrintSubtree(), buildScenariosFromBlocks(), checkConsnames(), checkVarnames(), cliquePresolve(), componentCreateSubscip(), computeCut(), computeEffectiveHorizon(), computeInteriorPoint(), computeMinDistance(), consdataCollectLinkingCons(), consdataCreateBinvars(), copyCuts(), createAndAddAndCons(), createAndAddLinearCons(), createAndAddProofcons(), createAndAddTransferredCut(), createCapacityRestriction(), createCapacityRestrictionIntvars(), createCGCutCMIR(), createCGCutDirect(), createCGCutStrongCG(), createCipFormulation(), createConflict(), createConstraints(), createCoverCutsTimepoint(), createCoveringProblem(), createDegreeConstraints(), createIndicatorConstraint(), createInitialColumns(), createIntervalRelaxation(), createKKTComplementarityBinary(), createKKTComplementarityBounds(), createKKTComplementarityLinear(), createKKTDualCons(), createMasterproblem(), createMIP(), createMipCpFormulation(), createMipFormulation(), createOriginalproblem(), createPartitionCut(), createPatternVars(), createPrizeConstraints(), createProbOnlyEdge(), createProbQP(), createProbSimplified(), createProbSimplifiedTest(), createRelaxation(), createRows(), createScenariosFromBlocks(), createSubproblem(), createSubproblems(), createSubSCIP(), createSubscip(), createVariableMappings(), createVariables(), createVarUbs(), deleteRedundantVars(), detectRedundantVars(), disaggregate(), displayRelevantStats(), doBendersCreate(), doBenderscutCreate(), doBranchruleCreate(), doComprCreate(), doConcsolverTypeCreate(), doConflicthdlrCreate(), doConshdlrCreate(), doCopy(), doDispCreate(), doHeurCreate(), doNodeselCreate(), doPresolCreate(), doPricerCreate(), doPropCreate(), doRelaxCreate(), doSepaCreate(), doTableCreate(), dualPresolve(), execmain(), extendToCover(), extensionOperatorSOS1(), extractGates(), findAggregation(), findBestObjectiveValue(), findCumulativeConss(), findScenarioVar(), fixDeleteOrUpgradeCons(), flattenAssignment(), flattenFloat(), forbidCover(), forbidFixation(), generateAndApplyBendersCuts(), generateAndApplyBendersIntegerCuts(), generateAndApplyBendersNogoodCut(), generateBoundInequalityFromSOS1Nodes(), generateConvexConcaveEstimator(), generateCut(), generateCutConvex(), generateCutFactorableDo(), generateCutLTI(), generateCutNonConvex(), generateCutPoint(), generateCutProjectedPoint(), generateCutSol(), generateDisjCutSOS1(), generateLinearizationCut(), generateOddCycleCut(), generateRowCardinality(), generateRowSOS2(), generateSecantCut(), generateZerohalfCut(), get_scale_order(), getFixedVariable(), getJobs(), getScenarioDecompVar(), getScenarioEntityName(), includeConshdlrCountsols(), initLP(), initProblem(), LOPseparate(), lpBarrier(), lpDualSimplex(), lpPrimalSimplex(), newsolCliqueAddRow(), nodepartitionIsConnected(), paramsetSetHeuristicsAggressive(), paramsetSetHeuristicsDefault(), paramsetSetHeuristicsOff(), paramsetSetPresolvingAggressive(), paramsetSetPresolvingDefault(), paramsetSetPresolvingFast(), paramsetSetPresolvingOff(), paramsetSetSeparatingAggressive(), paramsetSetSeparatingDefault(), paramsetSetSeparatingOff(), parseConstantArray(), parseConstraint(), parseName(), parseVariableArray(), performImplicationGraphAnalysis(), preprocessConstraintPairs(), presolveAddKKTLinearCons(), presolveCreateBenTalNemirovskiApproxDim3(), presolveCreateGlineurApproxDim3(), presolveCreateOuterApprox(), presolveDisaggregate(), presolveFindDuplicates(), presolveTryAddAND(), presolveTryAddLinearReform(), pricing(), printActiveVariables(), printAggregatedCons(), printAndCons(), printBoundSection(), printConformName(), printEntry(), printExpr(), printIndicatorCons(), printLinearCons(), printLinearRow(), printName(), printNLRow(), printNonlinearRow(), printPBRow(), printQuadraticRow(), printRecord(), printRow(), printRowNl(), printRowType(), printSignpowerRow(), printSOCCons(), printSOSCons(), printSosCons(), printStart(), probdataPrintGraph(), processArguments(), processNlRow(), propIndicator(), readArguments(), readBlocks(), readBounds(), readCnf(), readCnfLine(), readConstraints(), readIndep(), readIndicators(), readLIBSVM(), readScenarios(), readSemicontinuous(), readSol(), readSOS(), readSos(), readSOScons(), readVariables(), reformMonomial(), reformNode2Var(), reformulate(), resolvePropagation(), SCIP_DECL_CONCSOLVERCREATEINST(), SCIP_DECL_CONFLICTEXEC(), SCIP_DECL_CONSENFOLP(), SCIP_DECL_CONSINITLP(), SCIP_DECL_CONSINITPRE(), SCIP_DECL_CONSPARSE(), SCIP_DECL_CONSPRESOL(), SCIP_DECL_CONSTRANS(), SCIP_DECL_DIALOGDESC(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_EXPRGRAPHNODEREFORM(), SCIP_DECL_LINCONSUPGD(), SCIP_DECL_NONLINCONSUPGD(), SCIP_DECL_PARAMCHGD(), SCIP_DECL_PRESOLEXEC(), SCIP_DECL_PRICERREDCOST(), SCIP_DECL_QUADCONSUPGD(), SCIP_DECL_READERCOPY(), SCIP_DECL_READERREAD(), SCIP_DECL_SEPAEXECLP(), SCIP_DECL_SOLVECUMULATIVE(), SCIPbendersMergeSubproblemIntoMaster(), SCIPconcsolverCreateInstance(), SCIPcopyLargeNeighborhoodSearch(), SCIPcreateConsCardinality(), SCIPcreateConsIndicator(), SCIPcreateNlpSolverWorhp(), SCIPcreateSchedulingProblem(), SCIPdialogDisplayMenuEntry(), SCIPdialogGetPath(), SCIPdialoghdlrAddHistory(), SCIPdialoghdlrCreate(), SCIPdialoghdlrGetLine(), SCIPdialoghdlrGetWord(), SCIPdigraphPrintGml(), SCIPdispLongint(), SCIPdispTime(), SCIPdivesetCreate(), SCIPException::SCIPException(), SCIPexprPrint(), SCIPgetErrorString(), SCIPgetVarCopy(), SCIPincludeBenderscutInt(), SCIPincludeBenderscutNogood(), SCIPincludeBenderscutOpt(), SCIPincludeNlpi(), SCIPincludeNonlinconsUpgrade(), SCIPincludeQuadconsUpgrade(), SCIPincludeReaderZpl(), SCIPlpWriteMip(), SCIPnlpiOraclePrintProblemGams(), SCIPnodePrintAncestorBranchings(), SCIPparamsetSetEmphasis(), SCIPparamsetSetToSubscipsOff(), SCIPprintConflictStatistics(), SCIPprintReal(), SCIPprintSolutionStatistics(), SCIPprobdataAddNewSol(), SCIPprobdataCreate(), SCIPprobdataPrintGraph2(), SCIPprobTransform(), SCIPreaderWrite(), SCIPreoptApplyCuts(), SCIPreoptApplyGlbConss(), SCIPsetConshdlrPresol(), SCIPsetConshdlrProp(), SCIPsetConshdlrSepa(), SCIPsetPropPresol(), SCIPStpIncludeHeurTM(), SCIPtransformMinUC(), SCIPvarNegate(), SCIPvarTransform(), SCIPverifyCircularPatternNLP(), SCIPvisualizeConsCumulative(), SCIPwriteCliqueGraph(), SCIPwriteGms(), SCIPwriteLp(), SCIPwriteMps(), SCIPwritePip(), separateCons(), separateCuts(), separateGLS(), separateIndicators(), separatePerspective(), separateSCIs(), separateSequLiftedExtendedWeightInequality(), separateSequLiftedMinimalCoverInequality(), separateSupLiftedMinimalCoverInequality(), setObjective(), setupAndSolveCumulativeSubscip(), setupAndSolveFiniteSolSubscip(), setupProblem(), setupSubscipLpface(), solveClassification(), solveMinIISC(), solvePricingMINLP(), strengthenVarbounds(), syntaxError(), tightenCoefs(), tightenSingleVar(), tightenWeights(), toString(), tryAggregateIntVars(), tryUpgradingLogicor(), tryUpgradingSetppc(), tryUpgradingXor(), updateSolNodeArray(), upgradeCons(), upgradeIndicatorSuperindicator(), upgradeLinearSuperindicator(), varSetName(), visualizeSolutionAscii(), writeFzn(), writeOpb(), writeOpbFixedVars(), writeOpbObjective(), and writeOpbRelevantAnds().

◆ SCIPstrncpy()

SCIP_EXPORT int SCIPstrncpy ( char *  t,
const char *  s,
int  size 
)

safe version of strncpy

Copies string in s to t using at most size-1 nonzero characters (strncpy copies size characters). It always adds a terminating zero char. Does not pad the remaining string with zero characters (unlike strncpy). Returns the number of copied nonzero characters, if the length of s is at most size - 1, and returns size otherwise. Thus, the original string was truncated if the return value is size.

Parameters
ttarget string
ssource string
sizemaximal size of t

Definition at line 10306 of file misc.c.

Referenced by appendBuffer(), exprparseReadVariable(), readInputLine(), readPolynomial(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_READERREAD(), SCIPdialogGetPath(), SCIPdialoghdlrAddHistory(), and xmlProcess().

◆ SCIPstrToIntValue()

SCIP_EXPORT SCIP_Bool SCIPstrToIntValue ( const char *  str,
int *  value,
char **  endptr 
)

extract the next token as a integer value if it is one; in case no value is parsed the endptr is set to str

Returns
Returns TRUE if a value could be extracted, otherwise FALSE
Parameters
strstring to search
valuepointer to store the parsed value
endptrpointer to store the final string position if successfully parsed, otherwise str

Definition at line 10333 of file misc.c.

References FALSE, NULL, SCIPdebugMessage, and TRUE.

Referenced by exprParse(), getJobId(), getJobs(), getPrecedence(), parseDetails(), readFile(), and SCIP_DECL_DIALOGEXEC().

◆ SCIPstrToRealValue()

SCIP_EXPORT SCIP_Bool SCIPstrToRealValue ( const char *  str,
SCIP_Real value,
char **  endptr 
)

extract the next token as a double value if it is one; in case a value is parsed the endptr is set to str

Returns
Returns TRUE if a value could be extracted, otherwise FALSE

extract the next token as a double value if it is one; in case no value is parsed the endptr is set to str

Returns
Returns TRUE if a value could be extracted, otherwise FALSE
Parameters
strstring to search
valuepointer to store the parsed value
endptrpointer to store the final string position if successfully parsed, otherwise str

Definition at line 10364 of file misc.c.

References FALSE, NULL, SCIPdebugMessage, and TRUE.

Referenced by exprParse(), getFixedVariable(), getNJobs(), getNResources(), getObjective(), getResourcesCapacities(), parseValue(), SCIP_DECL_CONSPARSE(), SCIPparseReal(), SCIPparseVarsPolynomial(), and varParse().

◆ SCIPstrCopySection()

SCIP_EXPORT void SCIPstrCopySection ( const char *  str,
char  startchar,
char  endchar,
char *  token,
int  size,
char **  endptr 
)

copies the first size characters between a start and end character of str into token, if no error occured endptr will point to the position after the read part, otherwise it will point to str

Parameters
strstring to search
startcharcharacter which defines the beginning
endcharcharacter which defines the ending
tokenstring to store the copy
sizesize of the token char array
endptrpointer to store the final string position if successfully parsed, otherwise str

Definition at line 10394 of file misc.c.

References NULL, SCIP_MAXSTRLEN, and SCIPdebugMessage.

Referenced by parseBounds(), parseDetails(), SCIP_DECL_CONSPARSE(), SCIPconsParse(), SCIPparseVarName(), and varParse().