The code assumes a two-dimensional computational domain with TMz polarization (i.e., non-zero field Ez, Hx, and Hy). The program is currently written so that the incident field always strikes the lower-left corner of the total-field region first. (If you want a different corner, that should be a fairly simple tweak to the code, but for now you ll have to make that tweak yourself.) I have attempted to provide copious comments in the code and hope that a knowledgeable C programmer can quickly map the approach as described in the paper to what is in the program.
意圖 將一個類的接口轉換成客戶希望的另外一個接口。A d a p t e r 模式使得原本由于接口不兼容而不能一起工作的那些類可以一起工作。
適用性 · 你想使用一個已經存在的類,而它的接口不符合你的需求。 · 你想創建一個可以復用的類,該類可以與其他不相關的類或不可預見的類(即那些接口可能不一定兼容的類)協同工作。 · (僅適用于對象A d a p t e r )你想使用一些已經存在的子類,但是不可能對每一個都進行子類化以匹配它們的接口。對象適配器可以適配它的父類接口。