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
0
votes
1 answer

Calculate Sum of All Elements in a Matrix GSL

I'm wondering what is the best way of calculating the sum of all elements in a matrix in GSL (Gnu scientific library). I don't see any library functions that do this, so will I just need to sum over all the indices myself?
theideasmith
  • 2,835
  • 2
  • 13
  • 20
0
votes
1 answer

Dirichlet distribution with RcppGSL

I have a Gibbs sampler currently written in R, and I'm trying to make it faster using the package Rcpp and RcppGSL. What is causing me problems right now is that I can't seem to be able to use the random variate generator for the dirichlet…
M Turgeon
  • 186
  • 11
0
votes
0 answers

GCC suddenly not finding GSL headers

I'm on OS X 10.11, and I have never had problems with linking libraries, but yesterday, out of the blue, I start getting errors when including GSL headers. For instance, I get: "fatal error: 'gsl/gsl_matrix.h' file not found", coming from the…
0
votes
2 answers

Transforming makefile to cmake

I was running a program using makefile and it looked like this: CXX = g++ CXXFLAGS = -c -Wall -g -std=c++11 -I/usr/local/include OBJS = main.o Integr.o Data.o Interpolate.o all: main main: $(OBJS) $(CXX) $(OBJS) -lgsl -lgslcblas -lm -o…
user36698
  • 35
  • 4
0
votes
3 answers

Returning double * in function argument

Countless GSL functions return their result as a pointer in their first argument. For instance int gsl_matrix_get_col (gsl_vector * v, const gsl_matrix * m, size_t j) My programming level is very low, but I was told such things were impossible…
Ludi
  • 451
  • 4
  • 17
0
votes
0 answers

Chi-square test from gsl while integrating gives 0

I'm trying to calculate the multiple integrant using gsl library but it seems endless because chisq value constantly equals 0. Here is my integrating method: double Integr::Fgg(double x_val, double k_val){ double result, error; double…
user36698
  • 35
  • 4
0
votes
1 answer

Undefined reference in GSL, possible linking error?

I am trying to use the gsl library for some random number generation. I have the following makefile CC = g++ #CFLAGS = -Wall -O2 CFLAGS = -g -Wall LDFLAGS = -Lgsl/lib -lgsl -lgslcblas -lm INCLDIRS = -Igsl/include RAND_TARGET = rand HM_TARGET =…
user47693
  • 129
  • 4
0
votes
0 answers

OS X building gsl (GNU Scientific Library)

I'm trying to build the gsl library on OS X. I got the gsl-1.0 from here. I rand ./configure in the folder followed my make. Once I ran make, I got this: In file included from…
user1291510
  • 265
  • 5
  • 14
0
votes
1 answer

How to speed up this GSL code for selecting a submatrix?

I wrote a very simple function in GSL, to select a submatrix from an existing matrix in a struct. EDIT: I had timed VERY INCORRECTLY and didn't notice the changed number of zeros in front.Still, I hope this can be sped up For 100x100 submatrices of…
Ludi
  • 451
  • 4
  • 17
0
votes
1 answer

gnu scientific library (GSL) cubic polynomial discrepancy in results

The GSL polynomial solver gives me an incorrect result. I have attempted to solve the following polynomial using GSL cubic polynomial solver: x^3-1.96848e20 x^2+9.07605e28 x+9.07605e28 = 0 On Wolframalpha the results…
0
votes
1 answer

GSL Polar Complex Numbers Appear to be extremely different

Using minunit.h to test built-in gsl structs. I have written the following test: static char * test_gsl_polar_complex_number_struct() { double r = 0.325784; double theta = 0.421329; gsl_complex test_polr_complex_number = gsl_complex_polar (…
Joshua Cook
  • 12,495
  • 2
  • 35
  • 31
0
votes
0 answers

Makefile returning error 1

I wish to convert this statement into a makefile: gcc -Wall -I/usr/local/include -c my_program.c I wrote this makefile: CC=gcc CFLAGS=-c -Wall -I:/usr/local/include LDFLAGS= -LE:/usr/local/include LIBS=…
Anagha
  • 740
  • 1
  • 10
  • 16
0
votes
1 answer

Double comparison in C

A checker(of type double) array is obtained from a gsl_vector in the following way. for (i=0; i
re3el
  • 735
  • 2
  • 12
  • 28
0
votes
0 answers

Installing R gsl package with gnu gsl installed at custom location

I've installed gsl at a custom location (linux system) as I don't have access to the /usr/local directory. When I install the R gsl package, is there a way I can instruct it to search for this directory instead of /usr/local? Help much appreciated.
David
  • 143
  • 9
0
votes
1 answer

using Pygsl with GCC 4.0 in Python

I am trying to install pygsl using latest version of GCC, i.e.: $ gcc --version i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5659) I get the error: $ sudo python setup.py build numpy Building testing ufuncs! running build running…
user248237