本文整理汇总了C++中GiSTentry::IsEqual方法的典型用法代码示例。如果您正苦于以下问题:C++ GiSTentry::IsEqual方法的具体用法?C++ GiSTentry::IsEqual怎么用?C++ GiSTentry::IsEqual使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GiSTentry
的用法示例。
在下文中一共展示了GiSTentry::IsEqual方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadNode
// adjust the keys of node, which is used during the final phase of the BulkLoad algorithm
void
MT::AdjKeys (GiSTnode *node)
{
if (node->Path().IsRoot()) {
return;
}
GiSTpath parentPath = node->Path();
parentPath.MakeParent ();
GiSTnode *parentNode = ReadNode (parentPath);
GiSTentry *parentEntry = parentNode->SearchPtr(node->Path().Page()); // parent entry
assert (parentEntry != NULL);
GiSTentry *unionEntry = node->Union();
unionEntry->SetPtr(node->Path().Page());
((MTkey *) unionEntry->Key())->distance = ((MTkey *) parentEntry->Key())->distance; // necessary to keep track of the distance from the parent
if (!parentEntry->IsEqual(*unionEntry)) { // replace this entry
parentNode->DeleteEntry(parentEntry->Position());
parentNode->Insert(*unionEntry);
WriteNode (parentNode);
AdjKeys (parentNode);
}
delete unionEntry;
delete parentEntry;
delete parentNode;
}
示例2: ReadNode
void
GiST::AdjustKeys (GiSTnode *node, GiSTnode **parent)
{
if (node->Path().IsRoot()) {
return;
}
GiSTnode *P;
// Read in node's parent
if (parent == NULL) {
GiSTpath parent_path = node->Path();
parent_path.MakeParent ();
P = ReadNode (parent_path);
parent = &P;
} else {
P = *parent;
}
// Get the old entry pointing to node
GiSTentry *entry = P->SearchPtr(node->Path().Page());
assert (entry != NULL);
// Get union of node
GiSTentry *actual = node->Union();
WriteNode(node); // added by myself for the splitted = false;
actual->SetPtr(node->Path().Page());
if (!entry->IsEqual(*actual)) {
int pos = entry->Position();
P->DeleteEntry(pos);
P->InsertBefore(*actual, pos);
// A split may be necessary.
// XXX: should we do Forced Reinsert here too?
if (P->IsOverFull(*store)) {
Split (parent, *actual);
GiSTpage page = node->Path().Page();
node->Path() = P->Path();
node->Path().MakeChild(page);
} else {
WriteNode (P);
AdjustKeys (P, NULL);
}
}
if (parent == &P) {
delete P;
}
delete actual;
delete entry;
}