gsl

How to use GSL library in C for diagonalization of a Hermitian Matrix?

匆匆过客 提交于 2019-12-25 14:40:32
问题 I have basic knowledge about C programming language. I know loop structure, array and control statements. Suddenly I need to know that how to diagonalize a Hermitian matrix using the GSL library in C language . Installation of GSL is not a problem. But I would like to know how to use it for this specific purpose. I am reading GSL manual these days but a concise and precise answer would be highly appreciated? 回答1: Start by looking at section 15.2 Complex Hermitian Matrices. To compute the

Writing Runge-Kutta ODE solver using gsl

社会主义新天地 提交于 2019-12-25 04:08:39
问题 It's been some time since I did any C/c++, but I wanted to write an ODE solver using the gsl library to solve the following ODE set $$ u'(r)=up(r)$$ $$ up'(r)=-(2*(r-1)/(r*(r-2)))*up(r)-((r*r/((r-2)*(r-2)))-(2/r*(r-2)))*u(r) $$ so in the gsl notation my y[0]=u, y[1]==up, and the RHS of the above defines f[0] and f[1]. From these definitions one can then compute the Jacobian and dfdr (usually their 'time' variable is called 't' not 'r'). The reason for doing this is because I am having speed

g++ linking and swig

只愿长相守 提交于 2019-12-24 15:27:01
问题 I have a cpp file with functions that I'm using in python with SWIG. I use the following commands to compile the source and create the file to use with python. swig -c++ -python mini.i g++ -O2 -c mini.cpp -I/usr/include/python2.4 -I/usr/lib/python2.4 g++ -O2 -c mini_wrap.cxx -I/usr/include/python2.4 -I/usr/lib/python2.4 g++ -shared mini.o mini_wrap.o -o _mini.so I'm trying now to use GSL in my source cpp source file. If I was just compiling the GSL file I would do g++ -lgsl -lgslcblas -lm -o

Linking Rcpp to interp2d (GSL-type library)

ぐ巨炮叔叔 提交于 2019-12-23 20:46:01
问题 I need some help with a linker error I get during installation of an Rcpp package on a linux system where I don't have admin rights. In a nutshell, I get this error: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC I have a file solve.cpp that uses external library interp2d, which in turn has a GSL dependency. I specify my dependencies via [[Rcpp::depends(RcppArmadillo,RcppGSL)]] and in the DESCRIPTION . My Makevars is like the one

Did anyone compiled GSL for androind?

。_饼干妹妹 提交于 2019-12-23 05:29:08
问题 I am trying to compile gsl for android but it is giving error. I checked on their website and they said that It has been reported to compile on the following other platforms, SunOS 4.1.3 & Solaris 2.x (Sparc) Alpha GNU/Linux, gcc HP-UX 9/10/11, PA-RISC, gcc/cc IRIX 6.5, gcc m68k NeXTSTEP, gcc Compaq Alpha Tru64 Unix, gcc FreeBSD, OpenBSD & NetBSD, gcc Cygwin Apple Darwin 5.4 Hitachi SR8000 Super Technical Server, cc I want to compile gsl for armeabi . Did anyone did this before? Please

Building an R package that uses the GSL on Windows

坚强是说给别人听的谎言 提交于 2019-12-23 01:46:08
问题 I have little to no knowledge about developing for Windows. I have written an R package that works just fine on Linux. I am trying to get it to work on Windows. Unfortunately, I feel I just hit a wall. The package uses the GSL library. The first thing I did was to compile it using mingw-w64, which worked as expected. I then proceeded to build the package. Everything went fine up until when R tests if the package can be loaded. I get this error message: Error in inDL(x, as.logical(local), as

Heroku/Rails: How to install the GNU Scientific Library (GSL) on Heroku?

谁说胖子不能爱 提交于 2019-12-22 05:58:20
问题 I need to install the GSL library on Heroku running a Rails (4.0.2) app to use some gems that depend on it. Goal: Install the GSL library to work with GSL and Similarity gems in Heroku. Tried approaches: Installing Ruby / GSL in Heroku Application: Heroku crashes after deploy. GSL gem is unable to find the lib. Trace: http://pastebin.com/CPcMUdCa Tomwolfe's Heroku's Ruby buildpack adapted for using couchbase: Same issue. Building Dependency Binaries for Heroku Applications: Vulcan is

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

爷,独闯天下 提交于 2019-12-21 17:45:59
问题 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, 14.653, 21.6534) ~ c(1970, 1980, 1990, 2000) ) summary(lmAvgs) I've no idea though how to go from the C output to a p-value, my code looks something like this so far: int main(void) { int i, n = 4; double x[4] = { 1970, 1980, 1990, 2000 }; double y[4] = {1

How to CORRECTLY install gsl library in Linux?

爱⌒轻易说出口 提交于 2019-12-21 05:37:09
问题 I got a problem while installing the GNU Scientific Library (gsl). I put the package on my desktop, and did "./configure", "make", and "sudo make install", according to the document included. I checked the /usr/local/include directory, there is a newly created "gsl" folder in there. But When I tried to use the functions provided by the library, the "undefined reference to 'gsl_sf_beta_inc'" error occurred. Here is my code. #include <stdio.h> #include <gsl/gsl_sf_gamma.h> int main (void) {

How to implement a left matrix division on C++ using gsl

时光总嘲笑我的痴心妄想 提交于 2019-12-21 05:05:36
问题 I am trying to port a MATLAB program to C++. And I want to implement a left matrix division between a matrix A and a column vector B . A is an m-by-n matrix with m is not equal to n and B is a column vector with m components. And I want the result X = A\B is the solution in the least squares sense to the under- or overdetermined system of equations AX = B . In other words, X minimizes norm(A*X - B) , the length of the vector AX - B . That means I want it has the same result as the A\B in