Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ repos:
rev: v6.0.0
hooks:
- id: trailing-whitespace
exclude: '^c/pcg64/LICENSE\.md$'
- id: check-yaml
- id: check-symlinks
- id: check-merge-conflict
Expand Down
44 changes: 5 additions & 39 deletions COPYRIGHTS
Original file line number Diff line number Diff line change
Expand Up @@ -88,48 +88,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

====

mt19937
pcg64/pcg64.h

Copyright (c) 2003-2005, Jean-Sebastien Roy (js@jeannot.org)
PCG Random Number Generation for C.

The rk_random and rk_seed functions algorithms and the original design of
the Mersenne Twister RNG:
Copyright 2014 Melissa O'Neill <oneill@pcg-random.org>
Copyright 2015 Robert Kern <robert.kern@gmail.com>

Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

3. The names of its contributors may not be used to endorse or promote
products derived from this software without specific prior written
permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Original algorithm for the implementation of rk_interval function from
Richard J. Wagner's implementation of the Mersenne Twister RNG, optimised by
Magnus Jonsson.

Constants used in the rk_double implementation by Isaku Wada.
The MIT License

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
Expand Down
15 changes: 7 additions & 8 deletions c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ SRCS = avl.c \
main-hv.c \
main-hvapprox.c \
main-nondominated.c \
mt19937/mt19937.c \
ndsort.c \
nondominated.c \
pareto.c \
Expand Down Expand Up @@ -105,9 +104,9 @@ HDRS = avl.h \
io.h \
io_priv.h \
libmoocore-config.h \
mt19937/mt19937.h \
nondominated.h \
nondominated_kung.h \
pcg64/pcg64.h \
pow_int.h \
rng.h \
sort.h \
Expand All @@ -117,7 +116,7 @@ HDRS = avl.h \
ziggurat_constants.h

# Relative to root folder.
DIST_OTHER_FILES = git_version *.mk
DIST_OTHER_FILES = git_version *.mk pcg64/LICENSE.md pcg64/README.md
DIST_ROOT_FILES = Makefile README.md LICENSE
OBJS = $(SRCS:.c=.o)
OBJS := $(OBJS:.cpp=.o)
Expand Down Expand Up @@ -196,7 +195,7 @@ $(BINDIR)/dominatedsets$(EXE): dominatedsets.o nondominated.o
$(BINDIR)/eaf$(EXE): eaf.o eaf_main.o eaf3d.o avl.o
$(BINDIR)/epsilon$(EXE): epsilon.o nondominated.o
$(BINDIR)/hv$(EXE): main-hv.o timer.o $(LIBHV_OBJS)
$(BINDIR)/hvapprox$(EXE): main-hvapprox.o timer.o hvapprox.o rng.o mt19937/mt19937.o nondominated.o
$(BINDIR)/hvapprox$(EXE): main-hvapprox.o timer.o hvapprox.o rng.o nondominated.o
$(BINDIR)/igd$(EXE): igd.o nondominated.o
$(BINDIR)/ndsort$(EXE): ndsort.o pareto.o nondominated.o $(LIBHV_OBJS)
$(BINDIR)/nondominated$(EXE): main-nondominated.o timer.o nondominated.o
Expand All @@ -217,7 +216,7 @@ hv.o: hv.h hv_priv.h hvc4d_priv.h sort.h libmoocore-config.h
hv3dplus.o: hv_priv.h sort.h hv3d_priv.h avl_tiny.h
hv4d.o: hv4d_priv.h hv_priv.h sort.h
hv_contrib.o: hv.h libmoocore-config.h nondominated.h
hvapprox.o: hvapprox.h pow_int.h rng.h mt19937/mt19937.h
hvapprox.o: hvapprox.h pow_int.h rng.h pcg64/pcg64.h
hvc3d.o: hv_priv.h sort.h hv3d_priv.h avl_tiny.h
igd.o: cmdline.h io.h nondominated.h igd.h pow_int.h
io.o: io.h io_priv.h
Expand All @@ -228,7 +227,7 @@ ndsort.o: cmdline.h io.h nondominated.h hv.h
nondominated.h: avl_tiny.h nondominated_kung.h
nondominated.o: nondominated.h nondominated_kung.h
pareto.o: nondominated.h
rng.o: rng.h mt19937/mt19937.h ziggurat_constants.h
rng.o: rng.h pcg64/pcg64.h ziggurat_constants.h
timer.o: timer.h
$(OBJS): common.h gcc_attribs.h config.h maxminclamp.h

Expand All @@ -247,7 +246,7 @@ clean-obj:
@$(RM) $(OBJS) $(HV_OBJS) $(HV_LIB)

clean: clean-obj
@-$(RM) *.s *.i *.gcda mt19937/*.gcda
@-$(RM) *.s *.i *.gcda
@-$(RM) config.status config.log
@-$(RM) $(SHLIB) $(CXXSHLIB)
@for exe in $(EXE_FILES); do \
Expand Down Expand Up @@ -332,7 +331,7 @@ dist: DEBUG=0
dist: CDEBUG=
dist: all
$(call MKDIR,../$(DIST_SRC)
@(rsync -rlpC --exclude=.svn $(DIST_SRC_FILES) ../$(DIST_SRC)/ \
@(rsync -RrlpC --exclude=.svn $(DIST_SRC_FILES) ../$(DIST_SRC)/ \
&& cd .. \
&& tar cf - $(DIST_SRC) | gzip -f9 > $(DIST_SRC).tar.gz \
&& rm -rf ./$(DIST_SRC)/* && rmdir ./$(DIST_SRC)/ \
Expand Down
1 change: 1 addition & 0 deletions c/NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 0.20

* Use PCG64 for stochastic hypervolume calculations. Seeded results change.
* radixsort.h, insort.h: New.
* main-nondominated.c: Renamed from nondominated.c.
* hv and hvapprox executables now use -U instead of -u for --union to be
Expand Down
4 changes: 4 additions & 0 deletions c/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ Most functions are implemented in headers such as `nondominated.h`. For other fu

Functions exported by the library are marked with `MOOCORE_API`.

The stochastic hypervolume functions use NumPy's PCG64 implementation. A
given seed is reproducible, but produces different results from earlier
moocore versions and from NumPy's seed initialization.


Testsuite
=========
Expand Down
61 changes: 0 additions & 61 deletions c/mt19937/LICENSE.md

This file was deleted.

61 changes: 0 additions & 61 deletions c/mt19937/mt19937.c

This file was deleted.

58 changes: 0 additions & 58 deletions c/mt19937/mt19937.h

This file was deleted.

22 changes: 22 additions & 0 deletions c/pcg64/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# PCG64

## The MIT License

PCG Random Number Generation for C.

Copyright 2014 Melissa O'Neill <oneill@pcg-random.org>

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.
10 changes: 10 additions & 0 deletions c/pcg64/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# PCG64

`pcg64.h` and `LICENSE.md` come from
[NumPy's PCG64 implementation](https://github.com/numpy/numpy/tree/98acfbde9876839be145d022beb76e7ff835e8e1/numpy/random/src/pcg64)
at revision `98acfbde9876839be145d022beb76e7ff835e8e1`.
The header adds explicit casts to silence conversion warnings.
moocore uses the inline functions in `pcg64.h`.

moocore initializes PCG64 with its 32-bit seed as the initial state and a
fixed stream identifier of 54; it does not use NumPy's `SeedSequence`.
Loading
Loading