2010年10月1日 星期五

GNU Scientific Library (GSL) [轉貼]

The GNU Scientific Library (GSL) is a numerical library for C and C++ programmers. It is free software under the GNU General Public License.
The library provides a wide range of mathematical routines such as random number generators, special functions and least-squares fitting. There are over 1000 functions in total with an extensive test suite.GNU Scientific Library (GSL) 是一個內含許多數值及科學運算函式的 C/C++ 函式庫,內含超過 1000 個以上的函式(例如︰數值微分小波轉換排序..等等) ,並且可以使用在各種作業系統平台。在 GSL 在 Windows開發環境下的使用 中有簡單說明如何在 Windows 環境使用 GSL ,以下則是再詳細一點介紹如何在 Visual C++ 6.0 的 IDE (整合型視窗介面) 下使用︰1. 首先到 http://gnuwin32.sourceforge.net/packages/gsl.htm 下載 BinariesDeveloper files 。2. 將 Binaries package 內 bin 子目錄下的 libgsl.dll, libgslcblas.dll 兩個檔案複製到 C:\Windows\System32 中。3. 將 Developer files 解壓縮後,在 VC 的 IDE 中設定 include, lib 子目錄的路徑。4. 由於此版本的 lib 子目錄中不含 .lib 檔,必須用以下指令產生。請先開啟 DOS 模式視窗(附屬應用程式/命令提式字元),切換目錄到 lib 目錄下,並下達︰
lib /machine:i386 /def:libgsl.deflib /machine:i386 /def:libgslcblas.def即可產生 libgsl.lib, libgslcblas.lib 兩個檔案。5. 在 VC 專案中加入 libgsl.lib, libgslcblas.lib 這 2 個 lib 到 link 參數中。6. 在 VC 專案的 Preprocessor definitions 中加入 GSL_DLL。6. 可用函式及說明請見 Reference Manual 。ps. GSL是使用C語法寫成,故並沒有使用類別(class),而是以結構(struct)及函式(function)組成,不過 GSL 仍可以用在 C++ 編繹器,並與 C++ 程式相容。

沒有留言:

張貼留言