From: stevenj Date: Wed, 5 Sep 2007 21:23:56 +0000 (-0400) Subject: copyright etc. comments X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=e7cf8b04fd538623b1939347a1629bae0d9a9581;p=nlopt.git copyright etc. comments darcs-hash:20070905212356-c8de0-23bbb4a4af7867599387cace7787eb63a07d16e3.gz --- diff --git a/util/sobolseq.c b/util/sobolseq.c index 207c60c..12c3d5d 100644 --- a/util/sobolseq.c +++ b/util/sobolseq.c @@ -1,3 +1,50 @@ +/* Copyright (c) 2007 Massachusetts Institute of Technology + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* Generation of Sobol sequences in up to 1111 dimensions, based on the + algorithms described in: + P. Bratley and B. L. Fox, Algorithm 659, ACM Trans. + Math. Soft. 14 (1), 88-100 (1988), + as modified by: + S. Joe and F. Y. Kuo, ACM Trans. Math. Soft 29 (1), 49-57 (2003). + + Note that the code below was written without even looking at the Fortran + code, which is only semi-free (being under the restrictive ACM copyright + terms). Then I went to the Fortran code and took out the table of + primitive polynomials and starting direction #'s ... since this is just + a table of numbers generated by a deterministic algorithm, it is not + copyrightable. (Obviously, the format of these tables necessitated + some slight modifications to the code.) + + For the test integral of Joe and Kuo (see the main() program + below), I get exactly the same results for integrals up to 1111 + dimensions compared to the table of published numbers (to the 5 + published significant digits). + + This is not to say that the authors above should not be credited for + their clear description of the algorithm (and their tabulation of + the critical numbers). Please cite them. Just that I needed + a free/open-source implementation. */ + #include #include "nlopt-util.h" diff --git a/util/sobolseq.h b/util/sobolseq.h index dbf3216..19efa5b 100644 --- a/util/sobolseq.h +++ b/util/sobolseq.h @@ -1,3 +1,25 @@ +/* Copyright (c) 2007 Massachusetts Institute of Technology + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + #ifndef SOBOLSEQ_H #define SOBOLSEQ_H