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

2009-10-19 Thread c . smulders
Hi!

I'd like to use gslWrap - downloaded it from SourceForge - , but it only 
supplies an installation procedure for Linux / Unix. Since I'm using Windows, 
I'm a bit lost.

For one thing, I can't find an installation exe-file in the zip downloaded at 
SourceForge.
Secondly, (assuming that the files might just need to be copied), the install 
help tells to fill in info for the following lines in the GSLWrap Makefile, 
which I cannot find in any of the makefile files:

GSLLIBDIR =
GSLINCDIR =

(yet, looking through the files, it looks like some installation procedure must 
be run through)

Thanks a lot in advance,
cheers Carola 

--
This message was sent on behalf of c.smuld...@gmail.com at openSubscriber.com
http://www.opensubscriber.com/message/help-gsl@gnu.org/12617065.html


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


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

2009-09-12 Thread Rohit Garg
On Sat, Sep 12, 2009 at 3:19 AM, Leo Razoumov slonik...@gmail.com wrote:
 On 9/10/09, Rohit Garg rpg@gmail.com wrote:
  [..snip..]
 But that still begs the question. Why would you want to use GSL's
  linear algebra subset?

 Here are few:
 (1) Simplicity of GSL design
 (2) No expression templates !!
I do not agree with you here, but if you like GSL's approach better
here, then good for you.

 (3) support for BLAS with vectorized optimizations (SSE2 and later)
I was under the impression that gsl's blas was fairly generic and you
had to use ATLAS and the like to get good performance and
vectorization. Or are you referring to gsl compiled with
auto-vectorization?

 (4) total manual control of resources

I certainly have less experience than you, and I _demand_ total manual
control over my code when I am optimizing it. But since eigen is a
purely template library, I think it offers you more choices.

BTW, I mostly link with fedora's gsl packages, so our POV may be
different. How do you use gsl ( in terms of compiling/compile
options/linking etc. ) ?


 I do not want to derogate your project. It could well be very good,
 indeed. But my 15+ years of large scale numerical simulations taught
 me few lessons. I would pick a simple, clean library with manual
 resource management numeric and flat debugging anytime over a smart
 library like Boost or eigen for that matter.
Agreed, overall choice depends on many factors. smartness is one of them.

 more crucial. And when you optimize algorithms you want to be very
 close to your hardware and have full manual control. In numerics I see
 people going from C to asm more often than to C++.

How about this for a manual control over optimization

http://listengine.tuxfamily.org/lists.tuxfamily.org/eigen/2009/01/msg00234.html

The product would have been auto vectorized if the size was a multiple
of 2. (3 in this case).

Just my 1 cent. :)

PS: GSL's non linear algebra subset is great, and I am really thankful
to the devs for this.
-- 
Rohit Garg

http://rpg-314.blogspot.com/

Senior Undergraduate
Department of Physics
Indian Institute of Technology
Bombay


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


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

2009-09-10 Thread Hongzheng Wang
Frankly, you have slowly drifted off the subject since your previous
post.  We are talking about how to wrap GSL and make GSL work better
with C++, rather than do advertisement for yet another C++
vector/matrix library.

For the original question, my personal opinion on this subject is that
just build the program in C++ with some favorite style and narrow the
interface between the C++ part and GSL facilities.  By contrast,
wrapping GSL is not an easy choice because GSL utilizes so many
classic C style coding tricks, e.g., void* pointer conversion etc.
Specifically, for vector/matrix support library, a third part one out
of GSL can be used, because most parts of GSL facilities can work well
with built-in array (which are widely supported in other vector/matrix
libraries) and do not rely on specific GSL vector/matrix interfaces.

On Thu, Sep 10, 2009 at 1:25 PM, Rohit Garg rpg@gmail.com wrote:

 Well,  you can of course use ublas and the like, but  after looking at
 these benchmarks,

 http://eigen.tuxfamily.org/index.php?title=Benchmark-August2008

 I wouldn't touch them with a bargepole if I can help it. As far as
 C++ey API goes, may be this

 http://eigen.tuxfamily.org/index.php?title=API_Showcase

 will convince to think twice, if not more.

-- 
HZ


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


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

2009-09-10 Thread Rohit Garg
On Thu, Sep 10, 2009 at 1:17 PM, Hongzheng Wang wan...@gmail.com wrote:
 Frankly, you have slowly drifted off the subject since your previous
 post.
With the benefit of hindsight, perhaps yes. My intention is not to
troll at all (even for things that may or may not be better), so
please bear with me.

 For the original question, my personal opinion on this subject is that
 just build the program in C++ with some favorite style and narrow the
 interface between the C++ part and GSL facilities.  By contrast,
 wrapping GSL is not an easy choice because GSL utilizes so many
 classic C style coding tricks, e.g., void* pointer conversion etc.
 Specifically, for vector/matrix support library, a third part one out
 of GSL can be used, because most parts of GSL facilities can work well
 with built-in array (which are widely supported in other vector/matrix
 libraries) and do not rely on specific GSL vector/matrix interfaces.

But that still begs the question. Why would you want to use GSL's
linear algebra subset? GSL's comprehensive coverage makes it a
valuable tool for many tasks. I for one, mix it's histogram routines
with some operations from eigen trivially.

Considering that there is some community interest in writing C++ish
wrappers to GSL, I want to know what motivates such need? I mean why
invest effort here, when it is possible to take something that,
atleast appears to be, is better? Is there a particular reason/benefit
to investing effort in writing GSL's C++ bindings over simply using
eigen?

I might be missing something here, but is the interest in writing c++
wrappers is for just the linear algebra subset or for the whole GSL?

Full GSL c++ wrappers would be a good idea, I agree. I am not so
enthused about wrappers for just the linear algebra subset.

-- 
Rohit Garg

http://rpg-314.blogspot.com/

Senior Undergraduate
Department of Physics
Indian Institute of Technology
Bombay


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


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

2009-09-06 Thread Rohit Garg
I think using eigen over gsl (for linear algebra) is a no brainer.

a) gsl is dog slow compared to eigen (no vectorization whatsoever).
b) gsl has no float option
c) eigen offers both column major and row major storage
d) eigen *does* expression templates
e) eigen will happily map your data and perform operations on it.
f) eigen has way cooler (aka C++-ey) api over gsl/lapack
g) eigen is adding support for sparse matrices at a rapid pace.

For (nearly full, I think) lapack to C++ bindings, FLENS is a great
idea too. But I have never used flens.

http://eigen.tuxfamily.org/index.php?title=Main_Page

I would recommend using eigen/FLENS over gsl anyday for linear algebra
purposes. BTW, it also does small vectors/matrices. :)

DISCLAIMER: I have contributed and continue to contribute to eigen.

On Wed, Sep 2, 2009 at 1:38 AM, Rodney Sparapanirspar...@mcw.edu wrote:
 John D Lamb wrote:

 I’ve written some wrappers for GSL matrices and vectors and might can
 help if someone has a suitable project.

 While Rodney is right that there are some issues with creating a
 practical OO interface, C++ is not the same as OO and OO is not the same
 as operator overloading (assuming OO means object orientation).


 I was talking about both OO and operator overloading.

 Another approach to wrapping GSL functions for C++ is to use shared
 pointers, namespaces and exceptions. Typically I might create a class
 gsl::vector that is an extended shared pointer and whose member
 functions look much like the original functions. The main benefit is not
 having to deallocate memory explicitly and only once.

 Well, it seems like there is plenty of interest.  We should all work
 together and create an add-on.  We can call it GSL++.  I'm in the
 process of working on my PhD which will mean that I'll have an
 ample opportunity to use it.  However, I strongly recommend that
 the test-bed be integral rather than an after-thought.  For each
 feature, there should be a corresponding check.  I don't really
 understand dejaGNU/etc. so I can't contribute much to this aspect.

 Rodney



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




-- 
Rohit Garg

http://rpg-314.blogspot.com/

Senior Undergraduate
Department of Physics
Indian Institute of Technology
Bombay


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


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

2009-09-06 Thread Hongzheng Wang
If I really need a C++ style vector/matrix library, I would refer to
boost uBlas + bindings.  But for daily normal numerical work I
encountered, gsl is easily used and better because vector/matrix
support is not the whole world; we usually need more numerical
computation facilities beyond basic vector/matrix support and gsl is
such a quite complete solution.

On Sat, Sep 5, 2009 at 10:26 PM, Rohit Gargrpg@gmail.com wrote:
 I think using eigen over gsl (for linear algebra) is a no brainer.

 a) gsl is dog slow compared to eigen (no vectorization whatsoever).
 b) gsl has no float option
 c) eigen offers both column major and row major storage
 d) eigen *does* expression templates
 e) eigen will happily map your data and perform operations on it.
 f) eigen has way cooler (aka C++-ey) api over gsl/lapack
 g) eigen is adding support for sparse matrices at a rapid pace.

 For (nearly full, I think) lapack to C++ bindings, FLENS is a great
 idea too. But I have never used flens.

 http://eigen.tuxfamily.org/index.php?title=Main_Page

 I would recommend using eigen/FLENS over gsl anyday for linear algebra
 purposes. BTW, it also does small vectors/matrices. :)

 DISCLAIMER: I have contributed and continue to contribute to eigen.

 On Wed, Sep 2, 2009 at 1:38 AM, Rodney Sparapanirspar...@mcw.edu wrote:
 John D Lamb wrote:

 I’ve written some wrappers for GSL matrices and vectors and might can
 help if someone has a suitable project.

 While Rodney is right that there are some issues with creating a
 practical OO interface, C++ is not the same as OO and OO is not the same
 as operator overloading (assuming OO means object orientation).


 I was talking about both OO and operator overloading.

 Another approach to wrapping GSL functions for C++ is to use shared
 pointers, namespaces and exceptions. Typically I might create a class
 gsl::vector that is an extended shared pointer and whose member
 functions look much like the original functions. The main benefit is not
 having to deallocate memory explicitly and only once.

 Well, it seems like there is plenty of interest.  We should all work
 together and create an add-on.  We can call it GSL++.  I'm in the
 process of working on my PhD which will mean that I'll have an
 ample opportunity to use it.  However, I strongly recommend that
 the test-bed be integral rather than an after-thought.  For each
 feature, there should be a corresponding check.  I don't really
 understand dejaGNU/etc. so I can't contribute much to this aspect.

 Rodney



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




 --
 Rohit Garg

 http://rpg-314.blogspot.com/

 Senior Undergraduate
 Department of Physics
 Indian Institute of Technology
 Bombay


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




-- 
HZ


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


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

2009-09-06 Thread John D Lamb
On Sun, 2009-09-06 at 23:29 +0800, Hongzheng Wang wrote:
 If I really need a C++ style vector/matrix library, I would refer to
 boost uBlas + bindings.  But for daily normal numerical work I
 encountered, gsl is easily used and better because vector/matrix
 support is not the whole world; we usually need more numerical
 computation facilities beyond basic vector/matrix support and gsl is
 such a quite complete solution.

This is more or less my view. I like GSL for what it can do. Sometimes I
use other libraries or write my own versions of GSL functions when they
are not enough.

What I’d like is a simple C++ wrapper for GSL that provides C++ features
not readily available in C:

(1) shared pointer or similar so that you don’t have to worry about
freeing pointers
(2) Exception handling instead of int error values from functions.
(3) Better use of const
(4) Templates where appropriate, e.g. gsl::vectordouble,
gsl::vectorfloat and the like, even if the only implementations are
only specialisations.
(5) Use of namespaces to simplify #includes.

Occasionally other C++ features might be useful:
Perhaps iterators for gsl::vector so that it’s easier to use the STL.
Perhaps operator overloading for GSL::complex.
Perhaps function objects where this is more natural than using a
function.

However, the main advantage for me is that more errors are caught at
compile-time in C++. I’m only interested in object orientation, operator
overloading and the like if there’s some obvious advantage to using
them.

If anyone wants to work on wrappers like this, I’m happy to help.

-- 
JDL



___
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 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