全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Gauss专版
4400 2
2007-04-19

不明白Gauss中的.ext和.dec文件有什么区别。看下面UserGuide 8.0(18-11)的例子:

.src File:
/*
** fcomp.src
** These functions use _fcmptol to fuzz the comparison operations
** to allow for roundoff error.
** The statement: y = feq(a,b);
** is equivalent to: y = a eq b;
** Returns a scalar result, 1 (true) or 0 (false)
** y = feq(a,b);
** y = fne(a,b);
*/

#include fcomp.ext;
proc feq(a,b);
retp(abs(a-b) <= _fcmptol);
endp;
proc fne(a,b);
retp(abs(a-b) > _fcmptol);
endp;

.dec File:

/*
** fcomp.dec - global declaration file for fuzzy comparisons.
*/
declare matrix _fcmptol != 1e-14;

.lcg File:
/*
** fcomp.lcg - fuzzy compare library*/

fcomp.dec
_fcmptol:matrix
fcomp.src
feq:proc
fne:proc

这里的_fcmptol != 1e-14;中!是什么意思。.dec和.ext文件有什么不同功能呢

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2007-5-22 12:57:00

Gauss中除了.src,.g,.fmt文件以外,其他的文件名全凭个人随意起。

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2008-11-12 08:22:00

If there a large numbe of global matrices and strings used in procedure definitions, it is better to place all the ‘external’ commands in a separate file with a file name having the ‘.ext’ extension and all the ‘declare’ commands in another file with a file name having the ‘.dec’ extension. When the corresponding procedure is to be compiled, we can ‘include’ the ‘.ext’ file before the procedure.The ‘.dec’ file needs not be ‘included’. It can be recorded in a library file so that they can be accessed just like the procedure definitions are.

You may have several procedures in different files that reference the same global variable. By placing an external statement at the top of each file, you can let the compiler know if the symbol is a matrix, string, or procedure. If the symbol is listed and strongly typed in an active library, no external statement is needed.


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群