gsl

Function pointers working as closures in C++

匆匆过客 提交于 2019-12-01 19:08:18
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 create it. Is there a nice trick to create a closure so that I don't have to pass all of them as params in the gsl_function structure? If not, should I just pass in a pointer to an array containing these parameters? EDIT I have tried to use boost::bind like this: #include <gsl/gsl_integration.h> #include <boost/bind.hpp> #include "bondpricecalculator

wrapping a C library (GSL) in a cython code by using callback

淺唱寂寞╮ 提交于 2019-11-30 16:34:36
I am a newbie with cython and c . I want to use cython to speed up the performance of my code. I would like to use gsl_integration library in my code for integration. update: test_gsl.pyx cdef extern from "math.h": double log(double x) nogil cdef extern from "gsl/gsl_math.h": ctypedef struct gsl_function: double (* function) (double x, void * params) void * params cdef extern from "gsl/gsl_integration.h": ctypedef struct gsl_integration_workspace gsl_integration_workspace * gsl_integration_workspace_alloc(size_t n) void gsl_integration_workspace_free(gsl_integration_workspace * w) int gsl

ld: library not found for -lgsl

99封情书 提交于 2019-11-30 11:51:40
I'm working in OSX and I'm attempting to run a make file and when I try I get the following: ld: library not found for -lgsl clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [harm] Error 1 Earlier I found out the I needed to get the gsl library and I used mac ports and typed: sudo port install gsl into my command line window and it seemed to isntall okay. Is the missing lgsl not configured correctly or does it not come with gsl? I tried googling lgsl but didn't get much. I've only been at programming a few days and I don't know if I was supposed to set

Haskell linear algebra?

依然范特西╮ 提交于 2019-11-30 07:57:46
I am starting to test Haskell for linear algebra. Does anyone have any recommendations for the best package for this purpose? Any other good resources for doing basic matrix manipulation with Haskell? The haskell wiki lists several resources for this . My current focus in on hmatrix and bindings-gsl , both of which look promising. The hmatrix and hmatrix-static libraries are excellent. Hunt around on Hackage some more: http://hackage.haskell.org/package/vect 来源: https://stackoverflow.com/questions/2343313/haskell-linear-algebra

Gnu Scientific Library in iOS

 ̄綄美尐妖づ 提交于 2019-11-30 07:54:12
问题 How can I use the GNU Scientific Library in an iOS application? I tried following this tutorial: http://www.os-scientific.org/devel/gslxcode/index.html. But it seems not to work for iOS this way, only for OS X. After I added the GSL source code to XCode using an "external build system", XCode wants to build the target of that GSL subproject for the OS X SDK instead of the iOS SDK. 回答1: Ok! The configuration that worked for me: sudo ./configure --disable-shared --disable-dependency-tracking -

wrapping a C library (GSL) in a cython code by using callback

一个人想着一个人 提交于 2019-11-29 23:41:08
问题 I am a newbie with cython and c . I want to use cython to speed up the performance of my code. I would like to use gsl_integration library in my code for integration. update: test_gsl.pyx cdef extern from "math.h": double log(double x) nogil cdef extern from "gsl/gsl_math.h": ctypedef struct gsl_function: double (* function) (double x, void * params) void * params cdef extern from "gsl/gsl_integration.h": ctypedef struct gsl_integration_workspace gsl_integration_workspace * gsl_integration

Linking a C library and its supporting library in Swift (linux)

拈花ヽ惹草 提交于 2019-11-29 15:14:40
I want to use GNU scientific library in Swift, particularly I want to use routines from gsl_rng.h . So I basically follow https://github.com/apple/swift-package-manager/blob/master/Documentation/SystemModules.md (I am using Linux, not OS X) I create the module as module CGSL [system] { header "/usr/include/gsl/gsl_rng.h" link "gsl" export * } However, I can't build my program, since I get lots of messages of the kind undefined reference to 'cblas_dasum' . And indeed, as the documentation for GSL states To link against the library you need to specify both the main library and a supporting CBLAS

Gnu Scientific Library in iOS

我怕爱的太早我们不能终老 提交于 2019-11-29 05:23:27
How can I use the GNU Scientific Library in an iOS application? I tried following this tutorial: http://www.os-scientific.org/devel/gslxcode/index.html . But it seems not to work for iOS this way, only for OS X. After I added the GSL source code to XCode using an "external build system", XCode wants to build the target of that GSL subproject for the OS X SDK instead of the iOS SDK. Runestone Ok! The configuration that worked for me: sudo ./configure --disable-shared --disable-dependency-tracking --host=armv7-apple-darwin10 CFLAGS="-I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs

Problems installing gsl gem

ぐ巨炮叔叔 提交于 2019-11-28 23:09:34
I can succesfully install the gsl library in my home directory, but when I try to install the gsl gem I get a big list of errors that I do not understand. I am wondering if someone could give me some idea why I could be getting those errors. I can say I have: Installed gsl succesfully; at least that is what it looked like. I pointed the path to gsl-config This is what the error log looks like: Building native extensions. This could take a while... ERROR: Error installing gsl: ERROR: Failed to build gem native extension. /home/ted/ruby-1.9.1/bin/ruby extconf.rb install gsl checking gsl version.

Linking a C library and its supporting library in Swift (linux)

白昼怎懂夜的黑 提交于 2019-11-28 08:47:34
问题 I want to use GNU scientific library in Swift, particularly I want to use routines from gsl_rng.h . So I basically follow https://github.com/apple/swift-package-manager/blob/master/Documentation/SystemModules.md (I am using Linux, not OS X) I create the module as module CGSL [system] { header "/usr/include/gsl/gsl_rng.h" link "gsl" export * } However, I can't build my program, since I get lots of messages of the kind undefined reference to 'cblas_dasum' . And indeed, as the documentation for