gsl

Efficient way to compute Kronecker product of matrices with GSL

大兔子大兔子 提交于 2019-12-08 05:15:56
问题 The bottleneck of my algorithm is my function Kronecker Product called KPro: gsl_matrix *KPro(gsl_matrix *a, gsl_matrix *b) { int i, j, k, l; int m, p, n, q; m = a->size1; p = a->size2; n = b->size1; q = b->size2; gsl_matrix *c = gsl_matrix_alloc(m*n, p*q); double da, db; for (i = 0; i < m; i++) { for (j = 0; j < p; j++) { da = gsl_matrix_get (a, i, j); for (k = 0; k < n; k++) { for (l = 0; l < q; l++) { db = gsl_matrix_get (b, k, l); gsl_matrix_set (c, n*i+k, q*j+l, da * db); } } } } return

Run a C executable in another distro

南楼画角 提交于 2019-12-07 22:41:07
问题 I have a C program that I'm developing using Ubuntu 11.10 (Linux version 3.0.0-12-generic-pae kernel). I need to run that program in a cluster that has Debian 3.1 (Linux version 2.4.24-om2) installed, and uses Intel(R) Pentium(R) 4 CPU 3.20GHz processors. The problem is that I can't compile in the Debian cluster because it doesn't have installed the GSL library that my program needs, and I don't know how to install it (or make use of it) without root privileges. If I try to run the executable

intel_sse2 problems when linking to gsl with icc

你离开我真会死。 提交于 2019-12-07 21:30:45
问题 My program links to both PETSc and gsl, and both libraries were compiled with icc. Here's the link command: /usr/local/mpich2/bin/mpicc -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g3 -I/usr/local/gsl-icc-1.15/include/ -I/usr/local/gsl-icc-1.15/include/ -L/usr/local/gsl-icc-1.15/lib/ -lgsl -lgslcblas prog_name.o -L/usr/local/petsc-3.2-p6/lib -lpetsc -lX11 -lpthread -llapack -lblas -L/central/intel/Compiler-11.1.072/mkl/lib/em64t -L/central/intel/Compiler-11.1.072/lib

Unable to link GSL library in Mac OS X

坚强是说给别人听的谎言 提交于 2019-12-07 20:01:22
问题 I am trying to use a gsl function in a simple C++ code. I have installed gsl using homebrew, but when I compile with "g++ J0_test.cpp -lgsl -lgslcblas", I get: "J0_test.cpp:34:10: fatal error: 'gsl/gsl_sf_bessel.h' file not found #include <gsl/gsl_sf_bessel.h> // gsl Bessel special function header file" GSL is installed by brew in /usr/local/Cellar, but it is symlinked to /usr/local/lib. So shouldn't gsl then be on the default search path of the compiler? Either way, even when I try -L /usr

Xcode 4.3.3 can't find any header files

半城伤御伤魂 提交于 2019-12-07 18:51:21
问题 Up until now I've managed to get Xcode to link to the Gnu Scientific Libraries (GSL) which I've installed under /usr/local/lib/ and with header files under /usr/local/include. Under "Build Phases" > "Link Binary With Libraries" I had added libgsl.a etc. Today, Xcode gives an error message claiming it can't find header files. For example #include <stdio.h> #include <gsl/gsl_matrix.h> int main(int argc, const char * argv[]) { printf("Hello, World!\n"); return 0; } results in 'gsl/gsl_matrix.h'

OpenMP and GSL RNG - Performance Issue - 4 threads implementation 10x slower than pure sequential one (quadcore CPU)

*爱你&永不变心* 提交于 2019-12-07 05:04:20
问题 I am trying to turn a C project of mine from sequential into parallel programming. Although most of the code has now been redesigned from scratch for this purpose, the generation of random numbers is still at its core. Thus, bad performance of the random number generator (RNG) affects very badly the overall performance of the program. I wrote some code lines (see below) to show the problem I am facing without much verbosity. The problem is the following: everytime the number of threads nt

installing R gsl package on Mac

给你一囗甜甜゛ 提交于 2019-12-06 18:41:06
问题 I'm trying to install the gsl package for R, which I understand is simply a wrapper around the GSL, under OSX Mavericks. I've tried the obvious: > install.packages('gsl') Installing package into ‘/Users/myusername/Library/R/3.1/library’ (as ‘lib’ is unspecified) package ‘gsl’ is available as a source package but not as a binary Warning in install.packages : package ‘gsl’ is not available (for R version 3.1.0) So I ran > install.packages('gsl',type = 'source') Installing package into ‘/Users

Run a C executable in another distro

夙愿已清 提交于 2019-12-06 14:20:46
I have a C program that I'm developing using Ubuntu 11.10 (Linux version 3.0.0-12-generic-pae kernel). I need to run that program in a cluster that has Debian 3.1 (Linux version 2.4.24-om2) installed, and uses Intel(R) Pentium(R) 4 CPU 3.20GHz processors. The problem is that I can't compile in the Debian cluster because it doesn't have installed the GSL library that my program needs, and I don't know how to install it (or make use of it) without root privileges. If I try to run the executable I compiled in Ubuntu (or a simple hello world program, for the case), it doesn't work, even if I

i have an error when i install gsl (with netbeans)

自作多情 提交于 2019-12-06 13:42:06
I try to install gsl gem for Ruby but it doesn't work. i have a matrix_complex.o error. So is there a solution to install gsl for netbeans ? or is there a fonction quantile in an other library? Any help would be appreciated. stagiaire@stagiaire-desktop:~$ sudo gem install -v=1.14.7 gsl Building native extensions. This could take a while... ERROR: Error installing gsl: ERROR: Failed to build gem native extension. /usr/bin/ruby1.8 extconf.rb checking gsl version... 1.15 checking gsl cflags... -I/usr/include checking for main() in -lcblas... no checking gsl libs... -L/usr/lib -lgsl -lgslcblas -lm

gsl::gsl_vector vs std::vector overheads and efficiency

我与影子孤独终老i 提交于 2019-12-06 13:26:45
问题 I am considering implementing an array like container, and I'm not sure whether to use a gsl::gsl_vector or a std::vector. The container needs to be space efficient but also very fast at calling values. The container will be referenced constantly in the main program to, for example, input values into tensor functions, amongst other things. I am calling from the container literally billions of times. Here are the pros and cons that I've considered so far: The gsl_vector is convenient because