找回密码
 注册
查看: 1348|回复: 2

[求助]关于Interpret是否能使用“math.h”的问题

[复制链接]
发表于 2012-10-29 12:33:40 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

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)
}
 楼主| 发表于 2012-10-29 12:34:18 | 显示全部楼层
另外,用compile能够通过。
 楼主| 发表于 2012-11-11 18:36:36 | 显示全部楼层
后来发现直接删除就行,可以直接用函数。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表