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) |
int | SCIPsnprintf (char *t, int len, const char *s,...) |
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) |
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.
dest | destination pointer to copy to |
src | source pointer to copy to |
stop | character when found stop copying |
cnt | maximal number of characters to copy too |
Definition at line 9252 of file misc.c.
References NULL.
Referenced by mpsinputSetObjname(), mpsinputSetProbname(), readBounds(), readCoefficients(), readCols(), readRanges(), readRhs(), readSOS(), and readSos().
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 9276 of file misc.c.
References SCIP_MAXSTRLEN, and SCIPmessagePrintError().
Referenced by LOPreadFile(), readBounds(), readDiffFile(), readFZNFile(), readLPFile(), readMps(), readOPBFile(), readPIPFile(), readSol(), readSolFile(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_EVENTEXEC(), 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 9298 of file misc.c.
Referenced by mpsinputReadLine(), parseConstraint(), readCnf(), and SCIP_DECL_CONSPARSE().
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
t | target buffer to store escaped string |
bufsize | size of buffer t |
s | string to transform into escaped string |
Definition at line 9312 of file misc.c.
References NULL.
Referenced by SCIP_DECL_DIALOGEXEC(), and SCIPdialoghdlrAddHistory().
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 |
Definition at line 9340 of file misc.c.
References NULL, and SCIPerrorMessage.
Referenced by addBranchingComplementaritiesSOS1(), addCliques(), addCut(), addExtendedAsymmetricFormulation(), addExtendedFlowFormulation(), addExtraCliques(), addFixParamDialog(), addLocalBranchingConstraint(), addLocalConss(), addRelaxation(), addSetParamDialog(), addSplitcons(), addVarbound(), addVarCardinality(), adjustOversizedJobBounds(), appendVarCardinality(), applyFixings(), applyRepair(), branchBalancedCardinality(), btPrintSubtree(), checkConsnames(), checkVarnames(), cliquePresolve(), componentCreateSubscip(), computeCut(), computeEffectiveHorizon(), computeInteriorPoint(), computeMinDistance(), consdataCollectLinkingCons(), consdataCreateBinvars(), copyCuts(), createAndAddAndCons(), createAndAddDualray(), createAndAddLinearCons(), createCapacityRestriction(), createCapacityRestrictionIntvars(), createCGCutCMIR(), createCGCutDirect(), createCGCutStrongCG(), createConflict(), createConstraints(), createCoverCutsTimepoint(), createCoveringProblem(), createIndicatorConstraint(), createInitialColumns(), createKKTComplementarityBinary(), createKKTComplementarityBounds(), createKKTComplementarityLinear(), createKKTDualCons(), createMIP(), createRelaxation(), createRows(), createSubproblem(), createSubSCIP(), createSubscip(), createVarUbs(), createZerohalfCutFromZerohalfWeightvector(), deleteRedundantVars(), detectRedundantVars(), disaggregate(), displayRelevantStats(), doCopy(), dualPresolve(), extendToCover(), extensionOperatorSOS1(), extractGates(), findAggregation(), findCumulativeConss(), fixDeleteOrUpgradeCons(), flattenAssignment(), flattenFloat(), forbidCover(), forbidFixation(), generateBoundInequalityFromSOS1Nodes(), generateConvexConcaveEstimator(), generateCut(), generateCutConvex(), generateCutFactorableDo(), generateCutLTI(), generateCutNonConvex(), generateCutPoint(), generateCutProjectedPoint(), generateCutSol(), generateDisjCutSOS1(), generateLinearizationCut(), generateOddCycleCut(), generateRowCardinality(), generateRowSOS2(), generateSecantCut(), getFixedVariable(), includeConshdlrCountsols(), 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(), printActiveVariables(), printAggregatedCons(), printAndCons(), printBoundSection(), printConflictStatistics(), printConformName(), printEntry(), printExpr(), printIndicatorCons(), printLinearCons(), printLinearRow(), printNLRow(), printNonlinearRow(), printPBRow(), printQuadraticRow(), printRecord(), printRow(), printRowNl(), printRowType(), printSignpowerRow(), printSOCCons(), printSolutionStatistics(), printSOSCons(), printSosCons(), printStart(), processNlRow(), propIndicator(), readBounds(), readCnf(), readCnfLine(), readConstraints(), readIndicators(), 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_READERWRITE(), SCIP_DECL_SEPAEXECLP(), SCIP_DECL_SOLVECUMULATIVE(), SCIPbranchruleCreate(), SCIPcomprCreate(), SCIPconcsolverCreateInstance(), SCIPconcsolverTypeCreate(), SCIPconflicthdlrCreate(), SCIPconshdlrCreate(), SCIPcopyLargeNeighborhoodSearch(), SCIPcreateConsCardinality(), SCIPcreateConsIndicator(), SCIPcreateFiniteSolCopy(), SCIPdialogDisplayMenuEntry(), SCIPdialogGetPath(), SCIPdialoghdlrAddHistory(), SCIPdialoghdlrCreate(), SCIPdialoghdlrGetLine(), SCIPdialoghdlrGetWord(), SCIPdigraphPrintGml(), SCIPdispCreate(), SCIPdispLongint(), SCIPdispTime(), SCIPdivesetCreate(), SCIPgetVarCopy(), SCIPheurCreate(), SCIPincludeNlpi(), SCIPincludeNonlinconsUpgrade(), SCIPincludeQuadconsUpgrade(), SCIPincludeReaderZpl(), SCIPlpWriteMip(), SCIPnodePrintAncestorBranchings(), SCIPnodeselCreate(), SCIPparamsetSetEmphasis(), SCIPparamsetSetToSubscipsOff(), SCIPpresolCreate(), SCIPpricerCreate(), SCIPprintReal(), SCIPprobdataCreate(), SCIPprobTransform(), SCIPpropCreate(), SCIPreaderWrite(), SCIPrelaxCreate(), SCIPreoptApplyCuts(), SCIPreoptApplyGlbConss(), SCIPsepaCreate(), SCIPsetConshdlrPresol(), SCIPsetConshdlrProp(), SCIPsetConshdlrSepa(), SCIPsetPropPresol(), SCIPtransformMinUC(), SCIPvarNegate(), SCIPvarTransform(), SCIPvisualizeConsCumulative(), SCIPwriteCliqueGraph(), SCIPwriteGms(), SCIPwriteLp(), SCIPwritePip(), separateCons(), separateCuts(), separateGLS(), separateIndicators(), separatePerspective(), separateSCIs(), separateSequLiftedExtendedWeightInequality(), separateSequLiftedMinimalCoverInequality(), separateSupLiftedMinimalCoverInequality(), setObjective(), setupProblem(), strengthenVarbounds(), syntaxError(), tightenCoefs(), tightenWeights(), toString(), tryAggregateIntVars(), tryUpgradingLogicor(), tryUpgradingSetppc(), tryUpgradingXor(), upgradeIndicatorSuperindicator(), upgradeLinearSuperindicator(), varSetName(), writeFzn(), writeOpb(), writeOpbFixedVars(), writeOpbObjective(), writeOpbRelevantAnds(), and ZerohalfAuxGraphFree().
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 9380 of file misc.c.
References FALSE, NULL, SCIPdebugMessage, and TRUE.
Referenced by exprParse(), and SCIP_DECL_DIALOGEXEC().
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 9411 of file misc.c.
References FALSE, NULL, SCIPdebugMessage, and TRUE.
Referenced by exprParse(), getFixedVariable(), getObjective(), parseValue(), SCIP_DECL_CONSPARSE(), SCIPparseReal(), SCIPparseVarsPolynomial(), 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 occured 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 9441 of file misc.c.
References NULL, SCIP_MAXSTRLEN, and SCIPdebugMessage.
Referenced by parseBounds(), SCIP_DECL_CONSPARSE(), SCIPconsParse(), SCIPparseVarName(), and varParse().