help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gsl] A C++ Interface to GSL Data Structures


From: lostbits
Subject: [Help-gsl] A C++ Interface to GSL Data Structures
Date: Fri, 29 Dec 2017 21:34:11 -0800
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0


I developed (very) thin interface to the GSL data structures (chp 8 & 9).
I am including the I/F for anyone to use for any purpose. Consider the
I/F covered by a Gnu license (pick the one you like).

The purpose, for me, was to hide the mysteries of the GSL interface as
much as I could. I've got all chapter 8 & 9 functionality covered up to I/O.
The I/O is left out mainly because of time. I just didn't have the time
to look at what the intent was and how best to implement it.

The (thin) framework hides the details of handling gsl_vector, gsl_matrix
and gsl_permutation functionality by capturing the functionality in three
classes, GSLVector, GSLMatrix and GSLPermutation, and requiring that
gsl_matrix and gsl_vector parameters to these classes be an object  from
these two classes. I have not extended this notion to any of the other
gsl functions. Sigh. No time.

The framework only addresses double objects and not others (float, int,
etc.). So the frameworks is (very) thin. If there is any interest in
what I have done, then I will try to extend the interface to include all
types and I will extend the classes to include I/O.

Note that the path taken here can also be taken in C. See gnu.org/gslip
code, especially the code related to SlipDatum objects. The idea is that
the specific type of object is contained in an object template pointer,
similar to a C++ v-table pointer. Again, if there is interest I will
provide a C version of what I have.

The provided examples is from the Linear Algebra chapter. Unfortunately,
the original example has several flaws. My implementation probably has
more. There is some awkwardness in dealing with functions outside of
chp's 8 & 9.  Most particularly in passing data structures, as in
(gsl_matrix*)A.data(), where A is of type GSLMatrix. This awkwardness
is removed when all functions accept the developed classes, albeit there
are some issues with constness.

Attachment: gsl.zip
Description: Zip compressed data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]