某个参数如果在子程序或函数中没有用到,那就被称为哑元。这是程序设计语言中的一个术语,不是FORTRAN独有的:)
函数的形参又称“哑元”,实参又称“实元”。
广义,狭义的理解不同而已:
函数过程
FUNCTION
...
END
子程序
[RECURSIVE]
END
调用:CALL
呵呵,这样啊。那看来咱用的教材不一样:)
在C++的运算符重载中,就会用到哑元以区分i++与++i的区别:)
且在C/C++中,哑元是可以没有变量名的,如:
int
{
}
则在调用时,第一个参数随便给一个值就行了,因为它终会被丢弃:)
哑元
表示虚无的元素,没有实际空间,甚至连名字都可以没有,它只有联系上实元才有意义。
C函数中明显具有哑元特性的应该是可变参数表,如
int
);
dummy argument 又叫哑元变量 声明并定义一个函数 void f(int) { } 函数f有一个int参数,但没有给这个参数声明变量,所以在函数的实现中你永远 也无法使用这个函数,这个参数只是一个占位符,一般是因为兼容性方面的原因 这样做的。 又或者在++操作符定义中也需要这种占位符。 实际变量 就不用解释了吧?
如: 声明并定义一个函数 void { } 函数f有一个int参数,但每个给这个参数声明变量,所以在函数的实现中你永远 也无法使用这个函数,这个参数只是一个占位符,一般是因为兼容性方面的原因 这样做的。 Good |
如: 声明并定义一个函数 void { } 函数f有一个int参数,但每个给这个参数声明变量,所以在函数的实现中你永远 也无法使用这个函数,这个参数只是一个占位符,一般是因为兼容性方面的原因 这样做的。 Good |
如: 声明并定义一个函数 void { } 函数f有一个int参数,但每个给这个参数声明变量,所以在函数的实现中你永远 也无法使用这个函数,这个参数只是一个占位符,一般是因为兼容性方面的原因 这样做的。 Good |
如: 声明并定义一个函数 void { } 函数f有一个int参数,但每个给这个参数声明变量,所以在函数的实现中你永远 也无法使用这个函数,这个参数只是一个占位符,一般是因为兼容性方面的原因 这样做的。 Good |
Dummy variables refer to "proxy" variables or numeric stand-ins for qualitative facts in a regression model. In regression analysis, the dependent variables are influenced not only by quantitative variables (income, output, prices, etc.), but also by qualitative variables (gender, religion, geographic region, etc.) Dummy independent variables take the value of 0 or 1. Hence, they are also called binary variables. A dummy explanatory variable with a value of 0 will cause that variable's coefficient to disappear and a dummy with a value 1 will cause the coefficient to act as a supplemental intercept in a regression model. For example, suppose Gender is one of the qualitative variables relevant to a regression. Then, female and male would be the categories included under 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 qualitative representative variable incorporated into a regression, such that it assumes the value 1 whenever the category it represents occurs, and 0 otherwise. [2] Dummy variables are used as devices to sort data into mutually exclusive categories (such as male/female, smoker/non-smoker, etc.) [3]
Dummy variables are generally used frequently in time series analysis with regime switching, seasonal analysis and qualitative data interpretation. Dummy variables are involved in studies for economic forecasting, bio-medical studies, credit scoring, response modelling, etc. Dummy variables may be incorporated in traditional regression methods or newly developed modeling paradigms.[1]
Synonyms for the term dummy variables include design variables, Boolean indicators, proxies, indicator variables, categorical variables and qualitative variables. [1] [3]
In mathematics, and in other disciplines involving formal languages, including mathematical logic andcomputer science, a free variable is a notation that specifies places in an expression wheresubstitution may take place. The idea is related to a placeholder (a symbol that will later be replaced by some literal string), or a wildcard character that stands for an unspecified symbol.
The variable x becomes a bound variable, for example, 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 logically whether we use x or some other letter. However, it could be confusing to use the same letter again elsewhere in some compound proposition. That is, free variables become bound, and then in a senseretire from being available as stand-in values for other values in the creation of formulae.
In computer programming, a free variable is 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 (closed over) with a closure. Note that variable "freeness" only applies in lexical scoping: there is no distinction, and hence no closures, when using dynamic scope.
The term "dummy variable" is also sometimes used for a bound variable (more often in general mathematics than in computer science), but that use creates an ambiguity with the definition of dummy variables in regression analysis.