(idx2gsl (gsl-function arg1 arg2 argn))

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)))
      (gsl_linalg_householder_transform z)
      (free z)))) Allocating a GSL vector/matrix views from an idx.

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. (gsl-vector-complex-double-idx-ptr m)
(packages/gsl/gsl-idx.lsh) (gsl-vector-complex-float-idx-ptr m)
(packages/gsl/gsl-idx.lsh) (gsl-vector-double-idx-ptr m)
(packages/gsl/gsl-idx.lsh) (gsl-vector-float-idx-ptr m)
(packages/gsl/gsl-idx.lsh) (gsl-vector-int-idx-ptr m)
(packages/gsl/gsl-idx.lsh) (gsl-vector-short-idx-ptr m)
(packages/gsl/gsl-idx.lsh) (gsl-vector-ubyte-idx-ptr m)
(packages/gsl/gsl-idx.lsh) (gsl-vector-byte-idx-ptr m)
(packages/gsl/gsl-idx.lsh) (gsl-matrix-complex-double-idx-ptr m)
(packages/gsl/gsl-idx.lsh) (gsl-matrix-complex-float-idx-ptr m)
(packages/gsl/gsl-idx.lsh) (gsl-matrix-double-idx-ptr m)
(packages/gsl/gsl-idx.lsh) (gsl-matrix-float-idx-ptr m)
(packages/gsl/gsl-idx.lsh) (gsl-matrix-int-idx-ptr m)
(packages/gsl/gsl-idx.lsh) (gsl-matrix-short-idx-ptr m)
(packages/gsl/gsl-idx.lsh) (gsl-matrix-byte-idx-ptr m)
(packages/gsl/gsl-idx.lsh) (gsl-matrix-ubyte-idx-ptr m)