Questions tagged [gsl]

The GNU Scientific Library (GSL) is a numerical library for C and C++ programmers.

The GNU Scientific Library (GSL) is a numerical library for C and C++ programmers. It is free software under the GNU General Public License.

The library provides a wide range of mathematical routines such as random number generators, special functions and least-squares fitting. There are over 1000 functions in total with an extensive test suite.

http://www.gnu.org/software/gsl/

748 questions
5
votes
1 answer

ghc issue with hmatrix

I'm trying to use hmatrix, and hmatrix-gsl-stats. But I am getting absolutely bizarre results. Can anybody reproduce what I'm seeing? import Numeric.LinearAlgebra import Numeric.GSL.Fitting.Linear main :: IO () main = do let y = fromList…
Victor
  • 584
  • 4
  • 16
5
votes
1 answer

How to find the inverse of a Rectangular Matrix in C using GSL

I searched on Google and I couldn't find a function to calculate the inverse of Rectangular Matrix using GSL. Being that it was hard to find, an answer here would help others when they need to find an inverse of a rectangular matrix. If it is not…
4
votes
1 answer

How to use the GSL implementation of the Pearson correlation coefficient?

I have two vectors of floats, x and y, and I want to compute the Pearson correlation coefficients. As I have to do it on a lot of data (for instance 10 millions different vectors x and 20 thousand different vectors y), I am using C++, and more…
tflutre
  • 3,354
  • 9
  • 39
  • 53
4
votes
0 answers

Numerical integration - Boost vs GSL

I've found two good libraries for numerical integration in c++ that are easy enough for me to use. I have to integrate fairly complex functions with the possibility of singularities at endpoints and it appears that an adaptive integration method…
Raul Laasner
  • 1,475
  • 1
  • 17
  • 30
4
votes
1 answer

EEG Wavelet Analysis

I want to do a time-frequency analysis of an EEG signal. I found the GSL wavelet function for computing wavelet coefficients. How can I extract actual frequency bands (e.g. 8 - 12 Hz) from that coefficients? The GSL manual says: For the forward…
Michael
  • 43
  • 1
  • 3
4
votes
1 answer

dyld: Library not loaded: /usr/local/opt/gsl/lib/libgsl.23.dylib

I am trying to get a piece of software called emergent working. It relies on qt and coin, which I've both installed. But when I try to run emergent, I get the following error: dyld: Library not loaded: /usr/local/opt/gsl/lib/libgsl.23.dylib …
doctopus
  • 5,349
  • 8
  • 53
  • 105
4
votes
1 answer

Getting p-value for linear regression in C gsl_fit_linear() function from GSL library

I'm trying to reporduce some code from R in C, so I'm trying to fit a linear regression using the gsl_fit_linear() function. In R I'd use the lm() function, which returns a p-value for the fit using this code: lmAvgs<- lm( c(1.23, 11.432, …
Sophie
  • 41
  • 1
  • 3
4
votes
2 answers

How to adapt a C++-style random number engine for GSL (GNU Scientific Library)?

I have a PRNG that satisfies the requirements of a C++ random number engine, as described here. (It's from the PCG family). That is, an instance of the engine can be used by C++ standard library distribution classes to generate random…
bernie
  • 546
  • 3
  • 13
4
votes
1 answer

Linking GSL in CMakeLists.txt

I have a code with multiple files, that uses the GSL Library. When I compile the code through the terminal with the command g++ main.cpp -lm -lgsl -lgslcblas -o Exec This compiles and gives the correct output and no errors. However, when I try and…
Kahealani
  • 63
  • 1
  • 5
4
votes
2 answers

gsl Error in inifinite integration interval. bad integrand behavior found. How to fix it?

I'm getting the following error message after trying to do the a numerical integration on a infinte interval [0,inf) using GSL in C. gsl: qags.c:553: ERROR: bad integrand behavior found in the integration interval Default GSL error handler…
JuanM
  • 79
  • 7
4
votes
1 answer

Eigen library: SVD is slow compared to GSL

I am comparing the performance of Eigen (v3.2.8) and GSL (v2.1) libraries in various linear algebra operations. While in most operations Eigen wins by a large margin (factor of few), in the computation of singular-value decomposition it lags behind.…
user3097263
  • 63
  • 1
  • 5
4
votes
1 answer

Is FFTW significantly better than GSL for real transform calculations?

I'm unable to get FFTW to link to my code in order to use its functions in my code. I have spent enough time on this that I am considering giving up on it. I am very familiar with GSL, and have used the linear algebra libraries extensively with good…
Machinus
  • 109
  • 10
4
votes
1 answer

Segmentation fault while calling gsl_integration

I am trying to implement the multidimensional integration routine from Numerical Recipes (code taken from here, pg. 164). The use of wrappers to pass the integrand to void* params is from here (further references there). My class declarations are in…
Zhong Yuan Lai
  • 123
  • 1
  • 6
4
votes
4 answers

Function pointers working as closures in C++

Is there a way in C++ to effectively create a closure which will be a function pointer? I am using the Gnu Scientific Library and I have to create a gsl_function. This function needs to effectively "close" a couple of parameters available when I…
Grzenio
  • 35,875
  • 47
  • 158
  • 240
4
votes
2 answers

Linking GSL (or other library) statically into a shared library

Note: Despite the mentioning of Python in the following there is a good chance for my problem not to be Python related at all. If I am not mistaken the “module” I mention is equivalent to a C library—at least for the concerns of my problem. On…
Wrzlprmft
  • 41
  • 2