文書の過去の版を表示しています。
BLAS Interface for Racket
(require math/blas) | package: blas |
Author: K. Hishinuma |
The math/blas
library (git://github.com/kazh98/blas package) provides BLAS interfaces for Racket using a libcblas
or libgslcblas
FFI.
To install math/blas
library, enter the following command in terminal.
% raco pkg install github://github.com/kazh98/blas/master
If your operating system isn't MacOS X, you are required to install GNU Scientific Library in your computer to use this library.
"vect" Object and its Operations
; [PROCEDURE] exact-nonnegative-integer? -> vect? (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? -> real? (vect-ref vec k) ; [PROCEDURE] vect? exact-nonnegative-integer? real? -> void? (vect-set! vec k val) ; [PROCEDURE] (listof real?) -> vect? (list->vect lst) ; [PROCEDURE] vect? -> (listof real?) (vect->list vec)
They are like make-vector, etc.
Level1 BLAS (Vector-Vector Operations) Interfaces
; [PROCEDURE] vect? vect? -> void? (SWAP x y)
$x\in\mathbb{R}^n,y\in\mathbb{R}^n,$
$$x \leftrightarrow y.$$
; [PROCEDURE] real? vect? -> void? (SCAL a x)
$a\in\mathbb{R},x\in\mathbb{R}^n,$
$$x \leftarrow ax.$$
; [PROCEDURE] vect? vect? -> void? (COPY x y)
$x\in\mathbb{R}^n,y\in\mathbb{R}^n,$
$$y \leftarrow x.$$
; [PROCEDURE] real? vect? vect? -> void? (AXPY a x y)
$a\in\mathbb{R},x\in\mathbb{R}^n,y\in\mathbb{R}^n,$
$$y \leftarrow ax+y.$$
; [PROCEDURE] vect? vect? -> real? (DOT_ x y)
$x\in\mathbb{R}^n,y\in\mathbb{R}^n,$
$$\langle x,y \rangle=\sum_{i=1}^nx_iy_i.$$
; [PROCEDURE] vect? -> (and/c real? (not/c negative?)) (NRM2 x)
$x\in\mathbb{R}^n,$
$$\|x\|_2=\sqrt{\langle x,x \rangle}.$$
; [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|.$$
; [PROCEDURE] vect? -> exact-nonnegative-integer? (IAMX x)
$x\in\mathbb{R}^n,$
$$k\in\mathbb{N}:\left|x_k\right|\ge{}\left|x_i\right|\hspace{1em}(\forall{}i\in\mathbb{Z}:0\le{}i<n).$$
References
- Numerical Algorithms Group Ltd.: Basic Linear Algebra Subprograms: A Quick Reference Guide. Oak Ridge National Laboratory, University of Tennessee: (1997).