啞元參數

   

   

某個參數如果在子程序或函數中沒有用到,那就被稱爲啞元。這是程序設計語言中的一個術語,不是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 = x2 +2x + 1.'

or

'There exists x such that x2 = 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.



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章