Re: [Help-gsl] Re: gsl c++ wrapper ?

2009-08-31 Thread Rhys Ulerich
 Designing a good C++ wrapper to any matrix
 library is difficult provided one tries to keep C++ semantics.

It may be easier, if you have a favorite C++ matrix/vector library, to
design a GSL-wrapper for the matrix/vector library itself.

For example, write wrappers that accept ublas [1] or eigen2 [2]
matrices and vectors, wrap the same storage with gsl_matrix and
gsl_vector views, and then call the GSL methods directly.  Such
GSL-ublas or GSL-eigen2 bindings would be independent of both
projects, mainly boilerplate, and easy to test for correctness.

- Rhys

[1] http://www.boost.org/doc/libs/1_40_0/libs/numeric/ublas/doc/index.htm
[2] http://eigen.tuxfamily.org/index.php


___
Help-gsl mailing list
Help-gsl@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gsl


Re: [Help-gsl] Re: gsl c++ wrapper ?

2009-08-31 Thread Leo Razoumov
On 8/31/09, Rhys Ulerich rhys.uler...@gmail.com wrote:
  Designing a good C++ wrapper to any matrix
   library is difficult provided one tries to keep C++ semantics.


 It may be easier, if you have a favorite C++ matrix/vector library, to
  design a GSL-wrapper for the matrix/vector library itself.

  For example, write wrappers that accept ublas [1] or eigen2 [2]
  matrices and vectors, wrap the same storage with gsl_matrix and
  gsl_vector views, and then call the GSL methods directly.  Such
  GSL-ublas or GSL-eigen2 bindings would be independent of both
  projects, mainly boilerplate, and easy to test for correctness.

  - Rhys

Many good and tested libraries like LAPACK have come from Fortran and
use column-major matrix storage incompatible with GSL. One cannot
simply wrap them up in some sort of GSL objects that can be passed to
GSL functions.

--Leo--


___
Help-gsl mailing list
Help-gsl@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gsl