8.6.1.2. (idx2gsl (gsl-function arg1 arg2 argn))
(packages/gsl/gsl-idx.lsh)


This macros makes it easy to call GSL functions that take vectors or matrices as arguments. It allows to call GSL functions that normally take gsl_vector or gsl_matrix with regular Lush idx. In other words, you can do (for example):
(setq z [1 2 3])
(idx2gsl (gsl_linalg_householder_transform z))
No data is copied in the process (no hidden inefficiency). This macro analyses the type of the arguments expected by gsl-function , then generates appropriate gsl structures that point to the idx data, then calls the gsl function. For example, the above call is turned into:
(let ((z (gsl-vector-double-idx-ptr z)))
  (prog1
      (gsl_linalg_householder_transform z)
    (progn
      (free z))))


8.6.1.3. Allocating a GSL vector/matrix views from an idx.
(packages/gsl/gsl-idx.lsh)


GSL functions that operate on vectors and matrices often take a gsl_vector_xxx or a gsl_matrix_xxx as argument. The functions below allocate appropriate GSL vector/matrix access structure that point to the data of the idx passed as argument. No actual data is copied. The pointer returned by these functions must be freed with the free function defined in libc/libc.lsh . The functions that create views of complex vectors and matrices take a Lush idx with an extra dimension of size 2 (the last dimension). So calling gsl-vector-complex-double-idx-ptr with an idx2 of double of size Nx2 will create a gsl_vector_complex of size N.

8.6.1.3.0. (gsl-vector-complex-double-idx-ptr m)
(packages/gsl/gsl-idx.lsh)




8.6.1.3.1. (gsl-vector-complex-float-idx-ptr m)
(packages/gsl/gsl-idx.lsh)




8.6.1.3.2. (gsl-vector-double-idx-ptr m)
(packages/gsl/gsl-idx.lsh)




8.6.1.3.3. (gsl-vector-float-idx-ptr m)
(packages/gsl/gsl-idx.lsh)




8.6.1.3.4. (gsl-vector-int-idx-ptr m)
(packages/gsl/gsl-idx.lsh)




8.6.1.3.5. (gsl-vector-short-idx-ptr m)
(packages/gsl/gsl-idx.lsh)




8.6.1.3.6. (gsl-vector-ubyte-idx-ptr m)
(packages/gsl/gsl-idx.lsh)




8.6.1.3.7. (gsl-vector-byte-idx-ptr m)
(packages/gsl/gsl-idx.lsh)




8.6.1.3.8. (gsl-matrix-complex-double-idx-ptr m)
(packages/gsl/gsl-idx.lsh)




8.6.1.3.9. (gsl-matrix-complex-float-idx-ptr m)
(packages/gsl/gsl-idx.lsh)




8.6.1.3.10. (gsl-matrix-double-idx-ptr m)
(packages/gsl/gsl-idx.lsh)




8.6.1.3.11. (gsl-matrix-float-idx-ptr m)
(packages/gsl/gsl-idx.lsh)




8.6.1.3.12. (gsl-matrix-int-idx-ptr m)
(packages/gsl/gsl-idx.lsh)




8.6.1.3.13. (gsl-matrix-short-idx-ptr m)
(packages/gsl/gsl-idx.lsh)




8.6.1.3.14. (gsl-matrix-byte-idx-ptr m)
(packages/gsl/gsl-idx.lsh)




8.6.1.3.15. (gsl-matrix-ubyte-idx-ptr m)
(packages/gsl/gsl-idx.lsh)