Witam, What can be legally (and morally) copied from a program under a restrictive copyright is "the algorithms, the ideas" but not the particular way of expressing them.
So the practical question is: where is the borderline?
In the GSL (GNU Scientific Library), http://www.gnu.org/software/gsl/, GNU provides, e.g. in Version 1.1.1, the version below of NR's ran0 routine.
i'm sure most of us have access to a legal copy of the NR routine, or else a little googling shows e.g.
http://cc.oulu.fi/~tf/tiedostot/pub/nrf/ran0.f
Well, to me these look extremely similar to one another. Even the constants:
static const long int m = 2147483647, a = 16807, q = 127773, r = 2836; static const unsigned long int mask = 123459876;
are exactly identical to those in the NR routines, they even have the same names, except for the "i". Is this really a different "expression"?
In any case, IMHO noone can deny that the authors of the GSL routines (there is also ran1, ran2, ran3) have very likely had access to the NR source code.
Sure, they translated it to C and added some stuff, but it's the same algorithm, it's essentially the same sequence of steps.
Anyway, GSL has lots of really cool stuff. :) Let's defend scientific software freedom!
pozdr boud
----------------------------------------------------------------------
/* rng/ran0.c * * Copyright (C) 1996, 1997, 1998, 1999, 2000 James Theiler, Brian Gough * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <config.h> #include <stdlib.h> #include <gsl/gsl_errno.h> #include <gsl/gsl_rng.h>
/* This is an implementation of the algorithm used in Numerical Recipe's ran0 generator. It is the same as MINSTD with an XOR mask of 123459876 on the seed.
The period of this generator is 2^31.
Note, if you choose a seed of 123459876 it would give a degenerate series 0,0,0,0, ... I've made that into an error. */
static inline unsigned long int ran0_get (void *vstate); static double ran0_get_double (void *vstate); static void ran0_set (void *state, unsigned long int s);
static const long int m = 2147483647, a = 16807, q = 127773, r = 2836; static const unsigned long int mask = 123459876;
typedef struct { unsigned long int x; } ran0_state_t;
static inline unsigned long int ran0_get (void *vstate) { ran0_state_t *state = (ran0_state_t *) vstate;
const unsigned long int x = state->x;
const long int h = x / q; const long int t = a * (x - h * q) - h * r;
if (t < 0) { state->x = t + m; } else { state->x = t; }
return state->x; }
static double ran0_get_double (void *vstate) { return ran0_get (vstate) / 2147483647.0 ; }
static void ran0_set (void *vstate, unsigned long int s) { ran0_state_t *state = (ran0_state_t *) vstate;
if (s == mask) { GSL_ERROR_VOID ("ran0 should not use seed == mask", GSL_EINVAL); }
state->x = s ^ mask;
return; }
static const gsl_rng_type ran0_type = {"ran0", /* name */ 2147483646, /* RAND_MAX */ 1, /* RAND_MIN */ sizeof (ran0_state_t), &ran0_set, &ran0_get, &ran0_get_double};
const gsl_rng_type *gsl_rng_ran0 = &ran0_type;
----------------------------------------------------------------------
Oh, I have just read this email. This is somehow terrifying. So the answer should be "don't care" I suppose. In this case the authors of GSL are the one to blame and not the user of GSL.
I agree the copyright of algorithms' code is tricky. I wonder if anyone understands it....
I think GSL violates the NR license. But it is their problem.
eeee..... perhaps we should just use it? ;-)
m.
Boud Roukema wrote:
Witam, What can be legally (and morally) copied from a program under a restrictive copyright is "the algorithms, the ideas" but not the particular way of expressing them.
So the practical question is: where is the borderline?
In the GSL (GNU Scientific Library), http://www.gnu.org/software/gsl/, GNU provides, e.g. in Version 1.1.1, the version below of NR's ran0 routine.
i'm sure most of us have access to a legal copy of the NR routine, or else a little googling shows e.g.
http://cc.oulu.fi/~tf/tiedostot/pub/nrf/ran0.f
Well, to me these look extremely similar to one another. Even the constants:
static const long int m = 2147483647, a = 16807, q = 127773, r = 2836; static const unsigned long int mask = 123459876;
are exactly identical to those in the NR routines, they even have the same names, except for the "i". Is this really a different "expression"?
In any case, IMHO noone can deny that the authors of the GSL routines (there is also ran1, ran2, ran3) have very likely had access to the NR source code.
Sure, they translated it to C and added some stuff, but it's the same algorithm, it's essentially the same sequence of steps.
Anyway, GSL has lots of really cool stuff. :) Let's defend scientific software freedom!
pozdr boud
/* rng/ran0.c
- Copyright (C) 1996, 1997, 1998, 1999, 2000 James Theiler, Brian Gough
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or (at
- your option) any later version.
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <config.h> #include <stdlib.h> #include <gsl/gsl_errno.h> #include <gsl/gsl_rng.h>
/* This is an implementation of the algorithm used in Numerical Recipe's ran0 generator. It is the same as MINSTD with an XOR mask of 123459876 on the seed.
The period of this generator is 2^31.
Note, if you choose a seed of 123459876 it would give a degenerate series 0,0,0,0, ... I've made that into an error. */
static inline unsigned long int ran0_get (void *vstate); static double ran0_get_double (void *vstate); static void ran0_set (void *state, unsigned long int s);
static const long int m = 2147483647, a = 16807, q = 127773, r = 2836; static const unsigned long int mask = 123459876;
typedef struct { unsigned long int x; } ran0_state_t;
static inline unsigned long int ran0_get (void *vstate) { ran0_state_t *state = (ran0_state_t *) vstate;
const unsigned long int x = state->x;
const long int h = x / q; const long int t = a * (x - h * q) - h * r;
if (t < 0) { state->x = t + m; } else { state->x = t; }
return state->x; }
static double ran0_get_double (void *vstate) { return ran0_get (vstate) / 2147483647.0 ; }
static void ran0_set (void *vstate, unsigned long int s) { ran0_state_t *state = (ran0_state_t *) vstate;
if (s == mask) { GSL_ERROR_VOID ("ran0 should not use seed == mask", GSL_EINVAL); }
state->x = s ^ mask;
return; }
static const gsl_rng_type ran0_type = {"ran0", /* name */ 2147483646, /* RAND_MAX */ 1, /* RAND_MIN */ sizeof (ran0_state_t), &ran0_set, &ran0_get, &ran0_get_double};
const gsl_rng_type *gsl_rng_ran0 = &ran0_type;
Cosmo-torun mailing list Cosmo-torun@cosmo.torun.pl http://cosmo.torun.pl/mailman/listinfo/cosmo-torun
On Mon, 15 Nov 2004, Michal Frackowiak wrote:
Oh, I have just read this email. This is somehow terrifying. So the answer should be "don't care" I suppose. In this case the authors of GSL are the one to blame and not the user of GSL.
I agree the copyright of algorithms' code is tricky. I wonder if anyone understands it....
i guess we have to agree to disagree on this. To me, all the stuff i've previously cited says "algorithms are not copyrighted, only the way they are expressed (especially arbitrary and stylistic choices) is copyrighted".
So to me the *principle* is clear, it's just the application in practice which is difficult.
So the question is: what part is algorithm, what part is expression, especially arbitrary and stylistic choices?
I think GSL violates the NR license. But it is their problem.
OK, so you are consistent. :)
Maybe you should write to Richard Stallman ;)
eeee..... perhaps we should just use it? ;-)
Well, we probably have consensus on that. :)
Anyway, any concrete comments, bug reports (or revised versions or forked distributions ;) of http://cosmo.torun.pl/GPLdownload/dodec/isolat-0.1.11.tar.gz would be welcome.
As long as there's only a small number of developers, we probably don't need a cvs system.
pozdr boud
Boud Roukema wrote:
Witam, What can be legally (and morally) copied from a program under a restrictive copyright is "the algorithms, the ideas" but not the particular way of expressing them.
So the practical question is: where is the borderline?
In the GSL (GNU Scientific Library), http://www.gnu.org/software/gsl/, GNU provides, e.g. in Version 1.1.1, the version below of NR's ran0 routine.
i'm sure most of us have access to a legal copy of the NR routine, or else a little googling shows e.g.
http://cc.oulu.fi/~tf/tiedostot/pub/nrf/ran0.f
Well, to me these look extremely similar to one another. Even the constants:
static const long int m = 2147483647, a = 16807, q = 127773, r = 2836; static const unsigned long int mask = 123459876;
are exactly identical to those in the NR routines, they even have the same names, except for the "i". Is this really a different "expression"?
In any case, IMHO noone can deny that the authors of the GSL routines (there is also ran1, ran2, ran3) have very likely had access to the NR source code.
Sure, they translated it to C and added some stuff, but it's the same algorithm, it's essentially the same sequence of steps.
Anyway, GSL has lots of really cool stuff. :) Let's defend scientific software freedom!
pozdr boud
/* rng/ran0.c
- Copyright (C) 1996, 1997, 1998, 1999, 2000 James Theiler, Brian Gough
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or (at
- your option) any later version.
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <config.h> #include <stdlib.h> #include <gsl/gsl_errno.h> #include <gsl/gsl_rng.h>
/* This is an implementation of the algorithm used in Numerical Recipe's ran0 generator. It is the same as MINSTD with an XOR mask of 123459876 on the seed.
The period of this generator is 2^31.
Note, if you choose a seed of 123459876 it would give a degenerate series 0,0,0,0, ... I've made that into an error. */
static inline unsigned long int ran0_get (void *vstate); static double ran0_get_double (void *vstate); static void ran0_set (void *state, unsigned long int s);
static const long int m = 2147483647, a = 16807, q = 127773, r = 2836; static const unsigned long int mask = 123459876;
typedef struct { unsigned long int x; } ran0_state_t;
static inline unsigned long int ran0_get (void *vstate) { ran0_state_t *state = (ran0_state_t *) vstate;
const unsigned long int x = state->x;
const long int h = x / q; const long int t = a * (x - h * q) - h * r;
if (t < 0) { state->x = t + m; } else { state->x = t; }
return state->x; }
static double ran0_get_double (void *vstate) { return ran0_get (vstate) / 2147483647.0 ; }
static void ran0_set (void *vstate, unsigned long int s) { ran0_state_t *state = (ran0_state_t *) vstate;
if (s == mask) { GSL_ERROR_VOID ("ran0 should not use seed == mask", GSL_EINVAL); }
state->x = s ^ mask;
return; }
static const gsl_rng_type ran0_type = {"ran0", /* name */ 2147483646, /* RAND_MAX */ 1, /* RAND_MIN */ sizeof (ran0_state_t), &ran0_set, &ran0_get, &ran0_get_double};
const gsl_rng_type *gsl_rng_ran0 = &ran0_type;
Cosmo-torun mailing list Cosmo-torun at cosmo.torun.pl http://cosmo.torun.pl/mailman/listinfo/cosmo-torun
--
Michal Frackowiak mail: michalf at ncac.torun.pl www: http://www.ncac.torun.pl/~michalf jabber im: michal_frackowiak at jabber.pl phone: +48 (56) 6219319 int. 22, fax: +48 (56) 6219381
Nicolaus Copernicus Astronomical Center Department of Astrophysics in Torun (CAMK Torun) ul. Rabianska 8, 87-100 Torun, Poland http://www.ncac.torun.pl, http://www.camk.edu.pl
even if you are a single developer a cvs is handful in a number of ways. e.g. :
- you can always come back to the code for a specific date - you can mark different versions with release tag and come back to ("download") any of them - you can make branches of code (ok, I never use these) - you have all the development process in one place and can backup it easily
all the benefits come from the fact that cvs stores incramental differences of any change in the code you make. sometimes it is useful to come back to the code a few days ago. if you use cvs it is not a problem. if not - you have to make "backups" every few days or so.
and it is really not that difficult to use. there are some frontends but the commandline is also nice.
if you use c/c++ you could give a try to www.eclipse.org with www.eclipse.org/cdt plugin. it nicely integrates with a cvs system, debugger etc. it is a complete (and outstanding) development platform. free. ;-)
pozdr m.
As long as there's only a small number of developers, we probably don't need a cvs system.
pozdr boud
witam,
On Fri, 19 Nov 2004, Michal Frackowiak wrote:
even if you are a single developer a cvs is handful in a number of ways. e.g. :
- you can always come back to the code for a specific date
- you can mark different versions with release tag and come back to
("download") any of them
- you can make branches of code (ok, I never use these)
- you have all the development process in one place and can backup it easily
all the benefits come from the fact that cvs stores incramental differences of any change in the code you make. sometimes it is useful to come back to the code a few days ago. if you use cvs it is not a problem. if not - you have to make "backups" every few days or so.
and it is really not that difficult to use. there are some frontends but the commandline is also nice.
Thanks for the motivation. It's on my todo list. ;)
if you use c/c++ you could give a try to www.eclipse.org with www.eclipse.org/cdt plugin. it nicely integrates with a cvs system, debugger etc. it is a complete (and outstanding) development platform.
free. ;-)
Free, but GPL incompatible :(
http://www.gnu.org/philosophy/license-list.html http://en.wikipedia.org/wiki/Common_Public_License
: This additional requirement renders the CPL incompatible with the GPL : (in the opinion of Eben Moglen), though it is possible that a future : version of the GPL will adopt a similar, compatible clause.
But probably the other reason for incompatibility is that it doesn't sufficiently discourage non-free code:
: while still retaining the ability to use the CPL'd content with : software licensed under other licenses, including many commercial : licenses.
And then just to confuse things, the eclipse web site says that it's using version 0.5 of the CPL: http://www.eclipse.org/legal/cpl-v05.html (i haven't checked the source).
Personally, i'd put this on a "waiting to hear other opinions in the free software community" list... But thanks for the suggestion anyway.
Meanwhile, i'll add anjuta, which is also an IDE, to my todo list: http://packages.debian.org/cgi-bin/search_packages.pl?keywords=anjuta&se...
pozdr boud