⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gdk_batop.c

📁 这个是内存数据库中的一个管理工具
💻 C
📖 第 1 页 / 共 5 页
字号:
#line 1222 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"		break;#endif	default:		if (b->hvarsized) {			#line 1110 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"	if (BAThordered(b)&1) {		int offset;		BUN p1, p2;		b= BATmirror(b);		SORTloop(b, p1, p2, hl, hh, offset) {			*m++ = p1;		}		b= BATmirror(b);	} else {		int lval = !atom_EQ(ATOMnilptr(t),hl,t);		int hval = !atom_EQ(ATOMnilptr(t),hh,t);		if (hval && lval && atom_GT(hl,hh,t)) {			GDKerror("BATrestrict: illegal head range.\n");		} else {			int xx;			BATloopFast(b, p, l, xx) {				if ((!lval || atom_LE(hl, BUNhvar(b, p),t)) &&				    (!hval || atom_LE(BUNhvar(b, p), hh,t))) {					*m++ = p;				}			}		}	}#line 1227 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"		} else {			#line 1110 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"	if (BAThordered(b)&1) {		int offset;		BUN p1, p2;		b= BATmirror(b);		SORTloop(b, p1, p2, hl, hh, offset) {			*m++ = p1;		}		b= BATmirror(b);	} else {		int lval = !atom_EQ(ATOMnilptr(t),hl,t);		int hval = !atom_EQ(ATOMnilptr(t),hh,t);		if (hval && lval && atom_GT(hl,hh,t)) {			GDKerror("BATrestrict: illegal head range.\n");		} else {			int xx;			BATloopFast(b, p, l, xx) {				if ((!lval || atom_LE(hl, BUNhloc(b, p),t)) &&				    (!hval || atom_LE(BUNhloc(b, p), hh,t))) {					*m++ = p;				}			}		}	}#line 1229 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"		}		break;	}	/* second phase */	if (b->hvarsized) {		switch (ATOMstorage(t = b->ttype)) {#ifndef NOEXPAND_CHR		case TYPE_chr:			#line 1138 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"	{		tl = simple_EQ(ATOMnilptr(t),tl,chr) ? 0 : tl;		th = simple_EQ(ATOMnilptr(t),th,chr) ? 0 : th;		if (th && tl && simple_GT(tl,th,chr)) {			GDKerror("BATrestrict: illegal tail range.\n");		} else {			for (; i < m; i++) {				ptr v = BUNtloc(b, *i);				if ((!tl || simple_LE(tl, v, chr)) &&				    (!th || simple_LE(v, th, chr))) {					bunfastins(bn, BUNhvar(b, *i), v);				}			}		}	}	break;#line 1239 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"			break;#endif#ifndef NOEXPAND_BTE		case TYPE_bte:			#line 1138 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"	{		tl = simple_EQ(ATOMnilptr(t),tl,bte) ? 0 : tl;		th = simple_EQ(ATOMnilptr(t),th,bte) ? 0 : th;		if (th && tl && simple_GT(tl,th,bte)) {			GDKerror("BATrestrict: illegal tail range.\n");		} else {			for (; i < m; i++) {				ptr v = BUNtloc(b, *i);				if ((!tl || simple_LE(tl, v, bte)) &&				    (!th || simple_LE(v, th, bte))) {					bunfastins(bn, BUNhvar(b, *i), v);				}			}		}	}	break;#line 1244 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"			break;#endif#ifndef NOEXPAND_SHT		case TYPE_sht:			#line 1138 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"	{		tl = simple_EQ(ATOMnilptr(t),tl,sht) ? 0 : tl;		th = simple_EQ(ATOMnilptr(t),th,sht) ? 0 : th;		if (th && tl && simple_GT(tl,th,sht)) {			GDKerror("BATrestrict: illegal tail range.\n");		} else {			for (; i < m; i++) {				ptr v = BUNtloc(b, *i);				if ((!tl || simple_LE(tl, v, sht)) &&				    (!th || simple_LE(v, th, sht))) {					bunfastins(bn, BUNhvar(b, *i), v);				}			}		}	}	break;#line 1249 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"			break;#endif#ifndef NOEXPAND_INT		case TYPE_int:			#line 1138 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"	{		tl = simple_EQ(ATOMnilptr(t),tl,int) ? 0 : tl;		th = simple_EQ(ATOMnilptr(t),th,int) ? 0 : th;		if (th && tl && simple_GT(tl,th,int)) {			GDKerror("BATrestrict: illegal tail range.\n");		} else {			for (; i < m; i++) {				ptr v = BUNtloc(b, *i);				if ((!tl || simple_LE(tl, v, int)) &&				    (!th || simple_LE(v, th, int))) {					bunfastins(bn, BUNhvar(b, *i), v);				}			}		}	}	break;#line 1254 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"			break;#endif#ifndef NOEXPAND_FLT		case TYPE_flt:			#line 1138 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"	{		tl = simple_EQ(ATOMnilptr(t),tl,flt) ? 0 : tl;		th = simple_EQ(ATOMnilptr(t),th,flt) ? 0 : th;		if (th && tl && simple_GT(tl,th,flt)) {			GDKerror("BATrestrict: illegal tail range.\n");		} else {			for (; i < m; i++) {				ptr v = BUNtloc(b, *i);				if ((!tl || simple_LE(tl, v, flt)) &&				    (!th || simple_LE(v, th, flt))) {					bunfastins(bn, BUNhvar(b, *i), v);				}			}		}	}	break;#line 1259 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"			break;#endif#ifndef NOEXPAND_DBL		case TYPE_dbl:			#line 1138 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"	{		tl = simple_EQ(ATOMnilptr(t),tl,dbl) ? 0 : tl;		th = simple_EQ(ATOMnilptr(t),th,dbl) ? 0 : th;		if (th && tl && simple_GT(tl,th,dbl)) {			GDKerror("BATrestrict: illegal tail range.\n");		} else {			for (; i < m; i++) {				ptr v = BUNtloc(b, *i);				if ((!tl || simple_LE(tl, v, dbl)) &&				    (!th || simple_LE(v, th, dbl))) {					bunfastins(bn, BUNhvar(b, *i), v);				}			}		}	}	break;#line 1264 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"			break;#endif#ifndef NOEXPAND_LNG		case TYPE_lng:			#line 1138 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"	{		tl = simple_EQ(ATOMnilptr(t),tl,lng) ? 0 : tl;		th = simple_EQ(ATOMnilptr(t),th,lng) ? 0 : th;		if (th && tl && simple_GT(tl,th,lng)) {			GDKerror("BATrestrict: illegal tail range.\n");		} else {			for (; i < m; i++) {				ptr v = BUNtloc(b, *i);				if ((!tl || simple_LE(tl, v, lng)) &&				    (!th || simple_LE(v, th, lng))) {					bunfastins(bn, BUNhvar(b, *i), v);				}			}		}	}	break;#line 1269 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"			break;#endif		default:			if (b->tvarsized) {				#line 1138 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"	{		tl = atom_EQ(ATOMnilptr(t),tl,t) ? 0 : tl;		th = atom_EQ(ATOMnilptr(t),th,t) ? 0 : th;		if (th && tl && atom_GT(tl,th,t)) {			GDKerror("BATrestrict: illegal tail range.\n");		} else {			for (; i < m; i++) {				ptr v = BUNtvar(b, *i);				if ((!tl || atom_LE(tl, v, t)) &&				    (!th || atom_LE(v, th, t))) {					bunfastins(bn, BUNhvar(b, *i), v);				}			}		}	}	break;#line 1274 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"			} else {				#line 1138 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"	{		tl = atom_EQ(ATOMnilptr(t),tl,t) ? 0 : tl;		th = atom_EQ(ATOMnilptr(t),th,t) ? 0 : th;		if (th && tl && atom_GT(tl,th,t)) {			GDKerror("BATrestrict: illegal tail range.\n");		} else {			for (; i < m; i++) {				ptr v = BUNtloc(b, *i);				if ((!tl || atom_LE(tl, v, t)) &&				    (!th || atom_LE(v, th, t))) {					bunfastins(bn, BUNhvar(b, *i), v);				}			}		}	}	break;#line 1276 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"			}			break;		}	} else {		switch (ATOMstorage(t = b->ttype)) {#ifndef NOEXPAND_CHR		case TYPE_chr:			#line 1138 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"	{		tl = simple_EQ(ATOMnilptr(t),tl,chr) ? 0 : tl;		th = simple_EQ(ATOMnilptr(t),th,chr) ? 0 : th;		if (th && tl && simple_GT(tl,th,chr)) {			GDKerror("BATrestrict: illegal tail range.\n");		} else {			for (; i < m; i++) {				ptr v = BUNtloc(b, *i);				if ((!tl || simple_LE(tl, v, chr)) &&				    (!th || simple_LE(v, th, chr))) {					bunfastins(bn, BUNhloc(b, *i), v);				}			}		}	}	break;#line 1284 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"			break;#endif#ifndef NOEXPAND_BTE		case TYPE_bte:			#line 1138 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"	{		tl = simple_EQ(ATOMnilptr(t),tl,bte) ? 0 : tl;		th = simple_EQ(ATOMnilptr(t),th,bte) ? 0 : th;		if (th && tl && simple_GT(tl,th,bte)) {			GDKerror("BATrestrict: illegal tail range.\n");		} else {			for (; i < m; i++) {				ptr v = BUNtloc(b, *i);				if ((!tl || simple_LE(tl, v, bte)) &&				    (!th || simple_LE(v, th, bte))) {					bunfastins(bn, BUNhloc(b, *i), v);				}			}		}	}	break;#line 1289 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"			break;#endif#ifndef NOEXPAND_SHT		case TYPE_sht:			#line 1138 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"	{		tl = simple_EQ(ATOMnilptr(t),tl,sht) ? 0 : tl;		th = simple_EQ(ATOMnilptr(t),th,sht) ? 0 : th;		if (th && tl && simple_GT(tl,th,sht)) {			GDKerror("BATrestrict: illegal tail range.\n");		} else {			for (; i < m; i++) {				ptr v = BUNtloc(b, *i);				if ((!tl || simple_LE(tl, v, sht)) &&				    (!th || simple_LE(v, th, sht))) {					bunfastins(bn, BUNhloc(b, *i), v);				}			}		}	}	break;#line 1294 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"			break;#endif#ifndef NOEXPAND_INT		case TYPE_int:			#line 1138 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"	{		tl = simple_EQ(ATOMnilptr(t),tl,int) ? 0 : tl;		th = simple_EQ(ATOMnilptr(t),th,int) ? 0 : th;		if (th && tl && simple_GT(tl,th,int)) {			GDKerror("BATrestrict: illegal tail range.\n");		} else {			for (; i < m; i++) {				ptr v = BUNtloc(b, *i);				if ((!tl || simple_LE(tl, v, int)) &&				    (!th || simple_LE(v, th, int))) {					bunfastins(bn, BUNhloc(b, *i), v);				}			}		}	}	break;#line 1299 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"			break;#endif#ifndef NOEXPAND_FLT		case TYPE_flt:			#line 1138 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"	{		tl = simple_EQ(ATOMnilptr(t),tl,flt) ? 0 : tl;		th = simple_EQ(ATOMnilptr(t),th,flt) ? 0 : th;		if (th && tl && simple_GT(tl,th,flt)) {			GDKerror("BATrestrict: illegal tail range.\n");		} else {			for (; i < m; i++) {				ptr v = BUNtloc(b, *i);				if ((!tl || simple_LE(tl, v, flt)) &&				    (!th || simple_LE(v, th, flt))) {					bunfastins(bn, BUNhloc(b, *i), v);				}			}		}	}	break;#line 1304 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"			break;#endif#if !defined(NOEXPAND_LNG) || !defined(NOEXPAND_DBL)		case TYPE_dbl:		case TYPE_lng:			#line 1138 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"	{		tl = simple_EQ(ATOMnilptr(t),tl,lng) ? 0 : tl;		th = simple_EQ(ATOMnilptr(t),th,lng) ? 0 : th;		if (th && tl && simple_GT(tl,th,lng)) {			GDKerror("BATrestrict: illegal tail range.\n");		} else {			for (; i < m; i++) {				ptr v = BUNtloc(b, *i);				if ((!tl || simple_LE(tl, v, lng)) &&				    (!th || simple_LE(v, th, lng))) {					bunfastins(bn, BUNhloc(b, *i), v);				}			}		}	}	break;#line 1310 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"			break;#endif		default:			if (b->tvarsized) {				#line 1138 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"	{		tl = atom_EQ(ATOMnilptr(t),tl,t) ? 0 : tl;		th = atom_EQ(ATOMnilptr(t),th,t) ? 0 : th;		if (th && tl && atom_GT(tl,th,t)) {			GDKerror("BATrestrict: illegal tail range.\n");		} else {			for (; i < m; i++) {				ptr v = BUNtvar(b, *i);				if ((!tl || atom_LE(tl, v, t)) &&				    (!th || atom_LE(v, th, t))) {					bunfastins(bn, BUNhloc(b, *i), v);				}			}		}	}	break;#line 1315 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"			} else {				#line 1138 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_batop.mx"	{		tl = atom_EQ(ATOMnilptr(t),tl,t) ? 0 : tl;		th = atom_EQ(ATOMnilptr(t),th,t) ? 0 : th;		if (th && tl && atom_GT(tl,th,t)) {			GDKerror("BATrestrict: illegal tail range.\n");		} else {			for (; i < m; i++) {				ptr v = BUNtloc(b, *i);				if ((!tl || atom_LE(tl, v, t)) &&				    (!th || atom_LE(v, th, t))) {					bunfastins(bn, BUNhloc(b, *i), v);				}			}		}	}	break;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -