哑元参数

   

   

某个参数如果在子程序或函数中没有用到,那就被称为哑元。这是程序设计语言中的一个术语,不是FORTRAN独有的:)

函数的形参又称“哑元”,实参又称“实元”。

广义,狭义的理解不同而已:函数过程 FUNCTION 函数名(哑元表) RESULT(结果名) ... END FUNCTION 函数名子程序 [RECURSIVE] SUBROUTINE 过程名(哑元表) ... END [[SUBROUTINE] 过程名]  调用:CALL 过程名(实元表

 

呵呵,这样啊。那看来咱用的教材不一样:)在C++的运算符重载中,就会用到哑元以区分i++与++i的区别:)且在C/C++中,哑元是可以没有变量名的,如:int fun(int,int a){    return a/10*10;}则在调用时,第一个参数随便给一个值就行了,因为它终会被丢弃:)

 

哑元   :   dummy表示虚无的元素,没有实际空间,甚至连名字都可以没有,它只有联系上实元才有意义。C函数中明显具有哑元特性的应该是可变参数表,如int   printf(      const  char   *format  [,     argument]...  );

dummy argument 又叫哑元变量
声明并定义一个函数   
  void   f(int)   
  {   
  }   
    
  函数f有一个int参数,但没有给这个参数声明变量,所以在函数的实现中你永远   
  也无法使用这个函数,这个参数只是一个占位符,一般是因为兼容性方面的原因   
  这样做的。
又或者在++操作符定义中也需要这种占位符。
实际变量 就不用解释了吧?

如:

声明并定义一个函数
void   f(int)
{
}

函数f有一个int参数,但每个给这个参数声明变量,所以在函数的实现中你永远
也无法使用这个函数,这个参数只是一个占位符,一般是因为兼容性方面的原因
这样做的。

Good   Luck.
如:

声明并定义一个函数
void   f(int)
{
}

函数f有一个int参数,但每个给这个参数声明变量,所以在函数的实现中你永远
也无法使用这个函数,这个参数只是一个占位符,一般是因为兼容性方面的原因
这样做的。

Good   Luck.
如:

声明并定义一个函数
void   f(int)
{
}

函数f有一个int参数,但每个给这个参数声明变量,所以在函数的实现中你永远
也无法使用这个函数,这个参数只是一个占位符,一般是因为兼容性方面的原因
这样做的。

Good   Luck.
如:

声明并定义一个函数
void   f(int)
{
}

函数f有一个int参数,但每个给这个参数声明变量,所以在函数的实现中你永远
也无法使用这个函数,这个参数只是一个占位符,一般是因为兼容性方面的原因
这样做的。

Good   Luck.

 

 

 

Dummy variables refer to "proxy" variables or numericstand-ins for qualitativefacts in a regressionmodel. In regressionanalysis, the dependentvariables are influenced not only by quantitative variables(income, output, prices, etc.), but also by qualitative variables(gender, religion, geographic region, etc.) Dummy independentvariables take the value of 0 or 1. Hence, they are also calledbinary variables. A dummy explanatory variable with a value of 0will cause that variable's coefficient todisappear and a dummy with a value 1 will cause the coefficient toact as a supplemental intercept in a regression model. For example,suppose Gender is one of the qualitative variables relevant to aregression. Then, female and male would be the categories includedunder the Gender variable. If female is assigned the value of 1,then male would get the value 0 (or vice-versa). [1]

Thus, a dummy variable can be defined as a qualitativerepresentative variable incorporated into a regression, such thatit assumes the value 1 whenever the category it represents occurs,and 0 otherwise. [2] Dummyvariables are used as devices to sort data into mutuallyexclusive categories (such as male/female, smoker/non-smoker,etc.) [3]

Dummy variables are generally used frequently in timeseries analysis with regime switching, seasonal analysis andqualitative data interpretation. Dummy variables are involved instudies for economicforecasting, bio-medical studies, credit scoring,response modelling, etc. Dummy variables may be incorporated intraditional regression methods or newly developed modelingparadigms.[1]

Synonyms for the term dummy variables include design variables,Boolean indicators, proxies, indicator variables, categoricalvariables and qualitative variables. [1][3]

In mathematics, and in other disciplinesinvolving formal languages, including mathematical logic and computer science, a free variable is anotation that specifies places in anexpression where substitution may take place. The idea is related to aplaceholder (a symbol that will later be replaced by someliteral string), or a wildcard character that stands for anunspecified symbol.

The variable x becomes a bound variable, forexample, when we write

'For all x, ( x + 1) 2 = x 2 +2 x + 1.'

or

'There exists x such that x 2 = 2.'

In either of these propositions, it does not matter logicallywhether we use x or some other letter. However, it could beconfusing to use the same letter again elsewhere in some compoundproposition. That is, free variables becomebound, and then in a sense retire from being available asstand-in values for other values in the creation of formulae.

In computer programming, a free variableis a variable referred to in a function that is not a local variable or an argument of that function.[1]An upvalue is a free variable that has been bound (closedover) with a closure. Note that variable "freeness" only applies inlexical scoping: there is nodistinction, and hence no closures, when using dynamic scope.

The term "dummy variable" is also sometimes used for a boundvariable (more often in general mathematics than in computerscience), but that use creates an ambiguity with the definition ofdummy variables in regression analysis.



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值