SCIP Doxygen Documentation
Loading...
Searching...
No Matches
Rational Arithmetic

Detailed Description

wrapper for rational number arithmetic

Macros

#define SCIPrationalDebugMessage   while ( FALSE ) SCIPrationalPrintf

Functions

SCIP_RETCODE SCIPrationalCreate (SCIP_RATIONAL **rational)
SCIP_RETCODE SCIPrationalCreateBuffer (BMS_BUFMEM *bufmem, SCIP_RATIONAL **rational)
SCIP_RETCODE SCIPrationalCreateBlock (BMS_BLKMEM *blkmem, SCIP_RATIONAL **rational)
SCIP_RETCODE SCIPrationalCopy (SCIP_RATIONAL **result, SCIP_RATIONAL *src)
SCIP_RETCODE SCIPrationalCopyBlock (BMS_BLKMEM *mem, SCIP_RATIONAL **result, SCIP_RATIONAL *src)
SCIP_RETCODE SCIPrationalCopyBuffer (BMS_BUFMEM *bufmem, SCIP_RATIONAL **result, SCIP_RATIONAL *src)
SCIP_RETCODE SCIPrationalCreateArray (SCIP_RATIONAL ***rational, int size)
SCIP_RETCODE SCIPrationalCreateBlockArray (BMS_BLKMEM *mem, SCIP_RATIONAL ***rational, int size)
SCIP_RETCODE SCIPrationalCreateBufferArray (BMS_BUFMEM *mem, SCIP_RATIONAL ***rational, int size)
SCIP_RETCODE SCIPrationalCopyArray (SCIP_RATIONAL ***target, SCIP_RATIONAL **src, int len)
SCIP_RETCODE SCIPrationalCopyBlockArray (BMS_BLKMEM *mem, SCIP_RATIONAL ***target, SCIP_RATIONAL **src, int len)
SCIP_RETCODE SCIPrationalCopyBufferArray (BMS_BUFMEM *mem, SCIP_RATIONAL ***result, SCIP_RATIONAL **src, int len)
SCIP_RETCODE SCIPrationalReallocArray (SCIP_RATIONAL ***result, int oldlen, int newlen)
SCIP_RETCODE SCIPrationalReallocBufferArray (BMS_BUFMEM *mem, SCIP_RATIONAL ***result, int oldlen, int newlen)
SCIP_RETCODE SCIPrationalReallocBlockArray (BMS_BLKMEM *mem, SCIP_RATIONAL ***result, int oldlen, int newlen)
void SCIPrationalFree (SCIP_RATIONAL **rational)
void SCIPrationalFreeBlock (BMS_BLKMEM *mem, SCIP_RATIONAL **rational)
void SCIPrationalFreeBuffer (BMS_BUFMEM *bufmem, SCIP_RATIONAL **rational)
void SCIPrationalFreeArray (SCIP_RATIONAL ***ratarray, int size)
void SCIPrationalFreeBlockArray (BMS_BLKMEM *mem, SCIP_RATIONAL ***ratblockarray, int size)
void SCIPrationalFreeBufferArray (BMS_BUFMEM *mem, SCIP_RATIONAL ***ratbufarray, int size)
void SCIPrationalSetRational (SCIP_RATIONAL *res, SCIP_RATIONAL *src)
void SCIPrationalSetFraction (SCIP_RATIONAL *res, SCIP_Longint nom, SCIP_Longint denom)
void SCIPrationalSetReal (SCIP_RATIONAL *res, SCIP_Real real)
void SCIPrationalSetInfinity (SCIP_RATIONAL *res)
void SCIPrationalSetNegInfinity (SCIP_RATIONAL *res)
SCIP_Bool SCIPrationalIsString (const char *desc)
void SCIPrationalSetString (SCIP_RATIONAL *res, const char *desc)
SCIP_RETCODE SCIPrationalCreateString (BMS_BLKMEM *mem, SCIP_RATIONAL **rational, const char *desc)
SCIP_Bool SCIPstrToRationalValue (char *desc, SCIP_RATIONAL *value, char **endptr)
void SCIPrationalResetFloatingPointRepresentable (SCIP_RATIONAL *rat)
void SCIPrationalCanonicalize (SCIP_RATIONAL *rational)
void SCIPrationalCheckInfByValue (SCIP_RATIONAL *rational)
void SCIPrationalAdd (SCIP_RATIONAL *res, SCIP_RATIONAL *op1, SCIP_RATIONAL *op2)
void SCIPrationalAddReal (SCIP_RATIONAL *res, SCIP_RATIONAL *rat, SCIP_Real real)
void SCIPrationalDiff (SCIP_RATIONAL *res, SCIP_RATIONAL *op1, SCIP_RATIONAL *op2)
void SCIPrationalDiffReal (SCIP_RATIONAL *res, SCIP_RATIONAL *rat, SCIP_Real real)
void SCIPrationalRelDiff (SCIP_RATIONAL *res, SCIP_RATIONAL *val1, SCIP_RATIONAL *val2)
void SCIPrationalMult (SCIP_RATIONAL *res, SCIP_RATIONAL *op1, SCIP_RATIONAL *op2)
void SCIPrationalMultReal (SCIP_RATIONAL *res, SCIP_RATIONAL *op1, SCIP_Real op2)
void SCIPrationalDiv (SCIP_RATIONAL *res, SCIP_RATIONAL *op1, SCIP_RATIONAL *op2)
void SCIPrationalDivReal (SCIP_RATIONAL *res, SCIP_RATIONAL *op1, SCIP_Real op2)
void SCIPrationalAddProd (SCIP_RATIONAL *res, SCIP_RATIONAL *op1, SCIP_RATIONAL *op2)
void SCIPrationalAddProdReal (SCIP_RATIONAL *res, SCIP_RATIONAL *op1, SCIP_Real op2)
void SCIPrationalDiffProd (SCIP_RATIONAL *res, SCIP_RATIONAL *op1, SCIP_RATIONAL *op2)
void SCIPrationalDiffProdReal (SCIP_RATIONAL *res, SCIP_RATIONAL *op1, SCIP_Real op2)
void SCIPrationalNegate (SCIP_RATIONAL *res, SCIP_RATIONAL *op)
void SCIPrationalAbs (SCIP_RATIONAL *res, SCIP_RATIONAL *op)
void SCIPrationalInvert (SCIP_RATIONAL *res, SCIP_RATIONAL *op)
void SCIPrationalMin (SCIP_RATIONAL *res, SCIP_RATIONAL *op1, SCIP_RATIONAL *op2)
void SCIPrationalMax (SCIP_RATIONAL *res, SCIP_RATIONAL *op1, SCIP_RATIONAL *op2)
SCIP_Bool SCIPrationalIsEQ (SCIP_RATIONAL *rat1, SCIP_RATIONAL *rat2)
SCIP_Bool SCIPrationalIsAbsEQ (SCIP_RATIONAL *rat1, SCIP_RATIONAL *rat2)
SCIP_Bool SCIPrationalIsEQReal (SCIP_RATIONAL *rat, SCIP_Real real)
SCIP_Bool SCIPrationalIsApproxEQReal (SCIP_SET *set, SCIP_RATIONAL *rat, SCIP_Real real, SCIP_ROUNDMODE_RAT roundmode)
SCIP_Bool SCIPrationalIsGT (SCIP_RATIONAL *rat1, SCIP_RATIONAL *rat2)
SCIP_Bool SCIPrationalIsLT (SCIP_RATIONAL *rat1, SCIP_RATIONAL *rat2)
SCIP_Bool SCIPrationalIsGE (SCIP_RATIONAL *rat1, SCIP_RATIONAL *rat2)
SCIP_Bool SCIPrationalIsLE (SCIP_RATIONAL *rat1, SCIP_RATIONAL *rat2)
SCIP_Bool SCIPrationalIsAbsGT (SCIP_RATIONAL *rat1, SCIP_RATIONAL *rat2)
SCIP_Bool SCIPrationalIsGTReal (SCIP_RATIONAL *rat, SCIP_Real real)
SCIP_Bool SCIPrationalIsLTReal (SCIP_RATIONAL *rat, SCIP_Real real)
SCIP_Bool SCIPrationalIsGEReal (SCIP_RATIONAL *rat, SCIP_Real real)
SCIP_Bool SCIPrationalIsLEReal (SCIP_RATIONAL *rat, SCIP_Real real)
SCIP_Bool SCIPrationalIsZero (SCIP_RATIONAL *rational)
SCIP_Bool SCIPrationalIsPositive (SCIP_RATIONAL *rational)
SCIP_Bool SCIPrationalIsNegative (SCIP_RATIONAL *rational)
SCIP_Bool SCIPrationalIsInfinity (SCIP_RATIONAL *rational)
SCIP_Bool SCIPrationalIsNegInfinity (SCIP_RATIONAL *rational)
SCIP_Bool SCIPrationalIsAbsInfinity (SCIP_RATIONAL *rational)
SCIP_Bool SCIPrationalIsIntegral (SCIP_RATIONAL *rational)
SCIP_Bool SCIPrationalIsFpRepresentable (SCIP_RATIONAL *rational)
int SCIPrationalToString (SCIP_RATIONAL *rational, char *str, int strlen)
int SCIPrationalStrLen (SCIP_RATIONAL *rational)
void SCIPrationalMessage (SCIP_MESSAGEHDLR *msg, FILE *file, SCIP_RATIONAL *rational)
void SCIPrationalPrintVerbInfo (SCIP_MESSAGEHDLR *msg, SCIP_VERBLEVEL verblevel, SCIP_VERBLEVEL msgverblevel, SCIP_RATIONAL *rational)
void SCIPrationalPrint (SCIP_RATIONAL *rational)
void SCIPrationalPrintf (const char *formatstr,...)
void SCIPrationalPrintDebugMessage (const char *sourcefile, int sourceline, const char *formatstr,...)
SCIP_Longint SCIPrationalNumerator (SCIP_RATIONAL *rational)
SCIP_Longint SCIPrationalDenominator (SCIP_RATIONAL *rational)
SCIP_Bool SCIPrationalDenominatorIsLE (SCIP_RATIONAL *rational, SCIP_Longint val)
int SCIPrationalGetSign (const SCIP_RATIONAL *rational)
void SCIPrationalGetFrac (SCIP_RATIONAL *res, SCIP_RATIONAL *src)
SCIP_Real SCIPrationalGetReal (SCIP_RATIONAL *rational)
SCIP_Real SCIPrationalRoundReal (SCIP_RATIONAL *rational, SCIP_ROUNDMODE_RAT roundmode)
void SCIPrationalRoundInteger (SCIP_RATIONAL *res, SCIP_RATIONAL *src, SCIP_ROUNDMODE_RAT roundmode)
SCIP_Bool SCIPrationalRoundLong (SCIP_Longint *res, SCIP_RATIONAL *src, SCIP_ROUNDMODE_RAT roundmode)
void SCIPrationalComputeApproximation (SCIP_RATIONAL *res, SCIP_RATIONAL *src, SCIP_Longint maxdenom, int forcegreater)
SCIP_RETCODE SCIPrationalarrayCreate (SCIP_RATIONALARRAY **rationalarray, BMS_BLKMEM *blkmem)
SCIP_RETCODE SCIPrationalarrayResize (SCIP_RATIONALARRAY *rationalarray, int newsize)
SCIP_RETCODE SCIPrationalarrayCopy (SCIP_RATIONALARRAY **rationalarray, BMS_BLKMEM *blkmem, SCIP_RATIONALARRAY *sourcerationalarray)
SCIP_RETCODE SCIPrationalarrayFree (SCIP_RATIONALARRAY **rationalarray, BMS_BLKMEM *blkmem)
void SCIPrationalarrayGetVal (SCIP_RATIONALARRAY *rationalarray, int idx, SCIP_RATIONAL *result)
SCIP_RETCODE SCIPrationalarraySetVal (SCIP_RATIONALARRAY *rationalarray, int idx, SCIP_RATIONAL *val)
SCIP_RETCODE SCIPrationalarrayIncVal (SCIP_RATIONALARRAY *rationalarray, int idx, SCIP_RATIONAL *incval)
SCIP_RETCODE SCIPrationalarrayPrint (SCIP_RATIONALARRAY *rationalarray)
int SCIPrationalarrayGetMinIdx (SCIP_RATIONALARRAY *rationalarray)
int SCIPrationalarrayGetMaxIdx (SCIP_RATIONALARRAY *rationalarray)
void SCIPrationalChgInfinity (SCIP_Real inf)
SCIP_Real SCIPrationalGetInfinity (void)

Macro Definition Documentation

◆ SCIPrationalDebugMessage

#define SCIPrationalDebugMessage   while ( FALSE ) SCIPrationalPrintf

rational extension for the SCIPdebugMsg

Definition at line 641 of file rational.h.

Referenced by applyBounding(), certificatePrintMirSplit(), checkCons(), colExactAddCoef(), colExactChgCoefPos(), colExactDelCoefPos(), consdataGetActivity(), getFixedVariable(), getObjective(), lpExactFlushAddRows(), lpExactFlushAndSolve(), parseValue(), primalSetCutoffboundExact(), primalSetUpperboundExact(), probScaleObjExact(), propagateCons(), readRhsExact(), rowExactAddCoef(), rowExactChgCoefPos(), rowExactDelCoefPos(), SCIPcertificatePrintDualboundExactLP(), SCIPcertificatePrintMirCut(), SCIPcolExactChgLb(), SCIPcolExactChgObj(), SCIPcolExactChgUb(), SCIPinferVarLbConsExact(), SCIPinferVarUbConsExact(), SCIPlpExactAddCol(), SCIPlpExactAddRow(), SCIPlpExactGetDualfarkas(), SCIPlpExactGetSol(), SCIPlpExactSolveAndEval(), SCIPnodeAddBoundinferExact(), SCIPnodepqInsert(), SCIPprobAddObjoffsetExact(), SCIPrationalToString(), SCIPsolOverwriteFPSolWithExact(), SCIPvarAddObjExact(), SCIPvarAddToRowExact(), SCIPvarAdjustLbExact(), SCIPvarAdjustUbExact(), SCIPvarAggregateExact(), SCIPvarChgLbExactDive(), SCIPvarChgLbGlobalExact(), SCIPvarChgLbLocalExact(), SCIPvarChgLbOriginalExact(), SCIPvarChgObjExact(), SCIPvarChgUbExactDive(), SCIPvarChgUbGlobalExact(), SCIPvarChgUbLocalExact(), SCIPvarChgUbOriginalExact(), SCIPvarFixExact(), SCIPvarGetProbvarBoundExact(), SCIPvarMultiaggregateExact(), solCheckExact(), varEventGlbChangedExact(), varEventLbChangedExact(), varProcessChgLbGlobalExact(), varProcessChgLbLocalExact(), varProcessChgUbGlobalExact(), varProcessChgUbLocalExact(), and varUpdateAggregationBoundsExact().

Function Documentation

◆ SCIPrationalCreate()

SCIP_RETCODE SCIPrationalCreate ( SCIP_RATIONAL ** rational)

creates a rational using standard memory allocation

allocate and create a rational from nominator and denominator using ordinary memory

Parameters
rationalpointer to the rational to create

Definition at line 95 of file rational.cpp.

References BMSallocMemory, FALSE, SCIP_ALLOC, SCIP_ISFPREPRESENTABLE_TRUE, and SCIP_OKAY.

Referenced by SCIP_DECL_SORTINDCOMP(), SCIPrationalCopy(), SCIPrationalCreateArray(), SCIPrationalReallocArray(), SCIPstatCreate(), SCIPvalidateSolveExact(), SCIPvarGetLPSolExact_rec(), and treeAddPendingBdchg().

◆ SCIPrationalCreateBuffer()

SCIP_RETCODE SCIPrationalCreateBuffer ( BMS_BUFMEM * bufmem,
SCIP_RATIONAL ** rational )

creates a rational using buffer memory

allocate and create a rational from nominator and denominator using buffer memory

Parameters
bufmembuffer memory
rationalpointer to the rational to create

Definition at line 124 of file rational.cpp.

References BMSallocBufferMemory, FALSE, SCIP_ISFPREPRESENTABLE_TRUE, and SCIP_OKAY.

Referenced by addConstraintExact(), applyFixings(), branchcandCalcLPCandsExact(), certificatePrintMirSplit(), certificatePrintRow(), checkIntegralityExact(), checkSolOrigExact(), colExactSwapCoefs(), consdataCreate(), consdataGetActivity(), consdataGetFeasibility(), consdataScaleMinValue(), consPrintConsSol(), createAndAddProofcons(), displayRelevantStats(), getFixedVariable(), getObjectiveRow(), getObjvalDeltaObjExact(), getVariable(), lpExactFlushChgCols(), lpExactFlushChgRows(), mergeMultiples(), primalAddSol(), primalAddSolExact(), primalSetCutoffbound(), primalSetUpperboundExact(), printActivityConflictToCertificate(), printLinearConsExact(), printRowExact(), probScaleObjExact(), readBinaries(), readBoundsExact(), readBoundsRational(), readCoefficientsRational(), readColsExact(), readConstraints(), readConstraintsRational(), readObjectiveRational(), readOPBFile(), readRangesExact(), readRhsExact(), readRowsExact(), rowExactCreateFromRowLimitEncodingLength(), rowExactSwapCoefs(), SCIP_DECL_CONSCHECK(), SCIP_DECL_CONSCHECK(), SCIP_DECL_CONSPARSE(), SCIP_DECL_READERREAD(), SCIPaddCoefExactLinear(), SCIPaddOrigObjoffset(), SCIPaggregateVarsExact(), SCIPbranchExecLPExact(), SCIPcalcIntegralScalarExact(), SCIPcertificatePrintAggrrow(), SCIPcertificatePrintCutoffBound(), SCIPcertificatePrintCutoffConflictingBounds(), SCIPcertificatePrintDualboundExactLP(), SCIPcertificatePrintDualboundPseudo(), SCIPcertificatePrintInheritedBound(), SCIPcertificatePrintMirCut(), SCIPcertificatePrintResult(), SCIPcertificatePrintUnsplitting(), SCIPcertificateUpdateBranchingData(), SCIPcertifyActivityVarBound(), SCIPcolExactCalcFarkasRedcostCoef(), SCIPcollectSolutionStatistics(), SCIPconsPrintCertificateExactLinear(), SCIPcreateConsExactLinear(), SCIPdelCoefExactLinear(), SCIPeventProcess(), SCIPgetDualboundExact(), SCIPgetSolOrigObjExact(), SCIPinferVarLbConsExact(), SCIPinferVarUbConsExact(), SCIPlpExactEndDive(), SCIPlpExactGetDualfarkas(), SCIPlpExactGetSol(), SCIPlpExactSetCutoffbound(), SCIPlpExactSolveAndEval(), SCIPlpExactUpdateAddVar(), SCIPlpExactUpdateDelVar(), SCIPlpExactUpdateVarColumn(), SCIPlpExactUpdateVarLb(), SCIPlpExactUpdateVarLbGlobal(), SCIPlpExactUpdateVarLoose(), SCIPlpExactUpdateVarObj(), SCIPlpExactUpdateVarUb(), SCIPlpExactUpdateVarUbGlobal(), SCIPnodeAddBoundinfer(), SCIPnodeAddBoundinferExact(), SCIPnodeUpdateLowerboundLP(), SCIPparseVarsPolynomialExact(), SCIPprimalUpdateObjoffsetExact(), SCIPprintSolExact(), SCIPprintSolutionStatistics(), SCIPrationalCopyBuffer(), SCIPrationalCreateBufferArray(), SCIPrationalReallocBufferArray(), SCIPreaderWrite(), SCIProwExactAddConstant(), SCIProwExactCreateFromRow(), SCIProwExactGetLPFeasibility(), SCIProwExactGetPseudoFeasibility(), SCIProwExactGetSolActivity(), SCIProwExactGetSolFeasibility(), SCIProwExactIncCoef(), SCIPsolGetValExact(), SCIPsolMakeExact(), SCIPsolMakeReal(), SCIPsolOverwriteFPSolWithExact(), SCIPsolPrintExact(), SCIPsolRecomputeInternObjExact(), SCIPsolRetransformExact(), SCIPsolSetValExact(), SCIPsolveExactDiveLP(), SCIPtightenVarLbExact(), SCIPtightenVarUbExact(), SCIPvarAddObjExact(), SCIPvarAddToRowExact(), SCIPvarAggregateExact(), SCIPvarChgLbGlobalExact(), SCIPvarChgLbLocalExact(), SCIPvarChgLbOriginalExact(), SCIPvarChgObjExact(), SCIPvarChgUbGlobalExact(), SCIPvarChgUbLocalExact(), SCIPvarChgUbOriginalExact(), SCIPvarFixExact(), SCIPvarGetActiveRepresentativesExact(), SCIPvarGetMultaggrLbLocalExact(), SCIPvarGetMultaggrUbLocalExact(), SCIPvarMultiaggregateExact(), SCIPvarTryAggregateVarsExact(), SCIPwriteLp(), setObjective(), solCheckExact(), solOfInterest(), solsAreEqualExact(), solUnlinkVarExact(), tightenVarBounds(), tightenVarLbGlobalSafe(), tightenVarUbGlobalSafe(), tryAggregateIntVarsExact(), updateLpExactBoundChange(), varProcessChgLbGlobalExact(), varProcessChgLbLocalExact(), varProcessChgUbGlobalExact(), varProcessChgUbLocalExact(), varUpdateAggregationBoundsExact(), writeOpbConstraints(), and writeOpbObjective().

◆ SCIPrationalCreateBlock()

◆ SCIPrationalCopy()

SCIP_RETCODE SCIPrationalCopy ( SCIP_RATIONAL ** result,
SCIP_RATIONAL * src )

creates a copy of a rational using ordinary memory

Parameters
resultpointer to the rational to create
srcrational to copy

Definition at line 139 of file rational.cpp.

References result, SCIP_CALL, SCIP_OKAY, SCIPrationalCreate(), and SCIPrationalSetRational().

Referenced by SCIPrationalCopyArray().

◆ SCIPrationalCopyBlock()

◆ SCIPrationalCopyBuffer()

SCIP_RETCODE SCIPrationalCopyBuffer ( BMS_BUFMEM * bufmem,
SCIP_RATIONAL ** result,
SCIP_RATIONAL * src )

creates a copy of a rational

creates a copy of a rational using buffer memory

Parameters
bufmembuffer memory
resultpointer to the rational to create
srcrational to copy

Definition at line 166 of file rational.cpp.

References result, SCIP_CALL, SCIP_OKAY, SCIPrationalCreateBuffer(), and SCIPrationalSetRational().

Referenced by addConstraintExact(), and SCIPrationalCopyBufferArray().

◆ SCIPrationalCreateArray()

SCIP_RETCODE SCIPrationalCreateArray ( SCIP_RATIONAL *** rational,
int size )

creates an array of rationals using ordinary memory

create an array of rationals using ordinary memory

Parameters
rationalpointer to the array to create
sizethe size of the array

Definition at line 180 of file rational.cpp.

References BMSallocMemoryArray, i, SCIP_CALL, SCIP_ISFPREPRESENTABLE_TRUE, SCIP_OKAY, and SCIPrationalCreate().

Referenced by SCIP_DECL_DIALOGEXEC().

◆ SCIPrationalCreateBlockArray()

SCIP_RETCODE SCIPrationalCreateBlockArray ( BMS_BLKMEM * mem,
SCIP_RATIONAL *** rational,
int size )

creates an array of rationals using block memory

create an array of rationals using block memory

Parameters
memblock memory
rationalpointer to the array to create
sizethe size of the array

Definition at line 197 of file rational.cpp.

References BMSallocBlockMemoryArray, i, SCIP_CALL, SCIP_ISFPREPRESENTABLE_TRUE, SCIP_OKAY, and SCIPrationalCreateBlock().

Referenced by readCoefficientsRational(), and SCIPcertificateInit().

◆ SCIPrationalCreateBufferArray()

◆ SCIPrationalCopyArray()

SCIP_RETCODE SCIPrationalCopyArray ( SCIP_RATIONAL *** target,
SCIP_RATIONAL ** src,
int len )

copies an array of rationals using ordinary memory

copy an array of rationals using ordinary memory

Parameters
targetaddress to copy to
srcsrc array
lensize of src array

Definition at line 233 of file rational.cpp.

References BMSduplicateMemoryArray, i, SCIP_CALL, SCIP_OKAY, and SCIPrationalCopy().

◆ SCIPrationalCopyBlockArray()

SCIP_RETCODE SCIPrationalCopyBlockArray ( BMS_BLKMEM * mem,
SCIP_RATIONAL *** target,
SCIP_RATIONAL ** src,
int len )

copies an array of rationals using block memory

copy an array of rationals using block memory

Parameters
memblock memory
targetaddress to copy to
srcsrc array
lensize of src array

Definition at line 250 of file rational.cpp.

References BMSduplicateBlockMemoryArray, i, SCIP_CALL, SCIP_OKAY, and SCIPrationalCopyBlock().

Referenced by consdataCreate(), SCIPcolExactCreate(), SCIProwExactCreate(), SCIPvarCopyExactData(), and SCIPvarMultiaggregateExact().

◆ SCIPrationalCopyBufferArray()

SCIP_RETCODE SCIPrationalCopyBufferArray ( BMS_BUFMEM * mem,
SCIP_RATIONAL *** result,
SCIP_RATIONAL ** src,
int len )

copy an array of rationals using buffer memory

Parameters
membuffer memory
resultaddress to copy to
srcsrc array
lensize of src array

Definition at line 268 of file rational.cpp.

References BMSduplicateBufferMemoryArray, i, result, SCIP_CALL, SCIP_OKAY, and SCIPrationalCopyBuffer().

Referenced by addConstraintExact(), printLinearConsExact(), and SCIPvarGetActiveRepresentativesExact().

◆ SCIPrationalReallocArray()

SCIP_RETCODE SCIPrationalReallocArray ( SCIP_RATIONAL *** result,
int oldlen,
int newlen )

realloc a rational ordinary array

realloc a rational ordinary arrray

Parameters
resultaddress to copy to
oldlensize of src array
newlensize of src array

Definition at line 286 of file rational.cpp.

References BMSreallocMemoryArray, i, result, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPrationalCreate(), and SCIPrationalFree().

◆ SCIPrationalReallocBufferArray()

SCIP_RETCODE SCIPrationalReallocBufferArray ( BMS_BUFMEM * mem,
SCIP_RATIONAL *** result,
int oldlen,
int newlen )

realloc a rational buffer arrray

Parameters
membuffer memory
resultaddress to copy to
oldlensize of src array
newlensize of src array

Definition at line 315 of file rational.cpp.

References BMSreallocBufferMemoryArray, i, result, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPrationalCreateBuffer(), and SCIPrationalFreeBuffer().

Referenced by getActiveVariablesExact(), getActiveVariablesExact(), getFixedVariable(), SCIP_DECL_CONSPARSE(), and SCIPvarGetActiveRepresentativesExact().

◆ SCIPrationalReallocBlockArray()

SCIP_RETCODE SCIPrationalReallocBlockArray ( BMS_BLKMEM * mem,
SCIP_RATIONAL *** result,
int oldlen,
int newlen )

realloc a rational block arrray

Parameters
memblock memory
resultaddress to copy to
oldlensize of src array
newlensize of src array

Definition at line 345 of file rational.cpp.

References BMSreallocBlockMemoryArray, i, result, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPrationalCreateBlock(), and SCIPrationalFreeBlock().

Referenced by readCoefficientsRational(), SCIPcertificatePrintDualboundExactLP(), SCIPparseVarsPolynomialExact(), SCIPvarFlattenAggregationGraph(), and SCIPvarMultiaggregateExact().

◆ SCIPrationalFree()

void SCIPrationalFree ( SCIP_RATIONAL ** rational)

deletes a rational and frees the allocated ordinary memory

delete a rational and free the allocated ordinary memory

Parameters
rationaladdress of the rational

Definition at line 451 of file rational.cpp.

References assert(), and BMSfreeMemory.

Referenced by SCIP_DECL_SORTINDCOMP(), SCIPrationalFreeArray(), SCIPrationalReallocArray(), SCIPstatFree(), SCIPvalidateSolveExact(), and SCIPvarGetLPSolExact_rec().

◆ SCIPrationalFreeBlock()

◆ SCIPrationalFreeBuffer()

void SCIPrationalFreeBuffer ( BMS_BUFMEM * bufmem,
SCIP_RATIONAL ** rational )

deletes a rational and frees the allocated buffer memory

delete a rational and free the allocated buffer memory

Parameters
bufmembuffer memory
rationaladdress of the rational

Definition at line 474 of file rational.cpp.

References assert(), and BMSfreeBufferMemory.

Referenced by addConstraintExact(), applyFixings(), branchcandCalcLPCandsExact(), certificatePrintMirSplit(), certificatePrintRow(), checkIntegralityExact(), checkSolOrigExact(), colExactSwapCoefs(), consdataCreate(), consdataGetActivity(), consdataGetFeasibility(), consdataScaleMinValue(), consPrintConsSol(), createAndAddProofcons(), displayRelevantStats(), getFixedVariable(), getObjectiveRow(), getObjvalDeltaObjExact(), getVariable(), lpExactFlushChgCols(), lpExactFlushChgRows(), mergeMultiples(), primalAddSol(), primalAddSolExact(), primalSetCutoffbound(), primalSetUpperboundExact(), printActivityConflictToCertificate(), printLinearConsExact(), printRowExact(), probScaleObjExact(), readBinaries(), readBoundsExact(), readBoundsRational(), readCoefficientsRational(), readColsExact(), readConstraints(), readConstraintsRational(), readObjectiveRational(), readOPBFile(), readRangesExact(), readRhsExact(), readRowsExact(), rowExactCreateFromRowLimitEncodingLength(), rowExactSwapCoefs(), SCIP_DECL_CONSCHECK(), SCIP_DECL_CONSCHECK(), SCIP_DECL_CONSPARSE(), SCIP_DECL_READERREAD(), SCIPaddCoefExactLinear(), SCIPaddOrigObjoffset(), SCIPaggregateVarsExact(), SCIPbranchExecLPExact(), SCIPcalcIntegralScalarExact(), SCIPcertificatePrintAggrrow(), SCIPcertificatePrintCutoffBound(), SCIPcertificatePrintCutoffConflictingBounds(), SCIPcertificatePrintDualboundExactLP(), SCIPcertificatePrintDualboundPseudo(), SCIPcertificatePrintInheritedBound(), SCIPcertificatePrintMirCut(), SCIPcertificatePrintResult(), SCIPcertificatePrintUnsplitting(), SCIPcertificateUpdateBranchingData(), SCIPcertifyActivityVarBound(), SCIPcolExactCalcFarkasRedcostCoef(), SCIPcollectSolutionStatistics(), SCIPconsPrintCertificateExactLinear(), SCIPcreateConsExactLinear(), SCIPdelCoefExactLinear(), SCIPeventProcess(), SCIPgetDualboundExact(), SCIPgetSolOrigObjExact(), SCIPinferVarLbConsExact(), SCIPinferVarUbConsExact(), SCIPlpExactEndDive(), SCIPlpExactGetDualfarkas(), SCIPlpExactGetSol(), SCIPlpExactSetCutoffbound(), SCIPlpExactSolveAndEval(), SCIPlpExactUpdateAddVar(), SCIPlpExactUpdateDelVar(), SCIPlpExactUpdateVarColumn(), SCIPlpExactUpdateVarLb(), SCIPlpExactUpdateVarLbGlobal(), SCIPlpExactUpdateVarLoose(), SCIPlpExactUpdateVarObj(), SCIPlpExactUpdateVarUb(), SCIPlpExactUpdateVarUbGlobal(), SCIPnodeAddBoundinfer(), SCIPnodeAddBoundinferExact(), SCIPnodeUpdateLowerboundLP(), SCIPparseVarsPolynomialExact(), SCIPprimalUpdateObjoffsetExact(), SCIPprintSolExact(), SCIPprintSolutionStatistics(), SCIPrationalFreeBufferArray(), SCIPrationalReallocBufferArray(), SCIPreaderWrite(), SCIProwExactAddConstant(), SCIProwExactCreateFromRow(), SCIProwExactGetLPFeasibility(), SCIProwExactGetPseudoFeasibility(), SCIProwExactGetSolActivity(), SCIProwExactGetSolFeasibility(), SCIProwExactIncCoef(), SCIPsolGetValExact(), SCIPsolMakeExact(), SCIPsolMakeReal(), SCIPsolOverwriteFPSolWithExact(), SCIPsolPrintExact(), SCIPsolRecomputeInternObjExact(), SCIPsolRetransformExact(), SCIPsolSetValExact(), SCIPsolveExactDiveLP(), SCIPtightenVarLbExact(), SCIPtightenVarUbExact(), SCIPvarAddObjExact(), SCIPvarAddToRowExact(), SCIPvarAggregateExact(), SCIPvarChgLbGlobalExact(), SCIPvarChgLbLocalExact(), SCIPvarChgLbOriginalExact(), SCIPvarChgObjExact(), SCIPvarChgUbGlobalExact(), SCIPvarChgUbLocalExact(), SCIPvarChgUbOriginalExact(), SCIPvarFixExact(), SCIPvarGetActiveRepresentativesExact(), SCIPvarGetMultaggrLbLocalExact(), SCIPvarGetMultaggrUbLocalExact(), SCIPvarMultiaggregateExact(), SCIPvarTryAggregateVarsExact(), SCIPwriteLp(), setObjective(), solCheckExact(), solOfInterest(), solsAreEqualExact(), solUnlinkVarExact(), tightenVarBounds(), tightenVarLbGlobalSafe(), tightenVarUbGlobalSafe(), tryAggregateIntVarsExact(), updateLpExactBoundChange(), varProcessChgLbGlobalExact(), varProcessChgLbLocalExact(), varProcessChgUbGlobalExact(), varProcessChgUbLocalExact(), varUpdateAggregationBoundsExact(), writeOpbConstraints(), and writeOpbObjective().

◆ SCIPrationalFreeArray()

void SCIPrationalFreeArray ( SCIP_RATIONAL *** ratarray,
int size )

deletes an array of rationals and frees the allocated ordinary memory

Parameters
ratarraypointer to the array
sizesize of the array

Definition at line 486 of file rational.cpp.

References assert(), BMSfreeMemoryArrayNull, i, and SCIPrationalFree().

Referenced by SCIP_DECL_DIALOGEXEC().

◆ SCIPrationalFreeBlockArray()

void SCIPrationalFreeBlockArray ( BMS_BLKMEM * mem,
SCIP_RATIONAL *** ratblockarray,
int size )

deletes an array of rationals and frees the allocated block memory

Parameters
memblock memory
ratblockarraypointer to the array
sizesize of the array

Definition at line 502 of file rational.cpp.

References assert(), BMSfreeBlockMemoryArrayNull, i, and SCIPrationalFreeBlock().

Referenced by consdataFree(), readConstraintsRational(), readObjectiveRational(), SCIPcertificateExit(), SCIPcolExactFree(), SCIPfreeParseVarsPolynomialDataExact(), SCIPlpExactProjectShiftFree(), SCIProwExactFree(), SCIPvarMultiaggregateExact(), and varFreeExactData().

◆ SCIPrationalFreeBufferArray()

◆ SCIPrationalSetRational()

void SCIPrationalSetRational ( SCIP_RATIONAL * res,
SCIP_RATIONAL * src )

sets a rational to the value of another rational

set a rational to the value of another rational

Parameters
resthe result
srcthe src

Definition at line 570 of file rational.cpp.

References assert(), SCIP_Rational::isfprepresentable, SCIP_Rational::isinf, and SCIP_Rational::val.

Referenced by addCoef(), addRowExact(), chgCoefPos(), chgLhs(), chgRhs(), colExactAddCoef(), colExactChgCoefPos(), colExactMoveCoef(), colExactRestoreSolVals(), colExactStoreSolVals(), colExactSwapCoefs(), consdataCreate(), delCoefPos(), initSolve(), lpExactFlushAddCols(), lpExactFlushAddRows(), lpExactFlushChgCols(), lpExactFlushChgRows(), lpExactRestoreSolVals(), lpExactStoreSolVals(), mergeMultiples(), nodeAssignParent(), primalSetCutoffbound(), primalSetUpperboundExact(), printBoundAssumption(), probScaleObjExact(), readConstraintsRational(), rowExactAddCoef(), rowExactChgCoefPos(), rowExactCreateFromRowLimitEncodingLength(), rowExactMerge(), rowExactMoveCoef(), rowExactRestoreSolVals(), rowExactStoreSolVals(), rowExactSwapCoefs(), SCIP_DECL_CONSPARSE(), SCIPcertificateInit(), SCIPcertificateInitTransFile(), SCIPcertificateNewNodeData(), SCIPcertificatePrintBoundCons(), SCIPcertificatePrintCutoffBound(), SCIPcertificatePrintDualboundExactLP(), SCIPcertificatePrintDualboundPseudo(), SCIPcertificatePrintGlobalBound(), SCIPcertificatePrintInheritedBound(), SCIPcertificatePrintMirCut(), SCIPcertificatePrintResult(), SCIPcertificatePrintUnsplitting(), SCIPcertificateUpdateBoundData(), SCIPcertificateUpdateParentData(), SCIPcertifyActivityVarBoundExact(), SCIPcolExactCalcFarkasRedcostCoef(), SCIPcolExactChgLb(), SCIPcolExactChgObj(), SCIPcolExactChgUb(), SCIPcomputeVarLbLocalExact(), SCIPcomputeVarUbLocalExact(), SCIPdomchgAddBoundchg(), SCIPeventqueueAdd(), SCIPgetConsValsExact(), SCIPgetLowerboundExact(), SCIPgetRowSolActivityExact(), SCIPgetSolOrigObjExact(), SCIPgetUpperboundExact(), SCIPinferVarLbConsExact(), SCIPinferVarUbConsExact(), SCIPlpExactEndDive(), SCIPlpExactGetDualfarkas(), SCIPlpExactGetObjval(), SCIPlpExactGetPrimalRay(), SCIPlpExactGetPseudoObjval(), SCIPlpExactGetSol(), SCIPnodeAddBoundinferExact(), SCIPnodeCutoff(), SCIPnodeFocus(), SCIPnodepqBound(), SCIPnodeUpdateLowerbound(), SCIPparseVarsLinearsumExact(), SCIPparseVarsPolynomialExact(), SCIPprintSolExact(), SCIPrationalAdd(), SCIPrationalAddReal(), SCIPrationalarrayGetVal(), SCIPrationalCopy(), SCIPrationalCopyBlock(), SCIPrationalCopyBuffer(), SCIPrationalDiff(), SCIPrationalDivReal(), SCIPrationalMax(), SCIPrationalMin(), SCIPrationalMultReal(), SCIPrationalRoundInteger(), SCIPreaderWrite(), SCIProwExactChgConstant(), SCIProwExactChgLhs(), SCIProwExactChgRhs(), SCIProwExactGetSolActivity(), SCIProwExactRecalcLPActivity(), SCIProwExactRecalcPseudoActivity(), SCIPsolGetObjExact(), SCIPsolGetValExact(), SCIPsolOverwriteFPSolWithExact(), SCIPsolRetransformExact(), SCIPvarAddObjExact(), SCIPvarAggregateExact(), SCIPvarChgLbGlobalExact(), SCIPvarChgLbLocalExact(), SCIPvarChgLbOriginalExact(), SCIPvarChgObjExact(), SCIPvarChgUbGlobalExact(), SCIPvarChgUbLocalExact(), SCIPvarChgUbOriginalExact(), SCIPvarFixExact(), SCIPvarGetActiveRepresentativesExact(), SCIPvarGetLPSolExact(), SCIPvarGetLPSolExact_rec(), SCIPvarGetMultaggrLbLocalExact(), SCIPvarGetMultaggrUbLocalExact(), SCIPvarGetSolExact(), SCIPvarMultiaggregateExact(), SCIPwriteLp(), setColumnMajorFormat(), solGetArrayValExact(), solsAreEqualExact(), treeAddPendingBdchg(), varParse(), varProcessChgLbGlobalExact(), varProcessChgLbLocalExact(), varProcessChgUbGlobalExact(), varProcessChgUbLocalExact(), varUpdateAggregationBoundsExact(), and writeOpbConstraints().

◆ SCIPrationalSetFraction()

◆ SCIPrationalSetReal()

void SCIPrationalSetReal ( SCIP_RATIONAL * res,
SCIP_Real real )

sets a rational to the value of another a real

set a rational to the value of another a real

Parameters
resthe result
realreal to set from

Definition at line 604 of file rational.cpp.

References assert(), SCIP_Rational::isfprepresentable, SCIP_ISFPREPRESENTABLE_TRUE, SCIP_Real, SCIPrationalCheckInfByValue(), SCIPrationalIsEQReal(), and SCIP_Rational::val.

Referenced by branchcandCalcLPCandsExact(), calcMIRSafely(), certificatePrintMirSplit(), certificatePrintRow(), checkIntegralityExact(), checkSolOrigExact(), colExactRestoreSolVals(), consdataCalcMinAbsvalEx(), consdataGetActivity(), consdataScaleMinValue(), createAndAddProofcons(), getFixedVariable(), getObjective(), getObjectiveRow(), getObjvalDeltaLbExact(), getObjvalDeltaObjExact(), getObjvalDeltaUbExact(), initPresolve(), initSolve(), markRowExactDeleted(), primalSetCutoffbound(), printActivityConflictToCertificate(), printLinearConsExact(), readBinaries(), readBoundsExact(), readBoundsRational(), readCoefficientsRational(), readConstraints(), readOPBFile(), readRowsExact(), rowExactCreateFromRowLimitEncodingLength(), rowExactRestoreSolVals(), SCIP_DECL_CONSCHECK(), SCIP_DECL_READERREAD(), SCIPaddOrigObjoffset(), SCIPbranchExecLPExact(), SCIPcertificatePrintAggrrow(), SCIPcertificatePrintDualboundPseudo(), SCIPcertificatePrintMirCut(), SCIPcertificateUpdateBranchingData(), SCIPcertifyActivityVarBound(), SCIPeventProcess(), SCIPgetDualboundExact(), SCIPgetFpDualfarkasExactLinear(), SCIPgetFpDualsolExactLinear(), SCIPlpExactDecNLoosevars(), SCIPlpExactGetDualfarkas(), SCIPlpExactGetSol(), SCIPlpExactReset(), SCIPnodeAddBoundinfer(), SCIPnodeUpdateLowerbound(), SCIPparseVarsPolynomialExact(), SCIPprimalUpdateObjoffsetExact(), SCIPprobCreate(), SCIPrationalAddReal(), SCIPrationalComputeApproximation(), SCIPrationalDivReal(), SCIPrationalGetFrac(), SCIPrationalMultReal(), SCIProwExactCreateFromRow(), SCIProwExactGetSolActivity(), SCIPsolClear(), SCIPsolGetValExact(), SCIPsolMakeExact(), SCIPsolRetransformExact(), SCIPvarAddExactData(), SCIPvarAggregateExact(), SCIPvarChgLbOriginalExact(), SCIPvarChgUbOriginalExact(), SCIPvarGetProbvarSumExact(), SCIPvarMultiaggregateExact(), setObjective(), solCheckExact(), solGetArrayValExact(), solOfInterest(), solsAreEqualExact(), tightenVarBounds(), tightenVarLbGlobalSafe(), tightenVarUbGlobalSafe(), updateLpExactBoundChange(), varProcessChgLbGlobal(), varProcessChgLbLocal(), varProcessChgUbGlobal(), varProcessChgUbLocal(), and writeOpbConstraints().

◆ SCIPrationalSetInfinity()

◆ SCIPrationalSetNegInfinity()

◆ SCIPrationalIsString()

SCIP_Bool SCIPrationalIsString ( const char * desc)

checks if a string describes a rational number

Parameters
descstring to check

Definition at line 653 of file rational.cpp.

References assert(), FALSE, NULL, SCIP_Bool, SCIPstrncasecmp(), and TRUE.

Referenced by isValueRational(), parseValue(), readSolFile(), and readXmlSolFile().

◆ SCIPrationalSetString()

void SCIPrationalSetString ( SCIP_RATIONAL * res,
const char * desc )

◆ SCIPrationalCreateString()

SCIP_RETCODE SCIPrationalCreateString ( BMS_BLKMEM * mem,
SCIP_RATIONAL ** rational,
const char * desc )

allocates and creates a rational from a string if known, otherwise assigns a null pointer

Parameters
memblock memory
rationalpointer to the rational to create
descthe string describing the rational

Definition at line 797 of file rational.cpp.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPrationalCreateBlock(), SCIPrationalSetString(), and SCIPstrncasecmp().

Referenced by consdataCreate(), readSolFile(), readXmlSolFile(), SCIPcertificateNewNodeData(), SCIPcolExactCreate(), and SCIProwExactCreate().

◆ SCIPstrToRationalValue()

SCIP_Bool SCIPstrToRationalValue ( char * desc,
SCIP_RATIONAL * value,
char ** endptr )

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

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

Definition at line 823 of file rational.cpp.

References assert(), FALSE, NULL, SCIP_Bool, SCIPrationalSetInfinity(), SCIPrationalSetNegInfinity(), SCIPrationalSetString(), SCIPstrncasecmp(), and TRUE.

Referenced by SCIPparseRational(), and SCIPparseVarsPolynomialExact().

◆ SCIPrationalResetFloatingPointRepresentable()

void SCIPrationalResetFloatingPointRepresentable ( SCIP_RATIONAL * rat)

resets the flag isfprepresentable to SCIP_ISFPREPRESENTABLE_UNKNOWN

Parameters
ratthe number to set flag for

Definition at line 643 of file rational.cpp.

References assert(), SCIP_Rational::isfprepresentable, and SCIP_ISFPREPRESENTABLE_UNKNOWN.

◆ SCIPrationalCanonicalize()

void SCIPrationalCanonicalize ( SCIP_RATIONAL * rational)

transforms rational into canonical form

Parameters
rationalrational to put in canonical form

Definition at line 539 of file rational.cpp.

References assert(), and SCIP_Rational::val.

Referenced by parseValue(), readBoundsExact(), readColsExact(), readRangesExact(), readRhsExact(), SCIPcalcIntegralScalarExact(), SCIPrationalComputeApproximation(), SCIPrationalIsIntegral(), and tryAggregateIntVarsExact().

◆ SCIPrationalCheckInfByValue()

void SCIPrationalCheckInfByValue ( SCIP_RATIONAL * rational)

checks if the underlying rational has a value >= infinity;

needed after underlying value was directly set, e.g. by exact lp solver

Parameters
rationalrational number

Definition at line 553 of file rational.cpp.

References FALSE, infinity, SCIP_Rational::isfprepresentable, SCIP_Rational::isinf, SCIP_ISFPREPRESENTABLE_TRUE, scip::Rational::sign(), TRUE, and SCIP_Rational::val.

Referenced by SCIPrationalSetFraction(), SCIPrationalSetReal(), and SCIPrationalSetString().

◆ SCIPrationalAdd()

◆ SCIPrationalAddReal()

void SCIPrationalAddReal ( SCIP_RATIONAL * res,
SCIP_RATIONAL * rat,
SCIP_Real real )

◆ SCIPrationalDiff()

void SCIPrationalDiff ( SCIP_RATIONAL * res,
SCIP_RATIONAL * op1,
SCIP_RATIONAL * op2 )

◆ SCIPrationalDiffReal()

◆ SCIPrationalRelDiff()

void SCIPrationalRelDiff ( SCIP_RATIONAL * res,
SCIP_RATIONAL * val1,
SCIP_RATIONAL * val2 )

returns the relative difference: (val1-val2)/max(|val1|,|val2|,1.0) of two rationals

Note
this method handles infinity like finite numbers

returns the relative difference: (val1-val2)/max(|val1|,|val2|,1.0)

Note
this method handles infinity like finite numbers
Parameters
resthe result
val1first value to be compared
val2second value to be compared

Definition at line 1025 of file rational.cpp.

References scip::abs(), assert(), SCIP_Rational::isfprepresentable, SCIP_Rational::isinf, SCIP_ISFPREPRESENTABLE_UNKNOWN, SCIPrationalGetSign(), and SCIP_Rational::val.

Referenced by SCIPvalidateSolveExact().

◆ SCIPrationalMult()

◆ SCIPrationalMultReal()

◆ SCIPrationalDiv()

◆ SCIPrationalDivReal()

void SCIPrationalDivReal ( SCIP_RATIONAL * res,
SCIP_RATIONAL * op1,
SCIP_Real op2 )

divide a rational by a real and save the result in res

divides a rational by a real and saves the result in res

Parameters
resthe result
op1first operand
op2second operand

Definition at line 1148 of file rational.cpp.

References assert(), FALSE, infinity, SCIP_Rational::isfprepresentable, SCIP_Rational::isinf, REALABS, SCIP_ISFPREPRESENTABLE_UNKNOWN, SCIP_Real, SCIPrationalIsZero(), SCIPrationalNegate(), SCIPrationalSetRational(), SCIPrationalSetReal(), scip::Rational::sign(), and SCIP_Rational::val.

Referenced by SCIPcertificatePrintMirCut(), and writeOpbObjective().

◆ SCIPrationalAddProd()

◆ SCIPrationalAddProdReal()

◆ SCIPrationalDiffProd()

◆ SCIPrationalDiffProdReal()

void SCIPrationalDiffProdReal ( SCIP_RATIONAL * res,
SCIP_RATIONAL * op1,
SCIP_Real op2 )

◆ SCIPrationalNegate()

◆ SCIPrationalAbs()

void SCIPrationalAbs ( SCIP_RATIONAL * res,
SCIP_RATIONAL * op )

set res to Abs(op)

Parameters
resthe result
opoperand

Definition at line 1311 of file rational.cpp.

References scip::abs(), assert(), SCIP_Rational::isfprepresentable, SCIP_Rational::isinf, and SCIP_Rational::val.

Referenced by consdataCalcMinAbsvalEx(), consdataUpdateChgCoef(), and readRangesExact().

◆ SCIPrationalInvert()

void SCIPrationalInvert ( SCIP_RATIONAL * res,
SCIP_RATIONAL * op )

◆ SCIPrationalMin()

◆ SCIPrationalMax()

◆ SCIPrationalIsEQ()

SCIP_Bool SCIPrationalIsEQ ( SCIP_RATIONAL * rat1,
SCIP_RATIONAL * rat2 )

checks if two rationals are equal

Parameters
rat1the first rational
rat2the second rational

Definition at line 1405 of file rational.cpp.

References assert(), FALSE, SCIP_Rational::isinf, SCIP_Bool, scip::Rational::sign(), and SCIP_Rational::val.

Referenced by certificatePrintWeakDerStart(), checkCons(), checkProbHasContEqs(), chgLhs(), chgRhs(), colExactChgCoefPos(), consdataCreate(), consdataPrint(), consPrintConsSol(), determineTotalNumberLinearConss(), getObjvalDeltaObjExact(), lpExactFlushChgCols(), lpExactFlushChgRows(), printLinearConsExact(), readRangesExact(), rowExactChgCoefPos(), SCIPcertificateGetConsIndex(), SCIPcertificateGetRowIndex(), SCIPcertificateInit(), SCIPcertificateInitTransFile(), SCIPcertificatePrintDualboundExactLP(), SCIPcertifyConsOrigExactLinear(), SCIPcolExactChgCoef(), SCIPcolExactChgLb(), SCIPcolExactChgObj(), SCIPcolExactChgUb(), SCIPcolExactDelCoef(), SCIPcolExactIncCoef(), SCIPconsPrintCertificateExactLinear(), SCIPeventAddExactBdChg(), SCIPeventAddExactObjChg(), SCIPfixVarExact(), SCIPlpExactEndDive(), SCIPlpExactStartDive(), SCIPlpExactUpdateVarLb(), SCIPlpExactUpdateVarLbGlobal(), SCIPlpExactUpdateVarObj(), SCIPlpExactUpdateVarUb(), SCIPlpExactUpdateVarUbGlobal(), SCIPnodeCutoff(), SCIPnodeUpdateLowerbound(), SCIProwExactChgCoef(), SCIProwExactChgConstant(), SCIProwExactChgLhs(), SCIProwExactChgRhs(), SCIProwExactDelCoef(), SCIProwExactIncCoef(), SCIPsolGetVal(), SCIPsolGetValExact(), SCIPsolSetValExact(), SCIPtreeGetLowerboundNode(), SCIPvarAddToRow(), SCIPvarAddToRowExact(), SCIPvarChgLbOriginalExact(), SCIPvarChgObjExact(), SCIPvarChgUbOriginalExact(), SCIPvarFixExact(), SCIPvarGetActiveRepresentativesExact(), SCIPvarGetLPSol_rec(), SCIPvarGetLPSolExact_rec(), SCIPvarMultiaggregateExact(), SCIPwriteLp(), solsAreEqualExact(), varEventGlbChangedExact(), varEventGubChangedExact(), varEventObjChangedExact(), varProcessChgLbGlobalExact(), varProcessChgLbLocalExact(), varProcessChgUbGlobalExact(), varProcessChgUbLocalExact(), and varUpdateAggregationBoundsExact().

◆ SCIPrationalIsAbsEQ()

SCIP_Bool SCIPrationalIsAbsEQ ( SCIP_RATIONAL * rat1,
SCIP_RATIONAL * rat2 )

checks if two rationals are equal

Parameters
rat1the first rational
rat2the second rational

Definition at line 1422 of file rational.cpp.

References scip::abs(), assert(), FALSE, SCIP_Rational::isinf, SCIP_Bool, TRUE, and SCIP_Rational::val.

Referenced by consdataUpdateAddCoef(), consdataUpdateChgCoef(), consdataUpdateDelCoef(), and SCIP_DECL_SORTINDCOMP().

◆ SCIPrationalIsEQReal()

◆ SCIPrationalIsApproxEQReal()

SCIP_Bool SCIPrationalIsApproxEQReal ( SCIP_SET * set,
SCIP_RATIONAL * rat,
SCIP_Real real,
SCIP_ROUNDMODE_RAT roundmode )

checks if real approx of rational and real are equal

Parameters
setSCIP set pointer
ratthe rational
realthe real
roundmodethe rounding mode to use

Definition at line 1452 of file rational.cpp.

References assert(), SCIP_Rational::isinf, SCIP_Bool, SCIP_R_ROUND_NEAREST, SCIP_Real, SCIPrationalGetReal(), SCIPrationalIsPositive(), SCIPrationalRoundReal(), SCIPsetIsEQ(), and SCIPsetIsInfinity().

Referenced by colExactInSync(), and rowExactInSync().

◆ SCIPrationalIsGT()

◆ SCIPrationalIsLT()

◆ SCIPrationalIsGE()

◆ SCIPrationalIsLE()

◆ SCIPrationalIsAbsGT()

SCIP_Bool SCIPrationalIsAbsGT ( SCIP_RATIONAL * rat1,
SCIP_RATIONAL * rat2 )

checks if first rational is greater than second rational

Parameters
rat1the first rational
rat2the second rational

Definition at line 1531 of file rational.cpp.

References scip::abs(), assert(), FALSE, SCIP_Rational::isinf, SCIP_Bool, TRUE, and SCIP_Rational::val.

Referenced by consdataCalcMinAbsvalEx(), consdataUpdateChgCoef(), and SCIP_DECL_SORTINDCOMP().

◆ SCIPrationalIsGTReal()

SCIP_Bool SCIPrationalIsGTReal ( SCIP_RATIONAL * rat,
SCIP_Real real )

checks if rational is greater than real

Parameters
ratthe rational
realthe real

Definition at line 1547 of file rational.cpp.

References assert(), FALSE, infinity, SCIP_Rational::isinf, SCIP_Bool, SCIP_Real, TRUE, and SCIP_Rational::val.

Referenced by lpExactFlushAndSolve(), propagateCons(), readBoundsExact(), rowExactCreateFromRowLimitEncodingLength(), SCIPrationalIsLEReal(), varParse(), and varProcessChgUbGlobal().

◆ SCIPrationalIsLTReal()

SCIP_Bool SCIPrationalIsLTReal ( SCIP_RATIONAL * rat,
SCIP_Real real )

◆ SCIPrationalIsGEReal()

SCIP_Bool SCIPrationalIsGEReal ( SCIP_RATIONAL * rat,
SCIP_Real real )

checks if rational is greater or equal than real

Parameters
ratthe rational
realthe real

Definition at line 1607 of file rational.cpp.

References SCIP_Bool, SCIP_Real, and SCIPrationalIsLTReal().

Referenced by propagateCons(), rowExactInSync(), SCIPcertificatePrintUnsplitting(), SCIPlpExactSetCutoffbound(), SCIPlpExactSolveAndEval(), SCIPnodeCutoff(), SCIPnodeFocus(), SCIPnodepqBound(), and SCIPnodeUpdateLowerbound().

◆ SCIPrationalIsLEReal()

SCIP_Bool SCIPrationalIsLEReal ( SCIP_RATIONAL * rat,
SCIP_Real real )

checks if rational is less or equal than real

Parameters
ratthe rational
realthe real

Definition at line 1616 of file rational.cpp.

References SCIP_Bool, SCIP_Real, and SCIPrationalIsGTReal().

Referenced by primalSetCutoffboundExact(), primalSetUpperboundExact(), propagateCons(), and rowExactInSync().

◆ SCIPrationalIsZero()

SCIP_Bool SCIPrationalIsZero ( SCIP_RATIONAL * rational)

checks if rational is zero

Parameters
rationalthe rational to check

Definition at line 1625 of file rational.cpp.

References assert(), FALSE, scip::Rational::is_zero(), SCIP_Rational::isinf, SCIP_Bool, TRUE, and SCIP_Rational::val.

Referenced by addCoef(), addRowExact(), applyFixings(), certificatePrintSol(), chgCoefPos(), chgLhs(), chgRhs(), colExactAddCoef(), colExactChgCoefPos(), colExactLink(), consdataCalcMinAbsvalEx(), consdataComputePseudoActivity(), consdataCreate(), consdataFree(), consdataGetActivity(), consdataScaleMinValue(), getFiniteLooseObjvalExact(), getObjectiveRow(), lockRounding(), lpExactUpdateObjval(), mergeMultiples(), printRowExact(), probCheckObjIntegralExact(), probScaleObjExact(), readBoundsExact(), readBoundsRational(), readCoefficientsRational(), readColsExact(), readObjectiveRational(), readRhsExact(), rowExactAddCoef(), rowExactChgCoefPos(), rowExactCreateFromRowLimitEncodingLength(), rowExactLink(), rowExactMerge(), SCIP_DECL_READERREAD(), SCIP_DECL_READERWRITE(), SCIPaggregateVarsExact(), SCIPcalcIntegralScalarExact(), SCIPcertificatePrintCutoffConflictingBounds(), SCIPcertificatePrintDualboundExactLP(), SCIPcertificatePrintDualboundPseudo(), SCIPcertificatePrintGlobalBound(), SCIPcertificateSetAndPrintObjective(), SCIPchgCoefExactLinear(), SCIPcolExactCalcFarkasRedcostCoef(), SCIPcolExactChgLb(), SCIPcolExactChgObj(), SCIPcolExactChgUb(), SCIPcolExactCreate(), SCIPcolExactGetBestBound(), SCIPcolExactIncCoef(), SCIPlpExactAddRow(), SCIPlpExactGetDualfarkas(), SCIPlpExactGetObjval(), SCIPlpiExactAddCols(), SCIPlpiExactAddRows(), SCIPlpiExactLoadColLP(), SCIPparseVarsLinearsumExact(), SCIPparseVarsPolynomialExact(), SCIPrationalarrayIncVal(), SCIPrationalDiv(), SCIPrationalDivReal(), SCIProwExactAddConstant(), SCIProwExactCreate(), SCIProwExactIncCoef(), SCIProwExactPrint(), SCIProwExactRecalcLPActivity(), SCIPsolGetValExact(), SCIPsolPrintExact(), SCIPsolRecomputeInternObjExact(), SCIPsolRetransformExact(), SCIPsolSetValExact(), SCIPvalidateSolveExact(), SCIPvarAddExactData(), SCIPvarAddObjExact(), SCIPvarAddToRowExact(), SCIPvarAggregateExact(), SCIPvarFixExact(), SCIPvarGetActiveRepresentativesExact(), SCIPvarGetProbvarSumExact(), SCIPvarMultiaggregateExact(), SCIPvarTryAggregateVarsExact(), SCIPwriteLp(), tryAggregateIntVarsExact(), unlockRounding(), varProcessChgLbLocalExact(), varProcessChgUbLocalExact(), varUpdateAggregationBoundsExact(), and writeOpbConstraints().

◆ SCIPrationalIsPositive()

SCIP_Bool SCIPrationalIsPositive ( SCIP_RATIONAL * rational)

checks if rational is positive

Parameters
rationalthe rational to check

Definition at line 1641 of file rational.cpp.

References assert(), SCIP_Bool, scip::Rational::sign(), and SCIP_Rational::val.

Referenced by addRowExact(), adjustedLbExact(), adjustedUbExact(), chgCoefPos(), chgLhs(), chgRhs(), getObjvalDeltaLbExact(), getObjvalDeltaObjExact(), lockRounding(), rowExactCreateFromRowLimitEncodingLength(), SCIP_DECL_CONSLOCK(), SCIPcertificatePrintAggrrow(), SCIPcertificatePrintCutoffConflictingBounds(), SCIPcertificatePrintDualboundExactLP(), SCIPcertificatePrintDualboundPseudo(), SCIPcertificatePrintGlobalBound(), SCIPcertificatePrintMirCut(), SCIPcertifyActivityConflict(), SCIPcertifyActivityVarBoundExact(), SCIPcolExactCalcFarkasRedcostCoef(), SCIPcolExactChgObj(), SCIPcolExactGetBestBound(), SCIPcolExactPrint(), SCIPlpExactGetDualfarkas(), SCIPlpExactGetSol(), SCIPlpExactUpdateVarColumn(), SCIPlpExactUpdateVarLb(), SCIPlpExactUpdateVarLbGlobal(), SCIPlpExactUpdateVarLoose(), SCIPprobExternObjvalExact(), SCIPprobInternObjvalExact(), SCIPrationalIsApproxEQReal(), SCIPrationalIsEQReal(), SCIProwExactGenerateFpRows(), SCIProwExactGetSolActivity(), SCIProwExactPrint(), SCIPsolSetValExact(), SCIPvarChgLbGlobalExact(), SCIPvarChgLbLocalExact(), SCIPvarChgUbGlobalExact(), SCIPvarChgUbLocalExact(), SCIPvarGetMultaggrLbLocalExact(), SCIPvarGetMultaggrUbLocalExact(), SCIPvarGetProbvarSumExact(), solCheckExact(), SpxRSetRat(), unlockRounding(), varProcessChgLbGlobalExact(), varProcessChgLbLocalExact(), varProcessChgUbGlobalExact(), varProcessChgUbLocalExact(), and varUpdateAggregationBoundsExact().

◆ SCIPrationalIsNegative()

◆ SCIPrationalIsInfinity()

SCIP_Bool SCIPrationalIsInfinity ( SCIP_RATIONAL * rational)

checks if rational is positive infinity

Parameters
rationalthe rational to check

Definition at line 1661 of file rational.cpp.

References assert(), SCIP_Rational::isinf, SCIP_Bool, scip::Rational::sign(), and SCIP_Rational::val.

Referenced by addConstraintExact(), addRelaxation(), addRowExact(), applyFixings(), certificatePrintDualbound(), checkCons(), chgLhs(), chgRhs(), colExactInSync(), consdataComputePseudoActivity(), consdataGetActivity(), consdataPrint(), consPrintConsSol(), determineTotalNumberLinearConss(), getObjectiveRow(), getObjvalDeltaLbExact(), getObjvalDeltaObjExact(), getObjvalDeltaUbExact(), lockRounding(), primalSetUpperboundExact(), printBoundsExact(), printLinearConsExact(), readBoundsExact(), readBoundsRational(), readRangesExact(), readRhsExact(), rowExactCreateFromRowLimitEncodingLength(), rowExactInSync(), SCIP_DECL_CONSLOCK(), SCIPcertificatePrintDualboundExactLP(), SCIPcertificatePrintRtpRange(), SCIPcertificatePrintUnsplitting(), SCIPcertificateUpdateParentData(), SCIPcertifyConsOrigExactLinear(), SCIPchgVarLbExact(), SCIPcolExactCalcFarkasRedcostCoef(), SCIPconsPrintCertificateExactLinear(), SCIPlpExactGetDualfarkas(), SCIPlpExactGetSol(), SCIPlpExactUpdateVarColumn(), SCIPlpExactUpdateVarLoose(), SCIPlpiExactChgBounds(), SCIPnodeAddBoundinferExact(), SCIPnodeUpdateLowerbound(), SCIPnodeUpdateLowerboundLP(), SCIProwExactChgConstant(), SCIProwExactGenerateFpRows(), SCIProwExactGetSolActivity(), SCIProwExactRecalcLPActivity(), SCIPsepastoreExactAddCut(), SCIPtightenVarLbExact(), SCIPvalidateSolveExact(), SCIPvarChgLbLocalExact(), SCIPvarChgUbLocalExact(), SCIPvarFixExact(), SCIPvarGetActiveRepresentativesExact(), SCIPvarGetMultaggrLbLocalExact(), SCIPvarGetMultaggrUbLocalExact(), SCIPvarGetProbvarSumExact(), SCIPvarParseOriginal(), SCIPvarParseTransformed(), SCIPwriteLp(), solCheckExact(), solOfInterest(), unlockRounding(), and varUpdateAggregationBoundsExact().

◆ SCIPrationalIsNegInfinity()

SCIP_Bool SCIPrationalIsNegInfinity ( SCIP_RATIONAL * rational)

checks if rational is negative infinity

Parameters
rationalthe rational to check

Definition at line 1671 of file rational.cpp.

References assert(), SCIP_Rational::isinf, SCIP_Bool, scip::Rational::sign(), and SCIP_Rational::val.

Referenced by addConstraintExact(), addRelaxation(), addRowExact(), applyFixings(), certificatePrintDualbound(), checkCons(), chgLhs(), chgRhs(), colExactInSync(), consdataComputePseudoActivity(), consdataGetActivity(), consdataPrint(), consPrintConsSol(), determineTotalNumberLinearConss(), getObjectiveRow(), getObjvalDeltaLbExact(), getObjvalDeltaObjExact(), getObjvalDeltaUbExact(), lockRounding(), printBoundsExact(), printLinearConsExact(), readRangesExact(), readRhsExact(), rowExactCreateFromRowLimitEncodingLength(), rowExactInSync(), SCIP_DECL_CONSLOCK(), SCIPcertificatePrintRtpRange(), SCIPcertifyConsOrigExactLinear(), SCIPchgVarUbExact(), SCIPcolExactCalcFarkasRedcostCoef(), SCIPconsPrintCertificateExactLinear(), SCIPinferVarLbConsExact(), SCIPinferVarUbConsExact(), SCIPlpExactGetDualfarkas(), SCIPlpExactGetPrimalRay(), SCIPlpExactGetSol(), SCIPlpExactUpdateVarColumn(), SCIPlpExactUpdateVarLoose(), SCIPlpiExactChgBounds(), SCIPnodeAddBoundinferExact(), SCIProwExactGenerateFpRows(), SCIProwExactGetSolActivity(), SCIPsepastoreExactAddCut(), SCIPtightenVarUbExact(), SCIPvalidateSolveExact(), SCIPvarChgLbLocalExact(), SCIPvarChgUbLocalExact(), SCIPvarFixExact(), SCIPvarGetActiveRepresentativesExact(), SCIPvarGetMultaggrLbLocalExact(), SCIPvarGetMultaggrUbLocalExact(), SCIPvarGetProbvarSumExact(), SCIPvarParseOriginal(), SCIPvarParseTransformed(), SCIPwriteLp(), solCheckExact(), unlockRounding(), and varUpdateAggregationBoundsExact().

◆ SCIPrationalIsAbsInfinity()

SCIP_Bool SCIPrationalIsAbsInfinity ( SCIP_RATIONAL * rational)

◆ SCIPrationalIsIntegral()

◆ SCIPrationalIsFpRepresentable()

SCIP_Bool SCIPrationalIsFpRepresentable ( SCIP_RATIONAL * rational)

◆ SCIPrationalToString()

int SCIPrationalToString ( SCIP_RATIONAL * rational,
char * str,
int strlen )

converts a rational to a string for printing, returns the number of copied characters.

Returns
number of characters printed into string, see also SCIPstrncpy()
Note
If return value is equal to strlen, it means the string was truncated.
Parameters
rationalthe rational to print
strthe string to save the rational in
strlenmaximal length that can be copied to str

Definition at line 1744 of file rational.cpp.

References SCIP_Rational::isinf, NULL, SCIPrationalDebugMessage, SCIPstrncpy(), scip::Rational::sign(), scip::Rational::str(), and SCIP_Rational::val.

Referenced by printRowExact(), printRowExact(), SCIPcertificatePrintProblemRational(), SCIPcertificatePrintProofRational(), SCIPcollectSolutionStatistics(), SCIPprintSolExact(), SCIPsolPrintExact(), SCIPvalidateSolveExact(), SCIPwriteLp(), and writeOpbObjective().

◆ SCIPrationalStrLen()

int SCIPrationalStrLen ( SCIP_RATIONAL * rational)

returns the strlen of a rational number

Parameters
rationalrational to consider

Definition at line 1775 of file rational.cpp.

References SCIP_Rational::isinf, NULL, scip::Rational::str(), and SCIP_Rational::val.

Referenced by SCIPcertificatePrintProblemRational(), SCIPcertificatePrintProofRational(), SCIPprintSolExact(), and SCIPsolPrintExact().

◆ SCIPrationalMessage()

◆ SCIPrationalPrintVerbInfo()

void SCIPrationalPrintVerbInfo ( SCIP_MESSAGEHDLR * msg,
SCIP_VERBLEVEL verblevel,
SCIP_VERBLEVEL msgverblevel,
SCIP_RATIONAL * rational )

prints rational depending on the verbosity level

Parameters
msgmessage handler
verblevelcurrent verbosity level
msgverblevelverbosity level of this message
rationalthe rational to print

Definition at line 1814 of file rational.cpp.

References assert(), NULL, SCIP_VERBLEVEL_FULL, SCIP_VERBLEVEL_NONE, and SCIPrationalMessage().

Referenced by SCIPpresolve().

◆ SCIPrationalPrint()

void SCIPrationalPrint ( SCIP_RATIONAL * rational)

prints a rational to command line (for debugging)

print a rational to command line (for debugging)

Parameters
rationalthe rational to print

Definition at line 1832 of file rational.cpp.

References NULL.

Referenced by SCIPrationalarrayPrint(), and SCIPrationalVPrintf().

◆ SCIPrationalPrintf()

void SCIPrationalPrintf ( const char * formatstr,
... )

printf extension for rationals (does not support all format options yet)

Parameters
formatstrformat string like in printf() function
...format arguments line in printf() function

Definition at line 1922 of file rational.cpp.

References SCIPrationalVPrintf().

◆ SCIPrationalPrintDebugMessage()

void SCIPrationalPrintDebugMessage ( const char * sourcefile,
int sourceline,
const char * formatstr,
... )

prints a debug message

Parameters
sourcefilename of the source file that called the function
sourcelineline in the source file where the function was called
formatstrformat string like in printf() function
...format arguments line in printf() function

Definition at line 1935 of file rational.cpp.

References assert(), NULL, and SCIPrationalVPrintf().

◆ SCIPrationalNumerator()

SCIP_Longint SCIPrationalNumerator ( SCIP_RATIONAL * rational)

returns the numerator of a rational as a long

Parameters
rationalthe rational

Definition at line 2017 of file rational.cpp.

References assert(), SCIP_Longint, scip::Rational::val, and SCIP_Rational::val.

Referenced by SCIPcalcIntegralScalarExact(), and tryAggregateIntVarsExact().

◆ SCIPrationalDenominator()

SCIP_Longint SCIPrationalDenominator ( SCIP_RATIONAL * rational)

returns the denominator of a rational as a long

Parameters
rationalthe rational

Definition at line 2026 of file rational.cpp.

References assert(), and SCIP_Longint.

Referenced by SCIPcalcIntegralScalarExact(), and tryAggregateIntVarsExact().

◆ SCIPrationalDenominatorIsLE()

SCIP_Bool SCIPrationalDenominatorIsLE ( SCIP_RATIONAL * rational,
SCIP_Longint val )

compares denominator of a rational to a long

returns the denominator of a rational as a long

Parameters
rationalthe rational
vallong value to compare to

Definition at line 2035 of file rational.cpp.

References assert(), SCIP_Bool, SCIP_Longint, and TRUE.

Referenced by rowExactCreateFromRowLimitEncodingLength().

◆ SCIPrationalGetSign()

int SCIPrationalGetSign ( const SCIP_RATIONAL * rational)

returns the sign of the rational (1 if positive, -1 if negative, 0 if zero)

Parameters
rationalthe rational

Definition at line 2047 of file rational.cpp.

References assert(), scip::Rational::sign(), and SCIP_Rational::val.

Referenced by applyFixings(), SCIPrationalRelDiff(), SCIPsolGetValExact(), SCIPvarGetActiveRepresentativesExact(), and SCIPvarGetProbvarSumExact().

◆ SCIPrationalGetFrac()

void SCIPrationalGetFrac ( SCIP_RATIONAL * res,
SCIP_RATIONAL * src )

computes fractional part of a rational number

computes fractional part of a rational

Parameters
resrational to save the frac
srcsrc rational

Definition at line 2056 of file rational.cpp.

References assert(), scip::denominator(), SCIP_Rational::isinf, scip::numerator(), SCIPrationalSetReal(), scip::Rational::sign(), and SCIP_Rational::val.

Referenced by branchcandCalcLPCandsExact().

◆ SCIPrationalGetReal()

◆ SCIPrationalRoundReal()

SCIP_Real SCIPrationalRoundReal ( SCIP_RATIONAL * rational,
SCIP_ROUNDMODE_RAT roundmode )

gets the relaxation of a rational as a real

Note
Requires MPFR if rational is not fp-representable and roundmode is different from SCIP_R_ROUND_NEAREST.
Parameters
rationalthe rational
roundmodethe rounding direction

Definition at line 2109 of file rational.cpp.

References assert(), infinity, SCIP_Rational::isfprepresentable, SCIP_Rational::isinf, SCIP_INVALID, SCIP_ISFPREPRESENTABLE_TRUE, SCIP_R_ROUND_DOWNWARDS, SCIP_R_ROUND_NEAREST, SCIP_R_ROUND_UPWARDS, SCIP_Real, SCIPABORT, SCIPerrorMessage, SCIPrationalGetReal(), scip::Rational::sign(), and SCIP_Rational::val.

Referenced by chgLhs(), chgRhs(), consdataCreate(), consdataScaleMinValue(), createAndAddProofcons(), getObjectiveRow(), lpExactFlushAndSolve(), primalSetCutoffboundExact(), primalSetUpperboundExact(), rowExactCreateFromRowLimitEncodingLength(), SCIPcertificateEnsureLastBoundInfoConsistent(), SCIPfixVarExact(), SCIPgetDualProof(), SCIPintervalSetRational(), SCIPlpExactGetSol(), SCIPlpExactSolveAndEval(), SCIPnodeAddBoundinferExact(), SCIPnodeUpdateLowerbound(), SCIPrationalIsApproxEQReal(), SCIPrationalIsFpRepresentable(), SCIProwExactChgLhs(), SCIProwExactChgRhs(), SCIProwExactCreate(), SCIProwExactGenerateFpRows(), SCIPsolLinkLPSolExact(), SCIPsolOverwriteFPSolWithExact(), SCIPvarAddExactData(), SCIPvarChgLbOriginalExact(), SCIPvarChgUbOriginalExact(), varEventGlbChangedExact(), varEventGubChangedExact(), varEventLbChangedExact(), varEventUbChangedExact(), varParse(), varProcessChgLbGlobalExact(), varProcessChgLbLocalExact(), varProcessChgUbGlobalExact(), and varProcessChgUbLocalExact().

◆ SCIPrationalRoundInteger()

void SCIPrationalRoundInteger ( SCIP_RATIONAL * res,
SCIP_RATIONAL * src,
SCIP_ROUNDMODE_RAT roundmode )

◆ SCIPrationalRoundLong()

SCIP_Bool SCIPrationalRoundLong ( SCIP_Longint * res,
SCIP_RATIONAL * src,
SCIP_ROUNDMODE_RAT roundmode )

rounds rational to next integer in direction of roundmode

Returns
FALSE if rational outside of long-range
Parameters
resthe resulting rounded long int
srcthe rational to round
roundmodethe rounding direction

Definition at line 2203 of file rational.cpp.

References scip::abs(), assert(), scip::denominator(), FALSE, SCIP_Rational::isinf, scip::numerator(), SCIP_Bool, SCIP_Longint, SCIP_R_ROUND_DOWNWARDS, SCIP_R_ROUND_NEAREST, SCIP_R_ROUND_UPWARDS, SCIPABORT, SCIPerrorMessage, scip::Rational::sign(), TRUE, and SCIP_Rational::val.

Referenced by SCIPcertificatePrintMirCut(), and tryAggregateIntVarsExact().

◆ SCIPrationalComputeApproximation()

void SCIPrationalComputeApproximation ( SCIP_RATIONAL * res,
SCIP_RATIONAL * src,
SCIP_Longint maxdenom,
int forcegreater )

compute an approximate number with denominator <= maxdenom, closest to src and save it in res using continued fractions

Parameters
resthe resulting rational
srcthe rational to approximate
maxdenommaximal denominator
forcegreater1 if res >= src should be enforced, -1 if res <= src should be enforced, 0 else

Definition at line 2463 of file rational.cpp.

References assert(), scip::denominator(), FALSE, SCIP_Rational::isfprepresentable, SCIP_Rational::isinf, scip::numerator(), SCIP_ISFPREPRESENTABLE_UNKNOWN, SCIP_Longint, SCIP_LONGINT_MAX, SCIPdebug, SCIPrationalCanonicalize(), SCIPrationalGetReal(), SCIPrationalSetFraction(), SCIPrationalSetReal(), scip::Rational::sign(), and SCIP_Rational::val.

Referenced by rowExactCreateFromRowLimitEncodingLength(), and tightenVarBounds().

◆ SCIPrationalarrayCreate()

SCIP_RETCODE SCIPrationalarrayCreate ( SCIP_RATIONALARRAY ** rationalarray,
BMS_BLKMEM * blkmem )

creates a dynamic array of real values

Parameters
rationalarraypointer to store the real array
blkmemblock memory

Definition at line 2667 of file rational.cpp.

References assert(), BMSallocBlockMemory, SCIP_ALLOC, and SCIP_OKAY.

Referenced by SCIPrationalarrayCopy(), SCIPsolCreateExact(), SCIPsolCreateOriginalExact(), and SCIPsolMakeExact().

◆ SCIPrationalarrayResize()

SCIP_RETCODE SCIPrationalarrayResize ( SCIP_RATIONALARRAY * rationalarray,
int newsize )

resizes a dynamic array of real values

creates a dynamic array of real values

Parameters
rationalarraypointer to store the real array
newsizenew size

Definition at line 2683 of file rational.cpp.

References assert(), SCIP_OKAY, and SCIP_RationalArray::vals.

◆ SCIPrationalarrayCopy()

SCIP_RETCODE SCIPrationalarrayCopy ( SCIP_RATIONALARRAY ** rationalarray,
BMS_BLKMEM * blkmem,
SCIP_RATIONALARRAY * sourcerationalarray )

creates a copy of a dynamic array of real values

Parameters
rationalarraypointer to store the copied real array
blkmemblock memory
sourcerationalarraydynamic rational array to copy

Definition at line 2696 of file rational.cpp.

References assert(), SCIP_RationalArray::firstidx, SCIP_CALL, SCIP_OKAY, SCIPrationalarrayCreate(), and SCIP_RationalArray::vals.

Referenced by SCIPvalsExactCopy().

◆ SCIPrationalarrayFree()

SCIP_RETCODE SCIPrationalarrayFree ( SCIP_RATIONALARRAY ** rationalarray,
BMS_BLKMEM * blkmem )

frees a dynamic array of real values

Parameters
rationalarraypointer to the real array
blkmemblock memory

Definition at line 2713 of file rational.cpp.

References assert(), BMSfreeBlockMemory, and SCIP_OKAY.

Referenced by SCIPsolMakeReal(), and valsExactFree().

◆ SCIPrationalarrayGetVal()

void SCIPrationalarrayGetVal ( SCIP_RATIONALARRAY * rationalarray,
int idx,
SCIP_RATIONAL * result )

gets value of entry in dynamic array

Parameters
rationalarraydynamic rational array
idxarray index to get value for
resultstore the result

Definition at line 2728 of file rational.cpp.

References assert(), SCIP_RationalArray::firstidx, result, SCIPrationalSetFraction(), SCIPrationalSetRational(), and SCIP_RationalArray::vals.

Referenced by solGetArrayValExact().

◆ SCIPrationalarraySetVal()

SCIP_RETCODE SCIPrationalarraySetVal ( SCIP_RATIONALARRAY * rationalarray,
int idx,
SCIP_RATIONAL * val )

sets value of entry in dynamic array

Parameters
rationalarraydynamic rational array
idxarray index to set value for
valvalue to set array index to

Definition at line 2745 of file rational.cpp.

References assert(), SCIP_RationalArray::firstidx, r, SCIP_OKAY, and SCIP_RationalArray::vals.

Referenced by SCIPrationalarrayIncVal(), and solSetArrayValExact().

◆ SCIPrationalarrayIncVal()

SCIP_RETCODE SCIPrationalarrayIncVal ( SCIP_RATIONALARRAY * rationalarray,
int idx,
SCIP_RATIONAL * incval )

increases value of entry in dynamic array

Parameters
rationalarraydynamic rational array
idxarray index to increase value for
incvalvalue to increase array index

Definition at line 2784 of file rational.cpp.

References assert(), FALSE, SCIP_RationalArray::firstidx, SCIP_Rational::isinf, SCIP_CALL, SCIP_OKAY, SCIPrationalarraySetVal(), SCIPrationalIsZero(), SCIP_Rational::val, and SCIP_RationalArray::vals.

◆ SCIPrationalarrayPrint()

SCIP_RETCODE SCIPrationalarrayPrint ( SCIP_RATIONALARRAY * rationalarray)

prints a rationalarray to std out

Parameters
rationalarraydynamic rational array

Definition at line 2808 of file rational.cpp.

References SCIP_RationalArray::firstidx, SCIP_OKAY, SCIPrationalPrint(), and SCIP_RationalArray::vals.

◆ SCIPrationalarrayGetMinIdx()

int SCIPrationalarrayGetMinIdx ( SCIP_RATIONALARRAY * rationalarray)

returns the minimal index of all stored non-zero elements

Parameters
rationalarraydynamic rational array

Definition at line 2823 of file rational.cpp.

References assert(), and SCIP_RationalArray::firstidx.

◆ SCIPrationalarrayGetMaxIdx()

int SCIPrationalarrayGetMaxIdx ( SCIP_RATIONALARRAY * rationalarray)

returns the maximal index of all stored non-zero elements

Parameters
rationalarraydynamic rational array

Definition at line 2833 of file rational.cpp.

References assert(), SCIP_RationalArray::firstidx, and SCIP_RationalArray::vals.

◆ SCIPrationalChgInfinity()

void SCIPrationalChgInfinity ( SCIP_Real inf)

changes the infinity threshold to new value

Parameters
infnew infinity value

Definition at line 2843 of file rational.cpp.

References assert(), infinity, SCIP_DEFAULT_INFINITY, SCIP_Real, SCIPABORT, and SCIPerrorMessage.

Referenced by SCIP_DECL_PARAMCHGD().

◆ SCIPrationalGetInfinity()

SCIP_Real SCIPrationalGetInfinity ( void )

return the infinity threshold for rationals

Definition at line 2862 of file rational.cpp.

References infinity, and SCIP_Real.

Referenced by SCIPnodeUpdateLowerboundLP().