差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン最新のリビジョン両方とも次のリビジョン | ||
kaz:blas [2014/02/16 03:06] – [Level1 BLAS Interfaces] kaz | kaz:blas [2014/02/17 16:00] – [Level1 BLAS Interfaces] kaz | ||
---|---|---|---|
行 1: | 行 1: | ||
+ | ====== BLAS Interface for Racket ====== | ||
+ | [[.:|Go back]] | ||
+ | |'' | ||
+ | |Author: K. Hishinuma|| | ||
+ | |||
+ | The '' | ||
+ | To install '' | ||
+ | < | ||
+ | % raco pkg install github:// | ||
+ | </ | ||
+ | If your operating system isn't MacOS X, you are required to install [[https:// | ||
+ | ===== " | ||
+ | <code scheme> | ||
+ | ; [PROCEDURE] exact-nonnegative-integer? | ||
+ | (make-vect len) | ||
+ | |||
+ | ; [PROCEDURE] real? ... -> vect? | ||
+ | (vect val ...) | ||
+ | |||
+ | ; [PROCEDURE] any/c -> boolean? | ||
+ | (vect? v) | ||
+ | |||
+ | ; [PROCEDURE] vect? -> exact-nonnegative-integer? | ||
+ | (vect-length vec) | ||
+ | |||
+ | ; [PROCEDURE] vect? exact-nonnegative-integer? | ||
+ | (vect-ref vec k) | ||
+ | |||
+ | ; [PROCEDURE] vect? exact-nonnegative-integer? | ||
+ | (vect-set! vec k val) | ||
+ | |||
+ | ; [PROCEDURE] (listof real?) -> vect? | ||
+ | (list-> | ||
+ | |||
+ | ; [PROCEDURE] vect? -> (listof real?) | ||
+ | (vect-> | ||
+ | </ | ||
+ | They are like [[http:// | ||
+ | |||
+ | ===== Level1 BLAS (Vector-Vector Operations) Interfaces ===== | ||
+ | <code scheme> | ||
+ | ; [PROCEDURE] vect? vect? -> void? | ||
+ | (SWAP x y) | ||
+ | </ | ||
+ | $x\in\mathbb{R}^n, | ||
+ | $$x \leftrightarrow y.$$ | ||
+ | |||
+ | <code scheme> | ||
+ | ; [PROCEDURE] real? vect? -> void? | ||
+ | (SCAL a x) | ||
+ | </ | ||
+ | $a\in\mathbb{R}, | ||
+ | $$x \leftarrow ax.$$ | ||
+ | |||
+ | <code scheme> | ||
+ | ; [PROCEDURE] vect? vect? -> void? | ||
+ | (COPY x y) | ||
+ | </ | ||
+ | $x\in\mathbb{R}^n, | ||
+ | $$y \leftarrow x.$$ | ||
+ | |||
+ | <code scheme> | ||
+ | ; [PROCEDURE] real? vect? vect? -> void? | ||
+ | (AXPY a x y) | ||
+ | </ | ||
+ | $a\in\mathbb{R}, | ||
+ | $$y \leftarrow ax+y.$$ | ||
+ | |||
+ | <code scheme> | ||
+ | ; [PROCEDURE] vect? vect? -> real? | ||
+ | (DOT_ x y) | ||
+ | </ | ||
+ | $x\in\mathbb{R}^n, | ||
+ | $$\langle x,y \rangle=\sum_{i=1}^nx_iy_i.$$ | ||
+ | |||
+ | <code scheme> | ||
+ | ; [PROCEDURE] vect? -> (and/c real? (not/c negative?)) | ||
+ | (NRM2 x) | ||
+ | </ | ||
+ | $x\in\mathbb{R}^n, | ||
+ | $$\|x\|_2=\sqrt{\langle x,x \rangle}.$$ | ||
+ | |||
+ | <code scheme> | ||
+ | ; [PROCEDURE] vect? -> (and/c real? (not/c negative?)) | ||
+ | (ASUM x) | ||
+ | </ | ||
+ | $x\in\mathbb{R}^n, | ||
+ | $$\|x\|_1=\sum_{i=1}^n\left|x_i\right|.$$ | ||
+ | |||
+ | <code scheme> | ||
+ | ; [PROCEDURE] vect? -> exact-nonnegative-integer? | ||
+ | (IAMX x) | ||
+ | </ | ||
+ | $x\in\mathbb{R}^n, | ||
+ | $$k\in\mathbb{N}: | ||
+ | |||
+ | ===== References ===== | ||
+ | - Numerical Algorithms Group Ltd.: [[http:// |