digitalmars.D - GNU Scientific Library in D
- Lars Kyllingstad (9/9) Jul 23 2007 Hello,
- Tomas Lindquist Olsen (4/20) Jul 23 2007 Renaming it to func or something else in you D header is not going to
- Lars Kyllingstad (3/26) Jul 23 2007 Thanks a lot, worked like a charm. But out of curiosity I would like to ...
- Jarrett Billingsley (5/9) Jul 23 2007 Field names mean nothing after compilation; they're just there for the
- Walter Bright (3/4) Jul 23 2007 When you get it done, can you contribute it to Dsource? That way,
- Lars Kyllingstad (3/7) Jul 23 2007 Sure! Assuming that I am able to make it work, that is... :)
- Don Clugston (4/15) Jul 23 2007 What parts of the GSL are you particularly interested in? I've been grad...
- Lars Kyllingstad (3/6) Jul 24 2007 Until now I've mostly done numerical integration and multidimensional ro...
- Witold Baryluk (5/13) Jul 26 2007 I was using gsl in D with out problems. This is very good C library.
- Don Clugston (6/23) Jul 27 2007 It's hard to evaluate without knowledge of Polish, but the breadth of wo...
- Bill Baxter (4/32) Jul 27 2007 Really? If that's true then it sounds like a violation of the Numerical...
- BCS (3/8) Jul 27 2007 someone could have re written it from scratch using only the non code po...
- Don Clugston (7/39) Jul 31 2007 I don't think so. Most of the Numerical Recipes code is itself cloned fr...
- Walter Bright (6/12) Aug 03 2007 That doesn't stop some 'tards from claiming copyright infringement. I
- 0ffh (3/5) Aug 05 2007 Goes to prove the usefulness of slightly cryptic variable names... ^^
- Chris Nicholson-Sauls (7/14) Aug 05 2007 Or just foreign language ones. (Russian, Irish, and Japanese are
- Deewiant (15/20) Aug 06 2007 Sure you can!
- Chris Nicholson-Sauls (5/29) Aug 06 2007 Huh, I remember there being some problems with doing so... then again,
- TomD (9/12) Jul 27 2007 GSL was always written in C, exploiting higher level features of a langu...
- Don Clugston (10/24) Aug 01 2007 The relationship is closer: it provides the same set of algorithms, orga...
- TomD (7/13) Aug 01 2007 Ahh interesting, I did not know that.
Hello, I would like to use the GNU Scientific Library, which is written in C, in D. While converting the header files to D modules, however I ran in to the following problem. In gsl_math.h, the following (crucially important) struct is defined: struct gsl_function_struct { double (* function) (double x, void * params); void * params; }; Note that the first member is named 'function', which unfortunately is a keyword in D. Any suggestions as to how I can work around this? -Lars
Jul 23 2007
On Mon, 23 Jul 2007 14:05:19 -0400, Lars Kyllingstad wrote:Hello, I would like to use the GNU Scientific Library, which is written in C, in D. While converting the header files to D modules, however I ran in to the following problem. In gsl_math.h, the following (crucially important) struct is defined: struct gsl_function_struct { double (* function) (double x, void * params); void * params; }; Note that the first member is named 'function', which unfortunately is a keyword in D. Any suggestions as to how I can work around this? -LarsRenaming it to func or something else in you D header is not going to break anything. -Tomas
Jul 23 2007
Tomas Lindquist Olsen Wrote:On Mon, 23 Jul 2007 14:05:19 -0400, Lars Kyllingstad wrote:Thanks a lot, worked like a charm. But out of curiosity I would like to know why. Aren't the functions in the GSL libraries expecting a field named 'function' there? Or don't the names of the fields matter at all, as long as the structure is the same? -LarsHello, I would like to use the GNU Scientific Library, which is written in C, in D. While converting the header files to D modules, however I ran in to the following problem. In gsl_math.h, the following (crucially important) struct is defined: struct gsl_function_struct { double (* function) (double x, void * params); void * params; }; Note that the first member is named 'function', which unfortunately is a keyword in D. Any suggestions as to how I can work around this? -LarsRenaming it to func or something else in you D header is not going to break anything. -Tomas
Jul 23 2007
"Lars Kyllingstad" <public kyllingen.net> wrote in message news:f834gc$n1q$1 digitalmars.com...Thanks a lot, worked like a charm. But out of curiosity I would like to know why. Aren't the functions in the GSL libraries expecting a field named 'function' there? Or don't the names of the fields matter at all, as long as the structure is the same?Field names mean nothing after compilation; they're just there for the programmer. They get turned into a byte offset. So, as long as the structure remains the same, the code doesn't care what you call it.
Jul 23 2007
Lars Kyllingstad wrote:I would like to use the GNU Scientific Library, which is written in C, in D. While converting the header files to D modules, however I ran in to the following problem. In gsl_math.h, the following (crucially important) struct is defined:When you get it done, can you contribute it to Dsource? That way, everyone can use it!
Jul 23 2007
Walter Bright Wrote:Lars Kyllingstad wrote:I would like to use the GNU Scientific Library, which is written in C, in D.When you get it done, can you contribute it to Dsource? That way, everyone can use it!Sure! Assuming that I am able to make it work, that is... :) -Lars
Jul 23 2007
Lars Kyllingstad wrote:Walter Bright Wrote:What parts of the GSL are you particularly interested in? I've been gradually building up a D scientific library, and I've made sure that Tango.Math.IEEE contains all the required primitive operations.Lars Kyllingstad wrote:I would like to use the GNU Scientific Library, which is written in C, in D.When you get it done, can you contribute it to Dsource? That way, everyone can use it!Sure! Assuming that I am able to make it work, that is... :) -Lars
Jul 23 2007
Don Clugston Wrote:What parts of the GSL are you particularly interested in? I've been gradually building up a D scientific library, and I've made sure that Tango.Math.IEEE contains all the required primitive operations.Until now I've mostly done numerical integration and multidimensional root finding, so those are the parts of the GSL I am concentrating on first. However, I am starting on my PhD in particle physics this fall, and I am not completely sure yet what other features I will need. -Lars
Jul 24 2007
Walter Bright wrote:Lars Kyllingstad wrote:I was using gsl in D with out problems. This is very good C library. BTW. I started some time ago similar library for D, designed from scratch. http://tsk.ch.uj.edu.pl/wiki/onp If anyone is interested in helping me in development, I will be happy :)I would like to use the GNU Scientific Library, which is written in C, in D. While converting the header files to D modules, however I ran in to the following problem. In gsl_math.h, the following (crucially important) struct is defined:When you get it done, can you contribute it to Dsource? That way, everyone can use it!
Jul 26 2007
Witold Baryluk wrote:Walter Bright wrote:It's hard to evaluate without knowledge of Polish, but the breadth of work there is very impressive. What license are you using? BTW, it seems to me that the GSL, at least originally, was just a clone of Numerical Recipes, and the code I've seen reproduces the NR bugs. There is scope for a lot of improvement, I think.Lars Kyllingstad wrote:I was using gsl in D with out problems. This is very good C library. BTW. I started some time ago similar library for D, designed from scratch. http://tsk.ch.uj.edu.pl/wiki/onp If anyone is interested in helping me in development, I will be happy :)I would like to use the GNU Scientific Library, which is written in C, in D. While converting the header files to D modules, however I ran in to the following problem. In gsl_math.h, the following (crucially important) struct is defined:When you get it done, can you contribute it to Dsource? That way, everyone can use it!
Jul 27 2007
Don Clugston wrote:Witold Baryluk wrote:Really? If that's true then it sounds like a violation of the Numerical Recipes' license agreement. --bbWalter Bright wrote:It's hard to evaluate without knowledge of Polish, but the breadth of work there is very impressive. What license are you using? BTW, it seems to me that the GSL, at least originally, was just a clone of Numerical Recipes, and the code I've seen reproduces the NR bugs. There is scope for a lot of improvement, I think.Lars Kyllingstad wrote:I was using gsl in D with out problems. This is very good C library. BTW. I started some time ago similar library for D, designed from scratch. http://tsk.ch.uj.edu.pl/wiki/onp If anyone is interested in helping me in development, I will be happy :)I would like to use the GNU Scientific Library, which is written in C, in D. While converting the header files to D modules, however I ran in to the following problem. In gsl_math.h, the following (crucially important) struct is defined:When you get it done, can you contribute it to Dsource? That way, everyone can use it!
Jul 27 2007
Reply to Bill,Really? If that's true then it sounds like a violation of the Numerical Recipes' license agreement. --bbsomeone could have re written it from scratch using only the non code portions of the book and a the API spec.
Jul 27 2007
Bill Baxter wrote:Don Clugston wrote:I don't think so. Most of the Numerical Recipes code is itself cloned from published articles. It's easy enough to clone it by going back to the original sources. I doubt that the NR license would even be enforceable, in general -- their code often even uses the same variable names as were used in the original Algol code! There's not much original code in NR. (The big contribution of NR was to collate all the algorithms).Witold Baryluk wrote:Really? If that's true then it sounds like a violation of the Numerical Recipes' license agreement.Walter Bright wrote:It's hard to evaluate without knowledge of Polish, but the breadth of work there is very impressive. What license are you using? BTW, it seems to me that the GSL, at least originally, was just a clone of Numerical Recipes, and the code I've seen reproduces the NR bugs. There is scope for a lot of improvement, I think.Lars Kyllingstad wrote:I was using gsl in D with out problems. This is very good C library. BTW. I started some time ago similar library for D, designed from scratch. http://tsk.ch.uj.edu.pl/wiki/onp If anyone is interested in helping me in development, I will be happy :)I would like to use the GNU Scientific Library, which is written in C, in D. While converting the header files to D modules, however I ran in to the following problem. In gsl_math.h, the following (crucially important) struct is defined:When you get it done, can you contribute it to Dsource? That way, everyone can use it!
Jul 31 2007
Don Clugston wrote:I don't think so. Most of the Numerical Recipes code is itself cloned from published articles. It's easy enough to clone it by going back to the original sources. I doubt that the NR license would even be enforceable, in general -- their code often even uses the same variable names as were used in the original Algol code! There's not much original code in NR. (The big contribution of NR was to collate all the algorithms).That doesn't stop some 'tards from claiming copyright infringement. I had some people accuse me of stealing their code once upon a time. In front of an arbitrator, they couldn't explain the etymology of (supposedly) their own variable names, while I could. They lost.
Aug 03 2007
Walter Bright wrote:In front of an arbitrator, they couldn't explain the etymology of (supposedly) their own variable names, while I could.Goes to prove the usefulness of slightly cryptic variable names... ^^ Regards, Frank
Aug 05 2007
0ffh wrote:Walter Bright wrote:Or just foreign language ones. (Russian, Irish, and Japanese are favorites of mine.) ;) return this.scaoil ? Staid.Rath : Staid.Loiceadh ; Alas the lament of the poor maintenance coder. Its a shame I can't put accents in a symbol. -- Chris Nicholson-SaulsIn front of an arbitrator, they couldn't explain the etymology of (supposedly) their own variable names, while I could.Goes to prove the usefulness of slightly cryptic variable names... ^^ Regards, Frank
Aug 05 2007
Chris Nicholson-Sauls wrote:return this.scaoil ? Staid.Rath : Staid.Loiceadh ; Alas the lament of the poor maintenance coder. Its a shame I can't put accents in a symbol.Sure you can! class Äöå { int fõó() { return Bàr.Ë; } } enum Bàr { Ë = 2 } void main() { auto x = new Äöå(); assert (x.fõó == 2); } Just save it in a UTF format. -- Remove ".doesnotlike.spam" from the mail address.
Aug 06 2007
Deewiant wrote:Chris Nicholson-Sauls wrote:Huh, I remember there being some problems with doing so... then again, that was actually a few years ago now. Nifty. :) I'm off to make some people even more mad at me than they already are. -- Chris Nicholson-Saulsreturn this.scaoil ? Staid.Rath : Staid.Loiceadh ; Alas the lament of the poor maintenance coder. Its a shame I can't put accents in a symbol.Sure you can! class Äöå { int fõó() { return Bàr.Ë; } } enum Bàr { Ë = 2 } void main() { auto x = new Äöå(); assert (x.fõó == 2); } Just save it in a UTF format.
Aug 06 2007
Don Clugston Wrote: [...]BTW, it seems to me that the GSL, at least originally, was just a clone of Numerical Recipes, and the code I've seen reproduces the NR bugs. There is scope for a lot of improvement, I think.GSL was always written in C, exploiting higher level features of a language, whereas the Recipes were originally written in FORTRAN, and even the C transcript (I am avoiding the word "port" here on purpose) is ugly. It is a clone in the sense that it gives tools for solving a similar set of problems. One target actually was to be as complete as the recipes, which it does not do, but it had some other additions that the Recipes lack. Out of curiosity, which bugs are in the current version? Ciao Tom
Jul 27 2007
TomD wrote:Don Clugston Wrote: [...]It's even worse than that. Much of the FORTRAN code is actually a port from Algol!BTW, it seems to me that the GSL, at least originally, was just a clone of Numerical Recipes, and the code I've seen reproduces the NR bugs. There is scope for a lot of improvement, I think.GSL was always written in C, exploiting higher level features of a language, whereas the Recipes were originally written in FORTRAN, and even the C transcript (I am avoiding the word "port" here on purpose) is ugly.It is a clone in the sense that it gives tools for solving a similar set of problems.The relationship is closer: it provides the same set of algorithms, organised in the same way. One target actually was to be as complete as the recipes, which it does not do, but it had some other additions that the Recipes lack. Out of curiosity,which bugs are in the current version?Little things like failing to check for overflow. (eg, a-b can overflow if a is large and positive, and b is large and negative). Sometimes these errors are not present in the original Algol. Extremely poor performance for worst-case situations. Mostly pretty obscure stuff.Ciao Tom
Aug 01 2007
Don Clugston Wrote: [...]It's even worse than that. Much of the FORTRAN code is actually a port from Algol!Ahh interesting, I did not know that. [...]Little things like failing to check for overflow. (eg, a-b can overflow if a is large and positive, and b is large and negative). Sometimes these errors are not present in the original Algol. Extremely poor performance for worst-case situations. Mostly pretty obscure stuff.Must be, I never noticed :-) Ciao Tom
Aug 01 2007