Detailed Description
binary search tree data structure
Function Documentation
◆ SCIPbtnodeCreate()
SCIP_EXPORT SCIP_RETCODE SCIPbtnodeCreate | ( | SCIP_BT * | tree, |
SCIP_BTNODE ** | node, | ||
void * | dataptr | ||
) |
creates a binary tree node with sorting value and user data
creates a tree node with (optinal) user data
- Parameters
-
tree binary tree node pointer to store the created node dataptr user node data pointer, or NULL
Definition at line 8578 of file misc.c.
References btnodeCreateEmpty(), NULL, SCIP_CALL, and SCIP_OKAY.
Referenced by checkOverloadViaThetaTree(), insertThetanode(), and SCIPrealHashCode().
◆ SCIPbtnodeFree()
SCIP_EXPORT void SCIPbtnodeFree | ( | SCIP_BT * | tree, |
SCIP_BTNODE ** | node | ||
) |
frees the binary node including the rooted subtree
- Note
- The user pointer (object) is not freed. If needed, it has to be done by the user.
frees the node including the rooted subtree
- Note
- The user pointer (object) is not freed. If needed, it has to be done by the user.
- Parameters
-
tree binary tree node node to be freed
Definition at line 8642 of file misc.c.
References btnodeFreeLeaf(), NULL, and SCIPbtnodeFree().
Referenced by deleteLambdaLeaf(), SCIPbtFree(), SCIPbtnodeFree(), and SCIPrealHashCode().
◆ SCIPbtnodeGetData()
SCIP_EXPORT void* SCIPbtnodeGetData | ( | SCIP_BTNODE * | node | ) |
returns the user data pointer stored in that node
- Parameters
-
node node
Definition at line 8687 of file misc.c.
References SCIP_BtNode::dataptr, and NULL.
Referenced by analyzeConflictOverload(), checkOverloadViaThetaTree(), collectThetaSubtree(), computeEnergyContribution(), deleteLambdaLeaf(), findResponsibleLambdaLeafTraceEnergy(), findResponsibleLambdaLeafTraceEnvelop(), inferboundsEdgeFinding(), insertThetanode(), moveNodeToLambda(), SCIP_DECL_SORTPTRCOMP(), SCIPrealHashCode(), traceLambdaEnergy(), traceLambdaEnvelop(), traceThetaEnvelop(), updateEnvelope(), and updateKeyOnTrace().
◆ SCIPbtnodeGetParent()
SCIP_EXPORT SCIP_BTNODE* SCIPbtnodeGetParent | ( | SCIP_BTNODE * | node | ) |
returns the parent which can be NULL if the given node is the root
- Parameters
-
node node
Definition at line 8697 of file misc.c.
References NULL, and SCIP_BtNode::parent.
Referenced by deleteLambdaLeaf(), insertThetanode(), SCIPbtnodeGetSibling(), SCIPbtnodeIsLeftchild(), SCIPbtnodeIsRightchild(), SCIPrealHashCode(), updateEnvelope(), and updateKeyOnTrace().
◆ SCIPbtnodeGetLeftchild()
SCIP_EXPORT SCIP_BTNODE* SCIPbtnodeGetLeftchild | ( | SCIP_BTNODE * | node | ) |
returns left child which can be NULL if the given node is a leaf
- Parameters
-
node node
Definition at line 8707 of file misc.c.
References SCIP_BtNode::left, and NULL.
Referenced by btPrintSubtree(), collectThetaSubtree(), deleteLambdaLeaf(), findResponsibleLambdaLeafTraceEnergy(), findResponsibleLambdaLeafTraceEnvelop(), insertThetanode(), SCIPbtnodeGetSibling(), SCIPbtnodeIsLeftchild(), SCIPrealHashCode(), traceLambdaEnergy(), traceLambdaEnvelop(), traceThetaEnvelop(), and updateEnvelope().
◆ SCIPbtnodeGetRightchild()
SCIP_EXPORT SCIP_BTNODE* SCIPbtnodeGetRightchild | ( | SCIP_BTNODE * | node | ) |
returns right child which can be NULL if the given node is a leaf
- Parameters
-
node node
Definition at line 8717 of file misc.c.
References NULL, and SCIP_BtNode::right.
Referenced by btPrintSubtree(), collectThetaSubtree(), deleteLambdaLeaf(), findResponsibleLambdaLeafTraceEnergy(), findResponsibleLambdaLeafTraceEnvelop(), insertThetanode(), SCIPbtnodeGetSibling(), SCIPbtnodeIsRightchild(), SCIPrealHashCode(), traceLambdaEnergy(), traceLambdaEnvelop(), traceThetaEnvelop(), and updateEnvelope().
◆ SCIPbtnodeGetSibling()
SCIP_EXPORT SCIP_BTNODE* SCIPbtnodeGetSibling | ( | SCIP_BTNODE * | node | ) |
returns the sibling of the node or NULL if does not exist
- Parameters
-
node node
Definition at line 8727 of file misc.c.
References NULL, SCIPbtnodeGetLeftchild(), SCIPbtnodeGetParent(), and SCIPbtnodeGetRightchild().
Referenced by SCIPrealHashCode().
◆ SCIPbtnodeIsRoot()
SCIP_EXPORT SCIP_Bool SCIPbtnodeIsRoot | ( | SCIP_BTNODE * | node | ) |
returns whether the node is a root node
- Parameters
-
node node
Definition at line 8747 of file misc.c.
References NULL, and SCIP_BtNode::parent.
Referenced by deleteLambdaLeaf(), inferboundsEdgeFinding(), SCIPbtnodeIsLeftchild(), SCIPbtnodeIsRightchild(), SCIPrealHashCode(), and updateKeyOnTrace().
◆ SCIPbtnodeIsLeaf()
SCIP_EXPORT SCIP_Bool SCIPbtnodeIsLeaf | ( | SCIP_BTNODE * | node | ) |
returns whether the node is a leaf
- Parameters
-
node node
Definition at line 8757 of file misc.c.
References SCIP_BtNode::left, NULL, and SCIP_BtNode::right.
Referenced by collectThetaSubtree(), deleteLambdaLeaf(), findResponsibleLambdaLeafTraceEnergy(), findResponsibleLambdaLeafTraceEnvelop(), inferboundsEdgeFinding(), insertThetanode(), SCIPrealHashCode(), traceLambdaEnergy(), traceLambdaEnvelop(), traceThetaEnvelop(), and updateEnvelope().
◆ SCIPbtnodeIsLeftchild()
SCIP_EXPORT SCIP_Bool SCIPbtnodeIsLeftchild | ( | SCIP_BTNODE * | node | ) |
returns TRUE if the given node is left child
- Parameters
-
node node
Definition at line 8767 of file misc.c.
References FALSE, SCIPbtnodeGetLeftchild(), SCIPbtnodeGetParent(), SCIPbtnodeIsRoot(), and TRUE.
Referenced by deleteLambdaLeaf(), SCIPrealHashCode(), and updateKeyOnTrace().
◆ SCIPbtnodeIsRightchild()
SCIP_EXPORT SCIP_Bool SCIPbtnodeIsRightchild | ( | SCIP_BTNODE * | node | ) |
returns TRUE if the given node is right child
- Parameters
-
node node
Definition at line 8785 of file misc.c.
References FALSE, SCIPbtnodeGetParent(), SCIPbtnodeGetRightchild(), SCIPbtnodeIsRoot(), and TRUE.
Referenced by deleteLambdaLeaf(), and SCIPrealHashCode().
◆ SCIPbtnodeSetData()
SCIP_EXPORT void SCIPbtnodeSetData | ( | SCIP_BTNODE * | node, |
void * | dataptr | ||
) |
sets the give node data
- Note
- The old user pointer is not freed.
- Parameters
-
node node dataptr node user data pointer
Definition at line 8806 of file misc.c.
References SCIP_BtNode::dataptr, and NULL.
Referenced by SCIPrealHashCode().
◆ SCIPbtnodeSetParent()
SCIP_EXPORT void SCIPbtnodeSetParent | ( | SCIP_BTNODE * | node, |
SCIP_BTNODE * | parent | ||
) |
sets parent node
- Note
- The old parent including the rooted subtree is not delete.
- Parameters
-
node node parent new parent node, or NULL
Definition at line 8820 of file misc.c.
References NULL, and SCIP_BtNode::parent.
Referenced by deleteLambdaLeaf(), insertThetanode(), and SCIPrealHashCode().
◆ SCIPbtnodeSetLeftchild()
SCIP_EXPORT void SCIPbtnodeSetLeftchild | ( | SCIP_BTNODE * | node, |
SCIP_BTNODE * | left | ||
) |
sets left child
- Note
- The old left child including the rooted subtree is not delete.
- Parameters
-
node node left new left child, or NULL
Definition at line 8834 of file misc.c.
References SCIP_BtNode::left, and NULL.
Referenced by deleteLambdaLeaf(), insertThetanode(), and SCIPrealHashCode().
◆ SCIPbtnodeSetRightchild()
SCIP_EXPORT void SCIPbtnodeSetRightchild | ( | SCIP_BTNODE * | node, |
SCIP_BTNODE * | right | ||
) |
sets right child
- Note
- The old right child including the rooted subtree is not delete.
- Parameters
-
node node right new right child, or NULL
Definition at line 8848 of file misc.c.
References NULL, and SCIP_BtNode::right.
Referenced by deleteLambdaLeaf(), insertThetanode(), and SCIPrealHashCode().
◆ SCIPbtCreate()
SCIP_EXPORT SCIP_RETCODE SCIPbtCreate | ( | SCIP_BT ** | tree, |
BMS_BLKMEM * | blkmem | ||
) |
creates an binary tree
- Parameters
-
tree pointer to store the created binary tree blkmem block memory used to createnode
Definition at line 8859 of file misc.c.
References BMSallocBlockMemory, NULL, SCIP_ALLOC, and SCIP_OKAY.
Referenced by checkOverloadViaThetaTree(), and SCIPrealHashCode().
◆ SCIPbtFree()
SCIP_EXPORT void SCIPbtFree | ( | SCIP_BT ** | tree | ) |
frees binary tree
- Note
- The user pointers (object) of the search nodes are not freed. If needed, it has to be done by the user.
frees binary tree
- Note
- The user pointers (object) of the nodes are not freed. If needed, it has to be done by the user.
- Parameters
-
tree pointer to binary tree
Definition at line 8878 of file misc.c.
References BMSfreeBlockMemory, NULL, and SCIPbtnodeFree().
Referenced by checkOverloadViaThetaTree(), and SCIPrealHashCode().
◆ SCIPbtPrintGml()
SCIP_EXPORT void SCIPbtPrintGml | ( | SCIP_BT * | tree, |
FILE * | file | ||
) |
prints the binary tree in GML format into the given file
- Parameters
-
tree binary tree file file to write to
Definition at line 8930 of file misc.c.
References btPrintSubtree(), nnodes, NULL, SCIPbtGetRoot(), SCIPbtIsEmpty(), SCIPgmlWriteClosing(), SCIPgmlWriteOpening(), and TRUE.
Referenced by SCIPrealHashCode().
◆ SCIPbtIsEmpty()
SCIP_EXPORT SCIP_Bool SCIPbtIsEmpty | ( | SCIP_BT * | tree | ) |
returns whether the binary tree is empty (has no nodes)
- Parameters
-
tree binary tree
Definition at line 8960 of file misc.c.
References NULL, and SCIP_Bt::root.
Referenced by checkOverloadViaThetaTree(), inferboundsEdgeFinding(), insertThetanode(), SCIPbtPrintGml(), and SCIPrealHashCode().
◆ SCIPbtGetRoot()
SCIP_EXPORT SCIP_BTNODE* SCIPbtGetRoot | ( | SCIP_BT * | tree | ) |
returns the root node of the binary tree or NULL if the binary tree is empty
returns the the root node of the binary or NULL if the binary tree is empty
- Parameters
-
tree tree to be evaluated
Definition at line 8970 of file misc.c.
References NULL, and SCIP_Bt::root.
Referenced by checkOverloadViaThetaTree(), inferboundsEdgeFinding(), insertThetanode(), SCIPbtPrintGml(), and SCIPrealHashCode().
◆ SCIPbtSetRoot()
SCIP_EXPORT void SCIPbtSetRoot | ( | SCIP_BT * | tree, |
SCIP_BTNODE * | root | ||
) |
sets root node
- Note
- The old root including the rooted subtree is not delete.
- Parameters
-
tree tree to be evaluated root new root, or NULL
Definition at line 8983 of file misc.c.
References NULL, and SCIP_Bt::root.
Referenced by deleteLambdaLeaf(), insertThetanode(), and SCIPrealHashCode().