commonly used methods for strings
Functions | |
int | SCIPmemccpy (char *dest, const char *src, char stop, unsigned int cnt) |
void | SCIPprintSysError (const char *message) |
char * | SCIPstrtok (char *s, const char *delim, char **ptrptr) |
void | SCIPescapeString (char *t, int bufsize, const char *s) |
SCIP_RETCODE | SCIPskipSpace (char **s) |
int | SCIPsnprintf (char *t, int len, const char *s,...) |
int | SCIPstrncpy (char *t, const char *s, int size) |
int | SCIPstrcasecmp (const char *s1, const char *s2) |
int | SCIPstrncasecmp (const char *s1, const char *s2, int length) |
SCIP_Bool | SCIPstrToIntValue (const char *str, int *value, char **endptr) |
SCIP_Bool | SCIPstrToRealValue (const char *str, SCIP_Real *value, char **endptr) |
void | SCIPstrCopySection (const char *str, char startchar, char endchar, char *token, int size, char **endptr) |
SCIP_Bool | SCIPstrAtStart (const char *s, const char *t, size_t tlen) |
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.
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.
dest | destination pointer to copy to |
src | source pointer to copy from |
stop | character when found stop copying |
cnt | maximal number of characters to copy |
Definition at line 10747 of file misc.c.
References NULL.
Referenced by mpsinputSetObjname(), mpsinputSetProbname(), readBounds(), readCoefficients(), readCoefficients(), readCoefficients(), readCols(), readRanges(), readRhs(), readSOS(), readSos(), stoinputSetProbname(), stoinputSetStochtype(), and timinputSetProbname().
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).
message | first part of the error message, e.g. the filename |
Definition at line 10772 of file misc.c.
References NULL, SCIP_MAXSTRLEN, and SCIPmessagePrintError().
Referenced by LOPreadFile(), processArguments(), readBounds(), readDecomposition(), readDiffFile(), readFZNFile(), readLIBSVM(), readLPFile(), readMps(), readOPBFile(), readPIPFile(), readSol(), readSolFile(), readSto(), readTim(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_EVENTEXEC(), SCIP_DECL_READERREAD(), SCIP_DECL_READERREAD(), SCIP_DECL_READERREAD(), SCIP_DECL_READERREAD(), SCIP_DECL_READERREAD(), SCIP_DECL_READERREAD(), SCIP_DECL_READERREAD(), SCIP_DECL_READERREAD(), SCIP_DECL_READERREAD(), SCIP_DECL_READERREAD(), SCIP_DECL_READERREAD(), SCIPlpWriteMip(), SCIPparamsetRead(), SCIPparamsetWrite(), SCIPparamWrite(), SCIPprocessShellArguments(), SCIPvisualInit(), SCIPvisualizeConsCumulative(), and writeProblem().
char * SCIPstrtok | ( | char * | s, |
const char * | delim, | ||
char ** | ptrptr ) |
extracts tokens from strings - wrapper method for strtok_r()
s | string to parse |
delim | delimiters for parsing |
ptrptr | pointer to working char pointer - must stay the same while parsing |
Definition at line 10821 of file misc.c.
Referenced by findBestObjectiveValue(), getNJobs(), getNResources(), getResourcesNames(), mpsinputReadLine(), parseConstraint(), readCnf(), SCIP_DECL_CONSPARSE(), smpsinputReadLine(), stoinputReadLine(), and timinputReadLine().
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 translates the given string into a string where unescaped symbols ", ', and spaces are escaped with a \ prefix
t | target buffer to store escaped string |
bufsize | size of buffer t |
s | string to transform into escaped string |
Definition at line 10835 of file misc.c.
References assert(), i, and NULL.
Referenced by SCIP_DECL_DIALOGEXEC(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_DIALOGEXEC(), and SCIPdialoghdlrAddHistory().
SCIP_RETCODE SCIPskipSpace | ( | char ** | s | ) |
increases string pointer as long as it refers to a space character or an explicit space control sequence
s | pointer to string pointer |
Definition at line 10869 of file misc.c.
References SCIP_OKAY, and SCIP_SPACECONTROL.
Referenced by getFixedVariable(), getObjective(), getStatistics(), parseBase(), parseExpr(), parseFactor(), parseTerm(), SCIP_DECL_CONSPARSE(), SCIP_DECL_CONSPARSE(), SCIP_DECL_CONSPARSE(), SCIP_DECL_CONSPARSE(), SCIP_DECL_CONSPARSE(), SCIP_DECL_CONSPARSE(), SCIP_DECL_CONSPARSE(), SCIP_DECL_CONSPARSE(), SCIP_DECL_CONSPARSE(), SCIP_DECL_CONSPARSE(), SCIP_DECL_CONSPARSE(), SCIP_DECL_CONSPARSE(), SCIP_DECL_CONSPARSE(), SCIP_DECL_CONSPARSE(), SCIP_DECL_CONSPARSE(), SCIPconsParse(), SCIPparseReal(), SCIPparseVarsList(), and SCIPparseVarsPolynomial().
int SCIPsnprintf | ( | char * | t, |
int | len, | ||
const char * | s, | ||
... ) |
safe version of snprintf
t | target string |
len | length of the string to copy |
s | source string |
... | further parameters |
Definition at line 10880 of file misc.c.
References assert(), NULL, and SCIPerrorMessage.
Referenced by ObjPricerVRP::add_tour_variable(), addAuxiliaryVariablesToMaster(), addBranchingComplementaritiesSOS1(), addCliques(), addCut(), addCut(), addCut(), addCut(), addCut(), addCut(), addCut(), addExtendedAsymmetricFormulation(), addExtendedFlowFormulation(), addExtraCliques(), addFixParamDialog(), addLocalBranchingConstraint(), addLocalBranchingConstraint(), addLocalbranchingConstraintAndObjcutoff(), addLocalConss(), addNlrow(), addObjCutoff(), addOrbitopesDynamic(), addOrbitopeSubgroup(), addPathCuts(), addRegularScholtes(), addRelaxation(), addRelaxation(), addScenarioVarsAndConsToProb(), addSetParamDialog(), addSlackVars(), addSplitcons(), addSSTConssOrbitAndUpdateSST(), addStrongSBCsSubgroup(), addSubtourCuts(), addSymresackConss(), addSymresackInequality(), addTourCuts(), addTrustRegionConstraints(), addVarCardinality(), addVariable(), addWeakSBCsSubgroup(), adjustOversizedJobBounds(), aggregateGeneratedCuts(), aggregation(), alnsIncludeNeighborhood(), appendVarCardinality(), applyCliqueFixings(), applyFixings(), applyFixings(), applyFixings(), applyObbtBilinear(), applyRepair(), assignAuxiliaryVariables(), BENDERS_CUTORACLE(), BENDERS_CUTORACLE(), blockCreateSubscip(), branchBalancedCardinality(), btPrintSubtree(), buildScenariosFromBlocks(), checkConsnames(), checkVarnames(), cliquePresolve(), cliquePresolve(), COLORprobSetUpArrayOfCons(), componentCreateSubscip(), componentPackingPartitioningOrbisackUpgrade(), computeAutomorphisms(), computeCut(), computeEffectiveHorizon(), computeMinDistance(), computeRltCut(), consdataCollectLinkingCons(), consdataCreateBinvars(), conshdlrsCanProvideSymInformation(), constructCutRow(), convertLongEquality(), copyCuts(), createAndAddAndCons(), createAndAddLinearCons(), createAndAddProofcons(), createAndAddTransferredCut(), createAndApplyStoredBendersCut(), createAuxVar(), createBinaryConstraintName(), createBlockproblem(), createCapacityRestriction(), createCapacityRestrictionIntvars(), createCGCutCMIR(), createCGCutDirect(), createCGCutStrongCG(), createCipFormulation(), createConflict(), createConstraints(), createCoverCutsTimepoint(), createCoveringProblem(), createDisaggrRow(), createDisaggrVars(), createIndicatorConstraint(), createInitialColumns(), createIntervalRelaxation(), createKKTComplementarityBinary(), createKKTComplementarityBounds(), createKKTComplementarityLinear(), createKKTDualCons(), createMasterproblem(), createMIP(), createMipCpFormulation(), createMipFormulation(), createOriginalproblem(), createPartitionCut(), createPatternVars(), createProbOnlyEdge(), createProbQP(), createProbSimplified(), createProbSimplifiedTest(), createRelaxation(), createRelaxation(), createRelaxation(), createRows(), createScenariosFromBlocks(), createSubproblem(), createSubproblems(), createSubSCIP(), createSubSCIP(), createSubscip(), createVariableMappings(), createVariables(), createVarUbs(), deleteRedundantVars(), detectAndHandleSubgroups(), detectRedundantVars(), displayRelevantStats(), doBendersCreate(), doBenderscutCreate(), doBranchruleCreate(), doComprCreate(), doConcsolverTypeCreate(), doConflicthdlrCreate(), doConshdlrCreate(), doCopy(), doCutselCreate(), doDispCreate(), doHeurCreate(), doNodeselCreate(), doPresolCreate(), doPricerCreate(), doPricing(), doPropCreate(), doRelaxCreate(), doScipCreate(), doSepaCreate(), doTableCreate(), dualPresolve(), AMPLProblemHandler::EndInput(), estimateBivariateQuotient(), estimateUnivariateQuotient(), execmain(), executeLNSHeuristic(), extendToCover(), extensionOperatorSOS1(), extractGates(), findAggregation(), findBestObjectiveValue(), findCumulativeConss(), findScenarioVar(), fixDeleteOrUpgradeCons(), flattenAssignment(), flattenFloat(), forbidCover(), forbidFixation(), fromAmpl(), generateAndApplyBendersCuts(), generateAndApplyBendersCuts(), generateAndApplyBendersIntegerCuts(), generateAndApplyBendersNogoodCut(), generateBoundInequalityFromSOS1Nodes(), generateCut(), generateCutSolDisagg(), generateCutSolSOC(), generateDisjCutSOS1(), generateOddCycleCut(), generateRowCardinality(), generateRowSOS2(), generateZerohalfCut(), getBinaryProductExprDo(), getFixedVariable(), getJobs(), getScenarioDecompVar(), getScenarioEntityName(), handleDoublelLexMatrix(), handleOrbitope(), includeConshdlrCountsols(), initLP(), initProblem(), initProblem(), LOPseparate(), lpBarrier(), lpDualSimplex(), lpPrimalSimplex(), newsolCliqueAddRow(), AMPLProblemHandler::OnHeader(), paramsetSetHeuristicsAggressive(), paramsetSetHeuristicsDefault(), paramsetSetHeuristicsFast(), paramsetSetHeuristicsOff(), paramsetSetPresolvingAggressive(), paramsetSetPresolvingDefault(), paramsetSetPresolvingFast(), paramsetSetPresolvingOff(), paramsetSetSeparatingAggressive(), paramsetSetSeparatingDefault(), paramsetSetSeparatingOff(), parseConstantArray(), parseConstraint(), parseName(), parseVariableArray(), performImplicationGraphAnalysis(), preprocessConstraintPairs(), presolveAddKKTLinearCons(), presolveSingleLockedVars(), printActiveVariables(), printAggregatedCons(), printAggregatedCons(), printAndCons(), printBoundSection(), printConformName(), printEntry(), printIndicatorCons(), printLinearCons(), printLinearRow(), printName(), printNLRow(), printNonlinearRow(), printRecord(), printReport(), printRow(), printRow(), printRow(), printRow(), printRow(), printRowNl(), printRowType(), printSignomial(), printSOSCons(), printSosCons(), printStart(), processArguments(), processNlRow(), propIndicator(), rangedRowPropagation(), readArguments(), readBlocks(), readBounds(), readBounds(), readCnf(), readCnfLine(), readConstraints(), readConstraints(), readConstraints(), readIndep(), readIndicators(), readLIBSVM(), readScenarios(), readSemicontinuous(), readSol(), readSolFile(), readSOS(), readSos(), readSOScons(), readVariables(), real2String(), reformulateFactorizedBinaryQuadratic(), resolvePropagation(), schedulerIncludeNeighborhood(), SCIP_DECL_BENDERSCUTEXEC(), SCIP_DECL_CONCSOLVERCREATEINST(), SCIP_DECL_CONFLICTEXEC(), SCIP_DECL_CONFLICTEXEC(), SCIP_DECL_CONFLICTEXEC(), SCIP_DECL_CONFLICTEXEC(), SCIP_DECL_CONFLICTEXEC(), SCIP_DECL_CONSENFOLP(), SCIP_DECL_CONSINITLP(), SCIP_DECL_CONSINITLP(), SCIP_DECL_CONSINITPRE(), SCIP_DECL_CONSINITPRE(), SCIP_DECL_CONSPARSE(), SCIP_DECL_CONSPRESOL(), SCIP_DECL_CONSPRESOL(), SCIP_DECL_CONSTRANS(), SCIP_DECL_CONSTRANS(), SCIP_DECL_CONSTRANS(), SCIP_DECL_CONSTRANS(), SCIP_DECL_CONSTRANS(), SCIP_DECL_CONSTRANS(), SCIP_DECL_DIALOGDESC(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_HEUREXEC(), SCIP_DECL_HEUREXEC(), SCIP_DECL_HEUREXEC(), SCIP_DECL_HEUREXIT(), SCIP_DECL_LINCONSUPGD(), SCIP_DECL_NLHDLRENFO(), SCIP_DECL_NLHDLRESTIMATE(), SCIP_DECL_NLHDLRESTIMATE(), SCIP_DECL_NLHDLRESTIMATE(), SCIP_DECL_NLHDLRINITSEPA(), SCIP_DECL_NLHDLRINITSEPA(), SCIP_DECL_NLHDLRINITSEPA(), SCIP_DECL_NLHDLRSOLLINEARIZE(), SCIP_DECL_NLHDLRSOLLINEARIZE(), SCIP_DECL_NLHDLRSOLLINEARIZE(), SCIP_DECL_PRESOLEXEC(), SCIP_DECL_PRESOLEXEC(), SCIP_DECL_PRESOLEXEC(), SCIP_DECL_PRESOLEXEC(), SCIP_DECL_READERREAD(), SCIP_DECL_READERREAD(), SCIP_DECL_SEPAEXECLP(), SCIP_DECL_SEPAEXECLP(), SCIPaddTrustregionNeighborhoodConstraint(), SCIPbendersApplyDecomposition(), SCIPbendersMergeSubproblemIntoMaster(), SCIPconcsolverCreateInstance(), SCIPcopyLargeNeighborhoodSearch(), SCIPcreateConsCardinality(), SCIPcreateConsIndicatorGeneric(), SCIPcreateConsIndicatorGenericLinConsPure(), SCIPcreateSchedulingProblem(), SCIPdecompPrintStats(), SCIPdialogDisplayMenuEntry(), SCIPdialogGetPath(), SCIPdialoghdlrAddHistory(), SCIPdialoghdlrCreate(), SCIPdialoghdlrGetLine(), SCIPdialoghdlrGetWord(), SCIPdigraphPrintGml(), SCIPdispLongint(), SCIPdispTime(), SCIPdivesetCreate(), SCIPException::SCIPException(), SCIPgetErrorString(), SCIPgetVarCopy(), SCIPincludeBenderscutInt(), SCIPincludeBenderscutNogood(), SCIPincludeBenderscutOpt(), SCIPincludeConsUpgradeNonlinear(), SCIPincludeLinconsUpgrade(), SCIPincludeNlpi(), SCIPincludeNlpSolverWorhp(), SCIPincludeReaderZpl(), SCIPlpiReadLP(), SCIPlpiWriteLP(), SCIPlpWriteMip(), SCIPnlhdlrCreate(), SCIPnlpiOraclePrintProblemGams(), SCIPnodePrintAncestorBranchings(), SCIPparamsetSetEmphasis(), SCIPparamsetSetToSubscipsOff(), SCIPprintConflictStatistics(), SCIPprintReal(), SCIPprintSolutionStatistics(), SCIPprobdataCreate(), SCIPprobdataCreate(), SCIPprobTransform(), SCIPreaderWrite(), SCIPregForestFromFile(), SCIPreoptApplyCuts(), SCIPreoptApplyGlbConss(), SCIPsetConshdlrPresol(), SCIPsetConshdlrProp(), SCIPsetConshdlrSepa(), SCIPsetPropPresol(), SCIPsnprintfProbingStats(), SCIPtpiGetLibraryDesc(), SCIPtpiGetLibraryName(), SCIPtransformMinUC(), SCIPvarNegate(), SCIPvarTransform(), SCIPverifyCircularPatternNLP(), SCIPvisualizeConsCumulative(), SCIPwriteCliqueGraph(), SCIPwriteGms(), SCIPwriteLp(), SCIPwriteMps(), SCIPwritePip(), separateCons(), separateCuts(), separateGLS(), separateIndicators(), separateMcCormickImplicit(), separatePerspective(), separateSCIs(), separateSequLiftedExtendedWeightInequality(), separateSequLiftedMinimalCoverInequality(), separateSupLiftedMinimalCoverInequality(), setObjective(), setupAndSolveCumulativeSubscip(), setupAndSolveFiniteSolSubscip(), setupProblem(), setupProblem(), setupProblem(), setupProblem(), setupProblem(), setupSubscipLpface(), solveClassification(), solveMinIISC(), solvePricingMINLP(), strengthenVarbounds(), subscipSetParams(), syntaxError(), syntaxError(), syntaxError(), TCLIQUE_NEWSOL(), tightenSingleVar(), tightenWeights(), toString(), tryAggregateIntVars(), tryUpgradingLogicor(), tryUpgradingSetppc(), tryUpgradingXor(), upgradeCons(), upgradeIndicatorSuperindicator(), upgradeLinearSuperindicator(), varSetName(), visualizeSolutionAscii(), writeFzn(), writeOpb(), writeOpbFixedVars(), writeOpbObjective(), and writeOpbRelevantAnds().
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.
t | target string |
s | source string |
size | maximal size of t |
Definition at line 10950 of file misc.c.
Referenced by appendBuffer(), readInputLine(), readPolynomial(), SCIP_DECL_CONSPARSE(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_EVENTEXEC(), SCIP_DECL_READERREAD(), SCIP_DECL_READERREAD(), SCIPdialogGetPath(), SCIPdialoghdlrAddHistory(), and xmlProcess().
int SCIPstrcasecmp | ( | const char * | s1, |
const char * | s2 ) |
portable version of strcasecmp for case-insensitive comparison of two strings
s1 | first string |
s2 | second string |
Definition at line 10916 of file misc.c.
Referenced by isNewSection(), isNewSection(), isValue(), isValue(), isValue(), isValue(), paramParseBool(), readBounds(), readBounds(), readerIsApplicable(), readSemicontinuous(), and SCIP_DECL_READERREAD().
int SCIPstrncasecmp | ( | const char * | s1, |
const char * | s2, | ||
int | length ) |
portable version of strncasecmp for case-insensitive comparison of two strings up to a given number of characters
s1 | first string |
s2 | second string |
length | maximal length to compare |
Definition at line 10929 of file misc.c.
References assert().
Referenced by getObjective(), readBounds(), readSol(), readSolFile(), and readXmlSolFile().
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
str | string to search |
value | pointer to store the parsed value |
endptr | pointer to store the final string position if successfully parsed, otherwise str |
Definition at line 10977 of file misc.c.
References assert(), FALSE, NULL, SCIP_Bool, SCIPdebugMessage, and TRUE.
Referenced by getJobId(), getJobs(), getPrecedence(), parseDetails(), parseDetails(), readFile(), readFile(), SCIP_DECL_CONSPARSE(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_DIALOGEXEC(), and SCIP_DECL_READERREAD().
extract the next token as a double value if it is one; in case a value is parsed the endptr is set to str
extract the next token as a double value if it is one; in case no value is parsed the endptr is set to str
str | string to search |
value | pointer to store the parsed value |
endptr | pointer to store the final string position if successfully parsed, otherwise str |
Definition at line 11008 of file misc.c.
References assert(), FALSE, NULL, SCIP_Bool, SCIP_Real, SCIPdebugMessage, and TRUE.
Referenced by getFixedVariable(), getNJobs(), getNResources(), getObjective(), getResourcesCapacities(), parseBase(), parseExpr(), parseFactor(), parseValue(), SCIP_DECL_CONSPARSE(), SCIPparseReal(), SCIPparseVarsPolynomial(), SCIPregForestFromFile(), and varParse().
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 occurred endptr will point to the position after the read part, otherwise it will point to str
str | string to search |
startchar | character which defines the beginning |
endchar | character which defines the ending |
token | string to store the copy |
size | size of the token char array |
endptr | pointer to store the final string position if successfully parsed, otherwise str |
Definition at line 11038 of file misc.c.
References assert(), NULL, SCIP_MAXSTRLEN, and SCIPdebugMessage.
Referenced by parseBounds(), parseDetails(), SCIP_DECL_CONSPARSE(), SCIP_DECL_CONSPARSE(), SCIPconsParse(), SCIPparseVarName(), and varParse().
SCIP_Bool SCIPstrAtStart | ( | const char * | s, |
const char * | t, | ||
size_t | tlen ) |
checks whether a given string t appears at the beginning of the string s (up to spaces at beginning)
s | string to search in |
t | string to search for |
tlen | length of t |
Definition at line 11417 of file misc.c.
References assert(), FALSE, NULL, SCIP_Bool, SCIP_MAXSTRLEN, and TRUE.
Referenced by SCIP_DECL_READERREAD(), and SCIP_DECL_READERREAD().