|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
我想问问各位做过UDF的前辈们,是否Interpret中不可能包含有#include "math.h"语句呢,违反了
The interpreter that is used for interpreted UDFs does not have all of the capabilities of a standard C compiler (which is used for compiled UDFs). Specifically interpreted UDFs cannot contain any of the following C programming language elements:
goto statements (X,这条不可能,是Goto语句)
non ANSI-C prototypes for syntax(未知,应该是 非ANSI-C语法原型)
direct data structure references(未知,)
declarations of local structures(应该是结构体,如果是的话也不是这个)
unions(X,这条也不可能,没有用这个东西,应该是共用体类型)
pointers to functions(X,这条也不可能,是函数指针)
arrays of functions(X,这条也不可能,是数组指针)
帮助文件里的哪一条呀,主要是C语言基础不好,请各位知道的赐教一下哦。
或者说明一样为什么不可以,还是我哪个地方搞错了,谢谢。
#include "udf.h"
#include "math.h"
DEFINE_PROFILE(curve_porosity,thread,i)
{
real x[ND_ND];
real p_x, permeability;
real co_b;
cell_t c;
begin_c_loop(c,thread)
{
C_CENTROID(x,c,thread,);
p_x=10.*exp(2.*fabs(x[0]))+4.;
co_b=exp(3.*(10.+fabs(x[1])))+1.;
permeability=2e-5*exp(0.23);
C_PROFILE(c,thread,i)=1./permeability;
}
end_c_loop(c,thread)
} |
|