digitalmars.D.learn - Binding to GSL library
- Radek (16/16) Nov 25 2015 Hi, I'm making a trying to bind a gsl library
 - drug (3/19) Nov 25 2015 A little bit offtopic but do you know about
 - Radek (8/11) Nov 25 2015 i have found bug. It shoul be
 - Andrew (5/16) Nov 26 2015 Hi, I've been a little slow updating that repository because of
 - lobo (5/21) Nov 25 2015 I believe if you're interfacing with C you should use __gshared:
 - Artur Skawina via Digitalmars-d-learn (8/27) Nov 26 2015 That's not a struct but a pointer to a struct.
 
Hi, I'm making a trying to bind a gsl library 
http://www.gnu.org/software/gsl/ so far it was working but when i 
started binding complex numbers some functions won't work, like 
trigonometric functions - called they return null.
in gsl code complex struct looks like:
typedef struct
   {
     double dat[2];
   }
gsl_complex;
my complex struct looks like that:
struct _gsl_complex {
   double dat[2];
}
alias gsl_complex = _gsl_complex*;
So, what im doing wrong?
 Nov 25 2015
On 25.11.2015 19:11, Radek wrote:
 Hi, I'm making a trying to bind a gsl library
 http://www.gnu.org/software/gsl/ so far it was working but when i
 started binding complex numbers some functions won't work, like
 trigonometric functions - called they return null.
 in gsl code complex struct looks like:
 typedef struct
    {
      double dat[2];
    }
 gsl_complex;
 my complex struct looks like that:
 struct _gsl_complex {
    double dat[2];
 }
 alias gsl_complex = _gsl_complex*;
 So, what im doing wrong?
A little bit offtopic but do you know about 
https://github.com/abrown25/gsld? It would be nice to join efforts.
 Nov 25 2015
i have found bug. It shoul be alias gsl_complex = _gsl_complex; not alias gsl_complex = _gsl_complex*; On Wednesday, 25 November 2015 at 16:35:06 UTC, drug wrote:A little bit offtopic but do you know about https://github.com/abrown25/gsld? It would be nice to join efforts.Sure, I'll share my code :) Ask me next month. That what I'm doing is my student project and first i need to complete it :)
 Nov 25 2015
On Wednesday, 25 November 2015 at 16:45:51 UTC, Radek wrote:i have found bug. It shoul be alias gsl_complex = _gsl_complex; not alias gsl_complex = _gsl_complex*; On Wednesday, 25 November 2015 at 16:35:06 UTC, drug wrote:Hi, I've been a little slow updating that repository because of work, and I got a little stuck with function pointers, I hope to get back to it soon. It would be lovely if it's all finished by that time :)A little bit offtopic but do you know about https://github.com/abrown25/gsld? It would be nice to join efforts.Sure, I'll share my code :) Ask me next month. That what I'm doing is my student project and first i need to complete it :)
 Nov 26 2015
On Wednesday, 25 November 2015 at 16:11:56 UTC, Radek wrote:
 Hi, I'm making a trying to bind a gsl library 
 http://www.gnu.org/software/gsl/ so far it was working but when 
 i started binding complex numbers some functions won't work, 
 like trigonometric functions - called they return null.
 in gsl code complex struct looks like:
 typedef struct
   {
     double dat[2];
   }
 gsl_complex;
 my complex struct looks like that:
 struct _gsl_complex {
   double dat[2];
 }
 alias gsl_complex = _gsl_complex*;
 So, what im doing wrong?
I believe if you're interfacing with C you should use __gshared:
alias gsl_complex = __gshared _gsl_complex*;
bye,
lobo
 Nov 25 2015
On 11/25/15 17:11, Radek via Digitalmars-d-learn wrote:
 Hi, I'm making a trying to bind a gsl library http://www.gnu.org/software/gsl/
so far it was working but when i started binding complex numbers some functions
won't work, like trigonometric functions - called they return null.
 
 in gsl code complex struct looks like:
 
 typedef struct
   {
     double dat[2];
   }
 gsl_complex;
 
 
 my complex struct looks like that:
 
 struct _gsl_complex {
   double dat[2];
 }
 alias gsl_complex = _gsl_complex*;
 
 So, what im doing wrong?
That's not a struct but a pointer to a struct.
Also, you can just drop the `typedef` hack (which is used
in C to avoid having to type the 'struct' keyword), so:
   struct gsl_complex {
      double[2] dat;
   }
artur
 Nov 26 2015








 
 
 
 Andrew <aabrown24 hotmail.com> 