当前位置: 首页>>代码示例>>C++>>正文


C++ GiSTentry::Copy方法代码示例

本文整理汇总了C++中GiSTentry::Copy方法的典型用法代码示例。如果您正苦于以下问题:C++ GiSTentry::Copy方法的具体用法?C++ GiSTentry::Copy怎么用?C++ GiSTentry::Copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GiSTentry的用法示例。


在下文中一共展示了GiSTentry::Copy方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Insert

void
MTnode::InsertBefore(const GiSTentry& entry, int index)
{
	int n=NumEntries();
	BOOL ordered=TRUE;

	if(index>0) ordered=((*this)[index-1]->Compare(entry)<=0);
	if(index<n) ordered=ordered&&((*this)[index]->Compare(entry)>=0);
	if(ordered) {	// yes, the position is right for this entry
		assert(index<=n);
		GiSTentry *e=(GiSTentry *)entry.Copy();

		e->SetLevel(Level());
		e->SetPosition(index);
		e->SetNode(this);
		// Move everything else over
		for(int i=n; i>index; i--) {
			GiSTentry *e=(*this)[i-1];

			e->SetPosition(i);
			(*this)[i]=e;
		}
		// Stick the entry in
		(*this)[index]=e;
		// Bump up the count
		SetNumEntries(n+1);
	}
	else Insert(entry);	// find the right place
}
开发者ID:Khalefa,项目名称:similarityjoin,代码行数:29,代码来源:MTnode.cpp

示例2: NumEntries

// insert before the original number according to the sequence instead of index
void
MTnode::InsertBefore (const GiSTentry& newEntry, int index)
{
	int n = NumEntries ();
	assert (index>=0 && index<=n);

	BOOL bOrder = TRUE;
	if (index > 0) {
		bOrder = (*this)[index-1]->Compare(newEntry) <= 0;
	}
	if (index < n) {
		bOrder = bOrder && (*this)[index]->Compare(newEntry) >= 0;
	}

	if (bOrder) {  // yes, the position is right for this entry
		GiSTentry *entry = (GiSTentry *) newEntry.Copy ();
		entry->SetLevel(Level());
		entry->SetPosition(index);
		entry->SetNode(this);
		// Move everything else over
		for (int i=n; i>index; i--) {
			GiSTentry *e = (*this)[i-1];
			e->SetPosition(i);
			(*this)[i] = e;
		}
		// Stick the entry in
		(*this)[index] = entry;
		// Bump up the count
		SetNumEntries (n+1);
	} else {
		Insert (newEntry);  // find the right place
	}
}
开发者ID:jsc0218,项目名称:MxTree,代码行数:34,代码来源:MTnode.cpp

示例3: return

GiSTentry* 
GiSTnode::SearchPtr(GiSTpage ptr) const
{
    for (int i=0; i<numEntries; i++) {
	GiSTentry *e = (*this)[i];
	if (e->Ptr() == ptr)
	    return (GiSTentry*) e->Copy();
    }
    return NULL;
}
开发者ID:VoR0220,项目名称:fastdb,代码行数:10,代码来源:GiSTnode.cpp

示例4:

GiSTlist<GiSTentry*> 
GiSTnode::Search(const GiSTpredicate &query) const
{
    GiSTlist<GiSTentry*> list;

    for (int i=0; i<numEntries; i++) {
	GiSTentry *e = (*this)[i];
	if (query.Consistent(*e))
	    list.Append((GiSTentry*)e->Copy());
    }
    return list;
}
开发者ID:VoR0220,项目名称:fastdb,代码行数:12,代码来源:GiSTnode.cpp

示例5: NumEntries

void 
GiSTnode::InsertBefore (const GiSTentry& entry, int index)
{
	assert (index <= NumEntries());
	GiSTentry *e = (GiSTentry*)entry.Copy();

	e->SetLevel (Level());
	e->SetPosition (index);
	e->SetNode (this);
	// Move everything else over
	for (int i=NumEntries(); i>index; i--) {
		GiSTentry *e = (*this)[i-1];
		e->SetPosition (i);
		(*this)[i] = e;
	}
	// Stick the entry in
	(*this)[index] = e;
	// Bump up the count
	numEntries++;
}
开发者ID:jsc0218,项目名称:MxTree,代码行数:20,代码来源:GiSTnode.cpp


注:本文中的GiSTentry::Copy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。