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

📄 batmath.c

📁 一个内存数据库的源代码这是服务器端还有客户端
💻 C
📖 第 1 页 / 共 2 页
字号:
#line 71 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"#include "mal_config.h"#include "gdk.h"#include "math.h"#include "mal_exception.h"#include "batmath.h"#ifdef WIN32#ifndef LIBBATMATH#define batmath_export extern __declspec(dllimport)#else#define batmath_export extern __declspec(dllexport)#endif#else#define batmath_export extern#endifBAT *BATMATHresult(BAT *b, int tpe){	BAT *bn;	if (BAThvoid(b)) {		bn = BATnew(TYPE_void, tpe, BATcount(b));		BATseqbase(bn, b->hseqbase);	} else		bn = BATnew(b->htype, tpe, BATcount(b));	return bn;}#line 170 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"#line 102 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"batmath_export str CMDsciencevoid_asin(int *ret, int *bid);str CMDsciencevoid_asin(int *ret, int *bid){	BAT *b,*bn;	dbl *o;	BUN p,q;	size_t xx;	if( (b= BATdescriptor(*bid)) == NULL ){		throw(MAL, "batcalc.asin", "Cannot access descriptor");	}	if( BUNsize(b) != sizeof(dbl)){		BBPreleaseref(b->batCacheid);		throw(MAL, "batcalc.asin","Unexpected type");	}	bn= BATMATHresult(b, TYPE_dbl);	#line 23 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"if( bn== NULL) {*ret= 0;	throw(MAL, "batcalc.CMDscience_asin", "can not create bat");}#line 118 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"	o = (dbl*) BUNtail(bn, BUNfirst(bn));	xx= BUNsize(b);	p = BUNtail(b, BUNfirst(b));	q = BUNtail(b, BUNlast(b));	while(p<q){		*o++ = *(dbl*)p== dbl_nil? dbl_nil: asin(*(dbl*)p);		p+= xx;	}	*ret= bn->batCacheid;	BBPkeepref(*ret);	BBPreleaseref(b->batCacheid);	return MAL_SUCCEED;}#line 170 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"#line 102 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"batmath_export str CMDsciencevoid_acos(int *ret, int *bid);str CMDsciencevoid_acos(int *ret, int *bid){	BAT *b,*bn;	dbl *o;	BUN p,q;	size_t xx;	if( (b= BATdescriptor(*bid)) == NULL ){		throw(MAL, "batcalc.acos", "Cannot access descriptor");	}	if( BUNsize(b) != sizeof(dbl)){		BBPreleaseref(b->batCacheid);		throw(MAL, "batcalc.acos","Unexpected type");	}	bn= BATMATHresult(b, TYPE_dbl);	#line 23 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"if( bn== NULL) {*ret= 0;	throw(MAL, "batcalc.CMDscience_acos", "can not create bat");}#line 118 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"	o = (dbl*) BUNtail(bn, BUNfirst(bn));	xx= BUNsize(b);	p = BUNtail(b, BUNfirst(b));	q = BUNtail(b, BUNlast(b));	while(p<q){		*o++ = *(dbl*)p== dbl_nil? dbl_nil: acos(*(dbl*)p);		p+= xx;	}	*ret= bn->batCacheid;	BBPkeepref(*ret);	BBPreleaseref(b->batCacheid);	return MAL_SUCCEED;}#line 171 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"#line 102 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"batmath_export str CMDsciencevoid_atan(int *ret, int *bid);str CMDsciencevoid_atan(int *ret, int *bid){	BAT *b,*bn;	dbl *o;	BUN p,q;	size_t xx;	if( (b= BATdescriptor(*bid)) == NULL ){		throw(MAL, "batcalc.atan", "Cannot access descriptor");	}	if( BUNsize(b) != sizeof(dbl)){		BBPreleaseref(b->batCacheid);		throw(MAL, "batcalc.atan","Unexpected type");	}	bn= BATMATHresult(b, TYPE_dbl);	#line 23 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"if( bn== NULL) {*ret= 0;	throw(MAL, "batcalc.CMDscience_atan", "can not create bat");}#line 118 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"	o = (dbl*) BUNtail(bn, BUNfirst(bn));	xx= BUNsize(b);	p = BUNtail(b, BUNfirst(b));	q = BUNtail(b, BUNlast(b));	while(p<q){		*o++ = *(dbl*)p== dbl_nil? dbl_nil: atan(*(dbl*)p);		p+= xx;	}	*ret= bn->batCacheid;	BBPkeepref(*ret);	BBPreleaseref(b->batCacheid);	return MAL_SUCCEED;}#line 172 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"#line 102 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"batmath_export str CMDsciencevoid_cos(int *ret, int *bid);str CMDsciencevoid_cos(int *ret, int *bid){	BAT *b,*bn;	dbl *o;	BUN p,q;	size_t xx;	if( (b= BATdescriptor(*bid)) == NULL ){		throw(MAL, "batcalc.cos", "Cannot access descriptor");	}	if( BUNsize(b) != sizeof(dbl)){		BBPreleaseref(b->batCacheid);		throw(MAL, "batcalc.cos","Unexpected type");	}	bn= BATMATHresult(b, TYPE_dbl);	#line 23 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"if( bn== NULL) {*ret= 0;	throw(MAL, "batcalc.CMDscience_cos", "can not create bat");}#line 118 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"	o = (dbl*) BUNtail(bn, BUNfirst(bn));	xx= BUNsize(b);	p = BUNtail(b, BUNfirst(b));	q = BUNtail(b, BUNlast(b));	while(p<q){		*o++ = *(dbl*)p== dbl_nil? dbl_nil: cos(*(dbl*)p);		p+= xx;	}	*ret= bn->batCacheid;	BBPkeepref(*ret);	BBPreleaseref(b->batCacheid);	return MAL_SUCCEED;}#line 173 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"#line 102 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"batmath_export str CMDsciencevoid_sin(int *ret, int *bid);str CMDsciencevoid_sin(int *ret, int *bid){	BAT *b,*bn;	dbl *o;	BUN p,q;	size_t xx;	if( (b= BATdescriptor(*bid)) == NULL ){		throw(MAL, "batcalc.sin", "Cannot access descriptor");	}	if( BUNsize(b) != sizeof(dbl)){		BBPreleaseref(b->batCacheid);		throw(MAL, "batcalc.sin","Unexpected type");	}	bn= BATMATHresult(b, TYPE_dbl);	#line 23 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"if( bn== NULL) {*ret= 0;	throw(MAL, "batcalc.CMDscience_sin", "can not create bat");}#line 118 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"	o = (dbl*) BUNtail(bn, BUNfirst(bn));	xx= BUNsize(b);	p = BUNtail(b, BUNfirst(b));	q = BUNtail(b, BUNlast(b));	while(p<q){		*o++ = *(dbl*)p== dbl_nil? dbl_nil: sin(*(dbl*)p);		p+= xx;	}	*ret= bn->batCacheid;	BBPkeepref(*ret);	BBPreleaseref(b->batCacheid);	return MAL_SUCCEED;}#line 174 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"#line 102 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"batmath_export str CMDsciencevoid_tan(int *ret, int *bid);str CMDsciencevoid_tan(int *ret, int *bid){	BAT *b,*bn;	dbl *o;	BUN p,q;	size_t xx;	if( (b= BATdescriptor(*bid)) == NULL ){		throw(MAL, "batcalc.tan", "Cannot access descriptor");	}	if( BUNsize(b) != sizeof(dbl)){		BBPreleaseref(b->batCacheid);		throw(MAL, "batcalc.tan","Unexpected type");	}	bn= BATMATHresult(b, TYPE_dbl);	#line 23 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"if( bn== NULL) {*ret= 0;	throw(MAL, "batcalc.CMDscience_tan", "can not create bat");}#line 118 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"	o = (dbl*) BUNtail(bn, BUNfirst(bn));	xx= BUNsize(b);	p = BUNtail(b, BUNfirst(b));	q = BUNtail(b, BUNlast(b));	while(p<q){		*o++ = *(dbl*)p== dbl_nil? dbl_nil: tan(*(dbl*)p);		p+= xx;	}	*ret= bn->batCacheid;	BBPkeepref(*ret);	BBPreleaseref(b->batCacheid);	return MAL_SUCCEED;}#line 175 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"#line 102 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"batmath_export str CMDsciencevoid_cosh(int *ret, int *bid);str CMDsciencevoid_cosh(int *ret, int *bid){	BAT *b,*bn;	dbl *o;	BUN p,q;	size_t xx;	if( (b= BATdescriptor(*bid)) == NULL ){		throw(MAL, "batcalc.cosh", "Cannot access descriptor");	}	if( BUNsize(b) != sizeof(dbl)){		BBPreleaseref(b->batCacheid);		throw(MAL, "batcalc.cosh","Unexpected type");	}	bn= BATMATHresult(b, TYPE_dbl);	#line 23 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"if( bn== NULL) {*ret= 0;	throw(MAL, "batcalc.CMDscience_cosh", "can not create bat");}#line 118 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"	o = (dbl*) BUNtail(bn, BUNfirst(bn));	xx= BUNsize(b);	p = BUNtail(b, BUNfirst(b));	q = BUNtail(b, BUNlast(b));	while(p<q){		*o++ = *(dbl*)p== dbl_nil? dbl_nil: cosh(*(dbl*)p);		p+= xx;	}	*ret= bn->batCacheid;	BBPkeepref(*ret);	BBPreleaseref(b->batCacheid);	return MAL_SUCCEED;}#line 176 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"#line 102 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"batmath_export str CMDsciencevoid_sinh(int *ret, int *bid);str CMDsciencevoid_sinh(int *ret, int *bid){	BAT *b,*bn;	dbl *o;	BUN p,q;	size_t xx;	if( (b= BATdescriptor(*bid)) == NULL ){		throw(MAL, "batcalc.sinh", "Cannot access descriptor");	}	if( BUNsize(b) != sizeof(dbl)){		BBPreleaseref(b->batCacheid);		throw(MAL, "batcalc.sinh","Unexpected type");	}	bn= BATMATHresult(b, TYPE_dbl);	#line 23 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"if( bn== NULL) {*ret= 0;	throw(MAL, "batcalc.CMDscience_sinh", "can not create bat");}#line 118 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"	o = (dbl*) BUNtail(bn, BUNfirst(bn));	xx= BUNsize(b);	p = BUNtail(b, BUNfirst(b));	q = BUNtail(b, BUNlast(b));	while(p<q){		*o++ = *(dbl*)p== dbl_nil? dbl_nil: sinh(*(dbl*)p);		p+= xx;	}	*ret= bn->batCacheid;	BBPkeepref(*ret);	BBPreleaseref(b->batCacheid);	return MAL_SUCCEED;}#line 177 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"#line 102 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"batmath_export str CMDsciencevoid_tanh(int *ret, int *bid);str CMDsciencevoid_tanh(int *ret, int *bid){	BAT *b,*bn;	dbl *o;	BUN p,q;	size_t xx;	if( (b= BATdescriptor(*bid)) == NULL ){		throw(MAL, "batcalc.tanh", "Cannot access descriptor");	}	if( BUNsize(b) != sizeof(dbl)){		BBPreleaseref(b->batCacheid);		throw(MAL, "batcalc.tanh","Unexpected type");	}	bn= BATMATHresult(b, TYPE_dbl);	#line 23 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"if( bn== NULL) {*ret= 0;	throw(MAL, "batcalc.CMDscience_tanh", "can not create bat");}#line 118 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"	o = (dbl*) BUNtail(bn, BUNfirst(bn));	xx= BUNsize(b);	p = BUNtail(b, BUNfirst(b));	q = BUNtail(b, BUNlast(b));	while(p<q){		*o++ = *(dbl*)p== dbl_nil? dbl_nil: tanh(*(dbl*)p);		p+= xx;	}	*ret= bn->batCacheid;	BBPkeepref(*ret);	BBPreleaseref(b->batCacheid);	return MAL_SUCCEED;}#line 178 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"#line 102 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/batmath.mx"batmath_export str CMDsciencevoid_exp(int *ret, int *bid);str CMDsciencevoid_exp(int *ret, int *bid){	BAT *b,*bn;	dbl *o;	BUN p,q;	size_t xx;	if( (b= BATdescriptor(*bid)) == NULL ){		throw(MAL, "batcalc.exp", "Cannot access descriptor");	}	if( BUNsize(b) != sizeof(dbl)){		BBPreleaseref(b->batCacheid);

⌨️ 快捷键说明

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