emoa/0000755000176200001440000000000014666617772011221 5ustar liggesusersemoa/tests/0000755000176200001440000000000014554263770012352 5ustar liggesusersemoa/tests/testthat/0000755000176200001440000000000014666617772014223 5ustar liggesusersemoa/tests/testthat/test-front_edge.R0000644000176200001440000000125614554263107017424 0ustar liggesusers## ## test-front_edge.R - Edge point tests ## context("front_edge") ## Predeclare some simple test fronts: front_2d <- matrix(c(0.0, 1.0, 0.5, 1.0, 0.0, 0.5), nrow=2, byrow=TRUE) front_3d <- matrix(c(0.0, 1.0, 0.0, 0.5, 0.7, 1.0, 1.0, 0.5, 0.0, 0.0, 1.0, 0.5, 0.5, 1.0, 0.5, 1.0, 1.0, 0.0, 0.0, 0.5, 0.3, 0.5, 1.0, 1.0), nrow=3, byrow=TRUE) which_points_on_edge(front_3d) test_that("which_points_on_edge_2d", { expect_equal(which_points_on_edge(front_2d), c(1, 2)) }) test_that("which_points_on_edge_3d", { expect_equal(which_points_on_edge(front_3d), c(1, 2, 3, 6, 7, 8)) }) emoa/tests/testthat/test-hypervolume.R0000644000176200001440000000620214554263107017663 0ustar liggesusers## ## test-hypervolume.r - Hypervolume tests ## context("hypervolume") ## Predeclare some simple test fronts: simpleFront <- matrix(c(0.0, 1.0, 0.5, 1.0, 0.0, 0.5), ncol=3, byrow=TRUE) infFront <- simpleFront infFront[,2] <- Inf naFront <- simpleFront naFront[,2] <- NA nanFront <- simpleFront nanFront[,2] <- NaN test_that("dominated_hypervolume", { expect_equal(dominated_hypervolume(simpleFront), 0.5^2) expect_equal(dominated_hypervolume(simpleFront, c(1.0, 1.0)), 0.5^2) ## OME: FIXME should ignore outer points? ## expect_equal(dominated_hypervolume(simpleFront, c(0.8, 0.8)), 0.3^2) expect_equal(dominated_hypervolume(simpleFront, c(2.0, 2.0)), 3.25) expect_equal(dominated_hypervolume(simpleFront, c(0.0, 0.0)), 0) expect_equal(dominated_hypervolume(simpleFront, c(0.5, 0.5)), 0) suppressWarnings(expect_equal(dominated_hypervolume(simpleFront, c(NaN, NaN)), NaN)) expect_warning(dominated_hypervolume(simpleFront, c(NaN, NaN))) }) test_that("bad_front", { ## OME: Should probably also return NaN instead of NA suppressWarnings(expect_equal(is.na(dominated_hypervolume(naFront)), TRUE)) suppressWarnings(expect_equal(dominated_hypervolume(nanFront), NaN)) expect_warning(is.na(dominated_hypervolume(naFront))) expect_warning(dominated_hypervolume(nanFront)) }) test_that("inf_front", { ## OME: These should probably be reworked to return 'saner' values. suppressWarnings(expect_equal(dominated_hypervolume(infFront), NaN)) expect_warning(dominated_hypervolume(infFront)) suppressWarnings(expect_equal(dominated_hypervolume(infFront, ref=c(1, 1)), NaN)) expect_warning(dominated_hypervolume(infFront, ref=c(1, 1))) suppressWarnings(expect_equal(dominated_hypervolume(simpleFront, ref=c(Inf, Inf)), NaN)) expect_warning(dominated_hypervolume(simpleFront, ref=c(Inf, Inf))) }) test.badInput <- function() { expect_error(dominated_hypervolume(1:10)) expect_error(dominated_hypervolume("abc")) expect_error(dominated_hypervolume(simpleFront, 1:3)) expect_error(dominated_hypervolume(simpleFront, 1)) } test.dhv3d <- function() { ## Built with Lego. Hurra! m3 <- structure(c(5, 2, 0, 4, 3, 0, 4, 2, 1, 4, 1, 2, 3, 2, 2, 2, 3, 2, 4, 0, 3, 3, 1, 3, 2, 2, 3, 3, 0, 4, 2, 1, 4, 1, 2, 4, 0, 3, 4, 0, 2, 5), .Dim = c(3L, 14L)) m3_dhv <- c(1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 1, 1) expect_equal(hypervolume_contribution(m3, c(6, 4, 6)), m3_dhv) } ## Regression test for the permutation bug (missing duplicate()). test.regress_perm <- function() { ## Built with Lego. Hurra! m3 <- structure(c(5, 2, 0, 4, 3, 0, 4, 2, 1, 4, 1, 2, 3, 2, 2, 2, 3, 2, 4, 0, 3, 3, 1, 3, 2, 2, 3, 3, 0, 4, 2, 1, 4, 1, 2, 4, 0, 3, 4, 0, 2, 5), .Dim = c(3L, 14L)) o3 <- structure(c(5, 2, 0, 4, 3, 0, 4, 2, 1, 4, 1, 2, 3, 2, 2, 2, 3, 2, 4, 0, 3, 3, 1, 3, 2, 2, 3, 3, 0, 4, 2, 1, 4, 1, 2, 4, 0, 3, 4, 0, 2, 5), .Dim = c(3L, 14L)) hypervolume_contribution(m3) expect_equal(m3, o3) } emoa/tests/testthat/test-id.R0000644000176200001440000000326114554263107015702 0ustar liggesusers## ## test-id.r - Pareto utility test ## context("id") points <- matrix(c(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.5, 0.5, 0.5, 0.5, 0.6, 0.6, 0.6, 0.5, 0.6, 0.6, 0.6, 0.5, 0.8, 0.8, 0.8), ncol=8, byrow=FALSE) nd <- c(TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) no <- c(1, 1, 1, 1, 2, 2, 2, 3) test_that("hv_indicators", { p1 <- points[, no==1] p2 <- points[, no==2] I12 <- hypervolume_indicator(p1, p2, ref=c(1, 1, 1)) I21 <- hypervolume_indicator(p2, p1, ref=c(1, 1, 1)) expect_equal(I21, 0.013) expect_equal(I12, -I21) I21p <- hypervolume_indicator(p2, p1, ref=c(10, 10, 10)) expect_true(I21 < I21p) }) test_that("r_indicators", { p1 <- points[, no==1] p2 <- points[, no==2] ## Basic sanity: expect_equal(r1_indicator(p1, p1), 0.5) expect_equal(r2_indicator(p1, p1), 0) expect_equal(r3_indicator(p1, p1), 0) expect_equal(r1_indicator(p2, p2), 0.5) expect_equal(r2_indicator(p2, p2), 0) expect_equal(r3_indicator(p2, p2), 0) ## Precalculate values: r112 <- r1_indicator(p1, p2) r121 <- r1_indicator(p2, p1) r212 <- r2_indicator(p1, p2) r221 <- r2_indicator(p2, p1) r312 <- r3_indicator(p1, p2) r321 <- r3_indicator(p2, p1) ## Symmetry properties: expect_equal(r112 + r121, 1) expect_equal(r212, -r221) ## Known 'better': expect_true(r112 > r121) expect_true(r212 < r221) expect_true(r312 < r321) }) test_that("eps_indicator", { p1 <- points[, no==1] p2 <- points[, no==2] expect_equal(epsilon_indicator(p1, p2), 0) expect_equal(epsilon_indicator(p2, p1), 0.6) }) emoa/tests/testthat/test-ei.R0000644000176200001440000000147714554263107015712 0ustar liggesusers## ## test-ei.r - Epsilon Indicator tests ## context("epsilon_indicator") x <- matrix(c(1.0, 0.5, 0.0, 0.0, 0.5, 1.0), ncol=3, byrow=TRUE) test_that("Permutations", { ## Check for different permutations of the rows and columns of ## points. k <- nrow(x) n <- ncol(x) for (i in 1:10) { o <- sample(1:n) p <- sample(1:k) m <- x[p, o] for (delta in seq(0, 1, by=0.2)) { expect_equal(epsilon_indicator(m, m + delta), -delta) expect_equal(epsilon_indicator(m + delta, m), delta) } } }) ## Check different sized matrices: test_that("different sized matrices", { expect_equal(epsilon_indicator(x, x[,-2] + 0.2), -0.2) }) ## Negative values: test_that("negative values", { expect_error(epsilon_indicator(x, x-10)) expect_error(epsilon_indicator(x-10, x)) }) emoa/tests/testthat/test-sbx.R0000644000176200001440000000067414554263107016107 0ustar liggesusers## ## test-sbx.r - SBX crossover ## ## These checks may fail sometimes! They are simply empirical checks of the ## probability of crossover. ## context("sbx") N <- 10000L f <- sbx_operator(2, 0.8, -2, 2) parents <- matrix(c(0, 1), ncol=2) x <- replicate(N, c(f(parents)))[1,] test_that("sbxP1", { p <- mean(x != 0) expect_true(p > 0.78 && p < 0.82) }) test_that("sbxInBounds", { expect_true(all(x >= -2)) expect_true(all(x <= 2)) }) emoa/tests/testthat/test-poly.R0000644000176200001440000000075214554263107016273 0ustar liggesusers## ## test-poly.r - Polynomial mutation ## ## These checks may fail sometimes! They are simply empirical checks of the ## probability of crossover. ## context("poly") N <- 10000L f <- pm_operator(5, 0.8, -10, 10) x <- replicate(N, f(5)) test_that("polyP1", { p <- mean(x != 5) expect_true(p > 0.78 && p < 0.82) }) test_that("polyP2", { p <- mean(x < 5) expect_true(p > 0.38 && p < 0.42) }) test_that("polyInBounds", { expect_true(all(x >= -10)) expect_true(all(x <= 10)) }) emoa/tests/testthat/test-nds.R0000644000176200001440000000363114554263107016073 0ustar liggesusers## ## test-nds.r - Pareto dominance stuff ## context("nds") points <- matrix(c(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.5, 0.5, 0.5, 0.5, 0.6, 0.6, 0.6, 0.5, 0.6, 0.6, 0.6, 0.5, 0.8, 0.8, 0.8), ncol=8, byrow=FALSE) nd <- c(TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) no <- c(1, 1, 1, 1, 2, 2, 2, 3) test_that("is_dominated", { k <- nrow(points) n <- ncol(points) ## Check for different permutations of the rows and columns of ## points. for (i in 1:10) { o <- sample(1:n) p <- sample(1:k) m <- points[p,o] res <- is_dominated(m) expect_equal(res, !nd[o]) } }) test_that("is_maximally_dominated", { k <- nrow(points) n <- ncol(points) ## Check for different permutations of the rows and columns of ## points. for (i in 1:10) { o <- sample(1:n) p <- sample(1:k) m <- points[p,o] res <- is_maximally_dominated(m) expect_equal(res, max(no[o]) == no[o]) } }) test_that("nds_rank", { k <- nrow(points) n <- ncol(points) ## Check for different permutations of the rows and columns of ## points. for (i in 1:10) { o <- sample(1:n) p <- sample(1:k) expect_equal(nds_rank(points[p,o]), no[o]) } }) test_that("nds_rank.args", { expect_error(nds_rank("a")) expect_error(nds_rank(1)) expect_error(nds_rank(list(1, 2, 3))) expect_error(nds_rank(data.frame(x=1:10))) expect_error(nds_rank(points, partial="a")) }) ## Bug fixed i test_that("single_nds", { expect_equal(dim(nondominated_points(points[,-(1:3)])), c(3, 1)) }) ##test_dominates_op <- function() { ## x <- c(1, 2, 1) ## y <- c(2, 1, 2) ## z <- c(0, 1, 0) ## expect_equal(x %dominates% y, FALSE) ## expect_equal(y %dominates% x, FALSE) ## expect_equal(z %dominates% x, FALSE) ## expect_equal(z %dominates% y, FALSE) ##} emoa/tests/testthat/test-cec2009.R0000644000176200001440000000572714554275703016371 0ustar liggesusers## ## cec2009 unit test ## context("cec2009_functions") ## Source to generate test point checks: ## ## f <- function(n, x=c(0.2, 0.2, 0.2, 0.2)) { ## fn <- get(n) ## r <- fn(x) ## message("expect_equal(", n, "(", ## "c(", paste(x, collapse=", "), "), ", ## "c(", paste(r, collapse=", "), ")))") ## } ## ## for (n in paste("UF", 1:10, sep="")) ## f(n) test_that("UF1", { expect_equal(UF1(c(0.2, 0.2, 0.2, 0.2)), c(0.454091055737032, 1.72127910133303)) expect_equal(UF1(c(1.0, 0.0, 0.0)), c(1.0, 1.5)) expect_equal(UF1(c(1.0, 2.0, 2.0)), c(NaN, NaN)) expect_equal(UF1(c(-1.0, 0.0, 0.0)), c(NaN, NaN)) # expect_equal(UF1(c(0.2, 0.2, "a")), c(NaN, NaN)) expect_error(UF1(c(1.0, 2.0))) }) test_that("UF2", { expect_equal(UF2(c(0.2, 0.2, 0.2, 0.2)), c(0.210335975924134, 0.654710703252405)) expect_equal(UF2(c(1.0, 1.0, 1.0)), c(8.2199999999999989, 0.7449042731880116)) # expect_equal(UF2(c(1.0, 2.0, 2.0)), c(NaN, NaN)) # expect_equal(UF2(c(-1.0, 0.0, 0.0)), c(NaN, NaN)) # expect_equal(UF2(c(0.2, 0.2, "a")), c(NaN, NaN)) expect_error(UF2(c(1.0, 2.0))) }) test_that("UF3", { expect_equal(UF3(c(0.2, 0.2, 0.2, 0.2)), c(7.1937361619286, 2.90716200450771)) expect_equal(UF3(c(1.0, 2.0, 2.0)), c(NaN, NaN)) expect_equal(UF3(c(-1.0, 0.0, 0.0)), c(NaN, NaN)) # expect_equal(UF3(c(0.2, 0.2, "a")), c(NaN, NaN)) expect_error(UF3(c(1.0, 2.0))) }) test_that("UF4", { expect_equal(UF4(c(0.2, 0.2, 0.2, 0.2)), c(0.434509085633295, 1.20063945204195)) expect_equal(UF4(c(1.0, 2.0, 2.0)), c(NaN, NaN)) expect_equal(UF4(c(-1.0, 0.0, 0.0)), c(NaN, NaN)) #expect_equal(UF4(c(0.2, 0.2, "a")), c(NaN, NaN)) expect_error(UF4(c(1.0, 2.0))) }) test_that("UF5", { expect_equal(UF5(c(0.2, 0.2, 0.2, 0.2)), c(3.17056357285719, 3.98342430089429)) }) test_that("UF6", { expect_equal(UF6(c(0.2, 0.2, 0.2, 0.2)), c(1.88938265125039, 6.65748253841339)) }) test_that("UF7", { expect_equal(UF7(c(0.2, 0.2, 0.2, 0.2)), c(0.978870719414727, 1.44371303315529)) }) test_that("UF8", { expect_equal(UF8(c(2.0, 0.2, 0.2, 0.2, 0.2)), c(NaN, NaN, NaN)) expect_equal(UF8(c(0.2, 2.0, 0.2, 0.2, 0.2)), c(NaN, NaN, NaN)) expect_equal(UF8(c(0.2, 0.2, 3.0, 0.2, 0.2)), c(NaN, NaN, NaN)) #expect_equal(UF8(c(0.2, 0.2, 0.2, 0.2, "a")), c(NaN, NaN, NaN)) for (i in 1:4) expect_error(UF8(rep(0.2, i))) }) test_that("UF9", { expect_equal(UF9(c(2.0, 0.2, 0.2, 0.2, 0.2)), c(NaN, NaN, NaN)) expect_equal(UF9(c(0.2, 2.0, 0.2, 0.2, 0.2)), c(NaN, NaN, NaN)) expect_equal(UF9(c(0.2, 0.2, 3.0, 0.2, 0.2)), c(NaN, NaN, NaN)) #expect_equal(UF9(c(0.2, 0.2, 0.2, 0.2, "a")), c(NaN, NaN, NaN)) for (i in 1:4) expect_error(UF9(rep(0.2, i))) }) test_that("UF10", { expect_equal(UF10(c(2.0, 0.2, 0.2, 0.2, 0.2)), c(NaN, NaN, NaN)) expect_equal(UF10(c(0.2, 2.0, 0.2, 0.2, 0.2)), c(NaN, NaN, NaN)) expect_equal(UF10(c(0.2, 0.2, 3.0, 0.2, 0.2)), c(NaN, NaN, NaN)) #expect_equal(UF10(c(0.2, 0.2, 0.2, 0.2, "a")), c(NaN, NaN, NaN)) for (i in 1:4) expect_error(UF10(rep(0.2, i))) }) emoa/tests/testthat/test-utilities.R0000644000176200001440000000076614554263107017330 0ustar liggesusers## ## test-utilities.r - check internal utility functions ## context("utilities") test_that("inbounds", { x <- c(0, 1, 2) expect_equal(emoa:::inbounds(x, 0, 1), c(0, 1, 1)) expect_equal(emoa:::inbounds(x, 1, 2), c(1, 1, 2)) expect_equal(emoa:::inbounds(x, 1, 1), c(1, 1, 1)) expect_equal(emoa:::inbounds(x, c(0, 0, 1), c(1, 1, 2)), c(0, 1, 2)) expect_equal(emoa:::inbounds(x, c(1, 0, 1), c(1, 1, 2)), c(1, 1, 2)) expect_equal(emoa:::inbounds(x, c(0, 0, 1), c(1, 1, 1)), c(0, 1, 1)) }) emoa/tests/testthat.R0000644000176200001440000000004714554263107014330 0ustar liggesuserslibrary("testthat") test_check("emoa") emoa/MD50000644000176200001440000000770414666617772011541 0ustar liggesusers63e7430c8b061123f8705c28e7957662 *DESCRIPTION a4231be47c5c1a5d0bbc93a74c1b16e0 *NAMESPACE 28d20019359493872bca36cbb3abd8c7 *R/cec2009.r 12d3e46f4e47f801bc071578554eb96c *R/control.R 4960eade70f12abca185820cbe0a7ba1 *R/crowding_distance.r 4550f85c5f3c98499c2fc5580166e087 *R/dominance.r 805d319b5aabbb5598a5abf77c0ce9b5 *R/emoa.r 20a3591dbff7f13576ae78df7dd5b220 *R/front_edge.R 59ee2bf90a3db9f5fd2697cf2e95683b *R/hypervolume.r 42846d1480f2f5786009b295f7bfa9ce *R/indicators.r 9fb2f97c01a95ce1b0659c3379672321 *R/logger.R 0b9181cd7c6421ec8afb99d5a68dc6da *R/poly_mutation.r 147a2a85bd7a14f7ae60f7f9a5822146 *R/sb_crossover.r 5658227865e2b601f3294356b978eec7 *R/selection.r c570d9e56c03bfd54268e66c54a8a9ae *R/sympart.r c271eb1b20393b55d5f9de7ca4daf9bd *R/utilities.r 99be4b384ffdf97926905995f761ac1b *README.md 30b35f5aff5af383b7aad7b1d53c8859 *data/cec2007.rda c12cce4ffcb162285965ef364181d083 *man/binary_indicator.Rd 3468e3a4010c82eb9221fb1a997f49fd *man/cec2007.Rd 1bba269684fb55e313f380ff78323c66 *man/cec2007_functions.Rd b52262f633a2711f78c8a2a7baca7317 *man/cec2009_functions.Rd 5bbd9a2de3f265c1b98783afa55cfaf2 *man/coalesce.Rd 1761ea4efb98d474cecde4b4a69c4239 *man/crowding_distance.Rd d04e83f39168602deab02906c0bc476c *man/dom_op.Rd bc893b50bbbf2cbce4b602920c3fb4a1 *man/dominance_matrix.Rd 494f7bd5dbe0bfe29ed374f6c8499ceb *man/dominated_hypervolume.Rd 2f7963b41be72b2ff9ca195a956d3763 *man/emoa-package.Rd 3e4254a9f80019df903cc2e0063636db *man/emoa_console_logger.Rd 8693d30ca5c44b43644b6b104d5a7918 *man/emoa_control.Rd e82608ead3184a4c8191adb2bd55a97f *man/emoa_logger.Rd 715d58ec9d0f07cc278cee50778e2760 *man/emoa_null_logger.Rd 5c50c1eb57fac5bc7adb69f2cb3e949a *man/inbounds.Rd 7ec9c6785281c6e9e67e25c3d874c69e *man/nds_hv_selection.Rd fd26e62365c78d90c5836f311235de1a *man/nds_rank.Rd f843706168ee907457dbc26a3e58b3d4 *man/nondominated_points.Rd 2bf35f1322a487667bde2e7d1e39f648 *man/normalize_points.Rd c6fbaafd73041e0f56c5c68eb25d0084 *man/pm_control.Rd 3ff51e79aaab08d2e0d46784ba59bc76 *man/pm_operator.Rd 84cd6b2a60f6aec2beffb6fb44fdcdf4 *man/sbx_control.Rd cf79635282555c68c4e443c76df0932b *man/sbx_operator.Rd 23436563fa4fc083794d4b4fad1355cd *man/steady_state_emoa_control.Rd 8c1abf73487a3dfd59ded059ee7a8be9 *man/unary_r2_indicator.Rd 58f95dddcbe9e591e2f7dbd8c7825e56 *man/which_points_on_edge.Rd 48739c1bd728437b7e082259fc89a221 *src/avl.c 0cb3368bc8945c9868334885577c5164 *src/avl.h 97710cb83e7c0700993d5edfece57ade *src/bitstring.h 1171b353c25fd964cafa4e9a88792f73 *src/cec2009.c db166015335971122c6750286c920a0c *src/crowding_distance.c 21430df8e8bbabd2c8092d1505dd4fbc *src/dominance.c 966b1b7fa267f6a06791171be1cce318 *src/emoa.c 9b46ef0a38ddbfecfd6929baa4b4798c *src/eps_ind.c baafc6ec5810eed315d659668a4209ec *src/extern.h 4f8e2796a7bb9607608991d1f8ee230b *src/front_edge.c b3e59db7f7fbfe9c9ec487129ec14132 *src/hv.c c314958a2de1d4564a999eafc1ed5642 *src/hv.h 257c281666888823a3d73ba734ea778a *src/hypervolume.c da124be9014e8179221c62f1fea6078c *src/poly_mutation.c f5a91f1230eff9149ddcbe483916e30c *src/precomputed_weight_vectors.h 87b0de440a1a025e6d733a19fe614305 *src/r_ind.c 06f74998c07015f8c1d88dabecead22e *src/sb_crossover.c 3e8bb6face58319a6c73a96dec14c0a3 *src/sexp_macros.h 9f61a6578a883adad23f324436d0225f *src/sympart.c ebd10b8f50b8b9531ad1f494ab9473f6 *src/utilities.c 32ca51b09551f132698abdeb20cbae0a *src/utilities.h 6a599be0d1e32387cdcf5a4edf9edbc8 *src/weight_vectors.h 7fc8592e0d6f067cf59631600ce6fefd *tests/testthat.R a6017e50bf32ee188c5e105de27a7cf8 *tests/testthat/test-cec2009.R 3920579ec5d5666d56d8fce532912ab1 *tests/testthat/test-ei.R 2a7d70570aa2b57d6d9a0b7695345796 *tests/testthat/test-front_edge.R e028e2148eb6f881ce8506d76c04f812 *tests/testthat/test-hypervolume.R 074e232986e24a71f58125b1aa62ddd6 *tests/testthat/test-id.R b624baa28c7e005759da7bfc10837c4c *tests/testthat/test-nds.R f7d7ab0afb58803e0e036998116bf783 *tests/testthat/test-poly.R c28862f29e00377e5027de1111ff43a2 *tests/testthat/test-sbx.R 25e5be30702eccde0c64a0e3896ea7de *tests/testthat/test-utilities.R emoa/R/0000755000176200001440000000000014554271516011406 5ustar liggesusersemoa/R/cec2009.r0000644000176200001440000000335512030307153012624 0ustar liggesusers## ## cec2009.r - Test functions from the CEC2009 competition ## ## Author: ## Olaf Mersmann (OME) ## ##' Functions from the CEC 2009 EMOA competition. ##' ##' @param x Parmater vector. ##' @return Function value. ##' ##' @author Olaf Mersmann \email{olafm@@statistik.tu-dortmund.de} ##' @keywords optimize ##' @export ##' @rdname cec2009_functions UF1 <- function(x) { stopifnot(length(x) >= 3) .Call("do_UF1", as.numeric(x), PACKAGE="emoa") } ##' @export ##' @rdname cec2009_functions UF2 <- function(x) { stopifnot(length(x) >= 3) .Call("do_UF2", as.numeric(x), PACKAGE="emoa") } ##' @export ##' @rdname cec2009_functions UF3 <- function(x) { stopifnot(length(x) >= 3) .Call("do_UF3", as.numeric(x), PACKAGE="emoa") } ##' @export ##' @rdname cec2009_functions UF4 <- function(x) { stopifnot(length(x) >= 3) .Call("do_UF4", as.numeric(x), PACKAGE="emoa") } ##' @export ##' @rdname cec2009_functions UF5 <- function(x) { stopifnot(length(x) >= 3) .Call("do_UF5", as.numeric(x), PACKAGE="emoa") } ##' @export ##' @rdname cec2009_functions UF6 <- function(x) { stopifnot(length(x) >= 3) .Call("do_UF6", as.numeric(x), PACKAGE="emoa") } ##' @export ##' @rdname cec2009_functions UF7 <- function(x) { stopifnot(length(x) >= 3) .Call("do_UF7", as.numeric(x), PACKAGE="emoa") } ##' @export ##' @rdname cec2009_functions UF8 <- function(x) { stopifnot(length(x) >= 5) .Call("do_UF8", as.numeric(x), PACKAGE="emoa") } ##' @export ##' @rdname cec2009_functions UF9 <- function(x) { stopifnot(length(x) >= 5) .Call("do_UF9", as.numeric(x), PACKAGE="emoa") } ##' @export ##' @rdname cec2009_functions UF10 <- function(x) { stopifnot(length(x) >= 5) .Call("do_UF10", as.numeric(x), PACKAGE="emoa") } emoa/R/front_edge.R0000644000176200001440000000072212030307153013626 0ustar liggesusers##' Determine which points are on the edge of a Pareto-front approximation. ##' ##' @param front Pareto-front approximation. ##' ##' @return An integer vector containing the indicies of the points ##' (columns) of \code{front} which are on the edge of the ##' Pareto-front approximation. ##' ##' @author Olaf Mersmann \email{olafm@@statistik.tu-dortmund.de} ##' ##' @export which_points_on_edge <- function(front) { which(.Call(do_which_points_on_edge, front)) } emoa/R/sympart.r0000644000176200001440000000100612030307153013245 0ustar liggesusers## ## sympart.r - SYM-PART test function from the CEC 2007 competition ## ## Author: ## Olaf Mersmann (OME) ## ##' Functions from the CEC 2007 EMOA competition. ##' ##' @param x Parmater vector. ##' @return Function value. ##' ##' @author Olaf Mersmann \email{olafm@@statistik.tu-dortmund.de} ##' @keywords optimize ##' @export ##' @rdname cec2007_functions sympart <- function(x) { #stopifnot(length(x) >= 2) #stopifnot(length(x) %% 2 == 0) .Call(do_sympart, as.numeric(x)) } emoa/R/crowding_distance.r0000644000176200001440000000064312030307153015242 0ustar liggesusers## ## crowding_distance.r - calculate crowding distance. ## ##' Calculate crowding distances. ##' ##' @aliases crowding_distance ##' @title Crowding Distance ##' @export ##' @param front matrix of function values. ##' ##' @return crowding distance for each function value. ##' ##' @author Olaf Mersmann \email{olafm@@statistik.tu-dortmund.de} crowding_distance <- function(front) .Call(do_crowding_distance, front) emoa/R/poly_mutation.r0000644000176200001440000000147212030307153014460 0ustar liggesusers## ## poly_mutation.r - Polynomial mutation operator ## ## Author ## Olaf Mersmann (OME) ## ##' Polynomial mutation operator ##' ##' Returns a polynomial mutation operator with the given parameters. ##' ##' @param n Distance parameter mutation distribution (\eqn{\eta}{eta}). ##' @param p Probability of one point mutation. ##' @param lower Lower bounds of parameter space. ##' @param upper Upper bounds of parameter space. ##' @export ##' @return Function which implements the specified mutation operator. ##' ##' @author Olaf Mersmann \email{olafm@@statistik.tu-dortmund.de} pm_operator <- function(n, p, lower, upper) { ## Force arguments: force(n); force(p); force(lower); force(upper); mutation <- function(x) .Call(do_pm, x, lower, upper, n, p) return(mutation) } emoa/R/sb_crossover.r0000644000176200001440000000240212030307153014260 0ustar liggesusers## ## sb_crossover - Simulated Binary Crossover ## ## Author: ## Olaf Mersmann (OME) ## ##' Simulated binary crossover operator ##' ##' Returns a simulated binary crossover operator with the given parameters. ##' ##' @param n Distance parameter of crossover distribution (\eqn{\eta}{eta}). ##' @param p Probability of one point crossover. ##' @param lower Lower bounds of parameter space. ##' @param upper Upper bounds of parameter space. ##' @export ##' ##' @return Function with one parameter \code{x} which takes a matrix ##' containing two sets of parameters and returns a matrix of two sets of ##' parameters which resulted from the crossover operation. As with all ##' \code{emoa} functions, the parameter sets are stored in the columns ##' of \code{x}. \code{x} should therefore always have two columns and a ##' warning will be given if it has more than two columns. ##' ##' @seealso \code{\link{pm_operator}} ##' ##' @author Olaf Mersmann \email{olafm@@statistik.tu-dortmund.de} sbx_operator <- function(n, p, lower, upper) { ## Force arguments: force(n); force(p); force(lower); force(upper); crossover <- function(x) .Call(do_sbx, x, lower, upper, n, p) return(crossover) } emoa/R/control.R0000644000176200001440000001265412030307153013201 0ustar liggesusers## ## control.R - Preliminary control parameter framework ## ## Author: Olaf Mersmann ## ##' Basic EMOA control parameters. ##' ##' The following control parameters are recognized by \code{emoa_control}: ##' \describe{ ##' \item{logger}{\code{emoa_logger} object used to log events.} ##' \item{n}{Number of parameters, defaults to the length of the longer ##' of \code{upper} or \code{lower}.} ##' \item{d}{Number of dimensions.} ##' } ##' ##' @param f Multiobjectve optimization function. ##' @param upper Upper bounds of parameter space. ##' @param lower Lower bounds of parameter space. ##' @param ... Further arguments passed to \code{f}. ##' @param control List of control parameters. ##' @param default List of default control parameters. ##' ##' @return The \code{control} list with suitably adjusted ##' arguments. Missing control parameters are taken from ##' \code{default} or, if not present there, from an internal default. ##' ##' @export ##' @author Olaf Mersmann \email{olafm@@statistik.tu-dortmund.de} emoa_control <- function(f, upper, lower, ..., control, default) { control$logger <- coalesce(control[["logger"]], default[["logger"]], emoa_console_logger()) control$n <- as.integer(coalesce(control[["n"]], default[["n"]], max(length(lower), length(upper)))) control$d <- as.integer(coalesce(control[["d"]], default[["d"]], length(f(rep(NA, control$n), ...)))) control } ##' Steady state EMOA parameters ##' ##' \code{steady_state_emoa_control} interprets the following control ##' parameters: ##' \describe{ ##' \item{mu}{Population size.} ##' \item{maxeval}{Maximum number of function evaluations to use.} ##' } ##' ##' @param f Multiobjectve optimization function. ##' @param upper Upper bounds of parameter space. ##' @param lower Lower bounds of parameter space. ##' @param ... Further arguments passed to \code{f}. ##' @param control List of control parameters. ##' @param default List of default control parameters. ##' ##' @return The \code{control} list with suitably adjusted ##' arguments. Missing control parameters are taken from ##' \code{default} or, if not present there, from an internal default. ##' ##' @export ##' @author Olaf Mersmann \email{olafm@@statistik.tu-dortmund.de} steady_state_emoa_control <- function(f, upper, lower, ..., control, default=list()) { control <- emoa_control(f, upper, lower, ..., control=control, default=default) control$mu <- as.integer(coalesce(control[["mu"]], default[["mu"]], 100L)) control$maxeval <- as.integer(coalesce(control[["maxeval"]], default[["maxeval"]], control$mu * 300L)) control } ##' Simulated binary crossover (SBX) control parameters ##' ##' \code{sbx_control} interprets the following parameters used to ##' control the behaviour of the simulated binary crossover operator ##' (see \code{\link{sbx_operator}}): ##' \describe{ ##' \item{sbx.n}{Nu parameter of SBX.} ##' \item{sbx.p}{$p$ parameter of SBX.} ##' } ##' ##' @param f Multiobjectve optimization function. ##' @param upper Upper bounds of parameter space. ##' @param lower Lower bounds of parameter space. ##' @param ... Further arguments passed to \code{f}. ##' @param control List of control parameters. ##' @param default List of default control parameters. ##' ##' @return The \code{control} list with suitably adjusted ##' arguments. Missing control parameters are taken from ##' \code{default} or, if not present there, from an internal default. ##' ##' @export ##' @author Olaf Mersmann \email{olafm@@statistik.tu-dortmund.de} sbx_control <- function(f, upper, lower, ..., control, default=list()) { if (!"crossover" %in% names(control)) { if (!"crossover" %in% names(default)) { control$sbx.n <- coalesce(control[["sbx.n"]], default[["sbx.n"]], 5) control$sbx.p <- coalesce(control[["sbx.p"]], default[["sbx.p"]], 1.0) control$crossover <- sbx_operator(control$sbx.n, control$sbx.p, lower, upper) } else { control$crossover <- default[["crossover"]] } } control } ##' Polynomial muation (PM) control parameters ##' ##' Control parameters: ##' \describe{ ##' \item{pm.n}{Nu parameter of PM.} ##' \item{pm.p}{p parameter of PM.} ##' } ##' ##' @param f Multiobjectve optimization function. ##' @param upper Upper bounds of parameter space. ##' @param lower Lower bounds of parameter space. ##' @param ... Further arguments passed to \code{f}. ##' @param control List of control parameters. ##' @param default List of default control parameters. ##' ##' @return The \code{control} list with suitably adjusted ##' arguments. Missing control parameters are taken from ##' \code{default} or, if not present there, from an internal default. ##' ##' @export ##' @author Olaf Mersmann \email{olafm@@statistik.tu-dortmund.de} pm_control <- function(f, upper, lower, ..., control, default=list()) { if (!"mutate" %in% names(control)) { if (!"mutate" %in% names(default)) { control$pm.n <- coalesce(control[["pm.n"]], default[["pm.n"]], 10) control$pm.p <- coalesce(control[["pm.p"]], default[["pm.p"]], .2) control$mutate <- pm_operator(control$pm.n, control$pm.p, lower, upper) } else { control$mutate <- default[["mutate"]] } } control } emoa/R/emoa.r0000644000176200001440000000272614554271516012521 0ustar liggesusers##' ##' This package provides functions to construct evolutionary ##' multiobjective optimization algorithms (EMOA). The long term goal ##' is to also provide standard implementations of the most common ##' EMOA in use today. ##' ##' Without the hard work of many researchers who have published their ##' source code under a liberal license, this package would not have ##' been possible. In alphabetical order they are ##' ##' \itemize{ ##' \item Michael H. Buselli ##' \item Wessel Dankers ##' \item Carlos Fonseca ##' \item Joshua Knowles ##' \item Huang Ling ##' \item Wudong Liu ##' \item Manuel Lopez-Ibanez ##' \item Luis Paquete ##' \item Ponnuthurai Nagaratnam Suganthany ##' \item Santosh Tiwar ##' \item Qingfu Zhang ##' \item Aimin Zhou ##' \item Shizheng Zhaoy ##' } ##' ##' @docType package ##' @name emoa-package ##' @title The EMOA package ##' @author Olaf Mersmann \email{olafm@@statistik.tu-dortmund.de} ##' @keywords package ##' @useDynLib emoa do_which_points_on_edge ##' @useDynLib emoa do_hv_contrib ##' @useDynLib emoa do_dominated_hypervolume ##' @useDynLib emoa do_crowding_distance ##' @useDynLib emoa do_is_dominated ##' @useDynLib emoa nondominated_order ##' @useDynLib emoa do_eps_ind ##' @useDynLib emoa do_r_ind ##' @useDynLib emoa do_unary_r2_ind ##' @useDynLib emoa do_pm ##' @useDynLib emoa do_sbx ##' @useDynLib emoa do_sympart ##' @useDynLib emoa do_dominance_matrix ##' ##' @importFrom graphics par ##' @importFrom stats runif NA emoa/R/utilities.r0000644000176200001440000000235312030307153013567 0ustar liggesusers## ## utilities.r - Internal utility functions ## ## Author: ## Olaf Mersmann (OME) ## ##' @useDynLib emoa do_which_points_on_edge NA rsbxbeta <- function(n, nc) { ## U ~ [0, 1] , twou := 2 * U ~ [0, 2] twou <- runif(n, 0, 2.0) e <- 1/(nc + 1) beta <- ifelse(twou < 1, twou, 1/(2 - twou))^e return(beta) } ##' Clip value to a given range ##' ##' Clip \eqn{x} to the interval \eqn{[l, u]}. This is useful to enforce ##' box constraints. ##' ##' @param x Value to clip. ##' @param l Lower limit. ##' @param u Upper limit. ##' ##' @return l if x < l, u if x > u else x. ##' ##' @author Olaf Mersmann \email{olafm@@statistik.tu-dortmund.de} ##' @export inbounds <- function(x, l, u) { ifelse(x < l, l, ifelse(x > u, u, x)) } ##' Return first non null argument. ##' ##' This function is useful when processing complex arguments with multiple ##' possible defaults based on other arguments that may or may not have been ##' provided. ##' ##' @param ... List of values. ##' @return First non null element in \code{...}. ##' ##' @author Olaf Mersmann \email{olafm@@statistik.tu-dortmund.de} ##' @export coalesce <- function(...) { l <- list(...) isnull <- sapply(l, is.null) l[[which.min(isnull)]] } emoa/R/selection.r0000644000176200001440000000336712030307153013547 0ustar liggesusers## ## selection.r - Selection schemes for EAs ## ## All selection methods should have the same signature: ## ## selection(values, n, ...) ## ##' Selection strategies for EMOA. ##' ##' The currently implemented strategies are nondominated sorting ##' followed by either hypervolume contribution or crowding distance ##' based ranking. Both of these implementations are currently ##' limited to selecting a single individual for replacement. ##' ##' @param values Matrix of function values. ##' @param n Number of individuals to select for replacement. ##' @param ... Optional parameters passed to ##' \code{\link{hypervolume_contribution}}. ##' ##' @title Selection strategies ##' @aliases nds_hv_selection nds_cd_selection ##' ##' @author Olaf Mersmann \email{olafm@@statistik.tu-dortmund.de} ##' @keywords optimize nonlinear ##' @export nds_hv_selection <- function(values, n=1, ...) { #stopifnot(n == 1) sel <- which(is_maximally_dominated(values)) ## Identify individual which gets replaced: if (length(sel) == 1) { sel } else { contrib <- if (length(sel) == ncol(values)) { hypervolume_contribution(values, ...) } else { hypervolume_contribution(values[,sel], ...) } sel[which.min(contrib)] } } ##' @export ##' @rdname nds_hv_selection nds_cd_selection <- function(values, n=1, ...) { #stopifnot(n == 1) N <- ncol(values) k <- N - n ranks <- nds_rank(values) sel <- rep(FALSE, N) cr <- 0 while(sum(sel) < k) { cr <- cr + 1 sel[ranks == cr] <- TRUE } if (sum(sel) != k) { nelim <- sum(sel) - k dist <- crowding_distance(values[,ranks == cr]) cdr <- rank(dist, ties.method="random") s <- which(ranks == cr)[cdr <= nelim] sel[s] <- FALSE } which(sel == FALSE) } emoa/R/dominance.r0000644000176200001440000000547714554263556013550 0ustar liggesusers## ## domination.R - Anything to do with Pareto dominance ## ## Author: ## Olaf Mersmann (OME) ## ##' \code{is_dominated} returns which points from a set are dominated ##' by another point in the set. \code{\%dominates\%} returns true if ##' \code{x} Pareto dominates \code{y} and ##' \code{is_maximally_dominated} returns TRUE for those points which ##' do not dominate any other points. ##' ##' @param points Matrix containing points one per column. ##' ##' @return For \code{is_dominated} and \code{is_maximally_dominated} ##' a boolean vector and for \code{\%dominates\%} a single boolean. ##' ##' @title Pareto dominance checks. ##' ##' @author Olaf Mersmann \email{olafm@@statistik.tu-dortmund.de} ##' ##' @keywords optimize ##' @export ##' @rdname dom_op is_dominated <- function(points) { #stopifnot(is.matrix(points)) #stopifnot(is.numeric(points)) .Call(do_is_dominated, points) } ##' @export ##' @rdname dom_op is_maximally_dominated <- function(points) { ## We should investiate a fast C implementation for this r <- nds_rank(points) r == max(r) } ##' Nondominated points ##' ##' Return those points which are not dominated by another point in ##' \code{points}. This is the Pareto front approximation of the ##' point set. ##' ##' @param points Matrix of points, one per column. ##' @return Those points in \code{points} which are not dominated by ##' another point. ##' ##' @author Olaf Mersmann \email{olafm@@statistik.tu-dortmund.de} ##' @export ##' @keywords optimize nondominated_points <- function(points) points[,!is_dominated(points), drop=FALSE] ##' Nondominated sorting ranks ##' ##' Perform (partial) nondominated sort of the points in \code{points} and ##' return the rank of each point. ##' ##' @param points Matrix containing points one per column. ##' @param partial Optional integer specifying the number of points for ##' which the rank should be calculated. Defaults to all points. ##' ##' @return Vector containing the ranks of the first \code{partial} ##' individuals or all individuals. ##' ##' @author Olaf Mersmann \email{olafm@@statistik.tu-dortmund.de} ##' @keywords optimize ##' @export nds_rank <- function(points, partial) { #stopifnot(is.matrix(points)) #stopifnot(is.numeric(points)) if (missing(partial)) partial <- ncol(points) else if (is.numeric(partial)) partial <- as.integer(partial) else stopifnot(is.integer(partial)) .Call(nondominated_order, points, partial) } ##' @export ##' @rdname nds_rank nondominated_ordering <- function(points, partial) { .Deprecated("nds_rank") nds_rank(par, partial) } #' Calculate the dominance matrix of a set of points #' #' @param points Matrix containing points one per column. #' #' @return Dominance matrix #' @export dominance_matrix <- function(points) { .Call(do_dominance_matrix, points) } emoa/R/indicators.r0000644000176200001440000001153712030307153013717 0ustar liggesusers## ## pareto_utilities.r - Operators relating to pareto optimality ## ## Author: ## Olaf Mersmann (OME) ## ##' Scale point cloud ##' ##' Rescale all points to lie in the box bounded by \code{minval} ##' and \code{maxval}. ##' ##' @param points Matrix containing points, one per column. ##' @param minval Optional lower limits for the new bounding box. ##' @param maxval Optional upper limits for the new bounding box. ##' @return Scaled points. ##' ##' @author Olaf Mersmann \email{olafm@@statistik.tu-dortmund.de} ##' @export normalize_points <- function(points, minval, maxval) { if (missing(minval)) minval <- apply(points, 1, min) if (missing(maxval)) maxval <- apply(points, 1, max) ## FIXME: This is ugly! (points - minval)/(maxval - minval) } ##' Binary quality indicators ##' ##' Calculates the quality indicator value of the set of points given in ##' \code{x} with respect to the set given in \code{o}. As with all ##' functions in \code{emoa} that deal with sets of objective values ##' these are stored by column. ##' ##' @param points Matrix of points for which to calculate the indicator ##' value stored one per column. ##' @param o Matrix of points of the reference set. ##' @param ref Reference point, if omitted, the nadir of the point sets ##' is used. ##' @param ideal Ideal point of true Pareto front. If omited the ideal ##' of both point sets is used. ##' @param nadir Nadir of the true Pareto front. If ommited the nadir ##' of both point sets is used. ##' @param lambda Number of weight vectors to use in estimating the ##' utility. ##' @param utility Name of utility function. ##' @return Value of the quality indicator. ##' ##' @author Olaf Mersmann \email{olafm@@statistik.tu-dortmund.de} ##' ##' @references ##' Zitzler, E., Thiele, L., Laumanns, M., Fonseca, C., and ##' Grunert da Fonseca, V (2003): Performance Assessment of ##' Multiobjective Optimizers: An Analysis and Review. IEEE ##' Transactions on Evolutionary Computation, 7(2), 117-132. ##' ##' @export ##' @rdname binary_indicator hypervolume_indicator <- function(points, o, ref) { if (missing(ref)) ref <- pmax(apply(points, 1, max), apply(o, 1, max)) hvx <- dominated_hypervolume(points, ref) hvo <- dominated_hypervolume(o, ref) return(hvo - hvx) } ##' @export ##' @rdname binary_indicator epsilon_indicator <- function(points, o) { stopifnot(is.matrix(points), is.numeric(points), is.matrix(o), is.numeric(o)) if (any(points < 0) || any(o < 0)) stop("The epsilon indicator is only defined for strictly positive objective values.") .Call(do_eps_ind, points, o) } ## ## R indicators: ## r_indicator <- function(points, o, ideal, nadir, lambda, utility, summary) { ## (OME): Order of utility functions is important. It translates ## into the method number in the C code! utility.functions <- c("weighted sum", "Tchebycheff", "Augmented Tchebycheff") utility <- match.arg(utility, utility.functions) method <- which(utility == utility.functions) if (missing(ideal)) ideal <- pmin(apply(points, 1, min), apply(o, 1, min)) if (missing(nadir)) nadir <- pmax(apply(points, 1, max), apply(o, 1, max)) dim <- nrow(points) if (missing(lambda)) { lambda <- if (dim == 2) { 500 } else if (dim == 3) { 30 } else if (dim == 4) { 12 } else if (dim == 5) { 8 } else { 3 } } ix <- .Call(do_r_ind, points, ideal, nadir, as.integer(lambda), as.integer(method)) io <- .Call(do_r_ind, o, ideal, nadir, as.integer(lambda), as.integer(method)) return(summary(ix, io)) } ##' @export ##' @rdname binary_indicator r1_indicator <- function(points, o, ideal, nadir, lambda, utility="Tchebycheff") r_indicator(points, o, ideal, nadir, lambda, utility, function(ua, ur) mean(ua > ur) + mean(ua == ur)/2) ##' @export ##' @rdname binary_indicator r2_indicator <- function(points, o, ideal, nadir, lambda, utility="Tchebycheff") r_indicator(points, o, ideal, nadir, lambda, utility, function(ua, ur) mean(ur - ua)) ##' @export ##' @rdname binary_indicator r3_indicator <- function(points, o, ideal, nadir, lambda, utility="Tchebycheff") r_indicator(points, o, ideal, nadir, lambda, utility, function(ua, ur) mean((ur - ua)/ur)) ##' Unary R2 indicator ##' ##' @param points Matrix of points for which to calculate the indicator ##' value stored one per column. ##' @param weights Matrix of weight vectors stored one per column. ##' @param ideal Ideal point of true Pareto front. If omited the ideal ##' of \code{points} is used. ##' @return Value of unary R2 indicator. ##' ##' @export ##' @author Olaf Mersmann \email{olafm@@p-value.net} unary_r2_indicator <- function(points, weights, ideal) { if (missing(ideal)) ideal <- apply(points, 1, min) .Call(do_unary_r2_ind, points, weights, ideal) } emoa/R/logger.R0000644000176200001440000000427214554271516013015 0ustar liggesusers## ## logger.R - EMOA logging routines ## ## Author: Olaf Mersmann ## ##' Basic logger object with a flexible output routine. ##' ##' @title generic logger factory ##' ##' @param output function used to display logging messages. ##' @param every number of steps of the emoa between evaluations. ##' @param ... passed to the parent logger factory. ##' ##' @return An \code{emoa_logger} object. ##' ##' @seealso \code{\link{emoa_console_logger}} and ##' \code{\link{emoa_null_logger}} for convinience wrappers around ##' \code{emoa_logger} providing useful defaults. ##' ##' @export emoa_logger <- function(output, every=10L, ...) { force(output) force(every) alg <- NULL start_time <- NULL trace_msg <- function(msg, ...) output(sprintf(msg, ...)) logger_start <- function(algorithm, env=parent.frame()) { alg <<- algorithm start_time <<- proc.time()[3] trace_msg("Starting %s run.", alg) trace_msg("%8s %8s", "NEVAL", "HV") } logger_step <- function(env=parent.frame()) { if (env$neval %% every == 0) trace_msg("%8i %8.4f", env$neval, dominated_hypervolume(env$Y[, env$active], env$control$ref)) } logger_stop <- function(env=parent.frame()) { time_used <- proc.time()[3] - start_time trace_msg("Stopped %s run after %5.3f seconds.", alg, round(time_used, 2)) } structure(list(start = logger_start, step = logger_step, stop = logger_stop), class="emoa_logger") } ##' Logger object that outputs log messages to the console ##' ##' This is a wrapper that calls \code{emoa_logger(output=output, ##' ...)} internally and returns that logger. ##' ##' @title console logger ##' @param ... passed to \code{\link{emoa_logger}}. ##' @return An \code{emoa_logger} object. ##' @export emoa_console_logger <- function(...) emoa_logger(output=message, ...) ##' Logger object that discards all log events. ##' ##' @title null logger ##' ##' @param ... ignored. ##' ##' @return An \code{emoa_logger} object. ##' ##' @export emoa_null_logger <- function(...) { structure(list(start=function(...) {}, step=function(...) {}, stop=function(...) {}), class="emoa_logger") } emoa/R/hypervolume.r0000644000176200001440000000625114554271516014154 0ustar liggesusers## ## hypervolume.r - Functions for calculating the dominated hypervolume ## ## Authors: ## Olaf Mersmann ## ##' Dominated Hypervolume calculation ##' ##' \code{dominated_hypervolume} calculates the dominated hypervolume of ##' the points in \code{points}. ##' ##' \code{hypervolume_contribution} calculates the hypervolume ##' contribution of each point. ##' ##' If no reference point \code{ref} is given, one is automatically ##' calculated by determening the maximum in each coordinate. ##' ##' Currently only one general algorithm is implemented due to Fonseca ##' et.al. but work is underway to include others such as the Beume & ##' Rudolph approach as well as the approach by Bradstreet et.al. ##' ##' The 1D and 2D cases are handle seperately by efficient algorithms. ##' Calculates the exact dominated hypervolume of the points given in ##' \code{x} subject to the reference point \code{ref}. ##' ##' @param points Matrix containing the points one per column. ##' @param ref Optional reference point. If not provided the maximum ##' in each dimension is used. ##' @return For \code{dominated_hypervolume} the dominated hypervolume ##' by the points in \code{points} with respect to the reference point ##' \code{ref}. For \code{hypervolume_contribution} a vector giving ##' the hypervolume soley dominated by that point. ##' ##' @seealso \code{\link{nondominated_points}} to extract the pareto ##' front approximation from a given set of points and ##' \code{\link{nds_hv_selection}} for a selection strategy based on ##' the hypervolume contribution of each point. ##' ##' @references ##' This code uses version 1.3 of the hypervolume code available from ##' \url{ https://lopez-ibanez.eu/hypervolume}. For a ##' description of the algorithm see ##' ##' Carlos M. Fonseca, Luis Paquete, and Manuel Lopez-Ibanez. \emph{An ##' improved dimension-sweep algorithm for the hypervolume ##' indicator}. In IEEE Congress on Evolutionary Computation, pages ##' 1157-1163, Vancouver, Canada, July 2006. ##' ##' @author Olaf Mersmann \email{olafm@@statistik.tu-dortmund.de} ##' ##' @export ##' @keywords optimize dominated_hypervolume <- function(points, ref) { ## Possibly infer reference point: if (missing(ref)) ref <- apply(points, 1, max) ## Sanity checks: if (!is.matrix(points)) stop("Pareto front must be a matrix") if (nrow(points) != length(ref)) stop("Reference point and front must have the same dimension.") if (!all(is.finite(ref))) { warning("Reference point containes non finite values.") return(NaN) } if (!all(is.finite(points))) { warning("Front includes non finite points.") return(NaN) } .Call(do_dominated_hypervolume, points, ref, PACKAGE="emoa") } ##' @export ##' @rdname dominated_hypervolume hypervolume_contribution <- function(points, ref) { ## Possibly infer reference point: if (missing(ref)) ref <- apply(points, 1, max) + 1 ## Sanity checks: if (!is.matrix(points)) stop("Pareto front must be a matrix") if (nrow(points) != length(ref)) stop("Reference point and front must have the same dimension.") ## Call C code: .Call(do_hv_contrib, points, ref, PACKAGE="emoa") } emoa/data/0000755000176200001440000000000014554263556012123 5ustar liggesusersemoa/data/cec2007.rda0000644000176200001440000010314314554263556013660 0ustar liggesusers‹ìýTU]» Ó "‚"¥ JÒ릥CJJºCº¤»¤‘Vº»D¡"¢H ( Šb Öφ­Çóüçœçýþ3ÆÿŽ3¾Ç1¦ì½ïsÍ5ó¾îëšçdÏó“ž'ÅÁÁÁÃÁÇÅÃÁÃßþH€·ý.Ξí¿ÄVü¼¼B88ø¶¿’mÿÝ»’vù¿HþIÿÖ„÷<íù'ý[é?éßšðÿ'‚ÿã‰ðÿx"ú?žˆÿ'²Ò¿5‘ÿ“þ­iï?éß™þÓ2“ÈÑÊËÊÑ}ûåŽu÷W‚‹fü¿Žp3ñ³ôøµ,u÷ur1sóøetÇùþÓ7þÿôMà?};óë2n&–Ž~ü¿¯ú_}=ý+7ÞÖ6||þã³È_ž‡ÐÂÑÌý×ãü~Hk3 ‹nÛŸ~ìÁÎ2úß½Œùߦ÷4î›þÝÓ ÿmúw¿ÿêÏÿíôï.¿ÿ·—ÿ¿»ýý“þIÿ¤ÿßÓ¿»ÿû{ÿùï.¿Êÿÿvúw—ßÿ6í®#‰ ˜ÿW §Oã—Dÿ¯Ò?ùÿ'ÿÿäÿŸüÿ“ÿòÿOþÿÉÿ?ùÿ'ÿÿäÿŸüÿ“ÿÿÿäÿ_ëý;Ø?çÿsþ?çÿsþ?çÿsþ?çÿsþ?çÿsþ?çÿsþ?çÿ¿â|L,ÞOœÝÈWÿ';!ÖŽÿǵ‰°Çü ö_åBŒ=–èûáý ö?Ÿé×5=3þ¿`ÿ3xœóçñgÇûãš¿løÿì$܃èûÿ ö¿¾«_uâÏ{ÿOö_uä×±–ñ¿hÿUGðÿ¸ß¯rû;;Þ×úõŒÿU]ûïì¾Ï?ëÖ¯{ýýÏwJðÇ}þl›ÿ“ý¯uõ¿+ëÿÎþgÿóÿ*·¿³ÿz&Ü¿\ç??ógÿk›úUæÿ]›û«ý×{ÄÇùÏåû«Îÿè/×ù¯Êý²ÿÙ·áþ¥\IþûŸýß}¯ûüýÏ>öWùïúàÿÊþç=þøýÏgýŸì¶É_ùù³®þý¯}ʯgû³½ýøc~µ­_åþwö?Ûůrúu}üÑþ«n“àü·±¿³ÿoú}¿üög}ÿ¯Îù¯ì¶“_ÇýuìúŸìÖ_åúç˜ý¯Øÿ:ÆüY?ÿÎþë÷_ïçÏz÷¯Øÿ|F¿\—à_°ÿù ¿êÚ¯òÁûì¿ÞϯvòçØ‚û/ØÿZžæù¿*ï¿Ú}ÿuÝ?ÛÞ¿`ÿk!ùË}ÿÎŽ‹óŸóô×2þWìÿ›ùïŸïàÏ÷ú«lÿÎþg„÷‡ýÏ{ýOöõ¸ÿÎþ¿íÿlø8ÿ¹ŒIþû_ûè?ûç¿Îþ+ûŸmç?×ó¿öÿ•ý¯óà?ç„ÿ‚ýÏwûçüîϺÿ?Ùÿ:Fÿ9¶üWcø_í¿ÞÁ¯üýÙ¿âþ ö?óô×¾ö¯sÖÿÂþŸV£$¿È™NM,­~-;·¿¸¸_Ä~ÛãìncÆoânîóŸp±øõ¾“‡ûœênöûB6–V¿¨¢Ä–VN½ÝÍþ•¥.f© ¾¡çt„ì¶ +©î)¹ðpa /Å©çD5ß»’\f Ó…¹ÞÙšÉÇ£ò±DÕ†Î>îˆ.ÿPQoKtã—£Y‚ç’(ƒa°>ªéö†tõŒÆ¯¿€óÐJø  A·e’PMW©¸ŽØTS燈®ù2ÄXlçrC‘v«Ç5 TŠôæHTûÐxF®Ýy˜îüòÑ€R>;›UÑ@ŸP½‹g3ªygd‘¤ï#˜&8XU”C„ËmËÍÀ'¨òRsúUs]TÓ¤h<âG# œ¤²«äàkÑLø¢Õ Áû8²õ;¥K–+‘ìP?û˜jÏkÐ5¹²ºÓ {»z&@­âXty}ªô°Š”® U]½Ea}2ÛÞ©¶¤ûBÄËà~Ñ›i©[ä×·ŽjØ7¨õ|”[3£P!®Œñ¦1„DÕö¤O¼¨iB5õoex°9¢²Fç]½Ý4•y‰ËÌÌ¿Ò?ã]„ð+•#ÃR÷‘Þ’ÇÜy\È=êÈ1åOAàyÅ=4{@²GF·gª¤¦ê ^lè#/~d FUWù9úãÎúÀSPÿBæ„ òRŽð`ÏZ&ò†éÄþû†ÂÀû³ú*¾ Ö4Æ-ÀêÜìT” E7ù•&ž/~/·ÉŒ!r‘^¼{¼nåi™ƒPÎqa­“Åລ¶O/n bæ†ô(£)€Xbþtuep~Ÿ"Nu>)—åŒNÀHG÷Õ7:ø»Wâ£à/ÂâÏ„·»<Ý ’ÀuOðu±ù°~oºt¦Y{xjäá8%¦m·’ÏÊÛ/ï°7*õæ¼³çÙÇk¡é ¸ð‘ÁEsôâ—„Ã×iªÀN6ۢ9rÎR;|䣾1›C=*ÖÀèmioAS~¥{þ|0¦ˆŸgú–ž£Ÿýœq©Ì„ ‰¿ AÍü'a›Ÿ€½­‚S?ý*qÞ)|Æ,ˆê±IQõøÁ{ëh¸y@'Ùìf“ Xø¼æ°9®¦ ËVé‘ûÀ«AýÍÚ xz×>(a·îÐqK×½Ó ¤À¸õòmm…2Ñfô%Š;Íj­Ÿ@ò‹ ¡nÊ|דôø7)Œ¥¨t®È“·‘V@úº¯÷2Þ,Òw+.U÷,¨Ÿ¼z41xsEOö+ȱ´·xW½ˆßyÕÇ]+™TÏüGkqd‰è}äIÙƒ'Âý/_íŸH¬s­õ%2HwEŠu»>Ñö'¬~¦"#äÞQù‘g>·ÍÕª€ÄÖ³N„" 4”¬ç§ß¢ÒDå¢ýìr y½Í6ùÆòjðIi‘щ_ùš}‘õM7#‘Ï"¤’Z&€Q±—f%ó0δfšú"Wc¿Dái£Î˜ï1È–îx ¬[þÊ/XÌ”ëÊ!ØëuÍÄYqà„Êã©i¥˜d0ØHZ÷< ïøk4yCÔuƒÍKPz±ŸK9àd‘6^\~ô¯ëu­„DÒ*<Jç³™º¿ú`ñ©1’=|„¦Ï>+•sHe{ ”„v3Á±ÿ®ð£5½dÌï‘ ­Á׬L‰¬…Áèð‘py·¾#S¯Àºdú3RØt;#fòR'íCqXŸAâÃXD”²rÀEñ&4ÍH,óx>DÐ ª2ŠðƒA¢@#Ýa ù\÷q«K¥Y}+°â0åL4ö®(#Ë ráúïBrÚñ`°ºü<Üï¯O¨_‡,ü.ʽ^*TN¾¹ ©7í·àÄs« ã^íÀ©nt¡¤ì6œyo2­ïC bîCÓ½Z…ÀÏOÔ¦ó^ΊÏoQ€$áá³3{”Ç«äN#â8„áªÔ:7ý¸µçu(ü0¡´g)$?UòÞïx¾šíŠÏä„ÀògëgdMoŽýøÒøÎÑ¢‰`P@¤3ßÞ 4né¢W;—D¥üñºY£W$‡LÙ¢Þyw‰9~Ô/ôpz¼£kðoïR/x&@;÷YɸÞ{´ôfÿÏzáŸÈ¼˜òܪ\¨±çÝÞtŸçUG§nÎÿ0¸¾Vs|ž\|ô“gpE®L±× £çL*5G~_ïígEVþ™8ra!îPɲxîd¼emå/;œzÔ*“\‚¼§œŸ5ü|\s÷´š—€i&É)!¸¥ †' §;ß§e!r߃}-Óo¢Øû=Ü,û|Â|7rÆx:sñ‡¹üaiàÃöÇ«^ó|XNÒ±²ƒ½%©]ªó‡¼¢KÍߟ³ÓÁàåB*pi¬¤é¬FV¢Ï.PŠ -ã§ÒøÑ P%{þúаòŠÍ9UÉbŽ$/"îÓ´H‡:DZ©!C/ž¥9Ähb~~¸‚ z·]œ[=‹äKgÖ¼ªƒÓÙç/!ë9ÌOÚí|CÍX3i+ÄílD°HˤiòB¼—ÛIäUÔ1o¼îad¶EC¯‚8Ôkö»¤£Èg¤ÆH,~{œÈÒѤ‘·âO—ν˜^] çcÐâù@>êe{âVr³òó[ÉRnAÏáÀ4éò)!dïeÿXB²aÜî¢5L޼¥O˜Š,‰Úý«<·©ó@ô˜³‡æ¢òöÕò‡ºÕ8Ðñ6©IUp¼;a³.`%ñBÞ@Ï2ðßõ§Œ@+Î#>}ðX©µ_Ü8êÜëït¤ÏAuýbsÇ…}Ûó4~êNpèéo%¿ò TyS.â½:AÇš×OµÁ¼ˆ—UF`´)HZÔÿ­zG}ˆ}!m_EÏžíq¨âØ·•ŒlH¹¿Ñ%4—¾ú&´Oïßæ÷¨ ŽBÐÛÇË9X¬xdG¨/?‚c±¥ñ¹¼¬ |‹Vvu™±KêÊ«¯_ ž> ®êC`âªøFÈ`¡ËδSöv4pÀ€ ]Ù\ݬmÌ0b2WÚÈñÎXÂã{õŽTÆÉS ‘Ç8 AÛ“²V…8ãR‚Ú ødÁAT°drº„ˆÇIÁœløu¶ÿkˆe¨&ácŽ<ýšÐÖ<”¼j£Ê”ŸPO!ŦrˆJ´íâ¹D¬9G ëƒúmÙµ+7A–2ŒçÓM°nT¡:®½F¯}è$áÞé\Š®ùbèœ\P!L¡„nÞ £÷//C6”ØÜí轡šF½n‘<ú1óPÊŠÐÙ…iByHP¿©¿4ÔÖ{”¹¸BkLFßd8M´7ÒÑäC"ZÙUlMß, A¾Èƒã÷!’"íµÈ)&(9ðHU_ý8pÄÚÕ~ƒF?y,4ý|»I[øR€–qå$îÏ(›]ŸÆMð ‡h Ý™)àÂW±j†ÔWéÙ¼™jˆZís±¡4å"z¦ì{ û¸M£'ÇZï£Á5.Oß?‡3Zã¶Þ—«\™ѾÔOâÝ8¸³yýcжÂVû”zûJ""÷2”#Ò¯-˜AÊkÁˆ¹S4ÖÞ¾é¹eq*½n$†à’I—Dßuð÷}2‰Þ›GÇ¡xe7sŒ£ÁCÕù³íÀ$¢+ô–ÈÙ¸ø›ÜáRk¥rfx?Ñìñg‚þ§.K='¦à½×XŸ ß´Uèj…;±·{`xƸðÈÛ/@›]K)d+ÁƒG?F}»õ™Ïï_‡Òï8®@-'?6ŽŽk:9Äw¡Ù&Gki:ï[¼“b6‚R»¸æñè0¸áèFϺï\}Áœ]): ÅïúØ fs‘Jï±èÞ#•È=ÜÓ„O†êH‹òg'<ÀkBÑ2sÈätîÅO¦"Íu “ }‹¨Î„¶Áàñˆ¿pñó|>E7·¡Ôô³v$©†?aºI¹KXÄ€•…ŒÀú¬QË2ò.òà*w^~2gÒöåH‚±Ê˶yŸš¿–‡Ú—¯C¬”‰ÜBó"¨ˆpVñ̓ÔtmåP}â d¶\ж£€F­ ÝQWp¨¶È¿¡¹ž K “àš¤,ŽxÔÿ^G :‰ òo¥ðè$£æmkè3‚ÌéMB‘¯ÅÐÃßráÝ÷yèWß®Š+˜LfÜ…†¾œÁ"\¸»|sÌ "nÅɤ‡±Á{U±F«Ípc±>&ÿø9(=üáÒe ƒZçuv¼hRŸ|´Ó W^o1"u¶PŸ…êË÷†ªÔ*™}ŠŠPëÊ6»Çà„7+GOI·žÆ3‚œ®¦éލóKmͤ—*è)ë<§•X|(ðš­~½ð=e, fi·a°ð­K¤Œã)Ÿ~ÜÕp´“Z­b¼~ŠÎ±šv- ?!ñâùý{bíMÉË ]ôvÇŽÌBë3u*q¹8pÓ›Zª•“X”Æ,`¸m³Ïj§çgîĦB‹ Ñêµ1(QÑ‘ápï„Ò¹o~"¡xP#cLæ> ÝI'1H«*ŠÒg„“ÃoêcÕhˆTÓO(VÓç´Áƒ'‚§tC'!-˜É“RU²:ì‹oD«@õNoó&·;1Ÿñ0òÞº]Q<&qF®<¿cßcgn|2€ æé4CG!6{øc»‹á3û^(Ä¿ÜàM®tè‰P¨¸ù]nRRØb€¥o§d‡¡›ZãÍ“\5è® ºVíZm+m—f!Bš@:|zðb|M…¾¢Lf†‰-4èÁ×üOµN09tëÈH!<üY}„ó‰ô`ó5Ž}Þá+™ýK¡0Ü÷aAˆ|²kL™¾*¢§c ô¹Ò  á­êc¶ûPvvŠpõä”Ý8¸×…Ĭ¾8‚*S¨Ï_¡låƒJJýz,ê0²ý£ƒ_! Åx >“ΆQ×fiÞï0"ú4â±W3ŒJ^pºS™Ñ_ÌJ÷Âù»`RCXØ.½Õ#PÁ¼øù‘x ”éßßz󩪧ÃÒ<®TAåLJJ: åPí0qºãè‹i>^€Æ§œËµ ¢£¦;“ìŒú8²ÚǑ½ìÁyŠ0*àt{R8VnÅxaë§Ýî­?‹Ã¤fà9Ó˜×£ß ÕùâÊ{ž'@‹>ÃHÿœ&T[Ф›— ¡áʾã&h¸0|ñ Üq›¡â©q‚¥bí¹À’/°`ÂK« ó©³\°pÙòÑÛWÌèÐmOu·óùòàz%ä”Â1’?ÑÚ±9ÇQ¨”®‘¡ƒ²ý›ìý/žBé±YžC׺ Lç< §œ`Ÿ#%MOÔ×'¬È>òò€…ø¯ß¬$ïÃBkm€®ãGXšæ Zˆ} K_Ÿ9ÆÉÂì•sâgöÃü­™$ü×…°¸+ûg°0¾öçæöõÏÓÝ(R…²:K"‘‰U¨xò%uë#Çïü¤Éæuõ*ìƒR^«M}†Q(¯©ÂôÐP6ÌQ0C#Û4×#`i»—6ì> ›{nÄÂꈚØÁrXÁT³'Q°Pˆ `ùë¨ûöР︗ AÙ×êfŽdz¨øgÑ›Óëè£Ãh㉤Ò)èC;Yá# ±Çm^.œ²œ¶ê.‡¢}+¾É7!ü~2gÒÓŸõÚG6!d¥jßrXɤŽE~åCb¶ºÙóЦíÚFÙC!ÅÚÈ>Í´1YËw+cmj’ZTžEëÍýQg@«Ÿ¬ÿ軆ÖÔ)=¾c9Ž^TiéÖ@/Sc&‘ Jº&f+øµmÈ–BãbYOjº¡Q_d¿dCÃoÏØËJù ¡$Üß_‰&ÉÒ¬5ÚH¥)f¸Q€Ö<µ ’CËñ^¼?‡V³tËr¨~‡†!ÿaA!z´FáåÔã¡»híîøˆ~ϸø¡f ô'ZÌIFCæOãÌ©h¢;ÍO «éW#¾7 ¾Ê—8Ò•‚Ѱ$AÇÝÏhìöäA»ù2Y|O]– :ž‹¼˜ÕG‹}žoT'Z‚™…„`ñ¾‰y&4‰ab3W¸­˜vÎA÷ö£YDòŒFähéj,ÿGÅ‘¢¥-ú¢ õ»¼¾¯æý+48ÉåëúUEÔcŸòã—²¨ÇUÜ9ödK4Ääé[ËXÔmdÅ¢÷¬0bëVÏ|+½áYW‘Æ é¶ßésÑêò¥¥¶~#´{g¸õBK–µ>M£©¥g¿ßN=‚¦÷?ˆ‰;•‡vïö HYv÷*x'ª>_0ãâ’’j·Évú¹ŒZ°‘“Éjéõ t³K9¨Ù.þÚÊ”×b=,ÐNÌlYùÂïû2ÅîÁ›ÃE3pDè»´ íècÌŒêÅÈå¢óUÑAWÏ–+ZhãN5Óm%‘ùOWÀ;yôØWsrÔìøÅúü"p~Fh,ttC/¯è7¨“._â›Ï×Ps…G ìr« ßì/ «·1Þ-}hð8B¢vnbûù,̬Ûû&t§;­‚žñÛ—tå&ÚŸ×x’B—”íÍò*îó±½l¡.Ñà=r¼ÄÔ[.Þ©ó× !æ{Å4WK!ô§uy=jVÄE5&eØõ£¨ŽAè8]$tÕßó‡ 黯^ í 5o<Ì&*ƒÿÕ“/ uPMq[ëCÏÈaz{úaËwÛh6QmÆìOí\ ´3áö¦u½QµWOÄIñ ïzz5‰ŠÏàåàÜ›Æj‰õà7<‚(§Ÿ@5 ‰ZǬeQ ^Å›dÛë¸o‘Cíº¿ïo매°éL‹ž+ß;\tø(Ì`J ?rû®}7}®Wš|lÞV²¢š\Î~|Là~l¢ð‚¥È¯ûƒ"x»¹2Õ`Vd®WëTñx2"Q!ýÔßžEO?ÿîöd;Î*ßI& žª&¤æE 4á¡lø±Q‹˜…Á˜Aºyx2= Îî%÷ŠeÊTH4Ø´½.}ë}¿[(r§×0+EH™|¹JYÁsúß³pU"ݧê7 hð“ÓnG´!ßÿ U*袒ÓNˆ ï>(—ï¯öëïGfÇ9½ÀYžÈ#á¬.ÄÙQm÷ FÈ Ï…ÛOy€ !eþ 3xê)ÙÕçõÂù¼ˆë–7Aó3“aû3ä“ÁÇ'_‰ÉÏa™ï‡9HYgKLk» ª×äNp~bÅdyfœÆú8^ïMè€ã/jŒ]Áì;P†¿>êNvÞª²±y þ\²š¶å¦ õ8–sgBÎþÈ=×iBÀç,DF7rô_³Þ{ǫփ{A`kyÑÚlŽ QÛÉ$ù‚àÙÄاéEU;íˆi½¶«LMó%cöžÝÀ¨{VÀõ db¦¡ã鎙ªÔ@Ä¥þÏ~’àå1b!ŠB5#uçwv>È»ÿ‚ã;dÖ¿êë4€ð’yV‘§Õ uNè±p¾H´yWñ+œñ;±‘G¬AŒ‡÷âé´PPóGìA3­´_sîÎ!ncɨªé;+bç p^RðaÃgMZw”õäÏWq1g ¬'`…ÏÉdUö~ŠßvôRô%}pÚ¡7çÎÅäß8$µ[Âæó‚*8ì,úŸp“öÙ¤ƒÂÌÂ_”‡'7ûÕ½ùÕï?ÖÕ‘¯ƒs¦7Ö~á ;^d°|É $¤Âõ{lìÀõ—–ý"È;Mäxx¢ì)T7sØÍá\öï8Í)dÕ(ùݽzˆ‰<w¶€’ÒÙü´Æ*i¨y¹6Ëó%#݃"@Üb~€¢k%Ø]0VŸ ˜ÞÆI?oNò0ÎÒ±jàœ‘o|92 2×è ¹òA>0Š>Qü ¨PÜ5:š 3Wy+AmA ¶Ï¾JÔû9Í'¥RvJ'`aò"ìÓÏÓ} ‡®œÒ9¾•'>GŒÇaÿƒ¾ÓLåpê ÅiŰPà©ÓþøFÈÇa×ܯª/@öKþ>íÈn° ,¸“pû(ø¯àÊ|†´«¤€d6pÈ£ö1&y‹ZYŸâ—vs€4–ÅA6ðöä{,{aÌt¯)᫃âÌȼuÇîðÿl_¿Äç´uAk·ÿG÷ö‘Ÿºî~.$¥µs`"Ýaíö5¤7«Ç›”C¦1ßéÀưÅϰ<Ýùë6½‘_jÀf4<·ñÜ„a5 ^½Š4e}Z€ðÔˆ0s¦zpÈSæ©€à €é gŸ,mG!â“Ë\¢(^h•8ï v4~Ñ8ëàÂÆ½Ç]^ì?©Ý§yUjØõvÓÞM·%¯íõùÉÖ­G]_T1ŠTªßƒF‰ Õâ¡È}ñ^³'µ¬TÍ ƒ ZúyLΧ4ÈÆöSWo¬¤Üäé‡Oiާyp!Åpk4+Ý2'Œ — LúU‡þl/¤×w|¢ð‚”Ýù0М»µ®fÓ5g—)ÄaÃ|]8ºâ¬ 3o¥sû”;È>¬×ýd صQxòÙ­{ƒ`|Ƶšúޏo¸.Þªº‚|¯æé®ÓN@&z%¹Šú€òSçOæŸÊp(mò¦È£ ßõû£´ /kÖà Þð‹®i8Þ{ N•­ÀRQ§Ùæà÷8ÔÍû“];ÿñ8Ì’‘¸vÅ/—¼öÐÞt ºïše˜aç°ë8úýäYpØ"ºÃïÅJþ¾1“yDHnp&“®‚\†`ô$PÌùTop|A>±`Ö¾ôÚŸž±ZÂi‰{V/ Òq0.`ÐJ5èò=?öwfi#+¶‘ê¢`jÝ"‰’¿‡Gf—äÝ•;{,¹‡eàüûÊêgÚ c›’”ôÄè·¿Uòp5Þ÷Vuàx×åÞ—Ë Ô!7òS?Þ$#$)P®žH.ÆÞK>òæí gF)v&~¦+m¼ ˆ& %(é'V9*’åÖ7‘FŸ¬BÃT°h"¼d_‰Ü0¿N&=ð´Í”=Ü2‹9tf_ð¥$d`™Õ•2âòÆþɆŒ¼>0R4±œ`@>3z®ÉôÁ·jÖ¤G|ÈMé&—UpèÄPl'ñœòÕÒ¢â¬eÿ‡ «´ZíX.)13ó-Ä(îuýu ño`K…×ÅlŽü\ñZŠõ•üC2Føs)ÖÝG¾~§–[½½¬‰j7¿yòoZá±ÁÛ€g-^ás6ºzÍ(.ï¬×¡—ãÑ7GÃnÓkLÔ™¾ÈBùÓJºLpq½>&®vnü?}\ úïÛó˜L!áEé¨d+Z_2a~mIŠ‹u¿ú¥®¹Ë¬Õûé€ùPñI½2àmœ¨ìYØî·¨ÄhqòL@t2w(^N=ˆ³È_‘˜P,¢Æ›œì gJ¥œá]ÏËJ“Ïê›®¼øs¥Ô¤æ‘iˆ¼ºÿ&Êl.é’ž` \GÞ ¨M¼è÷A¢È¥èpãÄ‘«xì~z?g€]”óp O1âBçà[.ò¤ö[×]·œcIç_°C^g‘[© D^+%!î~™@þX°hÚ‘XzbùÝ] ‰vÈ窷:ì_*×U†“'…\êÒÃ!uw}ˆt—ö(™w ·.¾ ]TU<Ù®î5tÀ@Y=è—" Â3´ñÜÊ€æ»Í™æë@“Ç|æw!ÈL0áÜ?Ùƒ¼W «ÎÓ³CÞ;óÏ“k„è"ÙdÎ0ªýü°n’œŠ?UX>‡ÀƒÇ-Þ\€”°®3¢d‹Ï˜é ¹´¹G¯§Ÿ„¬Tµo:f >­O¼âf{êOâ¿S¶ùcŠ]I ‰WZi7ÒŸ»Öæ.)ƒà=Ç|qeRPUÉ v&qéËÌ–¾þ2H[ŒE‹°D ÓÖåe“y(m`pb¤ŒGJ‰÷4 •¾§M»%!L4bB!´ ï3—Ç/ÿ;²J´ú\ˉŠX–9ßXbÏ:¶ºŽ¤ÓGÙ·üL Ì ÈfªmÏC¾ðÿA<%–>‘Ó—x¿ÜÑK`ð ‰7ƒ2ßú;DÈëÌ÷ÚwªJ…Î7ï„bÂQæ¾A(­ªâ…×EÀ»ü}}¬ˆ Dõ?XÛ]q.«xæ&+ õìßò2Bînð¤Q´!«Zߤ?ŒÞÚÍ11MàËMìð0E^XQT1p]FÆcž²ˆ‰Ã¹¢'Tí¯ÊßÞ·°V8?³’¾ì#Grž‘õËŽ#cZ kÊ’`çÓi ÷@dĬ!=öéˆðšasöŽªIdƒ÷©¢4i3ì—v»¢ÞŒD ižï@ÚŸMÞgÏÇC>¼+vKº"T~Íá-WátUØ¥OoਖÌÇû.|phDü*-ÎØßØz¨2Dï 0g~» z¢2w««sဖëÔy=äKB€ã¦E7)o´–å®ÒËç2äÓïDña¾|äsÜõéüìn`¥ Ý”=ÆÐ†+ÜÎÛ…l™/höºƒùÙôî~½’–­«÷Õܤ‚Çn¨B/­‚ä¢\~÷é’T7D) à´ÅÃù¯fC4͸•u* ‚"‹%Ç€÷4øÞv>Ý.Uúü˜2$g¬ZºŸe‚|Œ{g_%¸œP¿°´b ’[GÏr¯ŠAΪVµz`cÓxoú˜RÞ.”+¯@¤éê¶Êf zr銯6’dãy²ÉkâiXpØ/·’¥ D€a“ºªÜI>äzB’üý²tÔSeˆâ%78þü(ñ‰µN 2 1€³Œœ­uÔHWsé)S!䡳º}U ¨á&Œðû j’•ÝÄ µñå¢ÍË!HíOáðg†zÞ=MÄÏAëý7²À² ()ýôT^!8s*Ÿ[©0‡¤g?Ï‹jÝbO.»ŸÏîÀáû"Ú{2ÂP)»¸¯!U‡Ñby ¼Þ_=g ,yr@›~'p܆ðO6<ý †zHÕÁxAÏ,Cïž‘aâ¦pÛ≂ýè,4Þ_"ó®‹ŸUyZòBfù­ å‘ú?Ô{R~\Í/”âiT2!S³1ø7TÐZåQÝ›ƒ4›K"FÒÌPÓ–%ÂÓe‚oJi* .dçC·]˜æù68S•J{¶›~À\WøÖ8Íý žƃóX{Ù¼˜¥C5˜×žw 21®X&j¨ÿ~mìb ÈÞš£ùdÒ…rá'‡aYEL?fN>ùV *{iR„ýÑàwè Q¬Ø+~q½"§‰,0ŸKÍ“º#%VA­Y0X"– Õ…FUßz}ÃÊ1ËÍr½çÿÔ ÅÌŠL{Û¼Æ!åú’Ú¯\¡÷&~]á3 zö|à´Qò|y¹/ð²ÉÂ.{£A&ì8²Û¿wCR ×äóáëkgv§¾—bòâ­$ïû<ÿ ÷Ž”Õ7%§Àü;]úýŠ0ŽÅR9g\VŸ‡É&›üÍ=Žps×O cû1À·  ãþ¿<ôGºÁï&sà1tm¤É»‡LAûžÊ¢ºQènï§ä4ÊfJwêAè²Þù¥SGW ~^ˆ?W ¤„ÉZ¨?ñ"O[ÕgÛ¦Ôš”½"î¹$RÍsUK¼ #ýðŽå9#7‚õ«³J#P-"Ü‚îºh¸²"Z–Óþ¸3D;î¹"Ý)ƒ>kwñ˜²ÿü,£Ö]çZ#EàHZ’‹ÓqäÂA<”ƒúêÝÐ$’Ï`\ "N{N¶B~aTàÊ’˜×eÇÏå €å‘£ìž-‰ŽCž.Ò …?`½ë 2Ü%~Ð#ßèðÅëô  ÷úSúwø) ë?íÁâI·‘9Šï÷PþoÕ ¶+0Eæƒ/ÿĆûÛ’&JnÀ@æÞð˜/óÆaD4¥ˆP‹FF6p}ýoAîöèRÑÃR|’ȼÅ4Qʾ+Èt„r-£«ÖQ¡w1âsRøìE¨,4Æ”$TM ‹N¿-„ Ì•c6Ï'ž…Ñëº2xÍû`ÄïXŒŠ¬?ŒFí"ÀôöbTºv¦0‡§ÎÁâ.•ßgâFyÛ¡ö¤då‹­¨×»vT^ªLß5šXH@õâíPú3Ðä©C/´šjDMÕ]¡j΢ƒÑø ž„®p_ŠQ™ãæ°zèZ—×Ýf˜9<£I?D cíÑì• Í0M¸µ~‹dfŒlæ—OA îN@ëþ ϺºH¨.^ǧ‡&ülôt4ï¬@-aLõÍø½Ð4ÇæqòáöxqƒÜÃ°ÙæÛÑΰŒ}ž/¥ù/¬7a[ƒÁBé€ O¤b„”ï”Ór'׿P†Ä”DZAJ+‡\–T´à©–ß¿—Þº¡f…BYÀ0E4{kGHõõ0=v’\Jì…•ˆ£#»ã4z;oJ;i!Üìšž aÜ¿„ÊØt #òBƒîÓ¹>}À n7×kE,‚’DßÌBk;x‹þ ß:Ø:ΩWïë‚Ëe3ÛcêJGX/éÓCˆŽÍò@=‘ÈÄJQ:°žu½j…ŠrÑ’ÑÚ„#–éè½/BÍ…§sÁü^ûøJ2Æó.•ÂFu/“©ZˆŸØÃ@öÇð©£¼B Ô¼ÈBþ³ øy}<ɦl04ƒï h9&ºCÎʹ˜l/ÈC±ím˜n¸ž—t ­1ŒIM¡ËEc} \;´ŒVù?¹ç2²…ÖøHü„} hýÛïvµßk_>û„†š^¬6•ë@cwýh„½ßÝ#¢E¨Ûîz Êä]~} ˜©$dE«7óíùWÐÊogWr˜ªÑìwxgÄØ\Ðbì:´ÕÜû–QGZ’ sLêG9Z–uøöyK9H2NŸUñACuœèç†ôÐÀ.œ˜”ÔßùD0‘RêSªQÖÁ—oùJ ¢ÁZo¥ã¡¡SAÑ^†e¨&ó¦umoè]ÌIzqõ"švlU¢YÂ9çpÆ¡ôGs©•þg¸²xÞ“üpZRâ%_+* GiF‡P[ó³ÏÊd!±è´—úþVÔþô9ñåÖ#¨¯cè}}¸Ö?Kýrñ9X‹žžòÈ¿‰^š6 •¿Ò Ü>¤±‚z˜òöBÚ<(Ê–ÞBïÔ¡¹ò ´<¤@G½³½¹UAxÐÁ„ªö´ŒÐ@ÒĽvEMù2ï§v í*ÄLpéAÂøiidË¶Ë ƒÆ+NþÌ9>»PDL ¸–ᣰ_öð‚ª·×Û_ñzV.pRÜ÷$ÚÎ"}ñ]9ÜÙwÑðp?¾G_ަm#Ùò‹À5‚Á}˜ £:ˆ(Äúe,óžÞ(‡@£ê ÉÉXTc•šýÇöúêåNØ9ªò \âÏ¢ˆªR²LÔŒÊëëfQ0'½Äìš÷Ó\,_>/‚ÝáÕz|Æ¿h•‡ñçjË)‹oà¶ÉN:páêáí¥(z 7Q«VC.Áv üy‘0B ö 1˜h!rfˆÂ Cle ™ˆÜ¿e‡žëR(‰K0ôÞóîø=ëßšø˜ö‡Lê9-v¥Žj>¿ð<Ûâw†wKTCt¡ôªå LcèYµe»›_TkÒ+«]còz?n´Aø—–èeÛw¿Wü§åÃËpür>TýÎ}c×­†¤ñT\—êPMÒÀy|Þ3èáéUÝO!Ç”ãBßL+Ô—5¯ªû¥@ánܪaÖ+>¼Þ 3;ðÔy(Ыj ¦¨…k{Uï¹ ¦ùZý?ø ãöw|ûûþw0;¨ÊÙ æ%k€vz^ók¾„Ðܺlq 4‡.äÉ*B,ÍãÓ³¸àÖÿZ²ýñi8My}û4¸¦û⮩n(œ0™ÐkæþM-Û¨qàå”~c;M Þ˜ñÖ‚ S3›ðDN}.wÊ\UãŽÜ-е³pYË·_Š£u| Zà*?°ö²‹JÒˆcÌ$ø!†8HÝ-³[’g4¡g?+‚„íY®b’ø|tǬ4À”º%«Ò4ô&•¶†iô þ(Ÿ±Ë‘kàJí‰Gš+g/8¸ˆùŸ‡ÊÞÛKºÁ£èŽŒÜÃ×`JeC:Bm%²?ÎŒcƒ îàäØG&P5^+}•Tü÷î7õK; É¡]q=Pމª´}ÉöC•.ðA`Äw‚Âoo!¾e‡ˆÂöq@Нþû±»`ΙÔÅ.ޘ𠒈³9F]À›u±Zo À‚¡lÒ¹ 7"rãS™g ëŠÄ­ÈšSfU>©Íÿ¬­ø™¿µ*u„bÈO:£ 2W8*âÔ¼¢zyY÷ØõA6°2É‹à‚æ™Î={ïÀA~+×¶ÌQP:§É{‡"±<\ªý‹IÉÅpi˜Ôùõà18|%Æyœ‘­+ÿeŸvˆ?°v~dá {Ç~Ð{~€ãjò&{¾pr¿„äP]©<$¸Ü®·lý$`oÂ+m›÷v]ŸK»C䘨2^ZHÙYfö[6E ' ‹»ZñÇt÷‚ß|îHqì¾-ëOpÜ¡¥Ù‚pÝC±ýG€dxcHÿúM î5œÉ•žÅ=ͧ™kã¹Çö^ ª™MR'PUq¤Ö¥©µüxˆ®ÖÔSÿ®PÝÞ8¡ˆæ³'ÔÓ›DÎ(—yùe@êL †™€lÑÞ)‘tD&v†dê‚ÌÍwíÒDÈõÿÞ‚v%¤íYçì_:ÑõÖA( {Ÿy! d„¹Ò#Èß!N£²!%Ï£ÞÌxº¹Î‹{@êd7E‘g–Ÿ$”¿ 饡ψ†ˆž;£²Ñª’_ÝÆ ãY·3ý}Èâ¸ï× ¡1dAë‹€`â0Ï1Öö ¬ûzœƻë q‘½Âœ"h¯,(80 ,ÔÇüøïÂÙÁìþ=nÈ×Οñkö ›jÓ?>•À•bœ¯å¡àÙªT©  ˜0~Õ G÷¤W~N‚+ŒtËìö‘·k¥ºò1azÍW!¿ÚèÀ÷½D ݺðÖEÔ†;èÞŠ­ŸÚ“'« ·AÁÌTZ¿Ô^á01þE­^8'$Êñ¶ ÎúìȨý…·<J¯ŽiNp= DGv(òþÃÅCfÞñHóG{Âç&bOâ!Ýÿµ¢;_šˆ(_ú… "/«éMøGò‘Æj­Õ”ANõ"cÎ}?¤»ÖßNï¹-²pç\“×hp<ÉdøxøòÎñG¬üÆ!D44†ÏmÏ?oWŸ=¬ò•”±bSWÁ›3£üG²ò¾»‰Ihe¡gïôª+.†0ξ³k÷瀊ú– EÒ dÿ˜>\âYûC{/\zôlÚ1q`O¸Þuvè>òÙ–€céi—¢ù†¾kÙ py2c¤OpÝDËlyÛ ü;&P{â:Ö|¶: À-¯ZuD– .>moÎÕ6š‡žGn¨9@*ûÁžÎ*ˆXål_qüÑê8o(‚8ÙQb©.€œ‘>M"ÖnIx•Å lã÷=÷…ô‡ðLªA08û6Õ-8³§ºŒ*Î0|žum)AÞî9õé¤ipÒ”œGcA¯²š2­°ŽÔX~(S>¢¶àU§Z¤Ì-ÑóCäOdj>×=³ÿ-̸/òsr2¡öZŒ¬­(ûº~øYËä1Q×õ‰2 yIÊù0JhÛ´dÉ#I,‘.9W¤‘n±‘B?Ô¥Ô¨IÂyË}ûÇAÓe’ëS À ¼uÇA`M©èP¿ß¬O—¼k—O‚L“—ºÈQ0ÂÆ0¼)l¯ŒÉGrÎÇA¸Ê-–ŒOØúL; 0Àccö ¶ÿî¥d-mƒÕZõ!âÕ SAÝzGƒœ¤n‰¯g²7,qøé,&ÿ}] ü®¨Åª®ÀâÎvÒsvг㗇ܓǃ½cŠáÂë)Ld6tì¸[ô@»é%×™Õ‹üåŽúã=¥`nއaJAááa(·+ž?»™aY"_Ï郜؈µdaýBV_¸½qí U‚SWôš0=ßnyU Œa»· ÜoÇ6É.2¾k‚VOƪöš€î­oG>ð鸧¤f”êñ¤Uí ;D äŠR@*Ó‡˜é‚9Àd×ï…Ì"‹§¢(K‘7!vVË›Zà|ï•@Ë HxžmþJ”Ž_ š:;a>ÉKÐQôïýfè}=½f9uÔm/ÈMû ‚ùVlŸàÊÝf‘ó”æàZ®f+=ï œmm}UVŸP÷oB-¨!ŸÌF\]¬ N<È ì…ÓÍbOÔÁ©!îG©E5øm}Ñ—Nö„ï0ÈL´¸¿h²)€Û&ù+ z_ÕßדvÆ0dø‚¬àc#Ü~r¨©ˆ Ë»hqøVnTù nì¸ÙO@!Žh›ycÔ  @‚!ë§n÷èeTV>ú»=ÝÛyô üÒ@¦î$4ºíøÖ!ò÷Pî7Üê~Ì)˜ÜØ l™ÄÇ#bq*çÈ:`ënˆ x@ ñX^¢Æé­"ÂHÎ’U—”KŸeFÎPJPB‹Wû¶ëágŽîçv7_Ò7ãND+P Œ¥Ç‰øƒ[1wvJç,œ9VïçA$Ðe`µË>=T©¡Ì@ÂQ $ 7á¶øìö ”jcX1+qpǰø[À•–¸BªFrvÂôÕ¡]š˜,þë7hÇÆƒ%î6$8 Õ¾MJ²ýõvçét—Ê£ßñºÖ$né £Ú%&’üž z&Fì}Ÿy¼žR:À½íE¦å£w0n®:ú®âŒn¿—wÅx™uÏÃ(f¹ãx†å¼§u\U`X§^°S“ç7?²Á¤26´Ä Ú-{1žQ¸þM¦qV(J°õ¤ C‰–€¼ö¤XvhÉzå±ó8T¥MKú\¡FOí©R÷M\|Œçm8꼈+$TÜ T^JÍBÝð‚ž:6Í¡>¡c$òL×pÛàÚ§°±•®º;e¼3 Ái§ê³}×’‹vèuÏ$ȯõxÿîè-HÛåsþÆ!»°øÌeBNêºÏÐŽå›cjË4˧ïë?b m¬Ób¡¼tæÞMMhØ¡iq@›¤¡È’ï,ô=sÄ”ï,ÿD¡»Óú¸¿Ü}(ð—°•4…Óþîš^þ©æJi>\e–﷬Œ›¸EΧ¡~Œ¨°ÁEaÜ?‚Ï` ƒúÚ…©W &14Ę0éop˵ÙFaÂ#0Šq ÍÁ#L·¡›½Öõ%AèJÄ ô…`Ãß¡§WÌ÷ܨ ôì(QÐÉÓkeß¹Ñ'vôšr'…ô.Ã]L¸ºÖ´á‰:.Ÿ‡©]^Œ“Kd§Ãýs`óññ̦Õa³0²CÏ8£’ûÚ£Ù« C¼ ÿµÍZúÐdõ²o™ |ç2dPòºC€‘º ®žÝq CUnkxܺ!T§~Ù“ì £71޽0~Á„÷ÙÏó0¶ÛÀfY:Û•C̃Ì[·^éüöôôŸ°è¿B5ÁÝ›¹c‹P7˜"ÊÙïµûwÛ·ï£9Óuœj°ëÛ¦.Œ`Ø-hV™¯.2Ë‚£GïïëÏèb]£…QWòÆôçK°Zùðf°å:öt'P¦ïðïÍ’‡Ç‡”ç—‡šíÊi>X­‘Ïžž¼³ Õc(ÎyhʱÞï³}bš<%ïO¸fŸ‹’jÅå=:°r)‹d;Žq¨ÁâïµÄ·è¯­œrl\cý¼Ÿšßu]¨#‰ OŒHÓQÁD¨1SýÒ Çå»þBôzÎZc‘ (åÆBÖÑ;G¾¦Æ´0£vç-èí]þ)ڃŃ:±üà´£çÖMLÈЄ<Š,¦Ï´ Ó§,3È»ŽæV~í©ž;„Fcù–9Ù*£43‡PŒ¦ßX»åwð#˜ênµeš›C~f²á¬—-Ú úYeì ýoܱi×OönZ‡æ*ÐSŒc~ ÃxÏÖB6N'ŠûÑC5Y4b'ìŠÍJ˜aÝ(Ù‹F`j§z%g!§µRMÇ¡#P,6˜ˆúågŠnô.–:¶Éhy‘ж;AñÙGhîµÖÛY@kbØÃ‹¢ÉmGï»…6LJê/~(AŃúÜê<=šn ™¦Yyƒz¡¡©¡]͉¢f9¶¥‘Ãh7'·¢;z€äeÄa4œLà™­~$ê{¨mí…ÈmôÖdÙÊgkxˆ‰¦ðýŠNÝ£_ЛT„˜žÂú»§81µQôÞ×À¤ŸÇÐqYÞ1¢"Ô`÷¹Àãõ'š~+4rÇ+Œz¬í±TíFÚ[Ç¢+ ˯²g7˜N?òVjF#°q=3»:(Š™†ä5¢÷7³¯¢crÂo& кSÇ ®?¹®òâªÇ飷_ª0IzKÈ5ö Ü´¦àAG?TÓ-¬êР1X­sLY_@$_M Ó€Ÿœ×äÙ|ð4!Ÿ9¯Šz“€]¡ápo ö°ª€¾J_ 3’Ý¿ú™HÕÁÜNó¤‚6®íß‘wPFƒvh„jh&ÚB½ƒ§roÎd- nƒ0"!Í’U\ȳ×=¹) *šûíãÁ“r,~ÆÙ ¢- ›Â¿CˆN¾\„œ:¸//¥×± …`õ4b¦iyhÞ®ZqeG€-/‰‹>F(ÞÅ½Ñ Ôo¼ÑÃ-êrÜ#q }…$)!д/ñŒ"À1Œ·ÄŸ„†ŠÉ¾ü醆Ø(Û63ƒÍ¥”³é=¨ß´½=.[6ê¥n.±tã*ZÔ¯Þ¢¸©€VìâOh(¼æÎ\4ír žå5¸¹‹“£q;aóbhÍAš7ìuH\ö£Þ{® ?1D}¼\®•¨ ž&>‚9}’¨ÃN·H Ñî;Ä~Ô>šl4—¾ Íëgë›[ƒðš3§’ÎÈÂml<€ûþOƒ 8µC؆–i|~÷Õ¡ËÌÇòk–)¿ÕHg-ýð‰§R12"|›À» J,Û;ç°ñ¦q;t&K%غQŽdºžŒUiòEê‘/(O1©àò³\´žc\ ÿPçïú•ùŽ4«õÓ ºþ¥‡nÏúÔŠ·ëÉò "‹~ 4Ylé”ñ¢1Ú‰‘AP~ç¢tó7"NÂ/<رG•{:Œ83 æK'¸z@æî–î ¼þz?•œXÕ[™ÛfѦùÀ`áká0rµf"©»½í´30BécgÐ3 ¾­.0† úþ½‡A)5Ðtó¼ð=«Fàr0ÖT²Ñ¬?<y-Ž\ÿãpékBˆP¸aum«9?Þ¡D/í¸ÝþÀš’ç0üv‡á =Xþým ÍýÌLWà /˜sàîn¼ Ú½ÛO¡71*8>Ûó¸##…ŒEv`g÷LÄÆùÄ¿&#ýôR8tM/¬ÚFv†½¼ŒÔZ.Þ€˜ÝuÈo2Œ¸Žù…¡T¬¸ž’Œà‚?›’ý¨&–ß9]C7za–wñ¢ßz©)Ù Ü °‹Ur•ÐÿY«FûÕQƒ7 ¨Íÿ‡<õ¶VË üné>‰(ó@5uÇ¿¬  Jfö´"ç ‹—Ç­Y ªm_ž+ÞßJÂü^#è9¬¿y³ªaú¹Ù÷È9¸!c7Žçwþ¼!w7ø4`ù÷àÁyP#0/Õ`ÛÏ\¨fuö#嵆óEì)ÊÇ]ÄÂ=hõ|H©ÙC,/Ζ I;né=03¼j*#õ1{8òj¾‚ô¢s¶Ç4˜2ñ}t•‡íß4œ&ó eK#õŠ’d¼Vcf‚Ð$6ÿdeZèÆD3ùœ„kå§¢Fûo›ŽfÕŒ*(E¦áëé€fÆ£/¾›=ÈâÃëø…Çàªö¹ùÑrÄåºÛÖØ†! 1¢lë[@°A¤GÌ:^1B…* C[*ИêþQI¸ÝJÈÆ§×fÃÑ,À×P4á²b÷O*™G6l½…n­|ìå­Ò p$K†898u© UtßÁñ×Íbü‘`¶Nßõêé&„”PH-±^™6™òûâápiè®zb¬ Hk$&%êA¨ÔùÄ ~H-Ø3la »ºÀÇÐøœyÝm;NXàk‘KãÛÐf”;“þ\p˜iY«[ ‚XÌGÁÃéM ûx%ãV,çéwZ}W°øoDåçÄן^A$ÌZÈÆ€×…kdSª±ýGžªä±&‰zÈÊT¢"³€ð̾ú[çcAJ†Ñ¼çŠ0H–Ÿ¡NÄñSÍJKì fà6þD(Øt8Âc 2O­GîðŽ€¹ÈN€ˆò…GY\'1—«CñÝN`(U¼ú}C eÉ5ÉÍ«û á;LP¦ü(,ö ¤_B"€÷¦Õ}ó¬òÿàCžÕ;úéÚg8ÌBWqñX)à]½éÌ3,Q;Žc vùi]ŽônRO'ÎT _i>>hÍñîú¥Oª*ÌÄ…¸qƒx©Ö3þñ4p5Ý' aWgñØϦv¢Çl‡—{A˳ð8ÞÕé>\‘—α7)„Ëž‰ûÕcNw#€0‡aÄõ °b¿ÓP²¨3®.w=RГ~Íê LmÜ\>1y=3çwÑvàÝp3¿J° Ê:w¿Çïù¹Ôü:à]Òýò]PuÃ2¢'‚Pcñw_&%Á®Í)[HM8°|Üt¬nÕ=íh8üZ×slò{ÉcûÝÖ÷¬¹Ió—Nà<¬ÿ%k†Ù0µ+ä¥=g©%ŽÞ_Û×Iš¥‡ŒNþ€´ç!¾·öƒÓ¢Qé=üÛ¨…y“V> ¤ ý˜Ë¿X̯¸Ð;%j€ŠŠõÂ|…}¤ŠûÐU—DÈÚ¬îv¦„/ñ¹ÇèY«¥Æ5&ð›ë»¨³ÉfØøy¼EÞ'/« mïþüI9ùQÈPÛã£vlgXÙ–QÝÚë}½?Ò ½®¿’ºáö=¼Ž_o(š+@puÜÞÕœP=ÓH×ãø"ÊF¥‚džAEÄ5©cË l©¥.4Ã¥£½þϹÀ~í´tvh|:4P·¸½>Ã΃Z‡:ÚuFnA6~²² MdN \>ßX0ýùz;­ÐÐ&v2Zªwã! ÃZ8© yÃû¼8À3LÕ¿‡”Ýñ®`ÂÜ( âäQµÞp…Épuze/¤ØÑÊî;G˜˜*×ÙÊ»ž“ äýt€ÓnÁ_×Þ€Îi§õôÕzCÖ7ÉßUu}úÅÏ«, ÆX]ÖÀüñÏ7®Î#½ð}ü)È´¥ó´¤-ì·SíN‹z¼Çš×fF€~„]<+àJ+ðŠšÜ}íÆu̵Sµ/öƒ¤ñS>tù§»s²ÑÀ8I€O¿:®+D/ÚdÿImjï8¸ÑÓ9LÐç°º.•es“íñpXjë¾Hàw”eЕ%|únÓ”þ_A èùm®ƒO 3ïÝÁí! ÔáÔ¸xžéÒÅopŸYîm =˜bTèl9ÀázkU¨¬ˆëZ‰Ã3\éSA&¹F|ï8V³ø•øì]ûN¤áO\!VwNzÂaÒj4KéÀ‘@{¾áý#ØÏ0û©ë¾µØ>›¼ ·fr, ­y$Ä)Dø5å#IúÀ=;êåbîÓDVñÝ4´C„À²R>‰X1éž3ù¬sQ´ýî<ê–æ²Þï4€‹ô§¥fÜR»ƒ¼‰g?©³? ˜wýZÈF‚F%Žñ2¨[àþºxY0Ó½x×cûµ³s¯—Uiç”%®Msé5È"¢›lr&à¶øÆ½»ç;ʹïeC½ Øžs<Š ~Ü­ÚD®Ǻ¥üñ®Ã‘D~òŒTä;_Õ4Lë:p4OìÞ²¤‡É>¾Ž.ýíj8$‘ù¬÷ýyÀˉðuêZ~›œä}.faƒ¼­Óª}1µ)ê¬ø`:kËvVœÎ?`®+‚@G}§F°£ $:Áã ½” «Ö0|—²°ñø6oÆÌ©dAâEÁÕ’¿ùðõîr3ý¹#÷ ÷/œ¡Ëávè» ª4§:´µAúJ±».Ò!Úar:!Á%yœ¶'J1^ד­H¯D3ÓÍV¤ Gœˆ ·Â2ÄÞ<a2['Æž³ˆ×8•útìI@– ¤Æ[ É”ÇÕ4t’@$7F˜5R¹:1dÇÏ+ÌÊ[iÝ,(†c¨6Ê´ON-ß^*¼ÿñ7Iêî~édaý[,b”¸oáƒ}rƒÓ`‹²ÀdûúTÄ'‰áCÏrF& Xr¦£pjH‡=£•Å#žd{gš9“íÛ ŠÈ8ûÑï°Š9qÝ+—=z2Í`¢ZÄ‚;uÙR¬Q`=YºúÄÓT:NšÆ›&C¡)/R¿|­‚O"Fm@4ë´ \„“ÓúYÖ€Žk¿T|™fF¥9 ƶsÞŸ’™·¶ç‹MO’VièºD¦ {R5¦A'A ÷áòTè^ØÃæÏrmàpJ½µ:¯è„d¡úD[€Œ:“k„oeÄiCád$‰Z:°î2Íî™a‘åÉñËqÎÈVœëåÖ% ì/râþI…D|¥;îß¡†´ gß _¨@>‰° Æl¥;ušYA-/0ßL T® ¶³ø÷’àÐê…4Ò½ù@µ~Ýä=ˆ3òö‹]½‹ ¯U5h€š&®Æ µ œÔì°îò|êµuîŠà‰lRߤB6ÕÛ;}+vž"‰«ýü¦|òõÀCr‘+¹`v%}úPÛsHþœÆÜ4^ nçκT‹A3¥$º\×§u\•s¯C › Lm•œO”þªÍ^‹sÕ, pºÜ—ÐÏ|Ö§·o€þÙ‡…ö¬ÍòsäÉ#"rÈ{..*®X?‰$V9wàE¶ÄÉh8QQX¼‘ )©2£¿Àå Í7­OòA@¯dZúÛÞü¸æ1€G÷O¤»ËÊû‹ò8§ŠÁÌ8öSò³Èk­ã²6 ¨ç®Þ¸­fo®?@â©)*Ô@éø€[‰)ÒG!¢VçHÍé¯ WŒƒ‚ ,0rOÞ‚ô8^Á!ÚPH½…!,4A=ÅÃÒœ…\ÐÆT7ºpPÌÔó=ß/g5Ð^^„d,î'k}©´]ðrm‚$Q,ΖÚ?ñŠèÇàyÔÚÒÌíG6âÈ…Ê@?÷cÆËw¼à®tï§Óé=ÐõCþâCbHJB± p{Wß švÜžûaðzúö ¦ú^V¶• B†¦x| ê“—hN;½„fLweø²²™Ft¯)BÅŒ`•!¤auFk ¨âMïCéý[vßÜ ëOïŽÖÈÙ¼sÒ[%µ·¿ùÉݸäýÈ@Ÿ¾Ú×å”5”aýVܯ®Ž;|ÿ·4e|üP_øðùuR¤‡M8ÂÃñ!árT‹C”P¨‡sÞ¾< ~e5íQ eßø×W3À^S=àeÚsÀ =‡Xá>¦;4ÿ|HŸ­Îüùyp;zCºZå+¤¾¼Ah Õ w鼺 DµíT,dòH¾¨ÊàkhÛ^eo[€è} šŽ3Yˆ?5bø=oI|PEdN°~&ˆg¡ ô'Z‚{Û‹{NR ¢›2€±ÕAŸÂaèõutcäô²Ç·ç³_–«É- óA“ÿö% Ã: \…FLôú©ƒpÁ0_äÎàv»ÝåK ßò²#Øß>†°ýuëÔ­ ´;ÿCn(„>ãPF5çÚ¥m÷ÛÉgŽ E ëíòpp¦™t  ß‰¬‘ÖsæëßÛŠU)¡©f`j9žƒ˜ª”Ę´«¡Çª´kB éñA P,?±@Ï6· n,®(éw[µ‚%Ñ~ÌŽŽl´Œ›÷A±‘ƒë8|k'Á³û[ó»•f(Áÿ*$cÁ Q<8ó¢A¥çiÝý%PÂ'ó9%²þ~ùžáMC\l>nJ™\cw(N½{ ú±üÒl}N»u¶o//\ÏÄ8ðNüƉïíêÂÍSwn®iŠõ×Õ|àÝ»r{?´`hbS¯ e²æ3cÝk¸æ—¼Ý³†&,©!¼¡ŠD÷4aãJ4'ãíx.¢§ødœ_dYÃ5½“+È´êü|˜jÔ>Üî±|.ˆ¯’ã«,z¶yè)qœ3† 50Œñ~U‡ì¡×ûÄ›V»H$ UßB<Ï ŽÒý]K÷øêŽM™Sýlèw/HÝ#u—ÅÑì?ø1éz¿ùÍ:–­æß¿ÁÉ<Û(/<à ­çØ%BìB)F Qá9ÔPbLKЀ w{?½;0€\#ÚÙÁP® ÌŒ"O%‘‰~ E·¡z ¤™Km푇, ­Št ®i+7Ô‰Ò@¶ž>:b{'ec FwàcEx„Õ›(Ä@ÇÂÄ]ÍF$ê..^ƒ¬è$¦X­K —Ocfùémè<.aXŽ6€3ô`ä5ß4AFÓk:Êøç5Œ)!²{ò“lßÉ0ÜŽ‰;•;;Ñýò¼ðèó—{!™ïa¸XÀúïžìO§;‘O°ü‘ª#Ír¯”CÚ1ƒi{{¨:é¼ Ø~{sFÁŠ!&àx–ó©ô¯>ꇹyWoXh؆% [Ö"^qÄ?ùòÿàCJÄ )]Rƒª;DvHÇêÌ—iæ¥ ÏBÅ.¯Êq´r¢£`i-…oÿ;XÙKøÍs}ŠÝ7f®â2‹;Õ]V0ÛM¥Ý‚…íV¹VÆ•-–yç F»­ëËP”{ª y¶€zÓäj1ò‘êcÕ­~¾8å‚ëçÑöÀs4^1÷ ˆ[r¸²l½³ýÔÛUÅêwõ¡Ð[»zÈhwÐ@‹Vêê}µËTB“%õHŽ%×ÿöëæñß'ÊÆÔùüxc‚æbÔ술9X}ÅŒêg¯“eÐÝ0 "äÇ6Ÿµ‘¡­X}ã[;´SM´UxŸî†Ú÷f§C@Ûwè¹"èĽî0*çÌíùQžfó?°1VŒâO@/×xÒÕ¿F³Ó«c…ØÑØÁ»ÝCÉhÖ³'©/N¢É÷w„›Ñ 5YÞŸ&p-h’I܃Þß‘Ÿµ…Û;ôQmT¼öº>O,ZÌð´;uÚm”p)zD*^ûÇ.¢^ƒ¶ºþüœ΋VíòÁ™TªÐ †äçu†…]DÈm–Awê>uŒnù[îUxä~VjÛÑM¢FïÈ÷;¡¡ŸtB©Òôл¼;p;Ì”í<0z;#ËŒcßÏ-Lw­Ú…ްì¼xtòŒÛÅoûQ‡éÕvü\§®‰3z‘fªÑhŒÌ®|?ê—wñÙ[<ÔEÜ]uÂó9„9Y]ਔA `êШf|Æéw„DѾ°sB«;Nby±M† ‘ aß¡Ougƒ6;ODoß øÁŸo ©‡>ÿšùÎ\w=ô •ž üï½pY›r܆>Þ1H-b™¦·¦hà¼ðÂá 'Àöikèœ#?Üp¸§åywõۨ곀ǭ‡ëMjoB&ldù:Ð~Aü_£¹ù½¡wÞH %cÞ‹m¯ÐAÖ€,,b˜ú —Ɔ_®ô;=‡öE Æ‚êãC%]°M¿œs!½m{#²rÜÈ |`^Ìw°Æ &Ãh%FEÕD*¾2Ò½é @Ëw¦KÜhìl(‡Ö`Â}”£Ñ¸t#=º—è® ¹,Z»«€†ï4sp*:>·¹†)?r~†Ø¢ÑÑnœÏ‰¯ Ò…b?cQÇÁý‹cÅh0aB‹èJ4t™¶ã¤-Z½v}eN,­|ï®ú‰ ÍÙûC‹únwRP­AëÜ ?O E»ñ·hYþ Éšf‡‹îy¢¡’¹åRc{ÐÀ’²[Q‘¨ÿ.Nƒ^ºÐØ$Búw„£Qÿ0À`4|7®e›ORXz?½V´÷Nñ¢i8ž˜õÐ+Û£ã¡Pv0çûç5¸B°øŒRö=ZbŽîßd¿ Éq“æÞ·ŒÑ`¬ÞyB‚i°»ÞSÔáÈñó§ón¢ž"m˜'WŒœYXYé¹ÕäF¢—0,Σ`N")iöfõÄlKÀ8‡6äæÐùAÇéhY g–n@zs{v;ÓŽî„×ø–A-Ií×µœhê.?íÚ g@Ífþ²Ì½ÇPò <´¬hÏÚ³<¹&w,–'ŽÿÆ!´Ìв†Påù3rgÀ 7Ü2ðÔ z#ÿ!NÙè~‚z5Bïbà`¹Bð¤²ØŽî†'€{»ºõ¿ùEwE¯Œ÷‰¥ ™_TDE¿ÿ (Õ`eIùÜõÜÓïeÂq°Íp¹çäõ ÜÓh §›ÅQ3†:’߀ù9ªÃq^=¿ùXì>ˆ{ ¯p܇ÛôìRM×ѻۣMÝõçè­ùJ:¨ÆD;9Ë·²ô=ÌO`Bª™ 1´¥íyðJÕÓ"a¸Œ‰æÕ7EWõ® ‰€)VïËÿŽþK‚|ßß8¤u^Nät‘'DÞ“_Hdq«ÒÛ£Dw]‘Ïpæ~öƒû ~Å¢Žýc<8úië´e@5neòŠ‚G„ô½ uw°n=ö"çÀ+ùì«Ð#ò1‚?ÿ±?É©wW%œÀfGÆP ™ìË7`7‚ÓßÌDqkCÀå‘0&’|¦fû¬€°³;¦°÷ýºNË1/p@G©"×ÁáÈ]›e„l—ï¬è% ûï™,ìÛ/Ú¢¾‚»Jö²\ \ÂÆe’9J‰J)OwÅ¢6\°hry,àœ2ÏÊß±¹V"iï&5^~À…ê¶#Ï™¶Û‹¼æNÂ&HÀÆÍ%cǩڞñÉ(°H¼Gþã%xº*綆ǃ‹>íáAap¹¬\à\–eç[!jgÙvB³¦ÂÚdÁEàirÖÛG`’Þ€Ût\N´wը냖À×Xußäq¢»Ä‘‘`ƒA%Y®‚¹ïÜí#ÈÄ}ñKýG‘Ÿ²]ƒS¼'A†U¾tÊÕdJÔΗ_.~"ñ™oç9²CŸª’c€¼fË6XpDlŸ´“r@F:(Z/#ÏÚð’´‘­:zÖ”€Çü•$"§Ù¸$•voôÈúÅ™¹ÅÝçfÙPöV8öºøòss¹û‰}ŽR ŽÒ ]H&Øk»,æ‹à@ö ç®ÿP-áö£lü(ß•¯"@zc‰ð©ƒ&òާ\D6[Ù4µ¥ðü¡†¼]ĵï¹kü¨:-夳äsX –Rfaßþ.ºÀo àÍ,¾]åÀ³ë— –'Ž¢_Ê?‚ŠOÿ~–}ÙàÎf8sØn»]rë ˜òÇ®N6(ôÌÁ•Ò‘ó,T@‚ˆªžRâv¥šg÷ ß=7emÙ¹œ+ )»Aáe4•Db|‹;a@¿Á)Où ¹ÉY}Øp—d{êR¬ÂA+*WêÀHPTŠnW“Åzêǧ,aW÷Q•ãú|A»Y•dxaªd„¬¾’{NgŒL8 ÔkeÝbwËöúe {bõYFçËU3!3‘•ç„k#n‘™LpA¯…ÃAŸÚhøF²}XÉAîÕqA5šËÀ´Î=ÏÇáûgî.ÏïΉ¸Oç?¡:›À ãy°¬¿óänŸPîââȤÝ8¹²žÜ|ÉoL™~@û$ø5²æ74уëî°ƒ†~%ä(Pâôz7´ lG‚<ß q¡ig²†Ý÷€SóSÇg8Øù5ÅkÜyõ>\Ê©é2ð£_­“Ÿ` úB¼¼…ŒŸò½·Úì©û»¯ ¾xJƇ-Aä¡¡$ï]äÕåô߇¦È‹Fã…ú-dLƒý¡Ko7ˆ/5ÛWÉ!£«Ó«·Î¹ ›Ïœ>’&Æ#>6©+µÈZ‹úÁ° Ž+a{>¼ýñଭC?\qÀó«c˜%,ð’˜Þ¿غjÌŒa>wPqÅÖ4¤åhyiÙ½=Èû¦á+Šý7±v递äÝ­Ctì1´ÝÁK®:yá­žÑ;>ø_„0yÒ#s&¯5†j/xÇË\ì9ÿÈ&߯_ô“!œnzS8\Âõaó:œ U;êr¬ØL—2Ÿ¾Üî'SÒ邃€À3 ×%8 ì¦k ‘÷eÞíëdŠû%Ù!m #£©<Ù¸ û6cŒÙ„—áX0TYç_òt¶ÇJ5ˆ`2ª#Íe„ðâTåå‹ãƒÝ®¡>·|åÛ 'èîê‚ SK¡×z†}LŽš}óÀ:Ø|u*¯ɸåxwù)’)ÔDf6'Ô잸\rùˆYtOFùº6à( ÏUÊ.#cf½CSHÿ>玖~äë÷%g²»p¸²Êò.W9ÐÍ÷‚Jª/˜Z÷¤›±aFÀ¡×?W`GÖ»î˜þØ ¾Õtéå[1BXñ›8íó›óÍÏ1L§?!›ß[ª.¼Ü”)*¼ÈÐ!俯ecäõ°|Ål,ä/´\ŸÕDF}zU {…þ㛇Ý$À:_Ç3Ààhñ{ŽèY K-ë:sÐ4öèHEÁN/³#hÝô´n¶û †Ø8ç­8SNÔ@þ9*ÎØ"695”‘× ‚—uR#à°{ÑÓâD)`öóJ­gÎÜIC‚§ÀᥠuæÓi@pïÞÔíL¤YÞûÁÄd=µ'­ndíoaORר²8$*µ Iîj"X¼‚ÔÔ; Y•P”{N|ØöÜ4³æwä¾~!Z¢d¤˜;>òë}ì»x’s,yåÜ9¤P‘æÆ‘·¤È{îˆ/éóȇ®CjS,×ÏOqtWaO0¤c÷ùf÷—9àtÔgièÛ’ab;[tò°ÄGÆï_âîƒê¢ÿ,³²dtpßr‚ÒC`^¼P•܉¡¨yðOd£ÂIû^ÇI䯠„ ®˜Sߥ`AH8²½Bƒ|b2>ZÓ­…Œˆ±Ù—YÁy.‚¤hŸÐ% Æ•f2Ù’q+7ÏTPIe§šQµÎÞBq§áåý`‘ÑËIð„¹ÌþÆ&Zµ $wd=¬^¡ú&/špdÈdt,ý³'(r \§ÚnM”ÇR"Ž˜ÿ¡ ßSàÈ`Ëß49ɸ˜ä_ƒ£²ÁæI¯‡æå7i^MnÐkÀlüñ,év„‘@ÛǘäMÊ=À oÖ,:)tî®oE_ç‚'^UÕ‹ñ Àïe¡/ŒA¾hT^h» jº´KoýÊàPù—Æ“«´‰{ò»Ê äÏÊÐ9 ѳf#ó³ »/fÇ›åsJžpVççÓIð³s YξžØx¯0N%6êxÃê0º½)¶ålf©®g¼ßÀîí#gÊÀ1pEØ&ÀÓùûÞYa0;Ù®ê|ö «ñ}}3 ™¥µ³CÈ«ïR$sƒc±bu&ƒç_ZJÝýù‘´<´Î¸FÊáýZí8¸£V„Ûý¶Ï®žø]œ>úÂw`usˆx¾³‘!¸ÓÞÍ2³ò‚°TÛã¼w\!rgÛ3È<³®–y î)Áþ¢’Öh ä-n‹Ìj3o]ŸÆ,9àž#æ{„D;:ŽÇ §OÕ¿r …`µ ñ»ÄpNãá7nÁçÈBÂ>zÙ—O‘oŒO_éŽ:‚Âþ:ÎÍ¢l ДŠèßÞÿDTjÙØÅkÁ.µÝ(ª[ 0 š7óDcvÕ ÚÕQŸ9ažÃ ÂÃÌI£J¿½ÑÏd¹§;*"¥ê}þÛ;½~ÐT´ý™7ã í…çÁ…EiÌü9>XíM2äÉŸÅIN òŠŒ·¥Ò|­É‚­ûÀvòŽÒh<'¤”ªIñ„BO6 # ’¢S¯O)âA4^wq¾ñ4db÷sËÅй«B»_ÄîÈ6úÀ¥Ìþ<2¢võÀãöERßÉHpé…*ÊvsRêrÒP‘}/‰T¿€ÇVÀüÏ:pÍ{¹êJ‚\µì“yÈ 5'\h©’‘&×ÚfY|ã0ÞÖï™¶{®äÚÑ‚Ä;Ç õ쎰ë/ývDoÆ®tÙX<ÖW%ß#ê,ÌVf‚ÈùÒúÂÚñ²òxMº´ oÁ›h넆š ã€16îáìMîƒqä`Rµ·ä1¸$S‘å -`‡Ý'Ñ‹ŸyÅŸæ+\ÚÝ—0$Eä'=„¾Y,d'ß÷á¯DO\… ö›Ü™‰‘ y—„'I-x5Áœ0R³K¸,/h+žt,?Ø^tn“IŒ¬‹ê݇Á&Ÿ§e˜\ɘ^7‚%©ÏÏ;ŒÆA·³Ñ ÄrJI=¯3ß ƒÇŸƒû²TØyŠHI½ütö-äH‡Ïñ§ZƒÄ×½çÀKLòìëêÃpaT‹1Ž0ÌOÌ\;bC:ëG®-â€Â³ŸtSpRhhóЧx'3nû^8‡å럻,8GrÁ.MXxÈ\í€<,Ý>½æÒPèïWÀ(NƒååFéEvðO!úÁ‚W¾Ú<ÜžÕàƒÝV'LC|îâ:æ² òš#øTúŒ xÍ7Ôûù;œ|6Õó t±å ƒé-Í/‚ ¶¾š…cv0¿Yš·ÜªÖ !ôTY˜ B+¾]™!…DÌ.@’øàâñy³@êÔïýx|HóÖšš˜A õ=~Z©´år{eˆöÁ©”ß"X@ÃyGìMm7,®m÷Ûîù¤÷—rÁôîÅ‹[ó g~/f4Ù?¢¸x*<ŒÕ­/æ‚I™•€ðAÈRŽÃ‰wrpþÕ™‡×VW aWŽü°º éDzü4ßzáRYÒ‹_1Hï]é‰cƒ÷c‰Æ#AµžšÇì•!#g|sŒ°úÕ‚á?pYô[”¸O™+ÙãIrpó9êNI¢ü'>ySB&Œ¼B¬¾Î&)A*~©ÿÛüÅ[Æ × «Ös N¶±ÜÚ@ÕØòÀÀ€Q?Ê` Tãt^¼V±ô”w£íœ}A}ìF,.Ýææßƒ ´Ì„˜‘ÆÕìÍ—`†ÕÿŠHÿ1cM¾½>VžÞ¢+SFª$à>þãžçŒÈïî?²÷éô@wm•ïl~œ*7Ã0Ž@óã'R¼6)P46#`Ÿ„3×Gín¡m ñU¢È7Cö‹/”;K2À¥*q}•Bp˜¦Ør¾ê÷¾I‡]º¹üâ‹DîÐÿŽ‚×âfxÇM|ÈЯrÂi6í4ïCÏ“Îê–¦½ÎkáC›Á1? fW×R°xrH?«íBÚ puÄ¿ ¯YVzÁôécb ë5ã¿\ez³›O†á¬äQ®ˆ%0ÛÕÙìþò–he‰AÆ7HÄî;ò!¨ ³Õòå½ñõ¤¯Á;ðñÒHð be¢¸Á1RF=…Ûù~>Ò­™Zâ;@%hïòÁñm;×+5킘²‡A_U&¨!™ô8×x'Í À»®Æîþy`TI ´f1’>WŒ1@f_iˆÇ¨ñqÂÜ›™…¬êÅ558×_½[‡ ús€ ¼29m8K±ª|d!ÌãÎÕnð€PÈ·[K Ý ÃBåË› Rd{é ‚¯°UáaC°Ú‘w`QÎûS¤NPEØ)öâû•Ãâ÷†œ]œveu·ûÇJ×ó|o% C£ï*€Øí9X 0|¢óŒî8ì°§TãA¾¯ÔØ[Û vñbÇòš4)/0ÐìÙ®±»†ƒ2vß" ʽ(¯dcubËh˜ðGà*Æ»xÌÒ¾|)îY¿ 1;òÌê‚û6‡„’ùX¯·¿†ÄùÀS Y¨­…8xQ!†ò ³.?fò|ºä è •ÇpŽëRíâЗÇu܆Xÿ¹V, «™áÐófó Äî¡SCÈweúéÛ3àvÇËÕËr2lõ#j´âÀ”ìÒ9ž§8Vpí ˜0`JpŒÎl#ý6';;ïÃVd}ˆ~ÔùóÅõ„à">ïŽúM‰ž3u'6S¡C Á…çÀ=PZò.ô±óÏ0ñ"Æ€¬y—MVgZï’FÜ¿BÜáAMðïÝ«Ë9%×(_^Wíð÷Òå‡%@¦.V¾ûü œ“ô°Ôyñôn¿1ß¼gÆg/S¸<“kNt|ê'A»x´}¬ >X]íÔÙHFHdÂ0»!YþF‘Ò˜Oæ¾ÉÆ'q»ï™‚˾ïÅ„'­!moÒ’è‡Ã²[=c`³À.·òô˜ïÀvr`M,±¸4 -÷4ï‚c¦föwù5P9ñÚá$ÓU¸HÔ½b¶=ï¶;ŒaÌCDÚ{û—ÄlÐ’˜R—?—>­|$ý) ¾yõA‰ÜçA¼Ò á»D-”_4#}2Z—ˆ‰ jp¡)ãã9 Œf@Êõ}”l?ª ÙâYúÊ'p–H÷ Oòan†&¶ªLÆÝ†àlMNÝ‘DcÉ áé6'„0Åcg$a‡L¿ôXRXî–3žŸMë­…'Pƒ‘·ãÜG±:éÑŸK_…0ü*BÍ!Ðè ës…ÕÊ–¦c lKirµ€Î.ñþxÒÌv¶û=Ô¹ôMŸÓ@TÒüæ·AÈ2üI É‚É!yÇ þ9FÀ_nŸÙÊ‚„´c«)W\ ×’´C§÷ƒ\ì¾ÌúúS7ìé}Aw˜ËM`*ù)5Ý=ô0»œ¹;ƒ9fûÑüíúŽ rHú­'gékçcw•g/‡Üþ»ïo’Âß$’¿IR“pÿ&‰þM:ú7ÉèoÒ‘¿Iº“þMÒø›$ø7ÉùÿSx}õ$ EZ0€w\qÅ=êŒ#θˆ;®¸â(´`•ÒZjxõƒ± ½˜øàÿáwsî8¹çíÜ ¦À )Ð ŽA-ØQ°úÁ=èW œ‚y`dÁPÁxÝà´3°,0 0Ò ìƒØa°Àˆƒm UÐAì¬&pjÀ.ˆ€uÐN@H‚j° Á#è7 œƒE`ƒð ƆÀè· \€%ðfÁ˜:Ï ÜNp –æ@L‚Ìÿd¿G‡¼Ná÷úH^5õBUùá¥ÌG>CšÄJÔÔ]ÇH3YÍe-§ô‚û{J3T‘)ZNeK6õʆTpŲ­é«‹9VQú_‹ð§7”J_vù T * qMuU%ãx)ÞìÛ÷ÀÓQécçemoa/src/0000755000176200001440000000000014666420276011777 5ustar liggesusersemoa/src/bitstring.h0000644000176200001440000000240014554271516014146 0ustar liggesusers#ifndef __BITSTRING_H__ #define __BITSTRING_H__ #include #include #include /* for R_INLINE */ typedef uint8_t bs_base_t; typedef struct { bs_base_t *string; } bitstring_t; const size_t bs_base_size = 8 * sizeof(bs_base_t); #define BIT_INDEX(B) ((B) >> 3) #define BIT_MASK(B) (1 << ((B)&0x7)) static R_INLINE size_t bitstring_size(size_t nbits) { return ((((nbits)-1) >> 3) + 1); } static R_INLINE void bitstring_initialize(bitstring_t *bs, size_t nbits) { const size_t size = bitstring_size(nbits); bs->string = (uint8_t *)malloc(size); if (NULL == bs->string) error("Could not allocate bitstring of size %zd.", size); memset(bs->string, 0, size); } static R_INLINE void bitstring_delete(bitstring_t bs) { free(bs.string); bs.string = NULL; } static R_INLINE void bitstring_set(bitstring_t bs, size_t bit) { bs.string[BIT_INDEX(bit)] |= BIT_MASK(bit); } static R_INLINE void bitstring_clear(bitstring_t bs, size_t bit) { bs.string[BIT_INDEX(bit)] &= ~BIT_MASK(bit); } static R_INLINE int bitstring_is_set(const bitstring_t bs, size_t bit) { return bs.string[BIT_INDEX(bit)] & BIT_MASK(bit); } static R_INLINE int bitstring_is_clear(const bitstring_t bs, size_t bit) { return !bitstring_is_set(bs, bit); } #endif emoa/src/r_ind.c0000644000176200001440000002003414554272513013230 0ustar liggesusers/* * r_ind.c - R[123] indicator helpers. * * This file includes both helper functions to calculate R indicator * values from R as well as a utility to precompute common weight * vector sets to speed up the calculation. To generate the weight * vectors, compile this file using * * cc -std=c99 -DGENERATE_WV_HEADER -o gen_header r_ind.c * * and run * * ./gen_header > weight_vectors.h * * afterwards. * * Author: * Olaf Mersmann (OME) * * Based on source code by Joshua Knowles (c) 2008. */ #ifdef GENERATE_WV_HEADER #include #include #include #define error(...) exit(-1) #else #include "extern.h" #include #include #include #include #include "sexp_macros.h" #include "weight_vectors.h" #endif #define NORMALIZED(x, min, max) ((x - min) / (max - min)) /* * Helper functions: */ static int ipow(const int x, const int exp) { int val = 1; for (int i = 0; i < exp; ++i) val *= x; return (val); } /* * Utility functions: */ static double weighted_sum_utility(const double *wv, const double *x, const double *ideal, const double *nadir, const size_t nobjs) { int i; double total = 0.0; for (i = 0; i < nobjs; ++i) total += wv[i] * NORMALIZED(x[i], ideal[i], nadir[i]); return (1.0 - total); } static double tchebycheff_utility(const double *wv, const double *x, const double *ideal, const double *nadir, const size_t nobjs) { int i; double val, mymax = 0.0; for (i = 0; i < nobjs; i++) { val = wv[i] * NORMALIZED(x[i], ideal[i], nadir[i]); if (val > mymax) mymax = val; } return (1.0 - mymax); } static double augmented_tchebycheff_utility(const double *wv, const double *x, const double *ideal, const double *nadir, const size_t nobjs, const double rho) { double tu, wu; tu = tchebycheff_utility(wv, x, ideal, nadir, nobjs); wu = weighted_sum_utility(wv, x, ideal, nadir, nobjs); return (tu + rho * wu); } static void int2kary(int x, const int basek, const int digits, int *kary) { int i; int val; if (x >= ipow(basek, digits)) { error("Number in int2kary() too large. Exiting."); return; } val = digits - 1; for (i = 0; i < digits; i++) kary[i] = 0; i = 0; while (x) { if (x >= ipow(basek, val)) { kary[i] += 1; x -= ipow(basek, val); } else { val -= 1; i++; } } } #ifdef GENERATE_WV_HEADER size_t choose(int r, int k) { double result = 1; int lower = r, upper = r - k + 1; if (lower > upper) { int tmp = lower; lower = upper; upper = tmp; } for (int i = lower; i <= upper; ++i) result *= i; size_t val = (result / tgamma(k + 1)); return val; } #endif /* * create_weight_vectors - sample from all possible weight vectors */ static double *create_weight_vectors(const int s, const int k, unsigned int *pnwv) { int c = 0, i = 0; size_t nwv = choose(s + k - 1, k - 1); double *wv = (double *)malloc(nwv * k * sizeof(double)); int *count = (int *)malloc(k * sizeof(int)); while (i < ipow(s + 1, k) && c < nwv) { int sum = 0; int2kary(i, s + 1, k, count); for (int j = 0; j < k; ++j) sum += count[j]; if (sum == s) { for (int j = 0; j < k; ++j) wv[c * k + j] = (double)count[j] / (double)s; ++c; } ++i; } *pnwv = nwv; free(count); return (wv); } #ifdef GENERATE_WV_HEADER void dump_weights(int lambda, int objectives) { size_t current; int nwv; double *weight_vectors = create_weight_vectors(lambda, objectives, &nwv); printf("unsigned int number_of_weights_%i_%i = %i;\n", lambda, objectives, nwv); printf("double weights_%i_%i[] = {\n", lambda, objectives); for (current = 0; current < nwv * objectives; ++current) { printf("%f, ", weight_vectors[current]); } printf("};\n\n"); free(weight_vectors); } int main(int argc, char **argv) { printf("#ifndef WEIGHT_VECTORS_H\n\n"); #define DO_PRECOMPUTED_WEIGHT_VECTOR(L, D) dump_weights(L, D); #include "precomputed_weight_vectors.h" printf("\n#endif /* WEIGHT_VECTORS_H */\n"); return 0; } #else static double unary_tchebycheff_utility(const double *data, const double *weights, const double *ideal, const size_t n_objectives) { double max_val = -DBL_MAX; for (size_t i = 0; i < n_objectives; ++i) { const double diff = data[i] - ideal[i]; const double weighted_diff = weights[i] * diff; if (weighted_diff > max_val) max_val = weighted_diff; } return -max_val; } SEXP do_unary_r2_ind(SEXP s_data, SEXP s_weights, SEXP s_ideal) { /* Unpack arguments */ /* Matrix is in column major order! */ UNPACK_REAL_MATRIX(s_data, data, k_data, n_data); UNPACK_REAL_MATRIX(s_weights, weights, k_weights, n_weights); UNPACK_REAL_VECTOR(s_ideal, ideal, n_ideal); (void)n_ideal; /* Suppress unused variable warning */ (void)k_weights; /* Suppress unused variable warning */ const int n_objectives = k_data; double res = 0.0; /* Calculate r criterion */ for (int i = 0; i < n_weights; ++i) { /* Find max_weights u(data[i] */ double max_utility = -DBL_MAX; for (int j = 0; j < n_data; ++j) { const double *current_weights = weights + n_objectives * i; const double *current_data = data + n_objectives * j; const double utility = unary_tchebycheff_utility( current_data, current_weights, ideal, n_objectives); if (utility > max_utility) max_utility = utility; } res += max_utility; } return ScalarReal(-res / n_weights); } /* * do_r_ind - R interface routine */ SEXP do_r_ind(SEXP s_data, SEXP s_ideal, SEXP s_nadir, SEXP s_lambda, SEXP s_method) { int must_free_weight_vectors = FALSE; SEXP s_res; /* Unpack arguments */ UNPACK_REAL_MATRIX(s_data, data, k_data, n_data); /* Matrix is in column major order! */ UNPACK_REAL_VECTOR(s_ideal, ideal, n_ideal); UNPACK_REAL_VECTOR(s_nadir, nadir, n_nadir); UNPACK_INT(s_lambda, lambda); UNPACK_INT(s_method, method); const int nobjs = k_data; if (k_data != n_ideal) error("Ideal and current front must have the same dimension."); if (k_data != n_nadir) error("Nadir and current front must have the same dimension."); /* Generate weight vectors */ unsigned int nwv; double *wv = NULL; /* Compute weights: */ #define DO_PRECOMPUTED_WEIGHT_VECTOR(L, D) \ if (lambda == L && k_data == D) { \ nwv = number_of_weights_##L##_##D; \ wv = weights_##L##_##D; \ } else #include "precomputed_weight_vectors.h" { must_free_weight_vectors = TRUE; wv = create_weight_vectors(lambda, k_data, &nwv); } /* Allocate result */ PROTECT(s_res = allocVector(REALSXP, nwv)); double *res = REAL(s_res); /* Calculate r criterion */ for (int i = 0; i < nwv; ++i) { double maxval = -DBL_MAX; for (int j = 0; j < n_data; ++j) { const double *cwv = wv + nobjs * i; const double *cdata = data + nobjs * j; double val; switch (method) { case 1: val = weighted_sum_utility(cwv, cdata, ideal, nadir, nobjs); break; case 2: val = tchebycheff_utility(cwv, cdata, ideal, nadir, nobjs); break; default: val = augmented_tchebycheff_utility(cwv, cdata, ideal, nadir, nobjs, 0.01); break; } if (val > maxval) res[i] = maxval = val; } } if (must_free_weight_vectors) free(wv); UNPROTECT(1); /* s_res */ return s_res; } #endif emoa/src/sympart.c0000644000176200001440000000360114666413723013641 0ustar liggesusers/* * sympart.c - SYM-PART test function as used in the CEC 2007 EOMA competition * * Based on source code by Huang Ling * * Author: * Olaf Mersmann (OME) */ #include "extern.h" #include #include #include #include #include #include /* for memcpy */ #include "sexp_macros.h" static const double a = 1.0; static const double b = 10.0; /* static const double c = 8.0; */ static const double c2 = 10.0; /* c + 2*a */ #define MAX(a, b) ((a > b) ? a : b) /* * find_tile - find in which tile of (-1, 0, 1) x lies. */ static R_INLINE int find_tile(const double x, const double c) { const double xx = fabs(x); const double c2 = c / 2.0; int tmp = (int)ceil((xx - c2) / c); if (tmp > 1) tmp = 1; if (x < 0) tmp = -tmp; return tmp; } SEXP do_sympart(SEXP s_x) { R_len_t k; SEXP s_res; const double omega = M_PI / 4.0; const double si = sin(omega); const double co = cos(omega); UNPACK_REAL_VECTOR(s_x, x, n); /* Allocate return vector */ PROTECT(s_res = allocVector(REALSXP, 2)); double *res = REAL(s_res); res[0] = res[1] = 0.0; /* Copy input and rotate: */ double *xx = (double *)R_alloc(n, sizeof(double)); for (k = 0; k + 1 < n; k += 2) { const double xk = x[k]; const double xkp = x[k + 1]; xx[k] = co * xk - si * xkp; xx[k + 1] = si * xk + co * xkp; } /* Find tile (i, j) */ int i = find_tile(xx[0], c2); int j = find_tile(xx[1], b); /* Calculate function values */ for (k = 0; k < n; ++k) { double xxk = xx[k]; if ((k % 2) == 0) { res[0] += pow(xxk + a - i * c2, 2); res[1] += pow(xxk - a - i * c2, 2); } else { res[0] += pow(xxk - j * b, 2); res[1] += pow(xxk - j * b, 2); } } res[0] /= n; res[1] /= n; UNPROTECT(1); /* s_res */ return s_res; } emoa/src/weight_vectors.h0000644000176200001440000024010614554263556015211 0ustar liggesusers#ifndef WEIGHT_VECTORS_H unsigned int number_of_weights_500_2 = 501; double weights_500_2[] = { 0.000000, 1.000000, 0.002000, 0.998000, 0.004000, 0.996000, 0.006000, 0.994000, 0.008000, 0.992000, 0.010000, 0.990000, 0.012000, 0.988000, 0.014000, 0.986000, 0.016000, 0.984000, 0.018000, 0.982000, 0.020000, 0.980000, 0.022000, 0.978000, 0.024000, 0.976000, 0.026000, 0.974000, 0.028000, 0.972000, 0.030000, 0.970000, 0.032000, 0.968000, 0.034000, 0.966000, 0.036000, 0.964000, 0.038000, 0.962000, 0.040000, 0.960000, 0.042000, 0.958000, 0.044000, 0.956000, 0.046000, 0.954000, 0.048000, 0.952000, 0.050000, 0.950000, 0.052000, 0.948000, 0.054000, 0.946000, 0.056000, 0.944000, 0.058000, 0.942000, 0.060000, 0.940000, 0.062000, 0.938000, 0.064000, 0.936000, 0.066000, 0.934000, 0.068000, 0.932000, 0.070000, 0.930000, 0.072000, 0.928000, 0.074000, 0.926000, 0.076000, 0.924000, 0.078000, 0.922000, 0.080000, 0.920000, 0.082000, 0.918000, 0.084000, 0.916000, 0.086000, 0.914000, 0.088000, 0.912000, 0.090000, 0.910000, 0.092000, 0.908000, 0.094000, 0.906000, 0.096000, 0.904000, 0.098000, 0.902000, 0.100000, 0.900000, 0.102000, 0.898000, 0.104000, 0.896000, 0.106000, 0.894000, 0.108000, 0.892000, 0.110000, 0.890000, 0.112000, 0.888000, 0.114000, 0.886000, 0.116000, 0.884000, 0.118000, 0.882000, 0.120000, 0.880000, 0.122000, 0.878000, 0.124000, 0.876000, 0.126000, 0.874000, 0.128000, 0.872000, 0.130000, 0.870000, 0.132000, 0.868000, 0.134000, 0.866000, 0.136000, 0.864000, 0.138000, 0.862000, 0.140000, 0.860000, 0.142000, 0.858000, 0.144000, 0.856000, 0.146000, 0.854000, 0.148000, 0.852000, 0.150000, 0.850000, 0.152000, 0.848000, 0.154000, 0.846000, 0.156000, 0.844000, 0.158000, 0.842000, 0.160000, 0.840000, 0.162000, 0.838000, 0.164000, 0.836000, 0.166000, 0.834000, 0.168000, 0.832000, 0.170000, 0.830000, 0.172000, 0.828000, 0.174000, 0.826000, 0.176000, 0.824000, 0.178000, 0.822000, 0.180000, 0.820000, 0.182000, 0.818000, 0.184000, 0.816000, 0.186000, 0.814000, 0.188000, 0.812000, 0.190000, 0.810000, 0.192000, 0.808000, 0.194000, 0.806000, 0.196000, 0.804000, 0.198000, 0.802000, 0.200000, 0.800000, 0.202000, 0.798000, 0.204000, 0.796000, 0.206000, 0.794000, 0.208000, 0.792000, 0.210000, 0.790000, 0.212000, 0.788000, 0.214000, 0.786000, 0.216000, 0.784000, 0.218000, 0.782000, 0.220000, 0.780000, 0.222000, 0.778000, 0.224000, 0.776000, 0.226000, 0.774000, 0.228000, 0.772000, 0.230000, 0.770000, 0.232000, 0.768000, 0.234000, 0.766000, 0.236000, 0.764000, 0.238000, 0.762000, 0.240000, 0.760000, 0.242000, 0.758000, 0.244000, 0.756000, 0.246000, 0.754000, 0.248000, 0.752000, 0.250000, 0.750000, 0.252000, 0.748000, 0.254000, 0.746000, 0.256000, 0.744000, 0.258000, 0.742000, 0.260000, 0.740000, 0.262000, 0.738000, 0.264000, 0.736000, 0.266000, 0.734000, 0.268000, 0.732000, 0.270000, 0.730000, 0.272000, 0.728000, 0.274000, 0.726000, 0.276000, 0.724000, 0.278000, 0.722000, 0.280000, 0.720000, 0.282000, 0.718000, 0.284000, 0.716000, 0.286000, 0.714000, 0.288000, 0.712000, 0.290000, 0.710000, 0.292000, 0.708000, 0.294000, 0.706000, 0.296000, 0.704000, 0.298000, 0.702000, 0.300000, 0.700000, 0.302000, 0.698000, 0.304000, 0.696000, 0.306000, 0.694000, 0.308000, 0.692000, 0.310000, 0.690000, 0.312000, 0.688000, 0.314000, 0.686000, 0.316000, 0.684000, 0.318000, 0.682000, 0.320000, 0.680000, 0.322000, 0.678000, 0.324000, 0.676000, 0.326000, 0.674000, 0.328000, 0.672000, 0.330000, 0.670000, 0.332000, 0.668000, 0.334000, 0.666000, 0.336000, 0.664000, 0.338000, 0.662000, 0.340000, 0.660000, 0.342000, 0.658000, 0.344000, 0.656000, 0.346000, 0.654000, 0.348000, 0.652000, 0.350000, 0.650000, 0.352000, 0.648000, 0.354000, 0.646000, 0.356000, 0.644000, 0.358000, 0.642000, 0.360000, 0.640000, 0.362000, 0.638000, 0.364000, 0.636000, 0.366000, 0.634000, 0.368000, 0.632000, 0.370000, 0.630000, 0.372000, 0.628000, 0.374000, 0.626000, 0.376000, 0.624000, 0.378000, 0.622000, 0.380000, 0.620000, 0.382000, 0.618000, 0.384000, 0.616000, 0.386000, 0.614000, 0.388000, 0.612000, 0.390000, 0.610000, 0.392000, 0.608000, 0.394000, 0.606000, 0.396000, 0.604000, 0.398000, 0.602000, 0.400000, 0.600000, 0.402000, 0.598000, 0.404000, 0.596000, 0.406000, 0.594000, 0.408000, 0.592000, 0.410000, 0.590000, 0.412000, 0.588000, 0.414000, 0.586000, 0.416000, 0.584000, 0.418000, 0.582000, 0.420000, 0.580000, 0.422000, 0.578000, 0.424000, 0.576000, 0.426000, 0.574000, 0.428000, 0.572000, 0.430000, 0.570000, 0.432000, 0.568000, 0.434000, 0.566000, 0.436000, 0.564000, 0.438000, 0.562000, 0.440000, 0.560000, 0.442000, 0.558000, 0.444000, 0.556000, 0.446000, 0.554000, 0.448000, 0.552000, 0.450000, 0.550000, 0.452000, 0.548000, 0.454000, 0.546000, 0.456000, 0.544000, 0.458000, 0.542000, 0.460000, 0.540000, 0.462000, 0.538000, 0.464000, 0.536000, 0.466000, 0.534000, 0.468000, 0.532000, 0.470000, 0.530000, 0.472000, 0.528000, 0.474000, 0.526000, 0.476000, 0.524000, 0.478000, 0.522000, 0.480000, 0.520000, 0.482000, 0.518000, 0.484000, 0.516000, 0.486000, 0.514000, 0.488000, 0.512000, 0.490000, 0.510000, 0.492000, 0.508000, 0.494000, 0.506000, 0.496000, 0.504000, 0.498000, 0.502000, 0.500000, 0.500000, 0.502000, 0.498000, 0.504000, 0.496000, 0.506000, 0.494000, 0.508000, 0.492000, 0.510000, 0.490000, 0.512000, 0.488000, 0.514000, 0.486000, 0.516000, 0.484000, 0.518000, 0.482000, 0.520000, 0.480000, 0.522000, 0.478000, 0.524000, 0.476000, 0.526000, 0.474000, 0.528000, 0.472000, 0.530000, 0.470000, 0.532000, 0.468000, 0.534000, 0.466000, 0.536000, 0.464000, 0.538000, 0.462000, 0.540000, 0.460000, 0.542000, 0.458000, 0.544000, 0.456000, 0.546000, 0.454000, 0.548000, 0.452000, 0.550000, 0.450000, 0.552000, 0.448000, 0.554000, 0.446000, 0.556000, 0.444000, 0.558000, 0.442000, 0.560000, 0.440000, 0.562000, 0.438000, 0.564000, 0.436000, 0.566000, 0.434000, 0.568000, 0.432000, 0.570000, 0.430000, 0.572000, 0.428000, 0.574000, 0.426000, 0.576000, 0.424000, 0.578000, 0.422000, 0.580000, 0.420000, 0.582000, 0.418000, 0.584000, 0.416000, 0.586000, 0.414000, 0.588000, 0.412000, 0.590000, 0.410000, 0.592000, 0.408000, 0.594000, 0.406000, 0.596000, 0.404000, 0.598000, 0.402000, 0.600000, 0.400000, 0.602000, 0.398000, 0.604000, 0.396000, 0.606000, 0.394000, 0.608000, 0.392000, 0.610000, 0.390000, 0.612000, 0.388000, 0.614000, 0.386000, 0.616000, 0.384000, 0.618000, 0.382000, 0.620000, 0.380000, 0.622000, 0.378000, 0.624000, 0.376000, 0.626000, 0.374000, 0.628000, 0.372000, 0.630000, 0.370000, 0.632000, 0.368000, 0.634000, 0.366000, 0.636000, 0.364000, 0.638000, 0.362000, 0.640000, 0.360000, 0.642000, 0.358000, 0.644000, 0.356000, 0.646000, 0.354000, 0.648000, 0.352000, 0.650000, 0.350000, 0.652000, 0.348000, 0.654000, 0.346000, 0.656000, 0.344000, 0.658000, 0.342000, 0.660000, 0.340000, 0.662000, 0.338000, 0.664000, 0.336000, 0.666000, 0.334000, 0.668000, 0.332000, 0.670000, 0.330000, 0.672000, 0.328000, 0.674000, 0.326000, 0.676000, 0.324000, 0.678000, 0.322000, 0.680000, 0.320000, 0.682000, 0.318000, 0.684000, 0.316000, 0.686000, 0.314000, 0.688000, 0.312000, 0.690000, 0.310000, 0.692000, 0.308000, 0.694000, 0.306000, 0.696000, 0.304000, 0.698000, 0.302000, 0.700000, 0.300000, 0.702000, 0.298000, 0.704000, 0.296000, 0.706000, 0.294000, 0.708000, 0.292000, 0.710000, 0.290000, 0.712000, 0.288000, 0.714000, 0.286000, 0.716000, 0.284000, 0.718000, 0.282000, 0.720000, 0.280000, 0.722000, 0.278000, 0.724000, 0.276000, 0.726000, 0.274000, 0.728000, 0.272000, 0.730000, 0.270000, 0.732000, 0.268000, 0.734000, 0.266000, 0.736000, 0.264000, 0.738000, 0.262000, 0.740000, 0.260000, 0.742000, 0.258000, 0.744000, 0.256000, 0.746000, 0.254000, 0.748000, 0.252000, 0.750000, 0.250000, 0.752000, 0.248000, 0.754000, 0.246000, 0.756000, 0.244000, 0.758000, 0.242000, 0.760000, 0.240000, 0.762000, 0.238000, 0.764000, 0.236000, 0.766000, 0.234000, 0.768000, 0.232000, 0.770000, 0.230000, 0.772000, 0.228000, 0.774000, 0.226000, 0.776000, 0.224000, 0.778000, 0.222000, 0.780000, 0.220000, 0.782000, 0.218000, 0.784000, 0.216000, 0.786000, 0.214000, 0.788000, 0.212000, 0.790000, 0.210000, 0.792000, 0.208000, 0.794000, 0.206000, 0.796000, 0.204000, 0.798000, 0.202000, 0.800000, 0.200000, 0.802000, 0.198000, 0.804000, 0.196000, 0.806000, 0.194000, 0.808000, 0.192000, 0.810000, 0.190000, 0.812000, 0.188000, 0.814000, 0.186000, 0.816000, 0.184000, 0.818000, 0.182000, 0.820000, 0.180000, 0.822000, 0.178000, 0.824000, 0.176000, 0.826000, 0.174000, 0.828000, 0.172000, 0.830000, 0.170000, 0.832000, 0.168000, 0.834000, 0.166000, 0.836000, 0.164000, 0.838000, 0.162000, 0.840000, 0.160000, 0.842000, 0.158000, 0.844000, 0.156000, 0.846000, 0.154000, 0.848000, 0.152000, 0.850000, 0.150000, 0.852000, 0.148000, 0.854000, 0.146000, 0.856000, 0.144000, 0.858000, 0.142000, 0.860000, 0.140000, 0.862000, 0.138000, 0.864000, 0.136000, 0.866000, 0.134000, 0.868000, 0.132000, 0.870000, 0.130000, 0.872000, 0.128000, 0.874000, 0.126000, 0.876000, 0.124000, 0.878000, 0.122000, 0.880000, 0.120000, 0.882000, 0.118000, 0.884000, 0.116000, 0.886000, 0.114000, 0.888000, 0.112000, 0.890000, 0.110000, 0.892000, 0.108000, 0.894000, 0.106000, 0.896000, 0.104000, 0.898000, 0.102000, 0.900000, 0.100000, 0.902000, 0.098000, 0.904000, 0.096000, 0.906000, 0.094000, 0.908000, 0.092000, 0.910000, 0.090000, 0.912000, 0.088000, 0.914000, 0.086000, 0.916000, 0.084000, 0.918000, 0.082000, 0.920000, 0.080000, 0.922000, 0.078000, 0.924000, 0.076000, 0.926000, 0.074000, 0.928000, 0.072000, 0.930000, 0.070000, 0.932000, 0.068000, 0.934000, 0.066000, 0.936000, 0.064000, 0.938000, 0.062000, 0.940000, 0.060000, 0.942000, 0.058000, 0.944000, 0.056000, 0.946000, 0.054000, 0.948000, 0.052000, 0.950000, 0.050000, 0.952000, 0.048000, 0.954000, 0.046000, 0.956000, 0.044000, 0.958000, 0.042000, 0.960000, 0.040000, 0.962000, 0.038000, 0.964000, 0.036000, 0.966000, 0.034000, 0.968000, 0.032000, 0.970000, 0.030000, 0.972000, 0.028000, 0.974000, 0.026000, 0.976000, 0.024000, 0.978000, 0.022000, 0.980000, 0.020000, 0.982000, 0.018000, 0.984000, 0.016000, 0.986000, 0.014000, 0.988000, 0.012000, 0.990000, 0.010000, 0.992000, 0.008000, 0.994000, 0.006000, 0.996000, 0.004000, 0.998000, 0.002000, 1.000000, 0.000000, }; unsigned int number_of_weights_30_3 = 496; double weights_30_3[] = { 0.000000, 0.000000, 1.000000, 0.000000, 0.033333, 0.966667, 0.000000, 0.066667, 0.933333, 0.000000, 0.100000, 0.900000, 0.000000, 0.133333, 0.866667, 0.000000, 0.166667, 0.833333, 0.000000, 0.200000, 0.800000, 0.000000, 0.233333, 0.766667, 0.000000, 0.266667, 0.733333, 0.000000, 0.300000, 0.700000, 0.000000, 0.333333, 0.666667, 0.000000, 0.366667, 0.633333, 0.000000, 0.400000, 0.600000, 0.000000, 0.433333, 0.566667, 0.000000, 0.466667, 0.533333, 0.000000, 0.500000, 0.500000, 0.000000, 0.533333, 0.466667, 0.000000, 0.566667, 0.433333, 0.000000, 0.600000, 0.400000, 0.000000, 0.633333, 0.366667, 0.000000, 0.666667, 0.333333, 0.000000, 0.700000, 0.300000, 0.000000, 0.733333, 0.266667, 0.000000, 0.766667, 0.233333, 0.000000, 0.800000, 0.200000, 0.000000, 0.833333, 0.166667, 0.000000, 0.866667, 0.133333, 0.000000, 0.900000, 0.100000, 0.000000, 0.933333, 0.066667, 0.000000, 0.966667, 0.033333, 0.000000, 1.000000, 0.000000, 0.033333, 0.000000, 0.966667, 0.033333, 0.033333, 0.933333, 0.033333, 0.066667, 0.900000, 0.033333, 0.100000, 0.866667, 0.033333, 0.133333, 0.833333, 0.033333, 0.166667, 0.800000, 0.033333, 0.200000, 0.766667, 0.033333, 0.233333, 0.733333, 0.033333, 0.266667, 0.700000, 0.033333, 0.300000, 0.666667, 0.033333, 0.333333, 0.633333, 0.033333, 0.366667, 0.600000, 0.033333, 0.400000, 0.566667, 0.033333, 0.433333, 0.533333, 0.033333, 0.466667, 0.500000, 0.033333, 0.500000, 0.466667, 0.033333, 0.533333, 0.433333, 0.033333, 0.566667, 0.400000, 0.033333, 0.600000, 0.366667, 0.033333, 0.633333, 0.333333, 0.033333, 0.666667, 0.300000, 0.033333, 0.700000, 0.266667, 0.033333, 0.733333, 0.233333, 0.033333, 0.766667, 0.200000, 0.033333, 0.800000, 0.166667, 0.033333, 0.833333, 0.133333, 0.033333, 0.866667, 0.100000, 0.033333, 0.900000, 0.066667, 0.033333, 0.933333, 0.033333, 0.033333, 0.966667, 0.000000, 0.066667, 0.000000, 0.933333, 0.066667, 0.033333, 0.900000, 0.066667, 0.066667, 0.866667, 0.066667, 0.100000, 0.833333, 0.066667, 0.133333, 0.800000, 0.066667, 0.166667, 0.766667, 0.066667, 0.200000, 0.733333, 0.066667, 0.233333, 0.700000, 0.066667, 0.266667, 0.666667, 0.066667, 0.300000, 0.633333, 0.066667, 0.333333, 0.600000, 0.066667, 0.366667, 0.566667, 0.066667, 0.400000, 0.533333, 0.066667, 0.433333, 0.500000, 0.066667, 0.466667, 0.466667, 0.066667, 0.500000, 0.433333, 0.066667, 0.533333, 0.400000, 0.066667, 0.566667, 0.366667, 0.066667, 0.600000, 0.333333, 0.066667, 0.633333, 0.300000, 0.066667, 0.666667, 0.266667, 0.066667, 0.700000, 0.233333, 0.066667, 0.733333, 0.200000, 0.066667, 0.766667, 0.166667, 0.066667, 0.800000, 0.133333, 0.066667, 0.833333, 0.100000, 0.066667, 0.866667, 0.066667, 0.066667, 0.900000, 0.033333, 0.066667, 0.933333, 0.000000, 0.100000, 0.000000, 0.900000, 0.100000, 0.033333, 0.866667, 0.100000, 0.066667, 0.833333, 0.100000, 0.100000, 0.800000, 0.100000, 0.133333, 0.766667, 0.100000, 0.166667, 0.733333, 0.100000, 0.200000, 0.700000, 0.100000, 0.233333, 0.666667, 0.100000, 0.266667, 0.633333, 0.100000, 0.300000, 0.600000, 0.100000, 0.333333, 0.566667, 0.100000, 0.366667, 0.533333, 0.100000, 0.400000, 0.500000, 0.100000, 0.433333, 0.466667, 0.100000, 0.466667, 0.433333, 0.100000, 0.500000, 0.400000, 0.100000, 0.533333, 0.366667, 0.100000, 0.566667, 0.333333, 0.100000, 0.600000, 0.300000, 0.100000, 0.633333, 0.266667, 0.100000, 0.666667, 0.233333, 0.100000, 0.700000, 0.200000, 0.100000, 0.733333, 0.166667, 0.100000, 0.766667, 0.133333, 0.100000, 0.800000, 0.100000, 0.100000, 0.833333, 0.066667, 0.100000, 0.866667, 0.033333, 0.100000, 0.900000, 0.000000, 0.133333, 0.000000, 0.866667, 0.133333, 0.033333, 0.833333, 0.133333, 0.066667, 0.800000, 0.133333, 0.100000, 0.766667, 0.133333, 0.133333, 0.733333, 0.133333, 0.166667, 0.700000, 0.133333, 0.200000, 0.666667, 0.133333, 0.233333, 0.633333, 0.133333, 0.266667, 0.600000, 0.133333, 0.300000, 0.566667, 0.133333, 0.333333, 0.533333, 0.133333, 0.366667, 0.500000, 0.133333, 0.400000, 0.466667, 0.133333, 0.433333, 0.433333, 0.133333, 0.466667, 0.400000, 0.133333, 0.500000, 0.366667, 0.133333, 0.533333, 0.333333, 0.133333, 0.566667, 0.300000, 0.133333, 0.600000, 0.266667, 0.133333, 0.633333, 0.233333, 0.133333, 0.666667, 0.200000, 0.133333, 0.700000, 0.166667, 0.133333, 0.733333, 0.133333, 0.133333, 0.766667, 0.100000, 0.133333, 0.800000, 0.066667, 0.133333, 0.833333, 0.033333, 0.133333, 0.866667, 0.000000, 0.166667, 0.000000, 0.833333, 0.166667, 0.033333, 0.800000, 0.166667, 0.066667, 0.766667, 0.166667, 0.100000, 0.733333, 0.166667, 0.133333, 0.700000, 0.166667, 0.166667, 0.666667, 0.166667, 0.200000, 0.633333, 0.166667, 0.233333, 0.600000, 0.166667, 0.266667, 0.566667, 0.166667, 0.300000, 0.533333, 0.166667, 0.333333, 0.500000, 0.166667, 0.366667, 0.466667, 0.166667, 0.400000, 0.433333, 0.166667, 0.433333, 0.400000, 0.166667, 0.466667, 0.366667, 0.166667, 0.500000, 0.333333, 0.166667, 0.533333, 0.300000, 0.166667, 0.566667, 0.266667, 0.166667, 0.600000, 0.233333, 0.166667, 0.633333, 0.200000, 0.166667, 0.666667, 0.166667, 0.166667, 0.700000, 0.133333, 0.166667, 0.733333, 0.100000, 0.166667, 0.766667, 0.066667, 0.166667, 0.800000, 0.033333, 0.166667, 0.833333, 0.000000, 0.200000, 0.000000, 0.800000, 0.200000, 0.033333, 0.766667, 0.200000, 0.066667, 0.733333, 0.200000, 0.100000, 0.700000, 0.200000, 0.133333, 0.666667, 0.200000, 0.166667, 0.633333, 0.200000, 0.200000, 0.600000, 0.200000, 0.233333, 0.566667, 0.200000, 0.266667, 0.533333, 0.200000, 0.300000, 0.500000, 0.200000, 0.333333, 0.466667, 0.200000, 0.366667, 0.433333, 0.200000, 0.400000, 0.400000, 0.200000, 0.433333, 0.366667, 0.200000, 0.466667, 0.333333, 0.200000, 0.500000, 0.300000, 0.200000, 0.533333, 0.266667, 0.200000, 0.566667, 0.233333, 0.200000, 0.600000, 0.200000, 0.200000, 0.633333, 0.166667, 0.200000, 0.666667, 0.133333, 0.200000, 0.700000, 0.100000, 0.200000, 0.733333, 0.066667, 0.200000, 0.766667, 0.033333, 0.200000, 0.800000, 0.000000, 0.233333, 0.000000, 0.766667, 0.233333, 0.033333, 0.733333, 0.233333, 0.066667, 0.700000, 0.233333, 0.100000, 0.666667, 0.233333, 0.133333, 0.633333, 0.233333, 0.166667, 0.600000, 0.233333, 0.200000, 0.566667, 0.233333, 0.233333, 0.533333, 0.233333, 0.266667, 0.500000, 0.233333, 0.300000, 0.466667, 0.233333, 0.333333, 0.433333, 0.233333, 0.366667, 0.400000, 0.233333, 0.400000, 0.366667, 0.233333, 0.433333, 0.333333, 0.233333, 0.466667, 0.300000, 0.233333, 0.500000, 0.266667, 0.233333, 0.533333, 0.233333, 0.233333, 0.566667, 0.200000, 0.233333, 0.600000, 0.166667, 0.233333, 0.633333, 0.133333, 0.233333, 0.666667, 0.100000, 0.233333, 0.700000, 0.066667, 0.233333, 0.733333, 0.033333, 0.233333, 0.766667, 0.000000, 0.266667, 0.000000, 0.733333, 0.266667, 0.033333, 0.700000, 0.266667, 0.066667, 0.666667, 0.266667, 0.100000, 0.633333, 0.266667, 0.133333, 0.600000, 0.266667, 0.166667, 0.566667, 0.266667, 0.200000, 0.533333, 0.266667, 0.233333, 0.500000, 0.266667, 0.266667, 0.466667, 0.266667, 0.300000, 0.433333, 0.266667, 0.333333, 0.400000, 0.266667, 0.366667, 0.366667, 0.266667, 0.400000, 0.333333, 0.266667, 0.433333, 0.300000, 0.266667, 0.466667, 0.266667, 0.266667, 0.500000, 0.233333, 0.266667, 0.533333, 0.200000, 0.266667, 0.566667, 0.166667, 0.266667, 0.600000, 0.133333, 0.266667, 0.633333, 0.100000, 0.266667, 0.666667, 0.066667, 0.266667, 0.700000, 0.033333, 0.266667, 0.733333, 0.000000, 0.300000, 0.000000, 0.700000, 0.300000, 0.033333, 0.666667, 0.300000, 0.066667, 0.633333, 0.300000, 0.100000, 0.600000, 0.300000, 0.133333, 0.566667, 0.300000, 0.166667, 0.533333, 0.300000, 0.200000, 0.500000, 0.300000, 0.233333, 0.466667, 0.300000, 0.266667, 0.433333, 0.300000, 0.300000, 0.400000, 0.300000, 0.333333, 0.366667, 0.300000, 0.366667, 0.333333, 0.300000, 0.400000, 0.300000, 0.300000, 0.433333, 0.266667, 0.300000, 0.466667, 0.233333, 0.300000, 0.500000, 0.200000, 0.300000, 0.533333, 0.166667, 0.300000, 0.566667, 0.133333, 0.300000, 0.600000, 0.100000, 0.300000, 0.633333, 0.066667, 0.300000, 0.666667, 0.033333, 0.300000, 0.700000, 0.000000, 0.333333, 0.000000, 0.666667, 0.333333, 0.033333, 0.633333, 0.333333, 0.066667, 0.600000, 0.333333, 0.100000, 0.566667, 0.333333, 0.133333, 0.533333, 0.333333, 0.166667, 0.500000, 0.333333, 0.200000, 0.466667, 0.333333, 0.233333, 0.433333, 0.333333, 0.266667, 0.400000, 0.333333, 0.300000, 0.366667, 0.333333, 0.333333, 0.333333, 0.333333, 0.366667, 0.300000, 0.333333, 0.400000, 0.266667, 0.333333, 0.433333, 0.233333, 0.333333, 0.466667, 0.200000, 0.333333, 0.500000, 0.166667, 0.333333, 0.533333, 0.133333, 0.333333, 0.566667, 0.100000, 0.333333, 0.600000, 0.066667, 0.333333, 0.633333, 0.033333, 0.333333, 0.666667, 0.000000, 0.366667, 0.000000, 0.633333, 0.366667, 0.033333, 0.600000, 0.366667, 0.066667, 0.566667, 0.366667, 0.100000, 0.533333, 0.366667, 0.133333, 0.500000, 0.366667, 0.166667, 0.466667, 0.366667, 0.200000, 0.433333, 0.366667, 0.233333, 0.400000, 0.366667, 0.266667, 0.366667, 0.366667, 0.300000, 0.333333, 0.366667, 0.333333, 0.300000, 0.366667, 0.366667, 0.266667, 0.366667, 0.400000, 0.233333, 0.366667, 0.433333, 0.200000, 0.366667, 0.466667, 0.166667, 0.366667, 0.500000, 0.133333, 0.366667, 0.533333, 0.100000, 0.366667, 0.566667, 0.066667, 0.366667, 0.600000, 0.033333, 0.366667, 0.633333, 0.000000, 0.400000, 0.000000, 0.600000, 0.400000, 0.033333, 0.566667, 0.400000, 0.066667, 0.533333, 0.400000, 0.100000, 0.500000, 0.400000, 0.133333, 0.466667, 0.400000, 0.166667, 0.433333, 0.400000, 0.200000, 0.400000, 0.400000, 0.233333, 0.366667, 0.400000, 0.266667, 0.333333, 0.400000, 0.300000, 0.300000, 0.400000, 0.333333, 0.266667, 0.400000, 0.366667, 0.233333, 0.400000, 0.400000, 0.200000, 0.400000, 0.433333, 0.166667, 0.400000, 0.466667, 0.133333, 0.400000, 0.500000, 0.100000, 0.400000, 0.533333, 0.066667, 0.400000, 0.566667, 0.033333, 0.400000, 0.600000, 0.000000, 0.433333, 0.000000, 0.566667, 0.433333, 0.033333, 0.533333, 0.433333, 0.066667, 0.500000, 0.433333, 0.100000, 0.466667, 0.433333, 0.133333, 0.433333, 0.433333, 0.166667, 0.400000, 0.433333, 0.200000, 0.366667, 0.433333, 0.233333, 0.333333, 0.433333, 0.266667, 0.300000, 0.433333, 0.300000, 0.266667, 0.433333, 0.333333, 0.233333, 0.433333, 0.366667, 0.200000, 0.433333, 0.400000, 0.166667, 0.433333, 0.433333, 0.133333, 0.433333, 0.466667, 0.100000, 0.433333, 0.500000, 0.066667, 0.433333, 0.533333, 0.033333, 0.433333, 0.566667, 0.000000, 0.466667, 0.000000, 0.533333, 0.466667, 0.033333, 0.500000, 0.466667, 0.066667, 0.466667, 0.466667, 0.100000, 0.433333, 0.466667, 0.133333, 0.400000, 0.466667, 0.166667, 0.366667, 0.466667, 0.200000, 0.333333, 0.466667, 0.233333, 0.300000, 0.466667, 0.266667, 0.266667, 0.466667, 0.300000, 0.233333, 0.466667, 0.333333, 0.200000, 0.466667, 0.366667, 0.166667, 0.466667, 0.400000, 0.133333, 0.466667, 0.433333, 0.100000, 0.466667, 0.466667, 0.066667, 0.466667, 0.500000, 0.033333, 0.466667, 0.533333, 0.000000, 0.500000, 0.000000, 0.500000, 0.500000, 0.033333, 0.466667, 0.500000, 0.066667, 0.433333, 0.500000, 0.100000, 0.400000, 0.500000, 0.133333, 0.366667, 0.500000, 0.166667, 0.333333, 0.500000, 0.200000, 0.300000, 0.500000, 0.233333, 0.266667, 0.500000, 0.266667, 0.233333, 0.500000, 0.300000, 0.200000, 0.500000, 0.333333, 0.166667, 0.500000, 0.366667, 0.133333, 0.500000, 0.400000, 0.100000, 0.500000, 0.433333, 0.066667, 0.500000, 0.466667, 0.033333, 0.500000, 0.500000, 0.000000, 0.533333, 0.000000, 0.466667, 0.533333, 0.033333, 0.433333, 0.533333, 0.066667, 0.400000, 0.533333, 0.100000, 0.366667, 0.533333, 0.133333, 0.333333, 0.533333, 0.166667, 0.300000, 0.533333, 0.200000, 0.266667, 0.533333, 0.233333, 0.233333, 0.533333, 0.266667, 0.200000, 0.533333, 0.300000, 0.166667, 0.533333, 0.333333, 0.133333, 0.533333, 0.366667, 0.100000, 0.533333, 0.400000, 0.066667, 0.533333, 0.433333, 0.033333, 0.533333, 0.466667, 0.000000, 0.566667, 0.000000, 0.433333, 0.566667, 0.033333, 0.400000, 0.566667, 0.066667, 0.366667, 0.566667, 0.100000, 0.333333, 0.566667, 0.133333, 0.300000, 0.566667, 0.166667, 0.266667, 0.566667, 0.200000, 0.233333, 0.566667, 0.233333, 0.200000, 0.566667, 0.266667, 0.166667, 0.566667, 0.300000, 0.133333, 0.566667, 0.333333, 0.100000, 0.566667, 0.366667, 0.066667, 0.566667, 0.400000, 0.033333, 0.566667, 0.433333, 0.000000, 0.600000, 0.000000, 0.400000, 0.600000, 0.033333, 0.366667, 0.600000, 0.066667, 0.333333, 0.600000, 0.100000, 0.300000, 0.600000, 0.133333, 0.266667, 0.600000, 0.166667, 0.233333, 0.600000, 0.200000, 0.200000, 0.600000, 0.233333, 0.166667, 0.600000, 0.266667, 0.133333, 0.600000, 0.300000, 0.100000, 0.600000, 0.333333, 0.066667, 0.600000, 0.366667, 0.033333, 0.600000, 0.400000, 0.000000, 0.633333, 0.000000, 0.366667, 0.633333, 0.033333, 0.333333, 0.633333, 0.066667, 0.300000, 0.633333, 0.100000, 0.266667, 0.633333, 0.133333, 0.233333, 0.633333, 0.166667, 0.200000, 0.633333, 0.200000, 0.166667, 0.633333, 0.233333, 0.133333, 0.633333, 0.266667, 0.100000, 0.633333, 0.300000, 0.066667, 0.633333, 0.333333, 0.033333, 0.633333, 0.366667, 0.000000, 0.666667, 0.000000, 0.333333, 0.666667, 0.033333, 0.300000, 0.666667, 0.066667, 0.266667, 0.666667, 0.100000, 0.233333, 0.666667, 0.133333, 0.200000, 0.666667, 0.166667, 0.166667, 0.666667, 0.200000, 0.133333, 0.666667, 0.233333, 0.100000, 0.666667, 0.266667, 0.066667, 0.666667, 0.300000, 0.033333, 0.666667, 0.333333, 0.000000, 0.700000, 0.000000, 0.300000, 0.700000, 0.033333, 0.266667, 0.700000, 0.066667, 0.233333, 0.700000, 0.100000, 0.200000, 0.700000, 0.133333, 0.166667, 0.700000, 0.166667, 0.133333, 0.700000, 0.200000, 0.100000, 0.700000, 0.233333, 0.066667, 0.700000, 0.266667, 0.033333, 0.700000, 0.300000, 0.000000, 0.733333, 0.000000, 0.266667, 0.733333, 0.033333, 0.233333, 0.733333, 0.066667, 0.200000, 0.733333, 0.100000, 0.166667, 0.733333, 0.133333, 0.133333, 0.733333, 0.166667, 0.100000, 0.733333, 0.200000, 0.066667, 0.733333, 0.233333, 0.033333, 0.733333, 0.266667, 0.000000, 0.766667, 0.000000, 0.233333, 0.766667, 0.033333, 0.200000, 0.766667, 0.066667, 0.166667, 0.766667, 0.100000, 0.133333, 0.766667, 0.133333, 0.100000, 0.766667, 0.166667, 0.066667, 0.766667, 0.200000, 0.033333, 0.766667, 0.233333, 0.000000, 0.800000, 0.000000, 0.200000, 0.800000, 0.033333, 0.166667, 0.800000, 0.066667, 0.133333, 0.800000, 0.100000, 0.100000, 0.800000, 0.133333, 0.066667, 0.800000, 0.166667, 0.033333, 0.800000, 0.200000, 0.000000, 0.833333, 0.000000, 0.166667, 0.833333, 0.033333, 0.133333, 0.833333, 0.066667, 0.100000, 0.833333, 0.100000, 0.066667, 0.833333, 0.133333, 0.033333, 0.833333, 0.166667, 0.000000, 0.866667, 0.000000, 0.133333, 0.866667, 0.033333, 0.100000, 0.866667, 0.066667, 0.066667, 0.866667, 0.100000, 0.033333, 0.866667, 0.133333, 0.000000, 0.900000, 0.000000, 0.100000, 0.900000, 0.033333, 0.066667, 0.900000, 0.066667, 0.033333, 0.900000, 0.100000, 0.000000, 0.933333, 0.000000, 0.066667, 0.933333, 0.033333, 0.033333, 0.933333, 0.066667, 0.000000, 0.966667, 0.000000, 0.033333, 0.966667, 0.033333, 0.000000, 1.000000, 0.000000, 0.000000, }; unsigned int number_of_weights_12_4 = 455; double weights_12_4[] = { 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.083333, 0.916667, 0.000000, 0.000000, 0.166667, 0.833333, 0.000000, 0.000000, 0.250000, 0.750000, 0.000000, 0.000000, 0.333333, 0.666667, 0.000000, 0.000000, 0.416667, 0.583333, 0.000000, 0.000000, 0.500000, 0.500000, 0.000000, 0.000000, 0.583333, 0.416667, 0.000000, 0.000000, 0.666667, 0.333333, 0.000000, 0.000000, 0.750000, 0.250000, 0.000000, 0.000000, 0.833333, 0.166667, 0.000000, 0.000000, 0.916667, 0.083333, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.083333, 0.000000, 0.916667, 0.000000, 0.083333, 0.083333, 0.833333, 0.000000, 0.083333, 0.166667, 0.750000, 0.000000, 0.083333, 0.250000, 0.666667, 0.000000, 0.083333, 0.333333, 0.583333, 0.000000, 0.083333, 0.416667, 0.500000, 0.000000, 0.083333, 0.500000, 0.416667, 0.000000, 0.083333, 0.583333, 0.333333, 0.000000, 0.083333, 0.666667, 0.250000, 0.000000, 0.083333, 0.750000, 0.166667, 0.000000, 0.083333, 0.833333, 0.083333, 0.000000, 0.083333, 0.916667, 0.000000, 0.000000, 0.166667, 0.000000, 0.833333, 0.000000, 0.166667, 0.083333, 0.750000, 0.000000, 0.166667, 0.166667, 0.666667, 0.000000, 0.166667, 0.250000, 0.583333, 0.000000, 0.166667, 0.333333, 0.500000, 0.000000, 0.166667, 0.416667, 0.416667, 0.000000, 0.166667, 0.500000, 0.333333, 0.000000, 0.166667, 0.583333, 0.250000, 0.000000, 0.166667, 0.666667, 0.166667, 0.000000, 0.166667, 0.750000, 0.083333, 0.000000, 0.166667, 0.833333, 0.000000, 0.000000, 0.250000, 0.000000, 0.750000, 0.000000, 0.250000, 0.083333, 0.666667, 0.000000, 0.250000, 0.166667, 0.583333, 0.000000, 0.250000, 0.250000, 0.500000, 0.000000, 0.250000, 0.333333, 0.416667, 0.000000, 0.250000, 0.416667, 0.333333, 0.000000, 0.250000, 0.500000, 0.250000, 0.000000, 0.250000, 0.583333, 0.166667, 0.000000, 0.250000, 0.666667, 0.083333, 0.000000, 0.250000, 0.750000, 0.000000, 0.000000, 0.333333, 0.000000, 0.666667, 0.000000, 0.333333, 0.083333, 0.583333, 0.000000, 0.333333, 0.166667, 0.500000, 0.000000, 0.333333, 0.250000, 0.416667, 0.000000, 0.333333, 0.333333, 0.333333, 0.000000, 0.333333, 0.416667, 0.250000, 0.000000, 0.333333, 0.500000, 0.166667, 0.000000, 0.333333, 0.583333, 0.083333, 0.000000, 0.333333, 0.666667, 0.000000, 0.000000, 0.416667, 0.000000, 0.583333, 0.000000, 0.416667, 0.083333, 0.500000, 0.000000, 0.416667, 0.166667, 0.416667, 0.000000, 0.416667, 0.250000, 0.333333, 0.000000, 0.416667, 0.333333, 0.250000, 0.000000, 0.416667, 0.416667, 0.166667, 0.000000, 0.416667, 0.500000, 0.083333, 0.000000, 0.416667, 0.583333, 0.000000, 0.000000, 0.500000, 0.000000, 0.500000, 0.000000, 0.500000, 0.083333, 0.416667, 0.000000, 0.500000, 0.166667, 0.333333, 0.000000, 0.500000, 0.250000, 0.250000, 0.000000, 0.500000, 0.333333, 0.166667, 0.000000, 0.500000, 0.416667, 0.083333, 0.000000, 0.500000, 0.500000, 0.000000, 0.000000, 0.583333, 0.000000, 0.416667, 0.000000, 0.583333, 0.083333, 0.333333, 0.000000, 0.583333, 0.166667, 0.250000, 0.000000, 0.583333, 0.250000, 0.166667, 0.000000, 0.583333, 0.333333, 0.083333, 0.000000, 0.583333, 0.416667, 0.000000, 0.000000, 0.666667, 0.000000, 0.333333, 0.000000, 0.666667, 0.083333, 0.250000, 0.000000, 0.666667, 0.166667, 0.166667, 0.000000, 0.666667, 0.250000, 0.083333, 0.000000, 0.666667, 0.333333, 0.000000, 0.000000, 0.750000, 0.000000, 0.250000, 0.000000, 0.750000, 0.083333, 0.166667, 0.000000, 0.750000, 0.166667, 0.083333, 0.000000, 0.750000, 0.250000, 0.000000, 0.000000, 0.833333, 0.000000, 0.166667, 0.000000, 0.833333, 0.083333, 0.083333, 0.000000, 0.833333, 0.166667, 0.000000, 0.000000, 0.916667, 0.000000, 0.083333, 0.000000, 0.916667, 0.083333, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.083333, 0.000000, 0.000000, 0.916667, 0.083333, 0.000000, 0.083333, 0.833333, 0.083333, 0.000000, 0.166667, 0.750000, 0.083333, 0.000000, 0.250000, 0.666667, 0.083333, 0.000000, 0.333333, 0.583333, 0.083333, 0.000000, 0.416667, 0.500000, 0.083333, 0.000000, 0.500000, 0.416667, 0.083333, 0.000000, 0.583333, 0.333333, 0.083333, 0.000000, 0.666667, 0.250000, 0.083333, 0.000000, 0.750000, 0.166667, 0.083333, 0.000000, 0.833333, 0.083333, 0.083333, 0.000000, 0.916667, 0.000000, 0.083333, 0.083333, 0.000000, 0.833333, 0.083333, 0.083333, 0.083333, 0.750000, 0.083333, 0.083333, 0.166667, 0.666667, 0.083333, 0.083333, 0.250000, 0.583333, 0.083333, 0.083333, 0.333333, 0.500000, 0.083333, 0.083333, 0.416667, 0.416667, 0.083333, 0.083333, 0.500000, 0.333333, 0.083333, 0.083333, 0.583333, 0.250000, 0.083333, 0.083333, 0.666667, 0.166667, 0.083333, 0.083333, 0.750000, 0.083333, 0.083333, 0.083333, 0.833333, 0.000000, 0.083333, 0.166667, 0.000000, 0.750000, 0.083333, 0.166667, 0.083333, 0.666667, 0.083333, 0.166667, 0.166667, 0.583333, 0.083333, 0.166667, 0.250000, 0.500000, 0.083333, 0.166667, 0.333333, 0.416667, 0.083333, 0.166667, 0.416667, 0.333333, 0.083333, 0.166667, 0.500000, 0.250000, 0.083333, 0.166667, 0.583333, 0.166667, 0.083333, 0.166667, 0.666667, 0.083333, 0.083333, 0.166667, 0.750000, 0.000000, 0.083333, 0.250000, 0.000000, 0.666667, 0.083333, 0.250000, 0.083333, 0.583333, 0.083333, 0.250000, 0.166667, 0.500000, 0.083333, 0.250000, 0.250000, 0.416667, 0.083333, 0.250000, 0.333333, 0.333333, 0.083333, 0.250000, 0.416667, 0.250000, 0.083333, 0.250000, 0.500000, 0.166667, 0.083333, 0.250000, 0.583333, 0.083333, 0.083333, 0.250000, 0.666667, 0.000000, 0.083333, 0.333333, 0.000000, 0.583333, 0.083333, 0.333333, 0.083333, 0.500000, 0.083333, 0.333333, 0.166667, 0.416667, 0.083333, 0.333333, 0.250000, 0.333333, 0.083333, 0.333333, 0.333333, 0.250000, 0.083333, 0.333333, 0.416667, 0.166667, 0.083333, 0.333333, 0.500000, 0.083333, 0.083333, 0.333333, 0.583333, 0.000000, 0.083333, 0.416667, 0.000000, 0.500000, 0.083333, 0.416667, 0.083333, 0.416667, 0.083333, 0.416667, 0.166667, 0.333333, 0.083333, 0.416667, 0.250000, 0.250000, 0.083333, 0.416667, 0.333333, 0.166667, 0.083333, 0.416667, 0.416667, 0.083333, 0.083333, 0.416667, 0.500000, 0.000000, 0.083333, 0.500000, 0.000000, 0.416667, 0.083333, 0.500000, 0.083333, 0.333333, 0.083333, 0.500000, 0.166667, 0.250000, 0.083333, 0.500000, 0.250000, 0.166667, 0.083333, 0.500000, 0.333333, 0.083333, 0.083333, 0.500000, 0.416667, 0.000000, 0.083333, 0.583333, 0.000000, 0.333333, 0.083333, 0.583333, 0.083333, 0.250000, 0.083333, 0.583333, 0.166667, 0.166667, 0.083333, 0.583333, 0.250000, 0.083333, 0.083333, 0.583333, 0.333333, 0.000000, 0.083333, 0.666667, 0.000000, 0.250000, 0.083333, 0.666667, 0.083333, 0.166667, 0.083333, 0.666667, 0.166667, 0.083333, 0.083333, 0.666667, 0.250000, 0.000000, 0.083333, 0.750000, 0.000000, 0.166667, 0.083333, 0.750000, 0.083333, 0.083333, 0.083333, 0.750000, 0.166667, 0.000000, 0.083333, 0.833333, 0.000000, 0.083333, 0.083333, 0.833333, 0.083333, 0.000000, 0.083333, 0.916667, 0.000000, 0.000000, 0.166667, 0.000000, 0.000000, 0.833333, 0.166667, 0.000000, 0.083333, 0.750000, 0.166667, 0.000000, 0.166667, 0.666667, 0.166667, 0.000000, 0.250000, 0.583333, 0.166667, 0.000000, 0.333333, 0.500000, 0.166667, 0.000000, 0.416667, 0.416667, 0.166667, 0.000000, 0.500000, 0.333333, 0.166667, 0.000000, 0.583333, 0.250000, 0.166667, 0.000000, 0.666667, 0.166667, 0.166667, 0.000000, 0.750000, 0.083333, 0.166667, 0.000000, 0.833333, 0.000000, 0.166667, 0.083333, 0.000000, 0.750000, 0.166667, 0.083333, 0.083333, 0.666667, 0.166667, 0.083333, 0.166667, 0.583333, 0.166667, 0.083333, 0.250000, 0.500000, 0.166667, 0.083333, 0.333333, 0.416667, 0.166667, 0.083333, 0.416667, 0.333333, 0.166667, 0.083333, 0.500000, 0.250000, 0.166667, 0.083333, 0.583333, 0.166667, 0.166667, 0.083333, 0.666667, 0.083333, 0.166667, 0.083333, 0.750000, 0.000000, 0.166667, 0.166667, 0.000000, 0.666667, 0.166667, 0.166667, 0.083333, 0.583333, 0.166667, 0.166667, 0.166667, 0.500000, 0.166667, 0.166667, 0.250000, 0.416667, 0.166667, 0.166667, 0.333333, 0.333333, 0.166667, 0.166667, 0.416667, 0.250000, 0.166667, 0.166667, 0.500000, 0.166667, 0.166667, 0.166667, 0.583333, 0.083333, 0.166667, 0.166667, 0.666667, 0.000000, 0.166667, 0.250000, 0.000000, 0.583333, 0.166667, 0.250000, 0.083333, 0.500000, 0.166667, 0.250000, 0.166667, 0.416667, 0.166667, 0.250000, 0.250000, 0.333333, 0.166667, 0.250000, 0.333333, 0.250000, 0.166667, 0.250000, 0.416667, 0.166667, 0.166667, 0.250000, 0.500000, 0.083333, 0.166667, 0.250000, 0.583333, 0.000000, 0.166667, 0.333333, 0.000000, 0.500000, 0.166667, 0.333333, 0.083333, 0.416667, 0.166667, 0.333333, 0.166667, 0.333333, 0.166667, 0.333333, 0.250000, 0.250000, 0.166667, 0.333333, 0.333333, 0.166667, 0.166667, 0.333333, 0.416667, 0.083333, 0.166667, 0.333333, 0.500000, 0.000000, 0.166667, 0.416667, 0.000000, 0.416667, 0.166667, 0.416667, 0.083333, 0.333333, 0.166667, 0.416667, 0.166667, 0.250000, 0.166667, 0.416667, 0.250000, 0.166667, 0.166667, 0.416667, 0.333333, 0.083333, 0.166667, 0.416667, 0.416667, 0.000000, 0.166667, 0.500000, 0.000000, 0.333333, 0.166667, 0.500000, 0.083333, 0.250000, 0.166667, 0.500000, 0.166667, 0.166667, 0.166667, 0.500000, 0.250000, 0.083333, 0.166667, 0.500000, 0.333333, 0.000000, 0.166667, 0.583333, 0.000000, 0.250000, 0.166667, 0.583333, 0.083333, 0.166667, 0.166667, 0.583333, 0.166667, 0.083333, 0.166667, 0.583333, 0.250000, 0.000000, 0.166667, 0.666667, 0.000000, 0.166667, 0.166667, 0.666667, 0.083333, 0.083333, 0.166667, 0.666667, 0.166667, 0.000000, 0.166667, 0.750000, 0.000000, 0.083333, 0.166667, 0.750000, 0.083333, 0.000000, 0.166667, 0.833333, 0.000000, 0.000000, 0.250000, 0.000000, 0.000000, 0.750000, 0.250000, 0.000000, 0.083333, 0.666667, 0.250000, 0.000000, 0.166667, 0.583333, 0.250000, 0.000000, 0.250000, 0.500000, 0.250000, 0.000000, 0.333333, 0.416667, 0.250000, 0.000000, 0.416667, 0.333333, 0.250000, 0.000000, 0.500000, 0.250000, 0.250000, 0.000000, 0.583333, 0.166667, 0.250000, 0.000000, 0.666667, 0.083333, 0.250000, 0.000000, 0.750000, 0.000000, 0.250000, 0.083333, 0.000000, 0.666667, 0.250000, 0.083333, 0.083333, 0.583333, 0.250000, 0.083333, 0.166667, 0.500000, 0.250000, 0.083333, 0.250000, 0.416667, 0.250000, 0.083333, 0.333333, 0.333333, 0.250000, 0.083333, 0.416667, 0.250000, 0.250000, 0.083333, 0.500000, 0.166667, 0.250000, 0.083333, 0.583333, 0.083333, 0.250000, 0.083333, 0.666667, 0.000000, 0.250000, 0.166667, 0.000000, 0.583333, 0.250000, 0.166667, 0.083333, 0.500000, 0.250000, 0.166667, 0.166667, 0.416667, 0.250000, 0.166667, 0.250000, 0.333333, 0.250000, 0.166667, 0.333333, 0.250000, 0.250000, 0.166667, 0.416667, 0.166667, 0.250000, 0.166667, 0.500000, 0.083333, 0.250000, 0.166667, 0.583333, 0.000000, 0.250000, 0.250000, 0.000000, 0.500000, 0.250000, 0.250000, 0.083333, 0.416667, 0.250000, 0.250000, 0.166667, 0.333333, 0.250000, 0.250000, 0.250000, 0.250000, 0.250000, 0.250000, 0.333333, 0.166667, 0.250000, 0.250000, 0.416667, 0.083333, 0.250000, 0.250000, 0.500000, 0.000000, 0.250000, 0.333333, 0.000000, 0.416667, 0.250000, 0.333333, 0.083333, 0.333333, 0.250000, 0.333333, 0.166667, 0.250000, 0.250000, 0.333333, 0.250000, 0.166667, 0.250000, 0.333333, 0.333333, 0.083333, 0.250000, 0.333333, 0.416667, 0.000000, 0.250000, 0.416667, 0.000000, 0.333333, 0.250000, 0.416667, 0.083333, 0.250000, 0.250000, 0.416667, 0.166667, 0.166667, 0.250000, 0.416667, 0.250000, 0.083333, 0.250000, 0.416667, 0.333333, 0.000000, 0.250000, 0.500000, 0.000000, 0.250000, 0.250000, 0.500000, 0.083333, 0.166667, 0.250000, 0.500000, 0.166667, 0.083333, 0.250000, 0.500000, 0.250000, 0.000000, 0.250000, 0.583333, 0.000000, 0.166667, 0.250000, 0.583333, 0.083333, 0.083333, 0.250000, 0.583333, 0.166667, 0.000000, 0.250000, 0.666667, 0.000000, 0.083333, 0.250000, 0.666667, 0.083333, 0.000000, 0.250000, 0.750000, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.666667, 0.333333, 0.000000, 0.083333, 0.583333, 0.333333, 0.000000, 0.166667, 0.500000, 0.333333, 0.000000, 0.250000, 0.416667, 0.333333, 0.000000, 0.333333, 0.333333, 0.333333, 0.000000, 0.416667, 0.250000, 0.333333, 0.000000, 0.500000, 0.166667, 0.333333, 0.000000, 0.583333, 0.083333, 0.333333, 0.000000, 0.666667, 0.000000, 0.333333, 0.083333, 0.000000, 0.583333, 0.333333, 0.083333, 0.083333, 0.500000, 0.333333, 0.083333, 0.166667, 0.416667, 0.333333, 0.083333, 0.250000, 0.333333, 0.333333, 0.083333, 0.333333, 0.250000, 0.333333, 0.083333, 0.416667, 0.166667, 0.333333, 0.083333, 0.500000, 0.083333, 0.333333, 0.083333, 0.583333, 0.000000, 0.333333, 0.166667, 0.000000, 0.500000, 0.333333, 0.166667, 0.083333, 0.416667, 0.333333, 0.166667, 0.166667, 0.333333, 0.333333, 0.166667, 0.250000, 0.250000, 0.333333, 0.166667, 0.333333, 0.166667, 0.333333, 0.166667, 0.416667, 0.083333, 0.333333, 0.166667, 0.500000, 0.000000, 0.333333, 0.250000, 0.000000, 0.416667, 0.333333, 0.250000, 0.083333, 0.333333, 0.333333, 0.250000, 0.166667, 0.250000, 0.333333, 0.250000, 0.250000, 0.166667, 0.333333, 0.250000, 0.333333, 0.083333, 0.333333, 0.250000, 0.416667, 0.000000, 0.333333, 0.333333, 0.000000, 0.333333, 0.333333, 0.333333, 0.083333, 0.250000, 0.333333, 0.333333, 0.166667, 0.166667, 0.333333, 0.333333, 0.250000, 0.083333, 0.333333, 0.333333, 0.333333, 0.000000, 0.333333, 0.416667, 0.000000, 0.250000, 0.333333, 0.416667, 0.083333, 0.166667, 0.333333, 0.416667, 0.166667, 0.083333, 0.333333, 0.416667, 0.250000, 0.000000, 0.333333, 0.500000, 0.000000, 0.166667, 0.333333, 0.500000, 0.083333, 0.083333, 0.333333, 0.500000, 0.166667, 0.000000, 0.333333, 0.583333, 0.000000, 0.083333, 0.333333, 0.583333, 0.083333, 0.000000, 0.333333, 0.666667, 0.000000, 0.000000, 0.416667, 0.000000, 0.000000, 0.583333, 0.416667, 0.000000, 0.083333, 0.500000, 0.416667, 0.000000, 0.166667, 0.416667, 0.416667, 0.000000, 0.250000, 0.333333, 0.416667, 0.000000, 0.333333, 0.250000, 0.416667, 0.000000, 0.416667, 0.166667, 0.416667, 0.000000, 0.500000, 0.083333, 0.416667, 0.000000, 0.583333, 0.000000, 0.416667, 0.083333, 0.000000, 0.500000, 0.416667, 0.083333, 0.083333, 0.416667, 0.416667, 0.083333, 0.166667, 0.333333, 0.416667, 0.083333, 0.250000, 0.250000, 0.416667, 0.083333, 0.333333, 0.166667, 0.416667, 0.083333, 0.416667, 0.083333, 0.416667, 0.083333, 0.500000, 0.000000, 0.416667, 0.166667, 0.000000, 0.416667, 0.416667, 0.166667, 0.083333, 0.333333, 0.416667, 0.166667, 0.166667, 0.250000, 0.416667, 0.166667, 0.250000, 0.166667, 0.416667, 0.166667, 0.333333, 0.083333, 0.416667, 0.166667, 0.416667, 0.000000, 0.416667, 0.250000, 0.000000, 0.333333, 0.416667, 0.250000, 0.083333, 0.250000, 0.416667, 0.250000, 0.166667, 0.166667, 0.416667, 0.250000, 0.250000, 0.083333, 0.416667, 0.250000, 0.333333, 0.000000, 0.416667, 0.333333, 0.000000, 0.250000, 0.416667, 0.333333, 0.083333, 0.166667, 0.416667, 0.333333, 0.166667, 0.083333, 0.416667, 0.333333, 0.250000, 0.000000, 0.416667, 0.416667, 0.000000, 0.166667, 0.416667, 0.416667, 0.083333, 0.083333, 0.416667, 0.416667, 0.166667, 0.000000, 0.416667, 0.500000, 0.000000, 0.083333, 0.416667, 0.500000, 0.083333, 0.000000, 0.416667, 0.583333, 0.000000, 0.000000, 0.500000, 0.000000, 0.000000, 0.500000, 0.500000, 0.000000, 0.083333, 0.416667, 0.500000, 0.000000, 0.166667, 0.333333, 0.500000, 0.000000, 0.250000, 0.250000, 0.500000, 0.000000, 0.333333, 0.166667, 0.500000, 0.000000, 0.416667, 0.083333, 0.500000, 0.000000, 0.500000, 0.000000, 0.500000, 0.083333, 0.000000, 0.416667, 0.500000, 0.083333, 0.083333, 0.333333, 0.500000, 0.083333, 0.166667, 0.250000, 0.500000, 0.083333, 0.250000, 0.166667, 0.500000, 0.083333, 0.333333, 0.083333, 0.500000, 0.083333, 0.416667, 0.000000, 0.500000, 0.166667, 0.000000, 0.333333, 0.500000, 0.166667, 0.083333, 0.250000, 0.500000, 0.166667, 0.166667, 0.166667, 0.500000, 0.166667, 0.250000, 0.083333, 0.500000, 0.166667, 0.333333, 0.000000, 0.500000, 0.250000, 0.000000, 0.250000, 0.500000, 0.250000, 0.083333, 0.166667, 0.500000, 0.250000, 0.166667, 0.083333, 0.500000, 0.250000, 0.250000, 0.000000, 0.500000, 0.333333, 0.000000, 0.166667, 0.500000, 0.333333, 0.083333, 0.083333, 0.500000, 0.333333, 0.166667, 0.000000, 0.500000, 0.416667, 0.000000, 0.083333, 0.500000, 0.416667, 0.083333, 0.000000, 0.500000, 0.500000, 0.000000, 0.000000, 0.583333, 0.000000, 0.000000, 0.416667, 0.583333, 0.000000, 0.083333, 0.333333, 0.583333, 0.000000, 0.166667, 0.250000, 0.583333, 0.000000, 0.250000, 0.166667, 0.583333, 0.000000, 0.333333, 0.083333, 0.583333, 0.000000, 0.416667, 0.000000, 0.583333, 0.083333, 0.000000, 0.333333, 0.583333, 0.083333, 0.083333, 0.250000, 0.583333, 0.083333, 0.166667, 0.166667, 0.583333, 0.083333, 0.250000, 0.083333, 0.583333, 0.083333, 0.333333, 0.000000, 0.583333, 0.166667, 0.000000, 0.250000, 0.583333, 0.166667, 0.083333, 0.166667, 0.583333, 0.166667, 0.166667, 0.083333, 0.583333, 0.166667, 0.250000, 0.000000, 0.583333, 0.250000, 0.000000, 0.166667, 0.583333, 0.250000, 0.083333, 0.083333, 0.583333, 0.250000, 0.166667, 0.000000, 0.583333, 0.333333, 0.000000, 0.083333, 0.583333, 0.333333, 0.083333, 0.000000, 0.583333, 0.416667, 0.000000, 0.000000, 0.666667, 0.000000, 0.000000, 0.333333, 0.666667, 0.000000, 0.083333, 0.250000, 0.666667, 0.000000, 0.166667, 0.166667, 0.666667, 0.000000, 0.250000, 0.083333, 0.666667, 0.000000, 0.333333, 0.000000, 0.666667, 0.083333, 0.000000, 0.250000, 0.666667, 0.083333, 0.083333, 0.166667, 0.666667, 0.083333, 0.166667, 0.083333, 0.666667, 0.083333, 0.250000, 0.000000, 0.666667, 0.166667, 0.000000, 0.166667, 0.666667, 0.166667, 0.083333, 0.083333, 0.666667, 0.166667, 0.166667, 0.000000, 0.666667, 0.250000, 0.000000, 0.083333, 0.666667, 0.250000, 0.083333, 0.000000, 0.666667, 0.333333, 0.000000, 0.000000, 0.750000, 0.000000, 0.000000, 0.250000, 0.750000, 0.000000, 0.083333, 0.166667, 0.750000, 0.000000, 0.166667, 0.083333, 0.750000, 0.000000, 0.250000, 0.000000, 0.750000, 0.083333, 0.000000, 0.166667, 0.750000, 0.083333, 0.083333, 0.083333, 0.750000, 0.083333, 0.166667, 0.000000, 0.750000, 0.166667, 0.000000, 0.083333, 0.750000, 0.166667, 0.083333, 0.000000, 0.750000, 0.250000, 0.000000, 0.000000, 0.833333, 0.000000, 0.000000, 0.166667, 0.833333, 0.000000, 0.083333, 0.083333, 0.833333, 0.000000, 0.166667, 0.000000, 0.833333, 0.083333, 0.000000, 0.083333, 0.833333, 0.083333, 0.083333, 0.000000, 0.833333, 0.166667, 0.000000, 0.000000, 0.916667, 0.000000, 0.000000, 0.083333, 0.916667, 0.000000, 0.083333, 0.000000, 0.916667, 0.083333, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, }; unsigned int number_of_weights_8_5 = 495; double weights_8_5[] = { 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.125000, 0.875000, 0.000000, 0.000000, 0.000000, 0.250000, 0.750000, 0.000000, 0.000000, 0.000000, 0.375000, 0.625000, 0.000000, 0.000000, 0.000000, 0.500000, 0.500000, 0.000000, 0.000000, 0.000000, 0.625000, 0.375000, 0.000000, 0.000000, 0.000000, 0.750000, 0.250000, 0.000000, 0.000000, 0.000000, 0.875000, 0.125000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.125000, 0.000000, 0.875000, 0.000000, 0.000000, 0.125000, 0.125000, 0.750000, 0.000000, 0.000000, 0.125000, 0.250000, 0.625000, 0.000000, 0.000000, 0.125000, 0.375000, 0.500000, 0.000000, 0.000000, 0.125000, 0.500000, 0.375000, 0.000000, 0.000000, 0.125000, 0.625000, 0.250000, 0.000000, 0.000000, 0.125000, 0.750000, 0.125000, 0.000000, 0.000000, 0.125000, 0.875000, 0.000000, 0.000000, 0.000000, 0.250000, 0.000000, 0.750000, 0.000000, 0.000000, 0.250000, 0.125000, 0.625000, 0.000000, 0.000000, 0.250000, 0.250000, 0.500000, 0.000000, 0.000000, 0.250000, 0.375000, 0.375000, 0.000000, 0.000000, 0.250000, 0.500000, 0.250000, 0.000000, 0.000000, 0.250000, 0.625000, 0.125000, 0.000000, 0.000000, 0.250000, 0.750000, 0.000000, 0.000000, 0.000000, 0.375000, 0.000000, 0.625000, 0.000000, 0.000000, 0.375000, 0.125000, 0.500000, 0.000000, 0.000000, 0.375000, 0.250000, 0.375000, 0.000000, 0.000000, 0.375000, 0.375000, 0.250000, 0.000000, 0.000000, 0.375000, 0.500000, 0.125000, 0.000000, 0.000000, 0.375000, 0.625000, 0.000000, 0.000000, 0.000000, 0.500000, 0.000000, 0.500000, 0.000000, 0.000000, 0.500000, 0.125000, 0.375000, 0.000000, 0.000000, 0.500000, 0.250000, 0.250000, 0.000000, 0.000000, 0.500000, 0.375000, 0.125000, 0.000000, 0.000000, 0.500000, 0.500000, 0.000000, 0.000000, 0.000000, 0.625000, 0.000000, 0.375000, 0.000000, 0.000000, 0.625000, 0.125000, 0.250000, 0.000000, 0.000000, 0.625000, 0.250000, 0.125000, 0.000000, 0.000000, 0.625000, 0.375000, 0.000000, 0.000000, 0.000000, 0.750000, 0.000000, 0.250000, 0.000000, 0.000000, 0.750000, 0.125000, 0.125000, 0.000000, 0.000000, 0.750000, 0.250000, 0.000000, 0.000000, 0.000000, 0.875000, 0.000000, 0.125000, 0.000000, 0.000000, 0.875000, 0.125000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.125000, 0.000000, 0.000000, 0.875000, 0.000000, 0.125000, 0.000000, 0.125000, 0.750000, 0.000000, 0.125000, 0.000000, 0.250000, 0.625000, 0.000000, 0.125000, 0.000000, 0.375000, 0.500000, 0.000000, 0.125000, 0.000000, 0.500000, 0.375000, 0.000000, 0.125000, 0.000000, 0.625000, 0.250000, 0.000000, 0.125000, 0.000000, 0.750000, 0.125000, 0.000000, 0.125000, 0.000000, 0.875000, 0.000000, 0.000000, 0.125000, 0.125000, 0.000000, 0.750000, 0.000000, 0.125000, 0.125000, 0.125000, 0.625000, 0.000000, 0.125000, 0.125000, 0.250000, 0.500000, 0.000000, 0.125000, 0.125000, 0.375000, 0.375000, 0.000000, 0.125000, 0.125000, 0.500000, 0.250000, 0.000000, 0.125000, 0.125000, 0.625000, 0.125000, 0.000000, 0.125000, 0.125000, 0.750000, 0.000000, 0.000000, 0.125000, 0.250000, 0.000000, 0.625000, 0.000000, 0.125000, 0.250000, 0.125000, 0.500000, 0.000000, 0.125000, 0.250000, 0.250000, 0.375000, 0.000000, 0.125000, 0.250000, 0.375000, 0.250000, 0.000000, 0.125000, 0.250000, 0.500000, 0.125000, 0.000000, 0.125000, 0.250000, 0.625000, 0.000000, 0.000000, 0.125000, 0.375000, 0.000000, 0.500000, 0.000000, 0.125000, 0.375000, 0.125000, 0.375000, 0.000000, 0.125000, 0.375000, 0.250000, 0.250000, 0.000000, 0.125000, 0.375000, 0.375000, 0.125000, 0.000000, 0.125000, 0.375000, 0.500000, 0.000000, 0.000000, 0.125000, 0.500000, 0.000000, 0.375000, 0.000000, 0.125000, 0.500000, 0.125000, 0.250000, 0.000000, 0.125000, 0.500000, 0.250000, 0.125000, 0.000000, 0.125000, 0.500000, 0.375000, 0.000000, 0.000000, 0.125000, 0.625000, 0.000000, 0.250000, 0.000000, 0.125000, 0.625000, 0.125000, 0.125000, 0.000000, 0.125000, 0.625000, 0.250000, 0.000000, 0.000000, 0.125000, 0.750000, 0.000000, 0.125000, 0.000000, 0.125000, 0.750000, 0.125000, 0.000000, 0.000000, 0.125000, 0.875000, 0.000000, 0.000000, 0.000000, 0.250000, 0.000000, 0.000000, 0.750000, 0.000000, 0.250000, 0.000000, 0.125000, 0.625000, 0.000000, 0.250000, 0.000000, 0.250000, 0.500000, 0.000000, 0.250000, 0.000000, 0.375000, 0.375000, 0.000000, 0.250000, 0.000000, 0.500000, 0.250000, 0.000000, 0.250000, 0.000000, 0.625000, 0.125000, 0.000000, 0.250000, 0.000000, 0.750000, 0.000000, 0.000000, 0.250000, 0.125000, 0.000000, 0.625000, 0.000000, 0.250000, 0.125000, 0.125000, 0.500000, 0.000000, 0.250000, 0.125000, 0.250000, 0.375000, 0.000000, 0.250000, 0.125000, 0.375000, 0.250000, 0.000000, 0.250000, 0.125000, 0.500000, 0.125000, 0.000000, 0.250000, 0.125000, 0.625000, 0.000000, 0.000000, 0.250000, 0.250000, 0.000000, 0.500000, 0.000000, 0.250000, 0.250000, 0.125000, 0.375000, 0.000000, 0.250000, 0.250000, 0.250000, 0.250000, 0.000000, 0.250000, 0.250000, 0.375000, 0.125000, 0.000000, 0.250000, 0.250000, 0.500000, 0.000000, 0.000000, 0.250000, 0.375000, 0.000000, 0.375000, 0.000000, 0.250000, 0.375000, 0.125000, 0.250000, 0.000000, 0.250000, 0.375000, 0.250000, 0.125000, 0.000000, 0.250000, 0.375000, 0.375000, 0.000000, 0.000000, 0.250000, 0.500000, 0.000000, 0.250000, 0.000000, 0.250000, 0.500000, 0.125000, 0.125000, 0.000000, 0.250000, 0.500000, 0.250000, 0.000000, 0.000000, 0.250000, 0.625000, 0.000000, 0.125000, 0.000000, 0.250000, 0.625000, 0.125000, 0.000000, 0.000000, 0.250000, 0.750000, 0.000000, 0.000000, 0.000000, 0.375000, 0.000000, 0.000000, 0.625000, 0.000000, 0.375000, 0.000000, 0.125000, 0.500000, 0.000000, 0.375000, 0.000000, 0.250000, 0.375000, 0.000000, 0.375000, 0.000000, 0.375000, 0.250000, 0.000000, 0.375000, 0.000000, 0.500000, 0.125000, 0.000000, 0.375000, 0.000000, 0.625000, 0.000000, 0.000000, 0.375000, 0.125000, 0.000000, 0.500000, 0.000000, 0.375000, 0.125000, 0.125000, 0.375000, 0.000000, 0.375000, 0.125000, 0.250000, 0.250000, 0.000000, 0.375000, 0.125000, 0.375000, 0.125000, 0.000000, 0.375000, 0.125000, 0.500000, 0.000000, 0.000000, 0.375000, 0.250000, 0.000000, 0.375000, 0.000000, 0.375000, 0.250000, 0.125000, 0.250000, 0.000000, 0.375000, 0.250000, 0.250000, 0.125000, 0.000000, 0.375000, 0.250000, 0.375000, 0.000000, 0.000000, 0.375000, 0.375000, 0.000000, 0.250000, 0.000000, 0.375000, 0.375000, 0.125000, 0.125000, 0.000000, 0.375000, 0.375000, 0.250000, 0.000000, 0.000000, 0.375000, 0.500000, 0.000000, 0.125000, 0.000000, 0.375000, 0.500000, 0.125000, 0.000000, 0.000000, 0.375000, 0.625000, 0.000000, 0.000000, 0.000000, 0.500000, 0.000000, 0.000000, 0.500000, 0.000000, 0.500000, 0.000000, 0.125000, 0.375000, 0.000000, 0.500000, 0.000000, 0.250000, 0.250000, 0.000000, 0.500000, 0.000000, 0.375000, 0.125000, 0.000000, 0.500000, 0.000000, 0.500000, 0.000000, 0.000000, 0.500000, 0.125000, 0.000000, 0.375000, 0.000000, 0.500000, 0.125000, 0.125000, 0.250000, 0.000000, 0.500000, 0.125000, 0.250000, 0.125000, 0.000000, 0.500000, 0.125000, 0.375000, 0.000000, 0.000000, 0.500000, 0.250000, 0.000000, 0.250000, 0.000000, 0.500000, 0.250000, 0.125000, 0.125000, 0.000000, 0.500000, 0.250000, 0.250000, 0.000000, 0.000000, 0.500000, 0.375000, 0.000000, 0.125000, 0.000000, 0.500000, 0.375000, 0.125000, 0.000000, 0.000000, 0.500000, 0.500000, 0.000000, 0.000000, 0.000000, 0.625000, 0.000000, 0.000000, 0.375000, 0.000000, 0.625000, 0.000000, 0.125000, 0.250000, 0.000000, 0.625000, 0.000000, 0.250000, 0.125000, 0.000000, 0.625000, 0.000000, 0.375000, 0.000000, 0.000000, 0.625000, 0.125000, 0.000000, 0.250000, 0.000000, 0.625000, 0.125000, 0.125000, 0.125000, 0.000000, 0.625000, 0.125000, 0.250000, 0.000000, 0.000000, 0.625000, 0.250000, 0.000000, 0.125000, 0.000000, 0.625000, 0.250000, 0.125000, 0.000000, 0.000000, 0.625000, 0.375000, 0.000000, 0.000000, 0.000000, 0.750000, 0.000000, 0.000000, 0.250000, 0.000000, 0.750000, 0.000000, 0.125000, 0.125000, 0.000000, 0.750000, 0.000000, 0.250000, 0.000000, 0.000000, 0.750000, 0.125000, 0.000000, 0.125000, 0.000000, 0.750000, 0.125000, 0.125000, 0.000000, 0.000000, 0.750000, 0.250000, 0.000000, 0.000000, 0.000000, 0.875000, 0.000000, 0.000000, 0.125000, 0.000000, 0.875000, 0.000000, 0.125000, 0.000000, 0.000000, 0.875000, 0.125000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.125000, 0.000000, 0.000000, 0.000000, 0.875000, 0.125000, 0.000000, 0.000000, 0.125000, 0.750000, 0.125000, 0.000000, 0.000000, 0.250000, 0.625000, 0.125000, 0.000000, 0.000000, 0.375000, 0.500000, 0.125000, 0.000000, 0.000000, 0.500000, 0.375000, 0.125000, 0.000000, 0.000000, 0.625000, 0.250000, 0.125000, 0.000000, 0.000000, 0.750000, 0.125000, 0.125000, 0.000000, 0.000000, 0.875000, 0.000000, 0.125000, 0.000000, 0.125000, 0.000000, 0.750000, 0.125000, 0.000000, 0.125000, 0.125000, 0.625000, 0.125000, 0.000000, 0.125000, 0.250000, 0.500000, 0.125000, 0.000000, 0.125000, 0.375000, 0.375000, 0.125000, 0.000000, 0.125000, 0.500000, 0.250000, 0.125000, 0.000000, 0.125000, 0.625000, 0.125000, 0.125000, 0.000000, 0.125000, 0.750000, 0.000000, 0.125000, 0.000000, 0.250000, 0.000000, 0.625000, 0.125000, 0.000000, 0.250000, 0.125000, 0.500000, 0.125000, 0.000000, 0.250000, 0.250000, 0.375000, 0.125000, 0.000000, 0.250000, 0.375000, 0.250000, 0.125000, 0.000000, 0.250000, 0.500000, 0.125000, 0.125000, 0.000000, 0.250000, 0.625000, 0.000000, 0.125000, 0.000000, 0.375000, 0.000000, 0.500000, 0.125000, 0.000000, 0.375000, 0.125000, 0.375000, 0.125000, 0.000000, 0.375000, 0.250000, 0.250000, 0.125000, 0.000000, 0.375000, 0.375000, 0.125000, 0.125000, 0.000000, 0.375000, 0.500000, 0.000000, 0.125000, 0.000000, 0.500000, 0.000000, 0.375000, 0.125000, 0.000000, 0.500000, 0.125000, 0.250000, 0.125000, 0.000000, 0.500000, 0.250000, 0.125000, 0.125000, 0.000000, 0.500000, 0.375000, 0.000000, 0.125000, 0.000000, 0.625000, 0.000000, 0.250000, 0.125000, 0.000000, 0.625000, 0.125000, 0.125000, 0.125000, 0.000000, 0.625000, 0.250000, 0.000000, 0.125000, 0.000000, 0.750000, 0.000000, 0.125000, 0.125000, 0.000000, 0.750000, 0.125000, 0.000000, 0.125000, 0.000000, 0.875000, 0.000000, 0.000000, 0.125000, 0.125000, 0.000000, 0.000000, 0.750000, 0.125000, 0.125000, 0.000000, 0.125000, 0.625000, 0.125000, 0.125000, 0.000000, 0.250000, 0.500000, 0.125000, 0.125000, 0.000000, 0.375000, 0.375000, 0.125000, 0.125000, 0.000000, 0.500000, 0.250000, 0.125000, 0.125000, 0.000000, 0.625000, 0.125000, 0.125000, 0.125000, 0.000000, 0.750000, 0.000000, 0.125000, 0.125000, 0.125000, 0.000000, 0.625000, 0.125000, 0.125000, 0.125000, 0.125000, 0.500000, 0.125000, 0.125000, 0.125000, 0.250000, 0.375000, 0.125000, 0.125000, 0.125000, 0.375000, 0.250000, 0.125000, 0.125000, 0.125000, 0.500000, 0.125000, 0.125000, 0.125000, 0.125000, 0.625000, 0.000000, 0.125000, 0.125000, 0.250000, 0.000000, 0.500000, 0.125000, 0.125000, 0.250000, 0.125000, 0.375000, 0.125000, 0.125000, 0.250000, 0.250000, 0.250000, 0.125000, 0.125000, 0.250000, 0.375000, 0.125000, 0.125000, 0.125000, 0.250000, 0.500000, 0.000000, 0.125000, 0.125000, 0.375000, 0.000000, 0.375000, 0.125000, 0.125000, 0.375000, 0.125000, 0.250000, 0.125000, 0.125000, 0.375000, 0.250000, 0.125000, 0.125000, 0.125000, 0.375000, 0.375000, 0.000000, 0.125000, 0.125000, 0.500000, 0.000000, 0.250000, 0.125000, 0.125000, 0.500000, 0.125000, 0.125000, 0.125000, 0.125000, 0.500000, 0.250000, 0.000000, 0.125000, 0.125000, 0.625000, 0.000000, 0.125000, 0.125000, 0.125000, 0.625000, 0.125000, 0.000000, 0.125000, 0.125000, 0.750000, 0.000000, 0.000000, 0.125000, 0.250000, 0.000000, 0.000000, 0.625000, 0.125000, 0.250000, 0.000000, 0.125000, 0.500000, 0.125000, 0.250000, 0.000000, 0.250000, 0.375000, 0.125000, 0.250000, 0.000000, 0.375000, 0.250000, 0.125000, 0.250000, 0.000000, 0.500000, 0.125000, 0.125000, 0.250000, 0.000000, 0.625000, 0.000000, 0.125000, 0.250000, 0.125000, 0.000000, 0.500000, 0.125000, 0.250000, 0.125000, 0.125000, 0.375000, 0.125000, 0.250000, 0.125000, 0.250000, 0.250000, 0.125000, 0.250000, 0.125000, 0.375000, 0.125000, 0.125000, 0.250000, 0.125000, 0.500000, 0.000000, 0.125000, 0.250000, 0.250000, 0.000000, 0.375000, 0.125000, 0.250000, 0.250000, 0.125000, 0.250000, 0.125000, 0.250000, 0.250000, 0.250000, 0.125000, 0.125000, 0.250000, 0.250000, 0.375000, 0.000000, 0.125000, 0.250000, 0.375000, 0.000000, 0.250000, 0.125000, 0.250000, 0.375000, 0.125000, 0.125000, 0.125000, 0.250000, 0.375000, 0.250000, 0.000000, 0.125000, 0.250000, 0.500000, 0.000000, 0.125000, 0.125000, 0.250000, 0.500000, 0.125000, 0.000000, 0.125000, 0.250000, 0.625000, 0.000000, 0.000000, 0.125000, 0.375000, 0.000000, 0.000000, 0.500000, 0.125000, 0.375000, 0.000000, 0.125000, 0.375000, 0.125000, 0.375000, 0.000000, 0.250000, 0.250000, 0.125000, 0.375000, 0.000000, 0.375000, 0.125000, 0.125000, 0.375000, 0.000000, 0.500000, 0.000000, 0.125000, 0.375000, 0.125000, 0.000000, 0.375000, 0.125000, 0.375000, 0.125000, 0.125000, 0.250000, 0.125000, 0.375000, 0.125000, 0.250000, 0.125000, 0.125000, 0.375000, 0.125000, 0.375000, 0.000000, 0.125000, 0.375000, 0.250000, 0.000000, 0.250000, 0.125000, 0.375000, 0.250000, 0.125000, 0.125000, 0.125000, 0.375000, 0.250000, 0.250000, 0.000000, 0.125000, 0.375000, 0.375000, 0.000000, 0.125000, 0.125000, 0.375000, 0.375000, 0.125000, 0.000000, 0.125000, 0.375000, 0.500000, 0.000000, 0.000000, 0.125000, 0.500000, 0.000000, 0.000000, 0.375000, 0.125000, 0.500000, 0.000000, 0.125000, 0.250000, 0.125000, 0.500000, 0.000000, 0.250000, 0.125000, 0.125000, 0.500000, 0.000000, 0.375000, 0.000000, 0.125000, 0.500000, 0.125000, 0.000000, 0.250000, 0.125000, 0.500000, 0.125000, 0.125000, 0.125000, 0.125000, 0.500000, 0.125000, 0.250000, 0.000000, 0.125000, 0.500000, 0.250000, 0.000000, 0.125000, 0.125000, 0.500000, 0.250000, 0.125000, 0.000000, 0.125000, 0.500000, 0.375000, 0.000000, 0.000000, 0.125000, 0.625000, 0.000000, 0.000000, 0.250000, 0.125000, 0.625000, 0.000000, 0.125000, 0.125000, 0.125000, 0.625000, 0.000000, 0.250000, 0.000000, 0.125000, 0.625000, 0.125000, 0.000000, 0.125000, 0.125000, 0.625000, 0.125000, 0.125000, 0.000000, 0.125000, 0.625000, 0.250000, 0.000000, 0.000000, 0.125000, 0.750000, 0.000000, 0.000000, 0.125000, 0.125000, 0.750000, 0.000000, 0.125000, 0.000000, 0.125000, 0.750000, 0.125000, 0.000000, 0.000000, 0.125000, 0.875000, 0.000000, 0.000000, 0.000000, 0.250000, 0.000000, 0.000000, 0.000000, 0.750000, 0.250000, 0.000000, 0.000000, 0.125000, 0.625000, 0.250000, 0.000000, 0.000000, 0.250000, 0.500000, 0.250000, 0.000000, 0.000000, 0.375000, 0.375000, 0.250000, 0.000000, 0.000000, 0.500000, 0.250000, 0.250000, 0.000000, 0.000000, 0.625000, 0.125000, 0.250000, 0.000000, 0.000000, 0.750000, 0.000000, 0.250000, 0.000000, 0.125000, 0.000000, 0.625000, 0.250000, 0.000000, 0.125000, 0.125000, 0.500000, 0.250000, 0.000000, 0.125000, 0.250000, 0.375000, 0.250000, 0.000000, 0.125000, 0.375000, 0.250000, 0.250000, 0.000000, 0.125000, 0.500000, 0.125000, 0.250000, 0.000000, 0.125000, 0.625000, 0.000000, 0.250000, 0.000000, 0.250000, 0.000000, 0.500000, 0.250000, 0.000000, 0.250000, 0.125000, 0.375000, 0.250000, 0.000000, 0.250000, 0.250000, 0.250000, 0.250000, 0.000000, 0.250000, 0.375000, 0.125000, 0.250000, 0.000000, 0.250000, 0.500000, 0.000000, 0.250000, 0.000000, 0.375000, 0.000000, 0.375000, 0.250000, 0.000000, 0.375000, 0.125000, 0.250000, 0.250000, 0.000000, 0.375000, 0.250000, 0.125000, 0.250000, 0.000000, 0.375000, 0.375000, 0.000000, 0.250000, 0.000000, 0.500000, 0.000000, 0.250000, 0.250000, 0.000000, 0.500000, 0.125000, 0.125000, 0.250000, 0.000000, 0.500000, 0.250000, 0.000000, 0.250000, 0.000000, 0.625000, 0.000000, 0.125000, 0.250000, 0.000000, 0.625000, 0.125000, 0.000000, 0.250000, 0.000000, 0.750000, 0.000000, 0.000000, 0.250000, 0.125000, 0.000000, 0.000000, 0.625000, 0.250000, 0.125000, 0.000000, 0.125000, 0.500000, 0.250000, 0.125000, 0.000000, 0.250000, 0.375000, 0.250000, 0.125000, 0.000000, 0.375000, 0.250000, 0.250000, 0.125000, 0.000000, 0.500000, 0.125000, 0.250000, 0.125000, 0.000000, 0.625000, 0.000000, 0.250000, 0.125000, 0.125000, 0.000000, 0.500000, 0.250000, 0.125000, 0.125000, 0.125000, 0.375000, 0.250000, 0.125000, 0.125000, 0.250000, 0.250000, 0.250000, 0.125000, 0.125000, 0.375000, 0.125000, 0.250000, 0.125000, 0.125000, 0.500000, 0.000000, 0.250000, 0.125000, 0.250000, 0.000000, 0.375000, 0.250000, 0.125000, 0.250000, 0.125000, 0.250000, 0.250000, 0.125000, 0.250000, 0.250000, 0.125000, 0.250000, 0.125000, 0.250000, 0.375000, 0.000000, 0.250000, 0.125000, 0.375000, 0.000000, 0.250000, 0.250000, 0.125000, 0.375000, 0.125000, 0.125000, 0.250000, 0.125000, 0.375000, 0.250000, 0.000000, 0.250000, 0.125000, 0.500000, 0.000000, 0.125000, 0.250000, 0.125000, 0.500000, 0.125000, 0.000000, 0.250000, 0.125000, 0.625000, 0.000000, 0.000000, 0.250000, 0.250000, 0.000000, 0.000000, 0.500000, 0.250000, 0.250000, 0.000000, 0.125000, 0.375000, 0.250000, 0.250000, 0.000000, 0.250000, 0.250000, 0.250000, 0.250000, 0.000000, 0.375000, 0.125000, 0.250000, 0.250000, 0.000000, 0.500000, 0.000000, 0.250000, 0.250000, 0.125000, 0.000000, 0.375000, 0.250000, 0.250000, 0.125000, 0.125000, 0.250000, 0.250000, 0.250000, 0.125000, 0.250000, 0.125000, 0.250000, 0.250000, 0.125000, 0.375000, 0.000000, 0.250000, 0.250000, 0.250000, 0.000000, 0.250000, 0.250000, 0.250000, 0.250000, 0.125000, 0.125000, 0.250000, 0.250000, 0.250000, 0.250000, 0.000000, 0.250000, 0.250000, 0.375000, 0.000000, 0.125000, 0.250000, 0.250000, 0.375000, 0.125000, 0.000000, 0.250000, 0.250000, 0.500000, 0.000000, 0.000000, 0.250000, 0.375000, 0.000000, 0.000000, 0.375000, 0.250000, 0.375000, 0.000000, 0.125000, 0.250000, 0.250000, 0.375000, 0.000000, 0.250000, 0.125000, 0.250000, 0.375000, 0.000000, 0.375000, 0.000000, 0.250000, 0.375000, 0.125000, 0.000000, 0.250000, 0.250000, 0.375000, 0.125000, 0.125000, 0.125000, 0.250000, 0.375000, 0.125000, 0.250000, 0.000000, 0.250000, 0.375000, 0.250000, 0.000000, 0.125000, 0.250000, 0.375000, 0.250000, 0.125000, 0.000000, 0.250000, 0.375000, 0.375000, 0.000000, 0.000000, 0.250000, 0.500000, 0.000000, 0.000000, 0.250000, 0.250000, 0.500000, 0.000000, 0.125000, 0.125000, 0.250000, 0.500000, 0.000000, 0.250000, 0.000000, 0.250000, 0.500000, 0.125000, 0.000000, 0.125000, 0.250000, 0.500000, 0.125000, 0.125000, 0.000000, 0.250000, 0.500000, 0.250000, 0.000000, 0.000000, 0.250000, 0.625000, 0.000000, 0.000000, 0.125000, 0.250000, 0.625000, 0.000000, 0.125000, 0.000000, 0.250000, 0.625000, 0.125000, 0.000000, 0.000000, 0.250000, 0.750000, 0.000000, 0.000000, 0.000000, 0.375000, 0.000000, 0.000000, 0.000000, 0.625000, 0.375000, 0.000000, 0.000000, 0.125000, 0.500000, 0.375000, 0.000000, 0.000000, 0.250000, 0.375000, 0.375000, 0.000000, 0.000000, 0.375000, 0.250000, 0.375000, 0.000000, 0.000000, 0.500000, 0.125000, 0.375000, 0.000000, 0.000000, 0.625000, 0.000000, 0.375000, 0.000000, 0.125000, 0.000000, 0.500000, 0.375000, 0.000000, 0.125000, 0.125000, 0.375000, 0.375000, 0.000000, 0.125000, 0.250000, 0.250000, 0.375000, 0.000000, 0.125000, 0.375000, 0.125000, 0.375000, 0.000000, 0.125000, 0.500000, 0.000000, 0.375000, 0.000000, 0.250000, 0.000000, 0.375000, 0.375000, 0.000000, 0.250000, 0.125000, 0.250000, 0.375000, 0.000000, 0.250000, 0.250000, 0.125000, 0.375000, 0.000000, 0.250000, 0.375000, 0.000000, 0.375000, 0.000000, 0.375000, 0.000000, 0.250000, 0.375000, 0.000000, 0.375000, 0.125000, 0.125000, 0.375000, 0.000000, 0.375000, 0.250000, 0.000000, 0.375000, 0.000000, 0.500000, 0.000000, 0.125000, 0.375000, 0.000000, 0.500000, 0.125000, 0.000000, 0.375000, 0.000000, 0.625000, 0.000000, 0.000000, 0.375000, 0.125000, 0.000000, 0.000000, 0.500000, 0.375000, 0.125000, 0.000000, 0.125000, 0.375000, 0.375000, 0.125000, 0.000000, 0.250000, 0.250000, 0.375000, 0.125000, 0.000000, 0.375000, 0.125000, 0.375000, 0.125000, 0.000000, 0.500000, 0.000000, 0.375000, 0.125000, 0.125000, 0.000000, 0.375000, 0.375000, 0.125000, 0.125000, 0.125000, 0.250000, 0.375000, 0.125000, 0.125000, 0.250000, 0.125000, 0.375000, 0.125000, 0.125000, 0.375000, 0.000000, 0.375000, 0.125000, 0.250000, 0.000000, 0.250000, 0.375000, 0.125000, 0.250000, 0.125000, 0.125000, 0.375000, 0.125000, 0.250000, 0.250000, 0.000000, 0.375000, 0.125000, 0.375000, 0.000000, 0.125000, 0.375000, 0.125000, 0.375000, 0.125000, 0.000000, 0.375000, 0.125000, 0.500000, 0.000000, 0.000000, 0.375000, 0.250000, 0.000000, 0.000000, 0.375000, 0.375000, 0.250000, 0.000000, 0.125000, 0.250000, 0.375000, 0.250000, 0.000000, 0.250000, 0.125000, 0.375000, 0.250000, 0.000000, 0.375000, 0.000000, 0.375000, 0.250000, 0.125000, 0.000000, 0.250000, 0.375000, 0.250000, 0.125000, 0.125000, 0.125000, 0.375000, 0.250000, 0.125000, 0.250000, 0.000000, 0.375000, 0.250000, 0.250000, 0.000000, 0.125000, 0.375000, 0.250000, 0.250000, 0.125000, 0.000000, 0.375000, 0.250000, 0.375000, 0.000000, 0.000000, 0.375000, 0.375000, 0.000000, 0.000000, 0.250000, 0.375000, 0.375000, 0.000000, 0.125000, 0.125000, 0.375000, 0.375000, 0.000000, 0.250000, 0.000000, 0.375000, 0.375000, 0.125000, 0.000000, 0.125000, 0.375000, 0.375000, 0.125000, 0.125000, 0.000000, 0.375000, 0.375000, 0.250000, 0.000000, 0.000000, 0.375000, 0.500000, 0.000000, 0.000000, 0.125000, 0.375000, 0.500000, 0.000000, 0.125000, 0.000000, 0.375000, 0.500000, 0.125000, 0.000000, 0.000000, 0.375000, 0.625000, 0.000000, 0.000000, 0.000000, 0.500000, 0.000000, 0.000000, 0.000000, 0.500000, 0.500000, 0.000000, 0.000000, 0.125000, 0.375000, 0.500000, 0.000000, 0.000000, 0.250000, 0.250000, 0.500000, 0.000000, 0.000000, 0.375000, 0.125000, 0.500000, 0.000000, 0.000000, 0.500000, 0.000000, 0.500000, 0.000000, 0.125000, 0.000000, 0.375000, 0.500000, 0.000000, 0.125000, 0.125000, 0.250000, 0.500000, 0.000000, 0.125000, 0.250000, 0.125000, 0.500000, 0.000000, 0.125000, 0.375000, 0.000000, 0.500000, 0.000000, 0.250000, 0.000000, 0.250000, 0.500000, 0.000000, 0.250000, 0.125000, 0.125000, 0.500000, 0.000000, 0.250000, 0.250000, 0.000000, 0.500000, 0.000000, 0.375000, 0.000000, 0.125000, 0.500000, 0.000000, 0.375000, 0.125000, 0.000000, 0.500000, 0.000000, 0.500000, 0.000000, 0.000000, 0.500000, 0.125000, 0.000000, 0.000000, 0.375000, 0.500000, 0.125000, 0.000000, 0.125000, 0.250000, 0.500000, 0.125000, 0.000000, 0.250000, 0.125000, 0.500000, 0.125000, 0.000000, 0.375000, 0.000000, 0.500000, 0.125000, 0.125000, 0.000000, 0.250000, 0.500000, 0.125000, 0.125000, 0.125000, 0.125000, 0.500000, 0.125000, 0.125000, 0.250000, 0.000000, 0.500000, 0.125000, 0.250000, 0.000000, 0.125000, 0.500000, 0.125000, 0.250000, 0.125000, 0.000000, 0.500000, 0.125000, 0.375000, 0.000000, 0.000000, 0.500000, 0.250000, 0.000000, 0.000000, 0.250000, 0.500000, 0.250000, 0.000000, 0.125000, 0.125000, 0.500000, 0.250000, 0.000000, 0.250000, 0.000000, 0.500000, 0.250000, 0.125000, 0.000000, 0.125000, 0.500000, 0.250000, 0.125000, 0.125000, 0.000000, 0.500000, 0.250000, 0.250000, 0.000000, 0.000000, 0.500000, 0.375000, 0.000000, 0.000000, 0.125000, 0.500000, 0.375000, 0.000000, 0.125000, 0.000000, 0.500000, 0.375000, 0.125000, 0.000000, 0.000000, 0.500000, 0.500000, 0.000000, 0.000000, 0.000000, 0.625000, 0.000000, 0.000000, 0.000000, 0.375000, 0.625000, 0.000000, 0.000000, 0.125000, 0.250000, 0.625000, 0.000000, 0.000000, 0.250000, 0.125000, 0.625000, 0.000000, 0.000000, 0.375000, 0.000000, 0.625000, 0.000000, 0.125000, 0.000000, 0.250000, 0.625000, 0.000000, 0.125000, 0.125000, 0.125000, 0.625000, 0.000000, 0.125000, 0.250000, 0.000000, 0.625000, 0.000000, 0.250000, 0.000000, 0.125000, 0.625000, 0.000000, 0.250000, 0.125000, 0.000000, 0.625000, 0.000000, 0.375000, 0.000000, 0.000000, 0.625000, 0.125000, 0.000000, 0.000000, 0.250000, 0.625000, 0.125000, 0.000000, 0.125000, 0.125000, 0.625000, 0.125000, 0.000000, 0.250000, 0.000000, 0.625000, 0.125000, 0.125000, 0.000000, 0.125000, 0.625000, 0.125000, 0.125000, 0.125000, 0.000000, 0.625000, 0.125000, 0.250000, 0.000000, 0.000000, 0.625000, 0.250000, 0.000000, 0.000000, 0.125000, 0.625000, 0.250000, 0.000000, 0.125000, 0.000000, 0.625000, 0.250000, 0.125000, 0.000000, 0.000000, 0.625000, 0.375000, 0.000000, 0.000000, 0.000000, 0.750000, 0.000000, 0.000000, 0.000000, 0.250000, 0.750000, 0.000000, 0.000000, 0.125000, 0.125000, 0.750000, 0.000000, 0.000000, 0.250000, 0.000000, 0.750000, 0.000000, 0.125000, 0.000000, 0.125000, 0.750000, 0.000000, 0.125000, 0.125000, 0.000000, 0.750000, 0.000000, 0.250000, 0.000000, 0.000000, 0.750000, 0.125000, 0.000000, 0.000000, 0.125000, 0.750000, 0.125000, 0.000000, 0.125000, 0.000000, 0.750000, 0.125000, 0.125000, 0.000000, 0.000000, 0.750000, 0.250000, 0.000000, 0.000000, 0.000000, 0.875000, 0.000000, 0.000000, 0.000000, 0.125000, 0.875000, 0.000000, 0.000000, 0.125000, 0.000000, 0.875000, 0.000000, 0.125000, 0.000000, 0.000000, 0.875000, 0.125000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, }; unsigned int number_of_weights_3_6 = 56; double weights_3_6[] = { 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.666667, 0.000000, 0.000000, 0.000000, 0.000000, 0.666667, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.666667, 0.000000, 0.000000, 0.000000, 0.333333, 0.333333, 0.333333, 0.000000, 0.000000, 0.000000, 0.333333, 0.666667, 0.000000, 0.000000, 0.000000, 0.000000, 0.666667, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.666667, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.666667, 0.000000, 0.000000, 0.333333, 0.000000, 0.333333, 0.333333, 0.000000, 0.000000, 0.333333, 0.000000, 0.666667, 0.000000, 0.000000, 0.000000, 0.333333, 0.333333, 0.000000, 0.333333, 0.000000, 0.000000, 0.333333, 0.333333, 0.333333, 0.000000, 0.000000, 0.000000, 0.333333, 0.666667, 0.000000, 0.000000, 0.000000, 0.000000, 0.666667, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.666667, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.666667, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.666667, 0.000000, 0.333333, 0.000000, 0.000000, 0.333333, 0.333333, 0.000000, 0.333333, 0.000000, 0.000000, 0.666667, 0.000000, 0.000000, 0.333333, 0.000000, 0.333333, 0.000000, 0.333333, 0.000000, 0.333333, 0.000000, 0.333333, 0.333333, 0.000000, 0.000000, 0.333333, 0.000000, 0.666667, 0.000000, 0.000000, 0.000000, 0.333333, 0.333333, 0.000000, 0.000000, 0.333333, 0.000000, 0.333333, 0.333333, 0.000000, 0.333333, 0.000000, 0.000000, 0.333333, 0.333333, 0.333333, 0.000000, 0.000000, 0.000000, 0.333333, 0.666667, 0.000000, 0.000000, 0.000000, 0.000000, 0.666667, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.666667, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.666667, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.666667, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 0.666667, 0.333333, 0.000000, 0.000000, 0.000000, 0.333333, 0.333333, 0.333333, 0.000000, 0.000000, 0.000000, 0.666667, 0.000000, 0.333333, 0.000000, 0.000000, 0.333333, 0.000000, 0.333333, 0.333333, 0.000000, 0.000000, 0.333333, 0.333333, 0.000000, 0.333333, 0.000000, 0.000000, 0.666667, 0.000000, 0.000000, 0.333333, 0.000000, 0.333333, 0.000000, 0.000000, 0.333333, 0.333333, 0.000000, 0.333333, 0.000000, 0.333333, 0.000000, 0.333333, 0.000000, 0.333333, 0.333333, 0.000000, 0.000000, 0.333333, 0.000000, 0.666667, 0.000000, 0.000000, 0.000000, 0.333333, 0.333333, 0.000000, 0.000000, 0.000000, 0.333333, 0.333333, 0.333333, 0.000000, 0.000000, 0.333333, 0.000000, 0.333333, 0.333333, 0.000000, 0.333333, 0.000000, 0.000000, 0.333333, 0.333333, 0.333333, 0.000000, 0.000000, 0.000000, 0.333333, 0.666667, 0.000000, 0.000000, 0.000000, 0.000000, 0.666667, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.666667, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.666667, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.666667, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.666667, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, }; unsigned int number_of_weights_3_7 = 84; double weights_3_7[] = { 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.666667, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.666667, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.666667, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.333333, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.666667, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.666667, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 0.666667, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.666667, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.333333, 0.333333, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.666667, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.333333, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.333333, 0.333333, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.666667, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.666667, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.666667, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 0.666667, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.666667, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.333333, 0.333333, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.666667, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.333333, 0.000000, 0.333333, 0.000000, 0.000000, 0.333333, 0.000000, 0.333333, 0.333333, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.666667, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.333333, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.333333, 0.333333, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.333333, 0.333333, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.666667, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.666667, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.666667, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.666667, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 0.666667, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 0.666667, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.333333, 0.333333, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.666667, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.333333, 0.000000, 0.333333, 0.000000, 0.333333, 0.000000, 0.000000, 0.333333, 0.333333, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.666667, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.333333, 0.000000, 0.000000, 0.333333, 0.000000, 0.333333, 0.000000, 0.333333, 0.000000, 0.333333, 0.000000, 0.000000, 0.333333, 0.000000, 0.333333, 0.333333, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.666667, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.333333, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.333333, 0.333333, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.333333, 0.333333, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.333333, 0.333333, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.666667, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.666667, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.666667, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.666667, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.666667, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 0.666667, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.666667, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.333333, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 0.666667, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.333333, 0.333333, 0.000000, 0.000000, 0.000000, 0.333333, 0.333333, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.666667, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.333333, 0.333333, 0.000000, 0.000000, 0.333333, 0.000000, 0.333333, 0.000000, 0.333333, 0.000000, 0.000000, 0.333333, 0.333333, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.666667, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.333333, 0.333333, 0.000000, 0.333333, 0.000000, 0.000000, 0.333333, 0.000000, 0.333333, 0.000000, 0.333333, 0.000000, 0.333333, 0.000000, 0.000000, 0.333333, 0.000000, 0.333333, 0.333333, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.666667, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.333333, 0.333333, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.333333, 0.333333, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.333333, 0.333333, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.333333, 0.333333, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.666667, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.666667, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.666667, 0.000000, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.666667, 0.000000, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.666667, 0.000000, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.666667, 0.000000, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 0.666667, 0.333333, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, }; #endif /* WEIGHT_VECTORS_H */ emoa/src/avl.c0000644000176200001440000003504314554271516012727 0ustar liggesusers#define VARIANT 4 /***************************************************************************** avl.c - Source code for the AVL-tree library. Copyright (C) 1998 Michael H. Buselli Copyright (C) 2000-2002 Wessel Dankers This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Augmented AVL-tree. Original by Michael H. Buselli . Modified by Wessel Dankers to add a bunch of bloat to the sourcecode, change the interface and squash a few bugs. Mail him if you find new bugs. *****************************************************************************/ #include #include #include #include "avl.h" static void avl_rebalance(avl_tree_t *, avl_node_t *); #ifdef AVL_COUNT #define NODE_COUNT(n) ((n) ? (n)->count : 0) #define L_COUNT(n) (NODE_COUNT((n)->left)) #define R_COUNT(n) (NODE_COUNT((n)->right)) #define CALC_COUNT(n) (L_COUNT(n) + R_COUNT(n) + 1) #endif #ifdef AVL_DEPTH #define NODE_DEPTH(n) ((n) ? (n)->depth : 0) #define L_DEPTH(n) (NODE_DEPTH((n)->left)) #define R_DEPTH(n) (NODE_DEPTH((n)->right)) #define CALC_DEPTH(n) ((L_DEPTH(n) > R_DEPTH(n) ? L_DEPTH(n) : R_DEPTH(n)) + 1) #endif #ifndef AVL_DEPTH /* Also known as ffs() (from BSD) */ static int lg(unsigned int u) { int r = 1; if (!u) return 0; if (u & 0xffff0000) { u >>= 16; r += 16; } if (u & 0x0000ff00) { u >>= 8; r += 8; } if (u & 0x000000f0) { u >>= 4; r += 4; } if (u & 0x0000000c) { u >>= 2; r += 2; } if (u & 0x00000002) r++; return r; } #endif static int avl_check_balance(avl_node_t *avlnode) { #ifdef AVL_DEPTH int d; d = R_DEPTH(avlnode) - L_DEPTH(avlnode); return d < -1 ? -1 : d > 1 ? 1 : 0; #else /* int d; * d = lg(R_COUNT(avlnode)) - lg(L_COUNT(avlnode)); * d = d<-1?-1:d>1?1:0; */ #ifdef AVL_COUNT int pl, r; pl = lg(L_COUNT(avlnode)); r = R_COUNT(avlnode); if (r >> pl + 1) return 1; if (pl < 2 || r >> pl - 2) return 0; return -1; #else #error No balancing possible. #endif #endif } #ifdef AVL_COUNT unsigned int avl_count(const avl_tree_t *avltree) { return NODE_COUNT(avltree->top); } avl_node_t *avl_at(const avl_tree_t *avltree, unsigned int index) { avl_node_t *avlnode; unsigned int c; avlnode = avltree->top; while (avlnode) { c = L_COUNT(avlnode); if (index < c) { avlnode = avlnode->left; } else if (index > c) { avlnode = avlnode->right; index -= c + 1; } else { return avlnode; } } return NULL; } unsigned int avl_index(const avl_node_t *avlnode) { avl_node_t *next; unsigned int c; c = L_COUNT(avlnode); while ((next = avlnode->parent)) { if (avlnode == next->right) c += L_COUNT(next) + 1; avlnode = next; } return c; } #endif int avl_search_closest(const avl_tree_t *avltree, const void *item, avl_node_t **avlnode) { avl_node_t *node; avl_compare_t cmp; int c; if (!avlnode) avlnode = &node; node = avltree->top; if (!node) return *avlnode = NULL, 0; cmp = avltree->cmp; for (;;) { c = cmp(item, node->item); if (c < 0) { if (node->left) node = node->left; else return *avlnode = node, -1; } else if (c > 0) { if (node->right) node = node->right; else return *avlnode = node, 1; } else { return *avlnode = node, 0; } } } /* * avl_search: * Return a pointer to a node with the given item in the tree. * If no such item is in the tree, then NULL is returned. */ avl_node_t *avl_search(const avl_tree_t *avltree, const void *item) { avl_node_t *node; return avl_search_closest(avltree, item, &node) ? NULL : node; } avl_tree_t *avl_init_tree(avl_tree_t *rc, avl_compare_t cmp, avl_freeitem_t freeitem) { if (rc) { rc->head = NULL; rc->tail = NULL; rc->top = NULL; rc->cmp = cmp; rc->freeitem = freeitem; } return rc; } avl_tree_t *avl_alloc_tree(avl_compare_t cmp, avl_freeitem_t freeitem) { return avl_init_tree(malloc(sizeof(avl_tree_t)), cmp, freeitem); } void avl_clear_tree(avl_tree_t *avltree) { avltree->top = avltree->head = avltree->tail = NULL; } void avl_free_nodes(avl_tree_t *avltree) { avl_node_t *node, *next; avl_freeitem_t freeitem; freeitem = avltree->freeitem; for (node = avltree->head; node; node = next) { next = node->next; if (freeitem) freeitem(node->item); free(node); } avl_clear_tree(avltree); } /* * avl_free_tree: * Free all memory used by this tree. If freeitem is not NULL, then * it is assumed to be a destructor for the items referenced in the avl_ * tree, and they are deleted as well. */ void avl_free_tree(avl_tree_t *avltree) { avl_free_nodes(avltree); free(avltree); } static void avl_clear_node(avl_node_t *newnode) { newnode->left = newnode->right = NULL; #ifdef AVL_COUNT newnode->count = 1; #endif #ifdef AVL_DEPTH newnode->depth = 1; #endif } avl_node_t *avl_init_node(avl_node_t *newnode, void *item) { if (newnode) { avl_clear_node(newnode); newnode->item = item; } return newnode; } avl_node_t *avl_insert_top(avl_tree_t *avltree, avl_node_t *newnode) { avl_clear_node(newnode); newnode->prev = newnode->next = newnode->parent = NULL; avltree->head = avltree->tail = avltree->top = newnode; return newnode; } avl_node_t *avl_insert_before(avl_tree_t *avltree, avl_node_t *node, avl_node_t *newnode) { if (!node) return avltree->tail ? avl_insert_after(avltree, avltree->tail, newnode) : avl_insert_top(avltree, newnode); if (node->left) return avl_insert_after(avltree, node->prev, newnode); avl_clear_node(newnode); newnode->next = node; newnode->parent = node; newnode->prev = node->prev; if (node->prev) node->prev->next = newnode; else avltree->head = newnode; node->prev = newnode; node->left = newnode; avl_rebalance(avltree, node); return newnode; } avl_node_t *avl_insert_after(avl_tree_t *avltree, avl_node_t *node, avl_node_t *newnode) { if (!node) return avltree->head ? avl_insert_before(avltree, avltree->head, newnode) : avl_insert_top(avltree, newnode); if (node->right) return avl_insert_before(avltree, node->next, newnode); avl_clear_node(newnode); newnode->prev = node; newnode->parent = node; newnode->next = node->next; if (node->next) node->next->prev = newnode; else avltree->tail = newnode; node->next = newnode; node->right = newnode; avl_rebalance(avltree, node); return newnode; } avl_node_t *avl_insert_node(avl_tree_t *avltree, avl_node_t *newnode) { avl_node_t *node; if (!avltree->top) return avl_insert_top(avltree, newnode); switch (avl_search_closest(avltree, newnode->item, &node)) { case -1: return avl_insert_before(avltree, node, newnode); case 1: return avl_insert_after(avltree, node, newnode); } return NULL; } /* * avl_insert: * Create a new node and insert an item there. * Returns the new node on success or NULL if no memory could be allocated. */ avl_node_t *avl_insert(avl_tree_t *avltree, void *item) { avl_node_t *newnode; newnode = avl_init_node(malloc(sizeof(avl_node_t)), item); if (newnode) { if (avl_insert_node(avltree, newnode)) return newnode; free(newnode); errno = EEXIST; } return NULL; } /* * avl_unlink_node: * Removes the given node. Does not delete the item at that node. * The item of the node may be freed before calling avl_unlink_node. * (In other words, it is not referenced by this function.) */ void avl_unlink_node(avl_tree_t *avltree, avl_node_t *avlnode) { avl_node_t *parent; avl_node_t **superparent; avl_node_t *subst, *left, *right; avl_node_t *balnode; if (avlnode->prev) avlnode->prev->next = avlnode->next; else avltree->head = avlnode->next; if (avlnode->next) avlnode->next->prev = avlnode->prev; else avltree->tail = avlnode->prev; parent = avlnode->parent; superparent = parent ? avlnode == parent->left ? &parent->left : &parent->right : &avltree->top; left = avlnode->left; right = avlnode->right; if (!left) { *superparent = right; if (right) right->parent = parent; balnode = parent; } else if (!right) { *superparent = left; left->parent = parent; balnode = parent; } else { subst = avlnode->prev; if (subst == left) { balnode = subst; } else { balnode = subst->parent; balnode->right = subst->left; if (balnode->right) balnode->right->parent = balnode; subst->left = left; left->parent = subst; } subst->right = right; subst->parent = parent; right->parent = subst; *superparent = subst; } avl_rebalance(avltree, balnode); } void *avl_delete_node(avl_tree_t *avltree, avl_node_t *avlnode) { void *item = NULL; if (avlnode) { item = avlnode->item; avl_unlink_node(avltree, avlnode); if (avltree->freeitem) avltree->freeitem(item); free(avlnode); } return item; } void *avl_delete(avl_tree_t *avltree, const void *item) { return avl_delete_node(avltree, avl_search(avltree, item)); } avl_node_t *avl_fixup_node(avl_tree_t *avltree, avl_node_t *newnode) { avl_node_t *oldnode = NULL, *node; if (!avltree || !newnode) return NULL; node = newnode->prev; if (node) { oldnode = node->next; node->next = newnode; } else { avltree->head = newnode; } node = newnode->next; if (node) { oldnode = node->prev; node->prev = newnode; } else { avltree->tail = newnode; } node = newnode->parent; if (node) { if (node->left == oldnode) node->left = newnode; else node->right = newnode; } else { oldnode = avltree->top; avltree->top = newnode; } return oldnode; } /* * avl_rebalance: * Rebalances the tree if one side becomes too heavy. This function * assumes that both subtrees are AVL-trees with consistant data. The * function has the additional side effect of recalculating the count of * the tree at this node. It should be noted that at the return of this * function, if a rebalance takes place, the top of this subtree is no * longer going to be the same node. */ void avl_rebalance(avl_tree_t *avltree, avl_node_t *avlnode) { avl_node_t *child; avl_node_t *gchild; avl_node_t *parent; avl_node_t **superparent; parent = avlnode; while (avlnode) { parent = avlnode->parent; superparent = parent ? avlnode == parent->left ? &parent->left : &parent->right : &avltree->top; switch (avl_check_balance(avlnode)) { case -1: child = avlnode->left; #ifdef AVL_DEPTH if (L_DEPTH(child) >= R_DEPTH(child)) { #else #ifdef AVL_COUNT if (L_COUNT(child) >= R_COUNT(child)) { #else #error No balancing possible. #endif #endif avlnode->left = child->right; if (avlnode->left) avlnode->left->parent = avlnode; child->right = avlnode; avlnode->parent = child; *superparent = child; child->parent = parent; #ifdef AVL_COUNT avlnode->count = CALC_COUNT(avlnode); child->count = CALC_COUNT(child); #endif #ifdef AVL_DEPTH avlnode->depth = CALC_DEPTH(avlnode); child->depth = CALC_DEPTH(child); #endif } else { gchild = child->right; avlnode->left = gchild->right; if (avlnode->left) avlnode->left->parent = avlnode; child->right = gchild->left; if (child->right) child->right->parent = child; gchild->right = avlnode; if (gchild->right) gchild->right->parent = gchild; gchild->left = child; if (gchild->left) gchild->left->parent = gchild; *superparent = gchild; gchild->parent = parent; #ifdef AVL_COUNT avlnode->count = CALC_COUNT(avlnode); child->count = CALC_COUNT(child); gchild->count = CALC_COUNT(gchild); #endif #ifdef AVL_DEPTH avlnode->depth = CALC_DEPTH(avlnode); child->depth = CALC_DEPTH(child); gchild->depth = CALC_DEPTH(gchild); #endif } break; case 1: child = avlnode->right; #ifdef AVL_DEPTH if (R_DEPTH(child) >= L_DEPTH(child)) { #else #ifdef AVL_COUNT if (R_COUNT(child) >= L_COUNT(child)) { #else #error No balancing possible. #endif #endif avlnode->right = child->left; if (avlnode->right) avlnode->right->parent = avlnode; child->left = avlnode; avlnode->parent = child; *superparent = child; child->parent = parent; #ifdef AVL_COUNT avlnode->count = CALC_COUNT(avlnode); child->count = CALC_COUNT(child); #endif #ifdef AVL_DEPTH avlnode->depth = CALC_DEPTH(avlnode); child->depth = CALC_DEPTH(child); #endif } else { gchild = child->left; avlnode->right = gchild->left; if (avlnode->right) avlnode->right->parent = avlnode; child->left = gchild->right; if (child->left) child->left->parent = child; gchild->left = avlnode; if (gchild->left) gchild->left->parent = gchild; gchild->right = child; if (gchild->right) gchild->right->parent = gchild; *superparent = gchild; gchild->parent = parent; #ifdef AVL_COUNT avlnode->count = CALC_COUNT(avlnode); child->count = CALC_COUNT(child); gchild->count = CALC_COUNT(gchild); #endif #ifdef AVL_DEPTH avlnode->depth = CALC_DEPTH(avlnode); child->depth = CALC_DEPTH(child); gchild->depth = CALC_DEPTH(gchild); #endif } break; default: #ifdef AVL_COUNT avlnode->count = CALC_COUNT(avlnode); #endif #ifdef AVL_DEPTH avlnode->depth = CALC_DEPTH(avlnode); #endif } avlnode = parent; } } emoa/src/cec2009.c0000644000176200001440000011337514666413671013223 0ustar liggesusers/* * cec2009.c - CEC 2009 test functions * * C implementation of the CEC 2009 EMOA competition test functions. * * Based on the file cec2009.cpp by Qingfu Zhang, Aimin Zhou, Shizheng * Zhaoy, Ponnuthurai Nagaratnam Suganthany, Wudong Liu and Santosh * Tiwar: * * http://web.mysites.ntu.edu.sg/epnsugan/PublicSite/Shared%20Documents/CEC2009-MOEA/ * * FIXME: The original author provides no licensing information for * the source code. * * Author: * Olaf Mersmann (OME) * */ #include #include #include #include #include #include "sexp_macros.h" /* We have our own definition of PI: */ #define CEC_PI 3.1415926535897932384626433832795 #define MYSIGN(x) ((x) > 0 ? 1.0 : -1.0) static void UF1(double *x, double *f, const unsigned int nx) { unsigned int j, count1, count2; double sum1, sum2, yj; sum1 = sum2 = 0.0; count1 = count2 = 0; for (j = 2; j <= nx; j++) { yj = x[j - 1] - sin(6.0 * CEC_PI * x[0] + j * CEC_PI / nx); yj = yj * yj; if (j % 2 == 0) { sum2 += yj; count2++; } else { sum1 += yj; count1++; } } f[0] = x[0] + 2.0 * sum1 / (double)count1; f[1] = 1.0 - sqrt(x[0]) + 2.0 * sum2 / (double)count2; } static void UF2(double *x, double *f, const unsigned int nx) { unsigned int j, count1, count2; double sum1, sum2, yj; sum1 = sum2 = 0.0; count1 = count2 = 0; for (j = 2; j <= nx; j++) { if (j % 2 == 0) { yj = x[j - 1] - 0.3 * x[0] * (x[0] * cos(24.0 * CEC_PI * x[0] + 4.0 * j * CEC_PI / nx) + 2.0) * sin(6.0 * CEC_PI * x[0] + j * CEC_PI / nx); sum2 += yj * yj; count2++; } else { yj = x[j - 1] - 0.3 * x[0] * (x[0] * cos(24.0 * CEC_PI * x[0] + 4.0 * j * CEC_PI / nx) + 2.0) * cos(6.0 * CEC_PI * x[0] + j * CEC_PI / nx); sum1 += yj * yj; count1++; } } f[0] = x[0] + 2.0 * sum1 / (double)count1; f[1] = 1.0 - sqrt(x[0]) + 2.0 * sum2 / (double)count2; } static void UF3(double *x, double *f, const unsigned int nx) { unsigned int j, count1, count2; double sum1, sum2, prod1, prod2, yj, pj; sum1 = sum2 = 0.0; count1 = count2 = 0; prod1 = prod2 = 1.0; for (j = 2; j <= nx; j++) { yj = x[j - 1] - pow(x[0], 0.5 * (1.0 + 3.0 * (j - 2.0) / (nx - 2.0))); pj = cos(20.0 * yj * CEC_PI / sqrt(j + 0.0)); if (j % 2 == 0) { sum2 += yj * yj; prod2 *= pj; count2++; } else { sum1 += yj * yj; prod1 *= pj; count1++; } } f[0] = x[0] + 2.0 * (4.0 * sum1 - 2.0 * prod1 + 2.0) / (double)count1; f[1] = 1.0 - sqrt(x[0]) + 2.0 * (4.0 * sum2 - 2.0 * prod2 + 2.0) / (double)count2; } static void UF4(double *x, double *f, const unsigned int nx) { unsigned int j, count1, count2; double sum1, sum2, yj, hj; sum1 = sum2 = 0.0; count1 = count2 = 0; for (j = 2; j <= nx; j++) { yj = x[j - 1] - sin(6.0 * CEC_PI * x[0] + j * CEC_PI / nx); hj = fabs(yj) / (1.0 + exp(2.0 * fabs(yj))); if (j % 2 == 0) { sum2 += hj; count2++; } else { sum1 += hj; count1++; } } f[0] = x[0] + 2.0 * sum1 / (double)count1; f[1] = 1.0 - x[0] * x[0] + 2.0 * sum2 / (double)count2; } static void UF5(double *x, double *f, const unsigned int nx) { unsigned int j, count1, count2; double sum1, sum2, yj, hj, N, E; sum1 = sum2 = 0.0; count1 = count2 = 0; N = 10.0; E = 0.1; for (j = 2; j <= nx; j++) { yj = x[j - 1] - sin(6.0 * CEC_PI * x[0] + j * CEC_PI / nx); hj = 2.0 * yj * yj - cos(4.0 * CEC_PI * yj) + 1.0; if (j % 2 == 0) { sum2 += hj; count2++; } else { sum1 += hj; count1++; } } hj = (0.5 / N + E) * fabs(sin(2.0 * N * CEC_PI * x[0])); f[0] = x[0] + hj + 2.0 * sum1 / (double)count1; f[1] = 1.0 - x[0] + hj + 2.0 * sum2 / (double)count2; } static void UF6(double *x, double *f, const unsigned int nx) { unsigned int j, count1, count2; double sum1, sum2, prod1, prod2, yj, hj, pj, N, E; N = 2.0; E = 0.1; sum1 = sum2 = 0.0; count1 = count2 = 0; prod1 = prod2 = 1.0; for (j = 2; j <= nx; j++) { yj = x[j - 1] - sin(6.0 * CEC_PI * x[0] + j * CEC_PI / nx); pj = cos(20.0 * yj * CEC_PI / sqrt(j + 0.0)); if (j % 2 == 0) { sum2 += yj * yj; prod2 *= pj; count2++; } else { sum1 += yj * yj; prod1 *= pj; count1++; } } hj = 2.0 * (0.5 / N + E) * sin(2.0 * N * CEC_PI * x[0]); if (hj < 0.0) hj = 0.0; f[0] = x[0] + hj + 2.0 * (4.0 * sum1 - 2.0 * prod1 + 2.0) / (double)count1; f[1] = 1.0 - x[0] + hj + 2.0 * (4.0 * sum2 - 2.0 * prod2 + 2.0) / (double)count2; } static void UF7(double *x, double *f, const unsigned int nx) { unsigned int j, count1, count2; double sum1, sum2, yj; sum1 = sum2 = 0.0; count1 = count2 = 0; for (j = 2; j <= nx; j++) { yj = x[j - 1] - sin(6.0 * CEC_PI * x[0] + j * CEC_PI / nx); if (j % 2 == 0) { sum2 += yj * yj; count2++; } else { sum1 += yj * yj; count1++; } } yj = pow(x[0], 0.2); f[0] = yj + 2.0 * sum1 / (double)count1; f[1] = 1.0 - yj + 2.0 * sum2 / (double)count2; } static void UF8(double *x, double *f, const unsigned int nx) { unsigned int j, count1, count2, count3; double sum1, sum2, sum3, yj; sum1 = sum2 = sum3 = 0.0; count1 = count2 = count3 = 0; for (j = 3; j <= nx; j++) { yj = x[j - 1] - 2.0 * x[1] * sin(2.0 * CEC_PI * x[0] + j * CEC_PI / nx); if (j % 3 == 1) { sum1 += yj * yj; count1++; } else if (j % 3 == 2) { sum2 += yj * yj; count2++; } else { sum3 += yj * yj; count3++; } } f[0] = cos(0.5 * CEC_PI * x[0]) * cos(0.5 * CEC_PI * x[1]) + 2.0 * sum1 / (double)count1; f[1] = cos(0.5 * CEC_PI * x[0]) * sin(0.5 * CEC_PI * x[1]) + 2.0 * sum2 / (double)count2; f[2] = sin(0.5 * CEC_PI * x[0]) + 2.0 * sum3 / (double)count3; } static void UF9(double *x, double *f, const unsigned int nx) { unsigned int j, count1, count2, count3; double sum1, sum2, sum3, yj, E; E = 0.1; sum1 = sum2 = sum3 = 0.0; count1 = count2 = count3 = 0; for (j = 3; j <= nx; j++) { yj = x[j - 1] - 2.0 * x[1] * sin(2.0 * CEC_PI * x[0] + j * CEC_PI / nx); if (j % 3 == 1) { sum1 += yj * yj; count1++; } else if (j % 3 == 2) { sum2 += yj * yj; count2++; } else { sum3 += yj * yj; count3++; } } yj = (1.0 + E) * (1.0 - 4.0 * (2.0 * x[0] - 1.0) * (2.0 * x[0] - 1.0)); if (yj < 0.0) yj = 0.0; f[0] = 0.5 * (yj + 2 * x[0]) * x[1] + 2.0 * sum1 / (double)count1; f[1] = 0.5 * (yj - 2 * x[0] + 2.0) * x[1] + 2.0 * sum2 / (double)count2; f[2] = 1.0 - x[1] + 2.0 * sum3 / (double)count3; } static void UF10(double *x, double *f, const unsigned int nx) { unsigned int j, count1, count2, count3; double sum1, sum2, sum3, yj, hj; sum1 = sum2 = sum3 = 0.0; count1 = count2 = count3 = 0; for (j = 3; j <= nx; j++) { yj = x[j - 1] - 2.0 * x[1] * sin(2.0 * CEC_PI * x[0] + j * CEC_PI / nx); hj = 4.0 * yj * yj - cos(8.0 * CEC_PI * yj) + 1.0; if (j % 3 == 1) { sum1 += hj; count1++; } else if (j % 3 == 2) { sum2 += hj; count2++; } else { sum3 += hj; count3++; } } f[0] = cos(0.5 * CEC_PI * x[0]) * cos(0.5 * CEC_PI * x[1]) + 2.0 * sum1 / (double)count1; f[1] = cos(0.5 * CEC_PI * x[0]) * sin(0.5 * CEC_PI * x[1]) + 2.0 * sum2 / (double)count2; f[2] = sin(0.5 * CEC_PI * x[0]) + 2.0 * sum3 / (double)count3; } #define UF_2D_WRAPPER(U) \ SEXP do_##U(SEXP s_x) { \ R_len_t i; \ SEXP s_res; \ if (!isReal(s_x) || !isVector(s_x)) \ error("Argument 's_x' is not a numeric vector."); \ UNPACK_REAL_VECTOR(s_x, x, n); \ PROTECT(s_res = allocVector(REALSXP, 2)); \ double *res = REAL(s_res); \ res[0] = res[1] = 0.0; \ if (!R_FINITE(x[0]) || x[0] < 0.0 || x[0] > 1.0) { \ res[0] = res[1] = R_NaN; \ } else { \ for (i = 1; i < n; ++i) { \ if (!R_FINITE(x[i]) || x[i] < -1.0 || x[i] > 1.0) { \ res[0] = res[1] = R_NaN; \ break; \ } \ } \ } \ if (!ISNAN(res[0]) && !ISNAN(res[1])) \ U(x, res, n); \ UNPROTECT(1); /* s_res */ \ return s_res; \ } #define UF_3D_WRAPPER(U) \ SEXP do_##U(SEXP s_x) { \ R_len_t i; \ SEXP s_res; \ UNPACK_REAL_VECTOR(s_x, x, n); \ PROTECT(s_res = allocVector(REALSXP, 3)); \ double *res = REAL(s_res); \ res[0] = res[1] = res[2] = 0.0; \ if (!R_FINITE(x[0]) || x[0] < 0.0 || x[0] > 1.0) { \ res[0] = res[1] = res[2] = R_NaN; \ } else if (!R_FINITE(x[1]) || x[1] < 0.0 || x[1] > 1.0) { \ res[0] = res[1] = res[2] = R_NaN; \ } else { \ for (i = 2; i < n; ++i) { \ if (!R_FINITE(x[i]) || x[i] < -2.0 || x[i] > 2.0) { \ res[0] = res[1] = res[2] = R_NaN; \ break; \ } \ } \ } \ if (!ISNAN(res[0]) && !ISNAN(res[1])) \ U(x, res, n); \ UNPROTECT(1); /* s_res */ \ return s_res; \ } UF_2D_WRAPPER(UF1) UF_2D_WRAPPER(UF2) UF_2D_WRAPPER(UF3) UF_2D_WRAPPER(UF4) UF_2D_WRAPPER(UF5) UF_2D_WRAPPER(UF6) UF_2D_WRAPPER(UF7) UF_3D_WRAPPER(UF8) UF_3D_WRAPPER(UF9) UF_3D_WRAPPER(UF10) /* OME: Other test functions currently not ported. */ #if 0 void CF1(double *x, double *f, double *c, const unsigned int nx) { unsigned int j, count1, count2; double sum1, sum2, yj, N, a; N = 10.0; a = 1.0; sum1 = sum2 = 0.0; count1 = count2 = 0; for(j = 2; j <= nx; j++) { yj = x[j-1]-pow(x[0],0.5*(1.0+3.0*(j-2.0)/(nx-2.0))); if (j % 2 == 1) { sum1 += yj*yj; count1++; } else { sum2 += yj*yj; count2++; } } f[0] = x[0] + 2.0*sum1 / (double)count1; f[1] = 1.0 - x[0] + 2.0*sum2 / (double)count2; c[0] = f[1] + f[0] - a*fabs(sin(N*CEC_PI*(f[0]-f[1]+1.0))) - 1.0; } void CF2(double *x, double *f, double *c, const unsigned int nx) { unsigned int j, count1, count2; double sum1, sum2, yj, N, a, t; N = 2.0; a = 1.0; sum1 = sum2 = 0.0; count1 = count2 = 0; for(j = 2; j <= nx; j++) { if (j % 2 == 1) { yj = x[j-1] - sin(6.0*CEC_PI*x[0] + j*CEC_PI/nx); sum1 += yj*yj; count1++; } else { yj = x[j-1] - cos(6.0*CEC_PI*x[0] + j*CEC_PI/nx); sum2 += yj*yj; count2++; } } f[0] = x[0] + 2.0*sum1 / (double)count1; f[1] = 1.0 - sqrt(x[0]) + 2.0*sum2 / (double)count2; t = f[1] + sqrt(f[0]) - a*sin(N*CEC_PI*(sqrt(f[0])-f[1]+1.0)) - 1.0; c[0] = MYSIGN(t)*fabs(t)/(1+exp(4.0*fabs(t))); } void CF3(double *x, double *f, double *c, const unsigned int nx) { unsigned int j, count1, count2; double sum1, sum2, prod1, prod2, yj, pj, N, a; N = 2.0; a = 1.0; sum1 = sum2 = 0.0; count1 = count2 = 0; prod1 = prod2 = 1.0; for(j = 2; j <= nx; j++) { yj = x[j-1]-sin(6.0*CEC_PI*x[0]+j*CEC_PI/nx); pj = cos(20.0*yj*CEC_PI/sqrt(j+0.0)); if (j % 2 == 0) { sum2 += yj*yj; prod2 *= pj; count2++; } else { sum1 += yj*yj; prod1 *= pj; count1++; } } f[0] = x[0] + 2.0*(4.0*sum1 - 2.0*prod1 + 2.0) / (double)count1; f[1] = 1.0 - x[0]*x[0] + 2.0*(4.0*sum2 - 2.0*prod2 + 2.0) / (double)count2; c[0] = f[1] + f[0]*f[0] - a*sin(N*CEC_PI*(f[0]*f[0]-f[1]+1.0)) - 1.0; } void CF4(double *x, double *f, double *c, const unsigned int nx) { unsigned int j; double sum1, sum2, yj, t; sum1 = sum2 = 0.0; for(j = 2; j <= nx; j++) { yj = x[j-1] - sin(6.0*CEC_PI*x[0] + j*CEC_PI/nx); if (j % 2 == 1) { sum1 += yj*yj; } else { if (j==2) sum2 += yj < 1.5-0.75*sqrt(2.0) ? fabs(yj) : (0.125+(yj-1)*(yj-1)); else sum2 += yj*yj; } } f[0] = x[0] + sum1; f[1] = 1.0 - x[0] + sum2; t = x[1] - sin(6.0*x[0]*CEC_PI+2.0*CEC_PI/nx) - 0.5*x[0] + 0.25; c[0] = MYSIGN(t)*fabs(t)/(1+exp(4.0*fabs(t))); } void CF5(double *x, double *f, double *c, const unsigned int nx) { unsigned int j; double sum1, sum2, yj; sum1 = sum2 = 0.0; for(j = 2; j <= nx; j++) { if (j % 2 == 1) { yj = x[j-1] - 0.8*x[0]*cos(6.0*CEC_PI*x[0] + j*CEC_PI/nx); sum1 += 2.0*yj*yj - cos(4.0*CEC_PI*yj) + 1.0; } else { yj = x[j-1] - 0.8*x[0]*sin(6.0*CEC_PI*x[0] + j*CEC_PI/nx); if (j==2) sum2 += yj < 1.5-0.75*sqrt(2.0) ? fabs(yj) : (0.125+(yj-1)*(yj-1)); else sum2 += 2.0*yj*yj - cos(4.0*CEC_PI*yj) + 1.0; } } f[0] = x[0] + sum1; f[1] = 1.0 - x[0] + sum2; c[0] = x[1] - 0.8*x[0]*sin(6.0*x[0]*CEC_PI+2.0*CEC_PI/nx) - 0.5*x[0] + 0.25; } void CF6(double *x, double *f, double *c, const unsigned int nx) { unsigned int j; double sum1, sum2, yj; sum1 = sum2 = 0.0; for(j = 2; j <= nx; j++) { if (j % 2 == 1) { yj = x[j-1] - 0.8*x[0]*cos(6.0*CEC_PI*x[0] + j*CEC_PI/nx); sum1 += yj*yj; } else { yj = x[j-1] - 0.8*x[0]*sin(6.0*CEC_PI*x[0] + j*CEC_PI/nx); sum2 += yj*yj; } } f[0] = x[0] + sum1; f[1] = (1.0 - x[0])*(1.0 - x[0]) + sum2; c[0] = x[1]-0.8*x[0]*sin(6.0*x[0]*CEC_PI+2.0*CEC_PI/nx) - MYSIGN((x[0]-0.5)*(1.0-x[0]))*sqrt(fabs((x[0]-0.5)*(1.0-x[0]))); c[1] = x[3]-0.8*x[0]*sin(6.0*x[0]*CEC_PI+4.0*CEC_PI/nx) - MYSIGN(0.25*sqrt(1-x[0])-0.5*(1.0-x[0]))*sqrt(fabs(0.25*sqrt(1-x[0])-0.5*(1.0-x[0]))); } void CF7(double *x, double *f, double *c, const unsigned int nx) { unsigned int j; double sum1, sum2, yj; sum1 = sum2 = 0.0; for(j = 2; j <= nx; j++) { if (j % 2 == 1) { yj = x[j-1] - cos(6.0*CEC_PI*x[0] + j*CEC_PI/nx); sum1 += 2.0*yj*yj-cos(4.0*CEC_PI*yj)+1.0; } else { yj = x[j-1] - sin(6.0*CEC_PI*x[0] + j*CEC_PI/nx); if (j==2 || j==4) sum2 += yj*yj; else sum2 += 2.0*yj*yj-cos(4.0*CEC_PI*yj)+1.0; } } f[0] = x[0] + sum1; f[1] = (1.0 - x[0])*(1.0 - x[0]) + sum2; c[0] = x[1]-sin(6.0*x[0]*CEC_PI+2.0*CEC_PI/nx) - MYSIGN((x[0]-0.5)*(1.0-x[0]))*sqrt(fabs((x[0]-0.5)*(1.0-x[0]))); c[1] = x[3]-sin(6.0*x[0]*CEC_PI+4.0*CEC_PI/nx) - MYSIGN(0.25*sqrt(1-x[0])-0.5*(1.0-x[0]))*sqrt(fabs(0.25*sqrt(1-x[0])-0.5*(1.0-x[0]))); } void CF8(double *x, double *f, double *c, const unsigned int nx) { unsigned int j, count1, count2, count3; double sum1, sum2, sum3, yj, N, a; N = 2.0; a = 4.0; sum1 = sum2 = sum3 = 0.0; count1 = count2 = count3 = 0; for(j = 3; j <= nx; j++) { yj = x[j-1] - 2.0*x[1]*sin(2.0*CEC_PI*x[0]+j*CEC_PI/nx); if(j % 3 == 1) { sum1 += yj*yj; count1++; } else if(j % 3 == 2) { sum2 += yj*yj; count2++; } else { sum3 += yj*yj; count3++; } } f[0] = cos(0.5*CEC_PI*x[0])*cos(0.5*CEC_PI*x[1]) + 2.0*sum1 / (double)count1; f[1] = cos(0.5*CEC_PI*x[0])*sin(0.5*CEC_PI*x[1]) + 2.0*sum2 / (double)count2; f[2] = sin(0.5*CEC_PI*x[0]) + 2.0*sum3 / (double)count3; c[0] = (f[0]*f[0]+f[1]*f[1])/(1-f[2]*f[2]) - a*fabs(sin(N*CEC_PI*((f[0]*f[0]-f[1]*f[1])/(1-f[2]*f[2])+1.0))) + 1.0; } void CF9(double *x, double *f, double *c, const unsigned int nx) { unsigned int j, count1, count2, count3; double sum1, sum2, sum3, yj, N, a; N = 2.0; a = 3.0; sum1 = sum2 = sum3 = 0.0; count1 = count2 = count3 = 0; for(j = 3; j <= nx; j++) { yj = x[j-1] - 2.0*x[1]*sin(2.0*CEC_PI*x[0]+j*CEC_PI/nx); if(j % 3 == 1) { sum1 += yj*yj; count1++; } else if(j % 3 == 2) { sum2 += yj*yj; count2++; } else { sum3 += yj*yj; count3++; } } f[0] = cos(0.5*CEC_PI*x[0])*cos(0.5*CEC_PI*x[1]) + 2.0*sum1 / (double)count1; f[1] = cos(0.5*CEC_PI*x[0])*sin(0.5*CEC_PI*x[1]) + 2.0*sum2 / (double)count2; f[2] = sin(0.5*CEC_PI*x[0]) + 2.0*sum3 / (double)count3; c[0] = (f[0]*f[0]+f[1]*f[1])/(1-f[2]*f[2]) - a*sin(N*CEC_PI*((f[0]*f[0]-f[1]*f[1])/(1-f[2]*f[2])+1.0)) + 1.0; } void CF10(double *x, double *f, double *c, const unsigned int nx) { unsigned int j, count1, count2, count3; double sum1, sum2, sum3, yj, hj, N, a; N = 2.0; a = 1.0; sum1 = sum2 = sum3 = 0.0; count1 = count2 = count3 = 0; for(j = 3; j <= nx; j++) { yj = x[j-1] - 2.0*x[1]*sin(2.0*CEC_PI*x[0]+j*CEC_PI/nx); hj = 4.0*yj*yj - cos(8.0*CEC_PI*yj) + 1.0; if(j % 3 == 1) { sum1 += hj; count1++; } else if(j % 3 == 2) { sum2 += hj; count2++; } else { sum3 += hj; count3++; } } f[0] = cos(0.5*CEC_PI*x[0])*cos(0.5*CEC_PI*x[1]) + 2.0*sum1 / (double)count1; f[1] = cos(0.5*CEC_PI*x[0])*sin(0.5*CEC_PI*x[1]) + 2.0*sum2 / (double)count2; f[2] = sin(0.5*CEC_PI*x[0]) + 2.0*sum3 / (double)count3; c[0] = (f[0]*f[0]+f[1]*f[1])/(1-f[2]*f[2]) - a*sin(N*CEC_PI*((f[0]*f[0]-f[1]*f[1])/(1-f[2]*f[2])+1.0)) + 1.0; } /* * 5-objctive test instances */ #define a 1 #define b 10 #define c 8 #define c1 (a + c / 2) #define c2 (c + 2 * a) #define b1 (b / 2) void R2_DTLZ2_M5(double *x, double *f, const unsigned int nx, const unsigned int n_obj) { int i=0,j=0; int k = nx - n_obj + 1; double g = 0; double sum = 0; /* double z[nx],zz[nx],p[nx],psum[n_obj],M[nx][nx],lamda_l[nx]; */ double *z, *zz, *p, *psum, **M, *lamda_l; double M_10D[10][10]={{0.0346, -0.7523, 0.3561, -0.2958, 0.4675,0,0,0,0,0},{0.8159, -0.0423, 0.4063, 0.3455, -0.2192,0,0,0,0,0},{-0.3499, 0.3421, 0.8227, -0.2190, -0.1889,0,0,0,0,0},{-0.0963, -0.4747, -0.0998, -0.2429, -0.8345,0,0,0,0,0},{-0.4487, -0.2998, 0.1460, 0.8283, -0.0363,0,0,0,0,0},{0,0,0,0,0,1,0,0,0,0},{0,0,0,0,0,0,1,0,0,0},{0,0,0,0,0,0,0,1,0,0},{0,0,0,0,0,0,0,0,1,0},{0,0,0,0,0,0,0,0,0,1}}; double lamda_l_10D[10]={0.313,0.312,0.321,0.316,0.456,1,1,1,1,1}; double M_30D[30][30]={{0.0128,0.2165,0.4374,-0.0800,0.0886,-0.2015,0.1071,0.2886,0.2354,0.2785,-0.1748,0.2147,0.1649,-0.3043,0.5316,0,0,0,0,0,0,0,0,0,0,0,0,0,0.000,0.000}, {0.4813, 0.2420, -0.3663, -0.0420, -0.0088, -0.4945, -0.3073, 0.1990, 0.0441, -0.0627, 0.0191, 0.3880, -0.0618, -0.0319, -0.1833,0,0,0,0,0,0,0,0,0,0,0,0,0,0.000,0.000}, {0.4816, -0.2254, 0.0663, 0.4801, 0.2009, -0.0008, -0.1501, 0.0269, -0.2037,0.4334, -0.2157, -0.3175, -0.0923, 0.1451, 0.1118,0,0,0,0,0,0,0,0,0,0,0,0,0,0.000,0.000}, {-0.0876, -0.2667, -0.0063, 0.2114, 0.4506, 0.0823, -0.0125, 0.2313, 0.0840,-0.2376, 0.1938, -0.0030, 0.3391, 0.0863, 0.1231,0,0,0,0,0,0,0,0,0,0,0,0,0,0.000,0.000}, {-0.1025, 0.4011, -0.0117, 0.2076, 0.2585, 0.1124, -0.0288, 0.3095, -0.6146,-0.2376, 0.1938, -0.0030, 0.3391, 0.0863, 0.1231,0,0,0,0,0,0,0,0,0,0,0,0,0,0.000,0.000}, {0.4543, -0.2761, -0.2985, -0.2837, 0.0634, 0.1070, 0.2996, -0.2690, -0.1634,-0.1452, 0.1799, -0.0014, 0.2394, -0.2745, 0.3969,0,0,0,0,0,0,0,0,0,0,0,0,0,0.000,0.000}, {-0.1422, -0.4364, 0.0751, -0.2235, 0.3966, -0.0252, 0.0908, 0.0477, -0.2254,0.1801, -0.0552, 0.5770, -0.0396, 0.3765, -0.0522,0,0,0,0,0,0,0,0,0,0,0,0,0,0.000,0.000}, {0.3542, -0.2245, 0.3497, -0.1609, -0.1107, 0.0079, 0.2241, 0.4517, 0.1309,-0.3355, -0.1123, -0.1831, 0.3000, 0.2045, -0.3191,0,0,0,0,0,0,0,0,0,0,0,0,0,0.000,0.000}, {0.0005, 0.0377, -0.2808, -0.0641, 0.1316, 0.2191, 0.0207, 0.3308, 0.4117,0.3839, 0.5775, -0.1219, 0.1192, 0.2435, 0.0414,0,0,0,0,0,0,0,0,0,0,0,0,0,0.000,0.000}, {-0.1177, -0.0001, -0.1992, -0.4533, 0.4234, -0.0191, -0.3740, 0.1325, 0.0972,-0.2042, -0.3493, -0.4018, -0.1087, 0.0918, 0.2217,0,0,0,0,0,0,0,0,0,0,0,0,0,0.000,0.000}, {0.1818, 0.3022, -0.1388, -0.2380, -0.0773, 0.6463, 0.0450, 0.1030, -0.0958,0.2837, -0.3969, 0.1779, -0.0251, -0.1543, -0.2452,0,0,0,0,0,0,0,0,0,0,0,0,0,0.000,0.000}, {-0.1889, -0.4397, -0.2206, 0.0981, -0.5203, 0.1325, -0.3427, 0.4242, -0.1271,-0.0291, -0.0795, 0.1213, 0.0565, -0.1092, 0.2720,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {-0.1808, -0.0624, -0.2689, 0.2289, 0.1128, -0.0844, -0.0549, -0.2202, 0.2450,0.0825, -0.3319, 0.0513, 0.7523, 0.0043, -0.1472,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {-0.0983, 0.0611, -0.4145, 0.3017, 0.0410, -0.0703, 0.6250, 0.2449, 0.1307,-0.1714, -0.3045, 0.0218, -0.2837, 0.1408, 0.1633,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0.2026, 0.0324, 0.1496, 0.3129, 0.1437, 0.4331, -0.2629, -0.1498, 0.3746,-0.4366, 0.0163, 0.3316, -0.0697, 0.1833, 0.2412,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}}; double lamda_l_30D[30]={0.113,0.105,0.117,0.119,0.108,0.110,0.101,0.107,0.111,0.109,0.120,0.108,0.101,0.105,0.116,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000}; z = new double[nx]; zz = new double[nx]; p = new double[nx]; psum = new double[n_obj]; M = new double*[nx]; for(i=0; i=0 && z[i]<=1) { zz[i]=z[i]; p[i]=0; } else if (z[i]<0) { zz[i]=-lamda_l[i] * z[i]; p[i]=-z[i]; } else { zz[i]=1-lamda_l[i]*(z[i]-1); p[i]=z[i]-1; } } for(j=0;j= 1; j--) { ff *= cos(zz[j-1] * CEC_PI / 2.0); psum[i-1] = sqrt( pow(psum[i-1],2) + pow(p[j-1],2) ); } if (i > 1) { ff *= sin(zz[(n_obj - i + 1) - 1] * CEC_PI / 2.0); psum[i-1] = sqrt( pow(psum[i-1],2) + pow(p[(n_obj - i + 1) - 1],2) ); } f[i-1] = 2.0/(1+exp(-psum[i-1])) * (ff+1); } delete []z; delete []zz; delete []p;delete []psum; delete []lamda_l; for(i=0; i=0 && z[i]<=1) { zz[i]=z[i]; p[i]=0; } else if (z[i]<0) { zz[i]=-lamda_l[i] * z[i]; p[i]=-z[i]; } else { zz[i]=1-lamda_l[i]*(z[i]-1); p[i]=z[i]-1; } } for(j=0;j= 1; j--) { ff *= cos(zz[j-1] * CEC_PI / 2.0); psum[i-1] = sqrt( pow(psum[i-1],2) + pow(p[j-1],2) ); } if (i > 1) { ff *= sin(zz[(n_obj - i + 1) - 1] * CEC_PI / 2.0); psum[i-1] = sqrt( pow(psum[i-1],2) + pow(p[(n_obj - i + 1) - 1],2) ); } f[i-1] = 2.0/(1+exp(-psum[i-1])) * (ff+1); } delete []z; delete []zz; delete []p;delete []psum; delete []lamda_l; for(i=0; i= min_epsilon ) { return min; } else if ( aa >= max && aa <= max_epsilon ) { return max; } else { return aa; } } int vector_in_01( const double *x, int nx ) { int i; for( i = 0; i < nx; i++ ) { if( x[i] < 0.0 || x[i] > 1.0 ) { return 0; } } return 1; } /* Local functions/values. */ double linear( const double *x, const int m,int M ) { int i; double result = 1.0; for( i=1; i <= M-m; i++ ) { result *= x[i-1]; } if( m != 1 ) { result *= 1 - x[M-m]; } return correct_to_01( result, EPSILON ); } double convex( const double *x, const int m,int M ) { int i; double result = 1.0; for( i=1; i <= M-m; i++ ) { result *= 1.0 - cos( x[i-1]*CEC_PI/2.0 ); } if( m != 1 ) { result *= 1.0 - sin( x[M-m]*CEC_PI/2.0 ); } return correct_to_01( result, EPSILON ); } double concave( const double *x, const int m,int M ) { int i; double result = 1.0; for( i=1; i <= M-m; i++ ) { result *= sin( x[i-1]*CEC_PI/2.0 ); } if( m != 1 ) { result *= cos( x[M-m]*CEC_PI/2.0 ); } return correct_to_01( result, EPSILON ); } double mixed( const double *x, const int A, const double alpha ) { const double tmp = 2.0*A*CEC_PI; return correct_to_01( pow( 1.0-x[0]-cos( tmp*x[0] + CEC_PI/2.0 )/tmp, alpha ), EPSILON ); } double disc( const double *x, const int A, const double alpha, const double beta ) { const double tmp1 = A*pow( x[0], beta )*CEC_PI; return correct_to_01( 1.0 - pow( x[0], alpha )*pow( cos( tmp1 ), 2.0 ), EPSILON ); } /* Calculate the minimum of two doubles. */ static double min_double( const double aa, const double bb ) { return aa < bb ? aa : bb; } /* Implemented functions. */ double b_poly( const double y, const double alpha ) { return correct_to_01( pow( y, alpha ), EPSILON ); } double b_flat ( const double y, const double A, const double B, const double C ) { const double tmp1 = min_double( 0.0, floor( y-B ) ) * A*( B-y )/B; const double tmp2 = min_double( 0.0, floor( C-y ) ) * ( 1.0-A )*( y-C )/( 1.0-C ); return correct_to_01( A+tmp1-tmp2, EPSILON ); } double b_param ( const double y, const double u, const double A, const double B, const double C ) { const double v = A - ( 1.0-2.0*u )*fabs( floor( 0.5-u )+A ); return correct_to_01( pow( y, B + ( C-B )*v ), EPSILON ); } double s_linear( const double y, const double A ) { return correct_to_01( fabs( y-A )/fabs( floor( A-y )+A ), EPSILON ); } double s_decept(const double y, const double A, const double B, const double C ) { const double tmp1 = floor( y-A+B )*( 1.0-C+( A-B )/B )/( A-B ); const double tmp2 = floor( A+B-y )*( 1.0-C+( 1.0-A-B )/B )/( 1.0-A-B ); return correct_to_01( 1.0 + ( fabs( y-A )-B )*( tmp1 + tmp2 + 1.0/B ), EPSILON ); } double s_multi ( const double y, const int A, const double B, const double C ) { const double tmp1 = fabs( y-C )/( 2.0*( floor( C-y )+C ) ); const double tmp2 = ( 4.0*A+2.0 )*CEC_PI*( 0.5-tmp1 ); return correct_to_01( ( 1.0 + cos( tmp2 ) + 4.0*B*pow( tmp1, 2.0 ) )/( B+2.0 ), EPSILON ); } double r_sum( const double *y, const double *w, int ny) { int i; double numerator = 0.0; double denominator = 0.0; for( i = 0; i < ny; i++ ) { numerator += w[i]*y[i]; denominator += w[i]; } return correct_to_01( numerator / denominator, EPSILON ); } double r_nonsep( const double *y, const int A, int ny) { const int y_len = ny; int j; double numerator = 0.0; for( j = 0; j < y_len; j++ ) { int k; numerator += y[j]; for( k = 0; k <= A-2; k++ ) { numerator += fabs( y[j] - y[( j+k+1 ) % y_len] ); } } { const double tmp = ceil( A/2.0 ); const double denominator = y_len*tmp*( 1.0 + 2.0*A - 2.0*tmp )/A; return correct_to_01( numerator / denominator, EPSILON ); } } void WFG1_M5( double *z, double *f, const unsigned int nx, const unsigned int M) { int i,j; double y[30],t1[30],t2[30],t3[30],t4[5]; const int k=M==2?4:2*(M-1); for( i = 0; i < nx; i++ ) { y[i] = z[i] / (2.0*( i+1 )); } /*y = WFG1_t1(y, k);*/ for( i = 0; i < k; i++ ) { t1[i] = y[i]; } for( i = k; i < nx; i++ ) { t1[i] = s_linear( y[i], 0.35 ); } /*y = WFG1_t2(y, k); */ for( i = 0; i < k; i++ ) { t2[i] = t1[i]; } for( i = k; i < nx; i++ ) { t2[i] = b_flat( t1[i], 0.8, 0.75, 0.85 ); } /*y = WFG1_t3(y); */ for( i = 0; i < nx; i++ ) { t3[i] = b_poly( t2[i], 0.02 ); } /*y = WFG1_t4( y,k,M,nx); */ { double w[30]; double y_sub[30],w_sub[30]; double y_sub2[30],w_sub2[30]; for( i = 1; i <= nx; i++) { w[i-1] = 2.0*i; } for( i = 1; i <= M-1; i++ ) { const int head = ( i-1 )*k/( M-1 ); const int tail = i*k/( M-1 ); for( j = head; j < tail; j++ ) { y_sub[j-head] = t3[j]; w_sub[j-head] = w[j]; } t4[i-1] = r_sum( y_sub, w_sub,tail-head ); } for( j = k; j < nx; j++ ) { y_sub2[j-k] = t3[j]; w_sub2[j-k] = w[j]; } t4[i-1] = r_sum( y_sub2, w_sub2,nx-k ); } /*shape */ { int m; short A[5]; double x[5],h[5],S[5]; A[0] = 1; for( i = 1; i < M-1; i++ ) { A[i] = 1; } for( i = 0; i < M-1; i++ ) { double tmp1; tmp1 = t4[M-1]; if( A[i] > tmp1 ) tmp1 = A[i]; x[i] = tmp1*( t4[i] - 0.5 ) + 0.5; } x[M-1] = t4[M-1]; for( m = 1; m <= M-1; m++ ) { h[m-1] = convex( x, m,M ); } h[m-1] = mixed( x, 5, 1.0 ); for( m = 1; m <= M; m++ ) { S[m-1] = m*2.0; } for( i = 0; i < M; i++ ) { f[i] = 1.0*x[M-1] + S[i]*h[i]; } } } } #endif emoa/src/sb_crossover.c0000644000176200001440000000524714554275232014660 0ustar liggesusers#include "extern.h" #include #include #include "sexp_macros.h" #include "utilities.h" #define MIN(A, B) ((A < B) ? (A) : (B)) #define MAX(A, B) ((A > B) ? (A) : (B)) static const double min_diff = 1.0e-14; /* * calc_betaq - calculate betaq parameter based on beta and eta. */ static R_INLINE double calc_betaq(const double beta, const double eta) { const double rand = unif_rand(); const double alpha = 2.0 - pow(beta, -(eta + 1.0)); if (rand <= (1.0 / alpha)) { return (pow(rand * alpha, 1.0 / (eta + 1.0))); } else { return (pow(1.0 / (2.0 - rand * alpha), 1.0 / (eta + 1.0))); } } /* * Perform a simulated binary crossover between two individuals and * return two new individuals. */ SEXP do_sbx(SEXP s_parents, SEXP s_lb, SEXP s_ub, SEXP s_eta, SEXP s_p) { SEXP s_res; double betaq; /* Unpack arguments: */ UNPACK_REAL_MATRIX(s_parents, parents, d, n); const double *parent1 = parents; const double *parent2 = parents + d; UNPACK_REAL_VECTOR(s_lb, lb, dlb); UNPACK_REAL_VECTOR(s_ub, ub, dub); UNPACK_REAL(s_eta, eta); UNPACK_REAL(s_p, p); /* Sanity checks; */ if (n < 2) error("do_sbx called with more less than two parents."); if (n > 2) warning("do_sbx called with more than two parents. Only the first two are " "used."); if (dlb != d || dub != d) error("do_sbx: Dimension of parents and bounds not equal."); /* Allocate result matrix: */ PROTECT(s_res = allocMatrix(REALSXP, d, 2)); double *child1 = REAL(s_res); double *child2 = REAL(s_res) + d; GetRNGstate(); for (int i = 0; i < d; ++i) { /* Perform crossover for i-th dimension with probability p, if * the two parents differ by at least min_diff. */ if (unif_rand() <= p && fabs(parent1[i] - parent2[i]) > min_diff) { const double y1 = MIN(parent1[i], parent2[i]); const double y2 = MAX(parent1[i], parent2[i]); const double yl = lb[i]; const double yu = ub[i]; /* Calculate offsprint: */ betaq = calc_betaq(1.0 + (2.0 * (y1 - yl) / (y2 - y1)), eta); const double c1 = clip_to_limits(0.5 * ((y1 + y2) - betaq * (y2 - y1)), yl, yu); betaq = calc_betaq(1.0 + (2.0 * (yu - y2) / (y2 - y1)), eta); const double c2 = clip_to_limits(0.5 * ((y1 + y2) + betaq * (y2 - y1)), yl, yu); /* Flip coin to see which offspring gets which new * value: */ if (flip_coin()) { child1[i] = c2; child2[i] = c1; } else { child1[i] = c1; child2[i] = c2; } } else { child1[i] = parent1[i]; child2[i] = parent2[i]; } } PutRNGstate(); UNPROTECT(1); /* s_res */ return (s_res); } emoa/src/eps_ind.c0000644000176200001440000000754414554275142013572 0ustar liggesusers/*===========================================================================* * eps_ind.c: implements the unary epsilon indicator as proposed in * Zitzler, E., Thiele, L., Laumanns, M., Fonseca, C., and * Grunert da Fonseca, V (2003): Performance Assessment of * Multiobjective Optimizers: An Analysis and Review. IEEE * Transactions on Evolutionary Computation, 7(2), 117-132. * * IMPORTANT: * To make the epsilon indicator work for mixed optimization problems * where some objectives are to be maximized while others are to be * minimized, in the case of minimization the value -epsilon (for the * additive case) resp. 1/epsilon (for the multiplicative version) is * considered and returned. Example: suppose f1 is to be minimized and * f2 to be maximized, and the multiplicative epsilon value computed by * this program is 3.0; this means that the considered nondominated front * needs to be multiplied by 1/3 for all f1 values and by 3 for all * f2 values. Thus, independently of which type of problem one considers * (minimization, maximization, mixed minimization/maximization), a lower * indicator value corresponds to a better approximation set. * * Author: * Eckart Zitzler, February 3, 2005 / last update August 9, 2005 * * Adapted for use in R by: * Olaf Mersmann */ #include "extern.h" #include #include #include #include typedef enum { additive, multiplicative } method_t; #define MAX(A, B) ((A > B) ? A : B) #define MIN(A, B) ((A < B) ? A : B) /* * calc_eps_ind: * a - reference front * b - current front */ static double calc_eps_ind(double *a, const size_t a_points, double *b, const size_t b_points, const size_t number_of_objectives, method_t method) { size_t i, j, current_objective; double maximal_eps, minimal_pointwise_eps, pointwise_eps, eps; maximal_eps = (additive == method) ? -DBL_MAX : 0.0; for (i = 0; i < a_points; i++) { minimal_pointwise_eps = DBL_MAX; const double *ai = a + i * number_of_objectives; for (j = 0; j < b_points; j++) { pointwise_eps = -DBL_MAX; const double *bj = b + j * number_of_objectives; for (current_objective = 0; current_objective < number_of_objectives; ++current_objective) { switch (method) { case additive: eps = bj[current_objective] - ai[current_objective]; break; case multiplicative: eps = bj[current_objective] / ai[current_objective]; break; } pointwise_eps = MAX(pointwise_eps, eps); } minimal_pointwise_eps = MIN(minimal_pointwise_eps, pointwise_eps); } maximal_eps = MAX(maximal_eps, minimal_pointwise_eps); } return maximal_eps; } #define UNPACK_REAL_VECTOR(S, D, N) \ double *D = REAL(S); \ const R_len_t N = length(S); #define UNPACK_REAL_MATRIX(S, D, N, K) \ double *D = REAL(S); \ const R_len_t N = nrows(S); \ const R_len_t K = ncols(S); SEXP do_eps_ind(SEXP s_data, SEXP s_ref) { /* Unpack arguments */ UNPACK_REAL_MATRIX(s_data, data, number_of_objectives, number_of_points); UNPACK_REAL_MATRIX(s_ref, ref, number_of_ref_objectives, number_of_ref_points); if (number_of_ref_objectives != number_of_objectives) error("Reference and current front must have the same dimension."); /* Calculate criterion */ double res = calc_eps_ind(ref, number_of_ref_points, data, number_of_points, number_of_objectives, additive); return ScalarReal(res); } emoa/src/extern.h0000644000176200001440000000142614554275343013457 0ustar liggesusers #ifndef EMOA_EXTERN_H #define EMOA_EXTERN_H #include #include #include SEXP do_crowding_distance(SEXP s_front); SEXP do_dominance_matrix(SEXP s_points); SEXP do_dominated_hypervolume(SEXP s_data, SEXP s_ref); SEXP do_eps_ind(SEXP s_data, SEXP s_ref); SEXP do_hv_contrib(SEXP s_data, SEXP s_ref); SEXP do_is_dominated(SEXP s_points); SEXP do_pm(SEXP s_x, SEXP s_lb, SEXP s_ub, SEXP s_eta, SEXP s_p); SEXP do_r_ind(SEXP s_data, SEXP s_ideal, SEXP s_nadir, SEXP s_lambda, SEXP s_method); SEXP do_sbx(SEXP s_parents, SEXP s_lb, SEXP s_ub, SEXP s_eta, SEXP s_p); SEXP do_sympart(SEXP s_x); SEXP do_unary_r2_ind(SEXP s_data, SEXP s_weights, SEXP s_ideal); SEXP do_which_points_on_edge(SEXP s_front); SEXP nondominated_order(SEXP s_points, SEXP s_tosort); #endif emoa/src/dominance.c0000644000176200001440000001406114666413323014075 0ustar liggesusers/* * domination.c - utility functions relating to pareto dominance * * Most of these functions could just as well have been implemented in * R but were deemed performance critical enough to warrant rewriting * them in C. * * NOTICE: These functions expect the points to be passed in column * major order. That means, we expect each column of the matrix to be * one point and each row to be one coordinate. This may seem counter * intuitive from an R standpoint but makes all C code more cache * efficient. * * Author: * Olaf Mersmann (OME) * */ #include "extern.h" #include #include #include #include #include "sexp_macros.h" #define BS_INLINE R_INLINE #include "bitstring.h" /* * dominates * * Expects points to be a nxd matrix in _column_ major format. This is * the default format used by R. * * Returns: * -1 iff points[,i] dominates points[,j] * 0 iff points[,i] and points[,j] are incomparable * 1 iff points[,j] dominates points[,i] */ static R_INLINE int dominates(double *p, R_len_t i, R_len_t j, R_len_t nobj) { int i_flagged = 0; int j_flagged = 0; R_len_t k; double *pi = p + i * nobj; double *pj = p + j * nobj; for (k = 0; k < nobj; ++k) { const double p_ik = pi[k]; const double p_jk = pj[k]; if (p_ik < p_jk) { j_flagged = 1; } else if (p_jk < p_ik) { i_flagged = 1; } } return j_flagged - i_flagged; } /* * dp_is_dominated * * Returns a logical vector whose length corresponds to the number of * columns contained in the matrix s_points. TRUE means the point is * dominated by some other point in s_points. */ SEXP do_is_dominated(SEXP s_points) { SEXP s_res; R_len_t i, j; /* Unpack arguments: * Note how we turn the nxd R matrix (which is stored in column major * order) into a dxn C matrix where all individuals are stored * consecutivly instead of interleaved. */ UNPACK_REAL_MATRIX(s_points, points, d, n); /* Allocate result vector: * * res[i] == TRUE <=> i-th point is dominated * res[i] == FALSE <=> i-th point is nondominated */ PROTECT(s_res = allocVector(LGLSXP, n)); int *res = LOGICAL(s_res); /* Initialy all points are not dominated: */ for (i = 0; i < n; ++i) res[i] = FALSE; for (i = 0; i < n; ++i) { if (res[i]) continue; /* Point is dominated, skip */ for (j = (i + 1); j < n; ++j) { if (res[j]) continue; /* Point is dominated, skip */ int dom = dominates(points, i, j, d); if (dom > 0) { /* i dominates j */ res[j] = TRUE; } else if (dom < 0) { /* j dominates i */ res[i] = TRUE; } } } UNPROTECT(1); /* s_res */ return s_res; } /* * nondominated_order * * Implements a variant of non dominated sorting, but only returns the * front membership instead of actually sorting the matrix s_points. */ SEXP nondominated_order(SEXP s_points, SEXP s_tosort) { R_len_t i, j; SEXP s_rank; UNPACK_REAL_MATRIX(s_points, points, d, n); /* Note column major layout */ R_len_t nsorted = 0; R_len_t ntosort = INTEGER(s_tosort)[0]; /* Use compact bitstring for speed and ease of managment instead * of a dynamicly sized array of arrays or linked lists. */ bitstring_t *S = (bitstring_t *) R_Calloc(n, bitstring_t); unsigned int *N = (unsigned int *) R_Calloc(n, unsigned int); /* Allocate result vector: */ PROTECT(s_rank = allocVector(INTSXP, n)); int *rank = INTEGER(s_rank); /* Check to make sure we exit while() loop further down even if * ntosort is missspecified. */ if (ntosort > n) ntosort = n; /* Initialize bitstrings and array counting the number of * individuals that dominate the i-th individual. */ for (i = 0; i < n; ++i) { bitstring_initialize(&S[i], n); N[i] = 0; } for (i = 0; i < n; ++i) { for (j = i + 1; j < n; ++j) { int dom = dominates(points, i, j, d); if (dom < 0) { /* j dominates i */ bitstring_set(S[j], i); ++N[i]; } else if (dom > 0) { /* i dominates j */ bitstring_set(S[i], j); ++N[j]; } else { /* neither dominates the other */ } } } /* Assign initial ranks: */ for (i = 0; i < n; ++i) { if (0 == N[i]) { /* Member of first front */ rank[i] = 1; ++nsorted; } else { /* Not yet decide what front i belongs to */ rank[i] = 0; } } /* Assign remaining ranks: */ unsigned int r = 1; while (nsorted < ntosort) { for (i = 0; i < n; ++i) { if (r != rank[i]) /* Skip all not in current rank */ continue; for (j = 0; j < n; ++j) { if (bitstring_is_set(S[i], j)) { /* j in S_i */ --N[j]; if (0 == N[j]) { /* N_j == 0 -> assign rank */ rank[j] = r + 1; ++nsorted; } } } } ++r; /* Emergency exit: */ if (r > n) { error("r > n. This should never happen. " "Please send a detailed bug report to the package author."); } } /* Free bitstrings and arrays */ for (i = 0; i < n; ++i) bitstring_delete(S[i]); R_Free(S); R_Free(N); UNPROTECT(1); /* s_rank */ return (s_rank); } SEXP do_dominance_matrix(SEXP s_points) { SEXP s_res; R_len_t i, j; /* Unpack arguments: * Note how we turn the nxd R matrix (which is stored in column major * order) into a dxn C matrix where all individuals are stored * consecutivly instead of interleaved. */ UNPACK_REAL_MATRIX(s_points, points, d, n); /* Allocate result matrix. * * res[i, j] == TRUE <=> i-th point dominates j-th point */ PROTECT(s_res = allocMatrix(LGLSXP, n, n)); int *res = LOGICAL(s_res); /* Initialy all points are not dominated: */ for (i = 0; i < n * n; ++i) res[i] = FALSE; for (i = 0; i < n; ++i) { for (j = i + 1; j < n; ++j) { int dom = dominates(points, i, j, d); if (dom > 0) { /* i dominates j */ res[n * j + i] = TRUE; } else if (dom < 0) { /* j dominates i */ res[n * i + j] = TRUE; } } } UNPROTECT(1); /* s_res */ return s_res; } emoa/src/poly_mutation.c0000644000176200001440000000302714554275201015040 0ustar liggesusers#include "extern.h" #include #include #include "sexp_macros.h" #include "utilities.h" /* * Perform polynomial mutation of x with probability p. */ SEXP do_pm(SEXP s_x, SEXP s_lb, SEXP s_ub, SEXP s_eta, SEXP s_p) { SEXP s_res; double deltaq, rnd; #if FALSE /* Only mutate in half of all calls: */ if (flip_coin()) return s_x; #endif /* Unpack arguments: */ UNPACK_REAL_VECTOR(s_x, x, d); UNPACK_REAL_VECTOR(s_lb, lb, dlb); UNPACK_REAL_VECTOR(s_ub, ub, dub); UNPACK_REAL(s_eta, eta); UNPACK_REAL(s_p, p); const double mpow = 1.0 / (eta + 1.0); /* Sanity checks: */ if (dlb != d || dub != d) error("do_pm: Dimension of individual and bounds differ."); /* Allocate results: */ PROTECT(s_res = allocVector(REALSXP, d)); double *res = REAL(s_res); GetRNGstate(); for (int i = 0; i < d; ++i) { /* Mutate with probability p: */ if (unif_rand() < p) { const double delta = ub[i] - lb[i]; rnd = unif_rand(); if (rnd <= 0.5) { const double xy = 1.0 - (x[i] - lb[i]) / delta; deltaq = pow(2.0 * rnd + (1.0 - 2.0 * rnd) * pow(xy, eta + 1.0), mpow) - 1.0; } else { const double xy = 1.0 - (ub[i] - x[i]) / delta; deltaq = 1.0 - pow(2.0 * (1.0 - rnd) + 2.0 * (rnd - 0.5) * pow(xy, eta + 1.0), mpow); } res[i] = clip_to_limits(x[i] + deltaq * delta, lb[i], ub[i]); } else { res[i] = x[i]; } } PutRNGstate(); UNPROTECT(1); /* s_res */ return (s_res); } emoa/src/utilities.c0000644000176200001440000000043114554277120014146 0ustar liggesusers#include #include "utilities.h" double clip_to_limits(const double x, const double l, const double u) { if (x < l) { return (l); } else if (x > u) { return (u); } else { return (x); } } int flip_coin(void) { return (.5 < unif_rand() ? HEADS : TAILS); } emoa/src/hypervolume.c0000644000176200001440000000566414554275037014534 0ustar liggesusers/** * hypervolume.c - Interface to hypervolume calculation code. * * Authors: * Olaf Mersmann * */ #include "extern.h" #include #include #include #include #include #include #include #include #include "sexp_macros.h" #include "hv.h" void calc_hv_contrib_2d(const double *data, double *res, const size_t n, const size_t k) { size_t i, j, l; double mindistplus; for (i = 0; i < n; ++i) { double dvol = 1.0; for (j = 0; j < k; ++j) { const double fij = data[k * i + j]; mindistplus = DBL_MAX; for (l = 0; l < n; ++l) { if (l != i) { const double flj = data[k * l + j]; const double delta = flj - fij; if (delta >= 0.0 && delta < mindistplus) mindistplus = delta; } } dvol *= mindistplus; } res[i] = dvol; } } void calc_hv_contrib_anyd(double *data, const double *ref, double *res, const size_t n, size_t k) { const double tothv = fpli_hv(data, k, n, ref); for (int i = 0; i < n; ++i) { const double ihv = fpli_hv(data + k, k, n - 1, ref); res[i] = tothv - ihv; /* Swap ith and last row in data matrix: */ if (i != (n - 1)) { for (int j = 0; j < k; ++j) { double tmp = data[k * (i + 1) + j]; data[k * (i + 1) + j] = data[j]; data[j] = tmp; } } } } SEXP do_dominated_hypervolume(SEXP s_data, SEXP s_ref) { SEXP s_res; /* Unpack arguments: * * Since we need s_data in row major format, it is passed in * transposed in column major format (R's internal format for * matricies). That means the number of rows and columns are * switched. */ UNPACK_REAL_MATRIX(s_data, data, k_data, n_data); UNPACK_REAL_VECTOR(s_ref, ref, n_ref); if (n_ref != k_data) error("ref and data must have the same dimension."); /* Allocate result */ PROTECT(s_res = allocVector(REALSXP, 1)); double *res = REAL(s_res); res[0] = fpli_hv(data, k_data, n_data, ref); UNPROTECT(1); /* s_res */ return s_res; } SEXP do_hv_contrib(SEXP s_data, SEXP s_ref) { SEXP s_res; double *ddata; UNPACK_REAL_MATRIX(s_data, data, k_data, n_data); UNPACK_REAL_VECTOR(s_ref, ref, n_ref); if (n_ref != k_data) error("ref and data must have the same dimension."); /* Allocate result */ PROTECT(s_res = allocVector(REALSXP, n_data)); double *res = REAL(s_res); switch (k_data) { case 2: calc_hv_contrib_2d(data, res, n_data, k_data); break; default: /* calc_hv_contrib modifies 'data', so we need to make sure we * duplicate it before use. */ ddata = (double *)R_alloc(k_data * n_data, sizeof(double)); memcpy(ddata, data, sizeof(double) * k_data * n_data); calc_hv_contrib_anyd(ddata, ref, res, n_data, k_data); break; } UNPROTECT(1); /* s_res */ return s_res; } emoa/src/crowding_distance.c0000644000176200001440000000406214666413323015626 0ustar liggesusers#include "extern.h" #include #include #include #include "sexp_macros.h" static R_INLINE void do_merge(double *data, int *index, int *work, R_len_t low, R_len_t mid, R_len_t high, R_len_t d, R_len_t offs) { int i, j, k; i = low; j = mid + 1; k = low; while (i <= mid && j <= high) { if (data[d * index[i] + offs] < data[d * index[j] + offs]) { work[k++] = index[i++]; } else { work[k++] = index[j++]; } } while (i <= mid) work[k++] = index[i++]; while (j <= high) work[k++] = index[j++]; for (i = low; i <= high; ++i) index[i] = work[i]; } static void do_index_mergesort(double *data, int *index, int *work, R_len_t low, R_len_t high, R_len_t d, R_len_t i) { if (low < high) { R_len_t mid = (low + high) / 2; do_index_mergesort(data, index, work, low, mid, d, i); do_index_mergesort(data, index, work, mid + 1, high, d, i); do_merge(data, index, work, low, mid, high, d, i); } } static R_INLINE void index_mergesort(double *data, int *index, int *work, R_len_t n, R_len_t d, R_len_t i) { R_len_t k; for (k = 0; k < n; ++k) index[k] = k; do_index_mergesort(data, index, work, 0, n - 1, d, i); } SEXP do_crowding_distance(SEXP s_front) { SEXP s_res; int i, j; UNPACK_REAL_MATRIX(s_front, front, d, n); /* Work arrays: */ int *index = R_Calloc(n, int); int *work = R_Calloc(n, int); /* Result: */ PROTECT(s_res = allocVector(REALSXP, n)); double *res = REAL(s_res); for (i = 0; i < n; ++i) res[i] = 0.0; /* Main loop. Calculate distance for each dimension: */ for (i = 0; i < d; ++i) { index_mergesort(front, index, work, n, d, i); res[index[0]] = R_PosInf; res[index[n - 1]] = R_PosInf; for (j = 1; j < (n - 1); ++j) { res[index[j]] += front[index[j + 1] * d + i] - front[index[j - 1] * d + i]; } } R_Free(work); R_Free(index); UNPROTECT(1); /* s_res */ return (s_res); } emoa/src/hv.c0000644000176200001440000003256414554271516012567 0ustar liggesusers#define VARIANT 4 /************************************************************************* hypervolume computation --------------------------------------------------------------------- Copyright (c) 2010 Carlos Fonseca Manuel Lopez-Ibanez Luis Paquete This program is free software (software libre); 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, you can obtain a copy of the GNU General Public License at: http://www.gnu.org/copyleft/gpl.html or by writing to: Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ---------------------------------------------------------------------- Relevant literature: [1] C. M. Fonseca, L. Paquete, and M. Lopez-Ibanez. An improved dimension-sweep algorithm for the hypervolume indicator. In IEEE Congress on Evolutionary Computation, pages 1157-1163, Vancouver, Canada, July 2006. [2] L. Paquete, C. M. Fonseca and M. Lopez-Ibanez. An optimal algorithm for a special case of Klee's measure problem in three dimensions. Technical Report CSI-RT-I-01/2006, CSI, Universidade do Algarve, 2006. *************************************************************************/ #include "hv.h" #include "avl.h" #include #include #include #include #include #include #if !defined(VARIANT) || VARIANT < 1 || VARIANT > 4 #error VARIANT must be either 1, 2, 3 or 4, e.g., 'make VARIANT=4' #endif #if __GNUC__ >= 3 #define __hv_unused __attribute__((unused)) #else #define __hv_unused /* no 'unused' attribute available */ #endif #if VARIANT < 3 #define __variant3_only __hv_unused #else #define __variant3_only #endif #if VARIANT < 2 #define __variant2_only __hv_unused #else #define __variant2_only #endif typedef struct dlnode { double *x; /* The data vector */ struct dlnode **next; /* Next-node vector */ struct dlnode **prev; /* Previous-node vector */ struct avl_node_t *tnode; int ignore; #if VARIANT >= 2 double *area; /* Area */ #endif #if VARIANT >= 3 double *vol; /* Volume */ #endif } dlnode_t; static avl_tree_t *tree; #if VARIANT < 4 int stop_dimension = 1; /* default: stop on dimension 2 */ #else int stop_dimension = 2; /* default: stop on dimension 3 */ #endif static int compare_node(const void *p1, const void *p2) { const double x1 = *((*(const dlnode_t **)p1)->x); const double x2 = *((*(const dlnode_t **)p2)->x); return (x1 < x2) ? -1 : (x1 > x2) ? 1 : 0; } static int compare_tree_asc(const void *p1, const void *p2) { const double x1 = *((const double *)p1 + 1); const double x2 = *((const double *)p2 + 1); return (x1 > x2) ? -1 : (x1 < x2) ? 1 : 0; } /* * Setup circular double-linked list in each dimension */ static dlnode_t *setup_cdllist(double *data, int d, int n) { dlnode_t *head; dlnode_t **scratch; int i, j; head = malloc((n + 1) * sizeof(dlnode_t)); head->x = data; head->ignore = 0; /* should never get used */ head->next = malloc(d * (n + 1) * sizeof(dlnode_t *)); head->prev = malloc(d * (n + 1) * sizeof(dlnode_t *)); head->tnode = malloc((n + 1) * sizeof(avl_node_t)); #if VARIANT >= 2 head->area = malloc(d * (n + 1) * sizeof(double)); #endif #if VARIANT >= 3 head->vol = malloc(d * (n + 1) * sizeof(double)); #endif for (i = 1; i <= n; i++) { head[i].x = head[i - 1].x + d; /* this will be fixed a few lines below... */ head[i].ignore = 0; head[i].next = head[i - 1].next + d; head[i].prev = head[i - 1].prev + d; head[i].tnode = head[i - 1].tnode + 1; #if VARIANT >= 2 head[i].area = head[i - 1].area + d; #endif #if VARIANT >= 3 head[i].vol = head[i - 1].vol + d; #endif } head->x = NULL; /* head contains no data */ scratch = malloc(n * sizeof(dlnode_t *)); for (i = 0; i < n; i++) scratch[i] = head + i + 1; for (j = d - 1; j >= 0; j--) { for (i = 0; i < n; i++) scratch[i]->x--; qsort(scratch, n, sizeof(dlnode_t *), compare_node); head->next[j] = scratch[0]; scratch[0]->prev[j] = head; for (i = 1; i < n; i++) { scratch[i - 1]->next[j] = scratch[i]; scratch[i]->prev[j] = scratch[i - 1]; } scratch[n - 1]->next[j] = head; head->prev[j] = scratch[n - 1]; } free(scratch); for (i = 1; i <= n; i++) avl_init_node(head[i].tnode, head[i].x); #if VARIANT >= 2 for (i = 0; i < d; i++) head->area[i] = 0; #endif return head; } static void free_cdllist(dlnode_t *head) { free(head->tnode); /* Frees _all_ nodes. */ free(head->next); free(head->prev); #if VARIANT >= 2 free(head->area); #endif #if VARIANT >= 3 free(head->vol); #endif free(head); } static void delete (dlnode_t *nodep, int dim, double *bound __variant3_only) { int i; for (i = 0; i < dim; i++) { nodep->prev[i]->next[i] = nodep->next[i]; nodep->next[i]->prev[i] = nodep->prev[i]; #if VARIANT >= 3 if (bound[i] > nodep->x[i]) bound[i] = nodep->x[i]; #endif } } static void reinsert(dlnode_t *nodep, int dim, double *bound __variant3_only) { int i; for (i = 0; i < dim; i++) { nodep->prev[i]->next[i] = nodep; nodep->next[i]->prev[i] = nodep; #if VARIANT >= 3 if (bound[i] > nodep->x[i]) bound[i] = nodep->x[i]; #endif } } static double hv_recursive(dlnode_t *list, int dim, int c, const double *ref, double *bound) { /* ------------------------------------------------------ General case for dimensions higher than stop_dimension ------------------------------------------------------ */ if (dim > stop_dimension) { dlnode_t *p0 = list; dlnode_t *p1 = list->prev[dim]; double hyperv = 0; #if VARIANT == 1 double hypera; #endif #if VARIANT >= 2 dlnode_t *pp; for (pp = p1; pp->x; pp = pp->prev[dim]) { if (pp->ignore < dim) pp->ignore = 0; } #endif while (c > 1 #if VARIANT >= 3 /* We delete all points x[dim] > bound[dim]. In case of repeated coordinates, we also delete all points x[dim] == bound[dim] except one. */ && (p1->x[dim] > bound[dim] || p1->prev[dim]->x[dim] >= bound[dim]) #endif ) { p0 = p1; delete (p0, dim, bound); p1 = p0->prev[dim]; c--; } #if VARIANT == 1 hypera = hv_recursive(list, dim - 1, c, ref, bound); #elif VARIANT >= 3 if (c > 1) { hyperv = p1->prev[dim]->vol[dim] + p1->prev[dim]->area[dim] * (p1->x[dim] - p1->prev[dim]->x[dim]); p1->vol[dim] = hyperv; } else { int i; p1->area[0] = 1; for (i = 1; i <= dim; i++) p1->area[i] = p1->area[i - 1] * (ref[i - 1] - p1->x[i - 1]); p1->vol[dim] = 0; } #endif #if VARIANT >= 2 if (p1->ignore >= dim) { p1->area[dim] = p1->prev[dim]->area[dim]; } else { p1->area[dim] = hv_recursive(list, dim - 1, c, ref, bound); if (p1->area[dim] <= p1->prev[dim]->area[dim]) p1->ignore = dim; } #endif while (p0->x != NULL) { #if VARIANT == 1 hyperv += hypera * (p0->x[dim] - p1->x[dim]); #elif VARIANT >= 2 hyperv += p1->area[dim] * (p0->x[dim] - p1->x[dim]); #endif #if VARIANT >= 3 bound[dim] = p0->x[dim]; #endif reinsert(p0, dim, bound); c++; p1 = p0; p0 = p0->next[dim]; #if VARIANT >= 3 p1->vol[dim] = hyperv; #endif #if VARIANT == 1 hypera = hv_recursive(list, dim - 1, c, ref, NULL); #elif VARIANT >= 2 if (p1->ignore >= dim) { p1->area[dim] = p1->prev[dim]->area[dim]; } else { p1->area[dim] = hv_recursive(list, dim - 1, c, ref, bound); if (p1->area[dim] <= p1->prev[dim]->area[dim]) p1->ignore = dim; } #endif } #if VARIANT == 1 hyperv += hypera * (ref[dim] - p1->x[dim]); #elif VARIANT >= 2 hyperv += p1->area[dim] * (ref[dim] - p1->x[dim]); #endif return hyperv; } /* --------------------------- special case of dimension 3 --------------------------- */ else if (dim == 2) { double hyperv; double hypera; double height; dlnode_t *pp = list->next[2]; hypera = (ref[0] - pp->x[0]) * (ref[1] - pp->x[1]); height = (c == 1) ? ref[2] - pp->x[2] : pp->next[2]->x[2] - pp->x[2]; hyperv = hypera * height; if (pp->next[2]->x == NULL) return hyperv; avl_insert_top(tree, pp->tnode); pp = pp->next[2]; do { height = (pp == list->prev[2]) ? ref[2] - pp->x[2] : pp->next[2]->x[2] - pp->x[2]; #if VARIANT >= 2 if (pp->ignore >= 2) hyperv += hypera * height; else { #endif const double *prv_ip, *nxt_ip; avl_node_t *tnode; if (avl_search_closest(tree, pp->x, &tnode) <= 0) { nxt_ip = (double *)(tnode->item); tnode = tnode->prev; } else { nxt_ip = (tnode->next != NULL) ? (double *)(tnode->next->item) : ref; } if (nxt_ip[0] > pp->x[0]) { avl_insert_after(tree, tnode, pp->tnode); if (tnode != NULL) { prv_ip = (double *)(tnode->item); if (prv_ip[0] > pp->x[0]) { const double *cur_ip; tnode = pp->tnode->prev; /* cur_ip = point dominated by pp with highest [0]-coordinate */ cur_ip = (double *)(tnode->item); while (tnode->prev) { prv_ip = (double *)(tnode->prev->item); hypera -= (prv_ip[1] - cur_ip[1]) * (nxt_ip[0] - cur_ip[0]); if (prv_ip[0] < pp->x[0]) break; /* prv is not dominated by pp */ cur_ip = prv_ip; avl_unlink_node(tree, tnode); tnode = tnode->prev; } avl_unlink_node(tree, tnode); if (!tnode->prev) { hypera -= (ref[1] - cur_ip[1]) * (nxt_ip[0] - cur_ip[0]); prv_ip = ref; } } } else prv_ip = ref; hypera += (prv_ip[1] - pp->x[1]) * (nxt_ip[0] - pp->x[0]); } else pp->ignore = 2; if (height > 0) hyperv += hypera * height; #if VARIANT >= 2 } #endif pp = pp->next[2]; } while (pp->x != NULL); avl_clear_tree(tree); return hyperv; } /* special case of dimension 2 */ else if (dim == 1) { const dlnode_t *p1 = list->next[1]; double hypera = p1->x[0]; double hyperv = 0; const dlnode_t *p0; while ((p0 = p1->next[1])->x) { hyperv += (ref[0] - hypera) * (p0->x[1] - p1->x[1]); if (p0->x[0] < hypera) hypera = p0->x[0]; p1 = p0; } hyperv += (ref[0] - hypera) * (ref[1] - p1->x[1]); return hyperv; } /* special case of dimension 1 */ else if (dim == 0) { return (ref[0] - list->next[0]->x[0]); } else { /* fprintf(stderr, "%s:%d: unreachable condition! \n" "This is a bug, please report it to " "manuel.lopez-ibanez@ulb.ac.be\n", __FILE__, __LINE__); exit(EXIT_FAILURE); */ error("hv: UNREACHABLE CODE REACHED. Please report this to the package " "author."); return -1.0; /* Never reached. */ } } /* Removes the point from the circular double-linked list. */ static void filter_delete_node(dlnode_t *node, int d) { int i; /* The memory allocated for the deleted node is lost (leaked) until the end of the program, but this should not be a problem. */ for (i = 0; i < d; i++) { node->next[i]->prev[i] = node->prev[i]; node->prev[i]->next[i] = node->next[i]; } } /* Filters those points that do not strictly dominate the reference point. This is needed to assure that the points left are only those which are needed to calculate the hypervolume. */ static int filter(dlnode_t *list, int d, int n, const double *ref) { int i, j; /* fprintf (stderr, "%d points initially\n", n); */ for (i = 0; i < d; i++) { dlnode_t *aux = list->prev[i]; int np = n; for (j = 0; j < np; j++) { if (aux->x[i] < ref[i]) break; filter_delete_node(aux, d); aux = aux->prev[i]; n--; } } /* fprintf (stderr, "%d points remain\n", n); */ return n; } double fpli_hv(double *data, int d, int n, const double *ref) { dlnode_t *list; double hyperv; double *bound = NULL; #if VARIANT >= 3 int i; bound = malloc(d * sizeof(double)); for (i = 0; i < d; i++) bound[i] = -DBL_MAX; #endif tree = avl_alloc_tree((avl_compare_t)compare_tree_asc, (avl_freeitem_t)NULL); list = setup_cdllist(data, d, n); n = filter(list, d, n, ref); if (n == 0) { /* Returning here would leak memory. */ hyperv = 0.0; } else { hyperv = hv_recursive(list, d - 1, n, ref, bound); } /* Clean up. */ free_cdllist(list); free(tree); /* The nodes are freed by free_cdllist (). */ free(bound); return hyperv; } emoa/src/hv.h0000644000176200001440000000304214554263556012566 0ustar liggesusers/************************************************************************* hv.h --------------------------------------------------------------------- Copyright (c) 2005, 2006 Carlos Fonseca Manuel Lopez-Ibanez Luis Paquete This program is free software (software libre); 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, you can obtain a copy of the GNU General Public License at: http://www.gnu.org/copyleft/gpl.html or by writing to: Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ---------------------------------------------------------------------- *************************************************************************/ #ifndef HV_H_ #define HV_H_ #ifdef __cplusplus extern "C" { #endif extern int stop_dimension; double fpli_hv(double *data, int d, int n, const double *ref); #ifdef __cplusplus } #endif #endif emoa/src/sexp_macros.h0000644000176200001440000000502114554263556014473 0ustar liggesusers/* * sexp_macros.h - helper macros for SEXPs * * Collection of useful macros to handle S expressions. Most of these * are used to unpack arguments passed in via the .Call() or * .External() interface. * * Author: * Olaf Mersmann (OME) */ #if !defined(__SEXP_MACROS_H__) #define __SEXP_MACROS_H__ #include #include #define CHECK_ARG_IS_REAL_MATRIX(A) \ if (!isReal(A) || !isMatrix(A)) \ error("Argument '" #A "' is not a real matrix."); #define CHECK_ARG_IS_REAL_VECTOR(A) \ if (!isReal(A) || !isVector(A)) \ error("Argument '" #A "' is not a real vector."); #define CHECK_ARG_IS_INT_VECTOR(A) \ if (!isInteger(A) || !isVector(A)) \ error("Argument '" #A "' is not an integer vector."); /* * Unpack a real matrix stored in SEXP S. */ #define UNPACK_REAL_MATRIX(S, D, N, K) \ CHECK_ARG_IS_REAL_MATRIX(S); \ double *D = REAL(S); \ const R_len_t N = nrows(S); \ const R_len_t K = ncols(S); /* * Unpack a real vector stored in SEXP S. */ #define UNPACK_REAL_VECTOR(S, D, N) \ CHECK_ARG_IS_REAL_VECTOR(S); \ double *D = REAL(S); \ const R_len_t N = length(S); /* * Unpack a single real stored in SEXP S. */ #define UNPACK_REAL(S, D) \ CHECK_ARG_IS_REAL_VECTOR(S); \ double D = REAL(S)[0]; /* * Unpack an integer vector stored in SEXP S. */ #define UNPACK_INT_VECTOR(S, I, N) \ CHECK_ARG_IS_INT_VECTOR(S); \ int *I = INTEGER(S); \ const R_len_t N = length(S); /* * Unpack a single integer stored in SEXP S. */ #define UNPACK_INT(S, I) \ CHECK_ARG_IS_INT_VECTOR(S); \ int I = INTEGER(S)[0]; #endif emoa/src/emoa.c0000644000176200001440000000160614554275356013072 0ustar liggesusers#include "extern.h" static const R_CallMethodDef callMethods[] = { {"do_crowding_distance", (DL_FUNC) &do_crowding_distance, 1}, {"do_dominance_matrix", (DL_FUNC) &do_dominance_matrix, 1}, {"do_dominated_hypervolume", (DL_FUNC) &do_dominated_hypervolume, 2}, {"do_eps_ind", (DL_FUNC) &do_eps_ind, 2}, {"do_hv_contrib", (DL_FUNC) &do_hv_contrib, 2}, {"do_is_dominated", (DL_FUNC) &do_is_dominated, 1}, {"do_pm", (DL_FUNC) &do_pm, 5}, {"do_r_ind", (DL_FUNC) &do_r_ind, 5}, {"do_sbx", (DL_FUNC) &do_sbx, 5}, {"do_sympart", (DL_FUNC) &do_sympart, 1}, {"do_unary_r2_ind", (DL_FUNC) &do_unary_r2_ind, 3}, {"do_which_points_on_edge", (DL_FUNC) &do_which_points_on_edge, 1}, {"nondominated_order", (DL_FUNC) &nondominated_order, 2} }; void R_init_mco(DllInfo *info) { R_registerRoutines(info, NULL, callMethods, NULL, NULL); R_useDynamicSymbols(info, FALSE); R_forceSymbols(info, TRUE); } emoa/src/avl.h0000644000176200001440000001542714554263556012745 0ustar liggesusers/***************************************************************************** avl.h - Source code for the AVL-tree library. Copyright (C) 1998 Michael H. Buselli Copyright (C) 2000-2002 Wessel Dankers This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Augmented AVL-tree. Original by Michael H. Buselli . Modified by Wessel Dankers to add a bunch of bloat to the sourcecode, change the interface and squash a few bugs. Mail him if you find new bugs. *****************************************************************************/ #ifndef _AVL_H #define _AVL_H /* We need either depths, counts or both (the latter being the default) */ #if !defined(AVL_DEPTH) && !defined(AVL_COUNT) #define AVL_DEPTH #define AVL_COUNT #endif /* User supplied function to compare two items like strcmp() does. * For example: cmp(a,b) will return: * -1 if a < b * 0 if a = b * 1 if a > b */ typedef int (*avl_compare_t)(const void *, const void *); /* User supplied function to delete an item when a node is free()d. * If NULL, the item is not free()d. */ typedef void (*avl_freeitem_t)(void *); typedef struct avl_node_t { struct avl_node_t *next; struct avl_node_t *prev; struct avl_node_t *parent; struct avl_node_t *left; struct avl_node_t *right; void *item; #ifdef AVL_COUNT unsigned int count; #endif #ifdef AVL_DEPTH unsigned char depth; #endif } avl_node_t; typedef struct avl_tree_t { avl_node_t *head; avl_node_t *tail; avl_node_t *top; avl_compare_t cmp; avl_freeitem_t freeitem; } avl_tree_t; /* Initializes a new tree for elements that will be ordered using * the supplied strcmp()-like function. * Returns the value of avltree (even if it's NULL). * O(1) */ extern avl_tree_t *avl_init_tree(avl_tree_t *avltree, avl_compare_t, avl_freeitem_t); /* Allocates and initializes a new tree for elements that will be * ordered using the supplied strcmp()-like function. * Returns NULL if memory could not be allocated. * O(1) */ extern avl_tree_t *avl_alloc_tree(avl_compare_t, avl_freeitem_t); /* Frees the entire tree efficiently. Nodes will be free()d. * If the tree's freeitem is not NULL it will be invoked on every item. * O(n) */ extern void avl_free_tree(avl_tree_t *); /* Reinitializes the tree structure for reuse. Nothing is free()d. * Compare and freeitem functions are left alone. * O(1) */ extern void avl_clear_tree(avl_tree_t *); /* Free()s all nodes in the tree but leaves the tree itself. * If the tree's freeitem is not NULL it will be invoked on every item. * O(n) */ extern void avl_free_nodes(avl_tree_t *); /* Initializes memory for use as a node. Returns NULL if avlnode is NULL. * O(1) */ extern avl_node_t *avl_init_node(avl_node_t *avlnode, void *item); /* Insert an item into the tree and return the new node. * Returns NULL and sets errno if memory for the new node could not be * allocated or if the node is already in the tree (EEXIST). * O(lg n) */ extern avl_node_t *avl_insert(avl_tree_t *, void *item); /* Insert a node into the tree and return it. * Returns NULL if the node is already in the tree. * O(lg n) */ extern avl_node_t *avl_insert_node(avl_tree_t *, avl_node_t *); /* Insert a node in an empty tree. If avlnode is NULL, the tree will be * cleared and ready for re-use. * If the tree is not empty, the old nodes are left dangling. * O(1) */ extern avl_node_t *avl_insert_top(avl_tree_t *, avl_node_t *avlnode); /* Insert a node before another node. Returns the new node. * If old is NULL, the item is appended to the tree. * O(lg n) */ extern avl_node_t *avl_insert_before(avl_tree_t *, avl_node_t *oldnode, avl_node_t *newnode); /* Insert a node after another node. Returns the new node. * If old is NULL, the item is prepended to the tree. * O(lg n) */ extern avl_node_t *avl_insert_after(avl_tree_t *, avl_node_t *oldnode, avl_node_t *newnode); /* Deletes a node from the tree. Returns immediately if the node is NULL. * The item will not be free()d regardless of the tree's freeitem handler. * This function comes in handy if you need to update the search key. * O(lg n) */ extern void avl_unlink_node(avl_tree_t *, avl_node_t *); /* Deletes a node from the tree. Returns immediately if the node is NULL. * If the tree's freeitem is not NULL, it is invoked on the item. * If it is, returns the item. * O(lg n) */ extern void *avl_delete_node(avl_tree_t *, avl_node_t *); /* Searches for an item in the tree and deletes it if found. * If the tree's freeitem is not NULL, it is invoked on the item. * If it is, returns the item. * O(lg n) */ extern void *avl_delete(avl_tree_t *, const void *item); /* If exactly one node is moved in memory, this will fix the pointers * in the tree that refer to it. It must be an exact shallow copy. * Returns the pointer to the old position. * O(1) */ extern avl_node_t *avl_fixup_node(avl_tree_t *, avl_node_t *newnode); /* Searches for a node with the key closest (or equal) to the given item. * If avlnode is not NULL, *avlnode will be set to the node found or NULL * if the tree is empty. Return values: * -1 if the returned node is smaller * 0 if the returned node is equal or if the tree is empty * 1 if the returned node is greater * O(lg n) */ extern int avl_search_closest(const avl_tree_t *, const void *item, avl_node_t **avlnode); /* Searches for the item in the tree and returns a matching node if found * or NULL if not. * O(lg n) */ extern avl_node_t *avl_search(const avl_tree_t *, const void *item); #ifdef AVL_COUNT /* Returns the number of nodes in the tree. * O(1) */ extern unsigned int avl_count(const avl_tree_t *); /* Searches a node by its rank in the list. Counting starts at 0. * Returns NULL if the index exceeds the number of nodes in the tree. * O(lg n) */ extern avl_node_t *avl_at(const avl_tree_t *, unsigned int); /* Returns the rank of a node in the list. Counting starts at 0. * O(lg n) */ extern unsigned int avl_index(const avl_node_t *); #endif #endif emoa/src/front_edge.c0000644000176200001440000000576214554275167014274 0ustar liggesusers#include "extern.h" #include #include #include #include #include "sexp_macros.h" #ifndef MIN #define MIN(A, B) ((A < B) ? A : B) #endif SEXP do_which_points_on_edge(SEXP s_front) { size_t point, other_point, objective; SEXP s_result; UNPACK_REAL_MATRIX(s_front, front, number_of_objectives, number_of_points); PROTECT(s_result = allocVector(LGLSXP, number_of_points)); int *result = LOGICAL(s_result); /* Temprary storage for two reference points. Automatically freed * on return. */ double *base_reference_point = (double *)R_alloc(number_of_objectives, sizeof(double)); double *current_reference_point = (double *)R_alloc(number_of_objectives, sizeof(double)); /* Find reference point: */ for (objective = 0; objective < number_of_objectives; ++objective) { base_reference_point[objective] = R_NegInf; for (point = 0; point < number_of_points; ++point) { /* Move up/right/back by 1 to make sure reference point is * really dominated: */ const double value = front[point * number_of_objectives + objective] + 1; if (value > base_reference_point[objective]) { base_reference_point[objective] = value; } } } /* Iterate over all points and... */ for (point = 0; point < number_of_points; ++point) { double *point_values = front + point * number_of_objectives; /* All points start out as points on the edge: */ result[point] = FALSE; /* Initialize reference point: */ for (objective = 0; objective < number_of_objectives; ++objective) current_reference_point[objective] = base_reference_point[objective]; /* Shrink bounding box w.r.t reference point: */ for (other_point = 0; other_point < number_of_points; ++other_point) { double *other_point_values = front + other_point * number_of_objectives; size_t number_of_dominated_objectives = 0; size_t last_dominated_objective = 0; for (objective = 0; objective < number_of_objectives; ++objective) { const double this_value = point_values[objective]; const double other_value = other_point_values[objective]; if (this_value < other_value) { ++number_of_dominated_objectives; last_dominated_objective = objective; if (number_of_dominated_objectives > 1) break; } } if (number_of_dominated_objectives == 1) { current_reference_point[last_dominated_objective] = MIN(current_reference_point[last_dominated_objective], other_point_values[last_dominated_objective]); } } /* If bounding box still depends on reference point, then the * point is on the edge of the front: */ for (objective = 0; objective < number_of_objectives; ++objective) { if (current_reference_point[objective] == base_reference_point[objective]) { result[point] = TRUE; break; } } } UNPROTECT(1); /* s_result */ return s_result; } emoa/src/utilities.h0000644000176200001440000000026714554277100014160 0ustar liggesusers#ifndef __UTILITIES_H__ #define __UTILITIES_H__ #define HEADS 1 #define TAILS 0 int flip_coin(void); double clip_to_limits(const double x, const double l, const double u); #endif emoa/src/precomputed_weight_vectors.h0000644000176200001440000000101212030307155017564 0ustar liggesusers/* List of precomputed weights. * * To use this definition list, set DO_PRECOMPUTED_WEIGHT_VECTOR to * something useful and include this file. */ DO_PRECOMPUTED_WEIGHT_VECTOR(500, 2) DO_PRECOMPUTED_WEIGHT_VECTOR(30, 3) DO_PRECOMPUTED_WEIGHT_VECTOR(12, 4) DO_PRECOMPUTED_WEIGHT_VECTOR(8, 5) DO_PRECOMPUTED_WEIGHT_VECTOR(3, 6) DO_PRECOMPUTED_WEIGHT_VECTOR(3, 7) /* DO_PRECOMPUTED_WEIGHT_VECTOR(800, 2) DO_PRECOMPUTED_WEIGHT_VECTOR(200, 3) DO_PRECOMPUTED_WEIGHT_VECTOR(40, 5) */ #undef DO_PRECOMPUTED_WEIGHT_VECTOR emoa/NAMESPACE0000644000176200001440000000253414554271516012430 0ustar liggesusers# Generated by roxygen2: do not edit by hand export(UF1) export(UF10) export(UF2) export(UF3) export(UF4) export(UF5) export(UF6) export(UF7) export(UF8) export(UF9) export(coalesce) export(crowding_distance) export(dominance_matrix) export(dominated_hypervolume) export(emoa_console_logger) export(emoa_control) export(emoa_logger) export(emoa_null_logger) export(epsilon_indicator) export(hypervolume_contribution) export(hypervolume_indicator) export(inbounds) export(is_dominated) export(is_maximally_dominated) export(nds_cd_selection) export(nds_hv_selection) export(nds_rank) export(nondominated_ordering) export(nondominated_points) export(normalize_points) export(pm_control) export(pm_operator) export(r1_indicator) export(r2_indicator) export(r3_indicator) export(sbx_control) export(sbx_operator) export(steady_state_emoa_control) export(sympart) export(unary_r2_indicator) export(which_points_on_edge) importFrom(graphics,par) importFrom(stats,runif) useDynLib(emoa,do_crowding_distance) useDynLib(emoa,do_dominance_matrix) useDynLib(emoa,do_dominated_hypervolume) useDynLib(emoa,do_eps_ind) useDynLib(emoa,do_hv_contrib) useDynLib(emoa,do_is_dominated) useDynLib(emoa,do_pm) useDynLib(emoa,do_r_ind) useDynLib(emoa,do_sbx) useDynLib(emoa,do_sympart) useDynLib(emoa,do_unary_r2_ind) useDynLib(emoa,do_which_points_on_edge) useDynLib(emoa,nondominated_order) emoa/README.md0000644000176200001440000000100014666412761012456 0ustar liggesusers# emoa [![OSS Lifecycle](https://img.shields.io/osslifecycle/olafmersmann/sendmailR)](https://lifecycle.r-lib.org/articles/stages.html) [![CRAN status](https://www.r-pkg.org/badges/version/emoa)](https://CRAN.R-project.org/package=emoa) [![CRAN Downloads](https://cranlogs.r-pkg.org/badges/last-month/emoa)](https://CRAN.R-project.org/package=emoa) A collection of building blocks for the design and analysis of evolutionary multi-objective optimization algorithms.emoa/man/0000755000176200001440000000000014554271516011760 5ustar liggesusersemoa/man/sbx_control.Rd0000644000176200001440000000205714554271516014607 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/control.R \name{sbx_control} \alias{sbx_control} \title{Simulated binary crossover (SBX) control parameters} \usage{ sbx_control(f, upper, lower, ..., control, default = list()) } \arguments{ \item{f}{Multiobjectve optimization function.} \item{upper}{Upper bounds of parameter space.} \item{lower}{Lower bounds of parameter space.} \item{...}{Further arguments passed to \code{f}.} \item{control}{List of control parameters.} \item{default}{List of default control parameters.} } \value{ The \code{control} list with suitably adjusted arguments. Missing control parameters are taken from \code{default} or, if not present there, from an internal default. } \description{ \code{sbx_control} interprets the following parameters used to control the behaviour of the simulated binary crossover operator (see \code{\link{sbx_operator}}): \describe{ \item{sbx.n}{Nu parameter of SBX.} \item{sbx.p}{$p$ parameter of SBX.} } } \author{ Olaf Mersmann \email{olafm@statistik.tu-dortmund.de} } emoa/man/dominance_matrix.Rd0000644000176200001440000000061314554271516015570 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/dominance.r \name{dominance_matrix} \alias{dominance_matrix} \title{Calculate the dominance matrix of a set of points} \usage{ dominance_matrix(points) } \arguments{ \item{points}{Matrix containing points one per column.} } \value{ Dominance matrix } \description{ Calculate the dominance matrix of a set of points } emoa/man/pm_operator.Rd0000644000176200001440000000121514554271516014575 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/poly_mutation.r \name{pm_operator} \alias{pm_operator} \title{Polynomial mutation operator} \usage{ pm_operator(n, p, lower, upper) } \arguments{ \item{n}{Distance parameter mutation distribution (\eqn{\eta}{eta}).} \item{p}{Probability of one point mutation.} \item{lower}{Lower bounds of parameter space.} \item{upper}{Upper bounds of parameter space.} } \value{ Function which implements the specified mutation operator. } \description{ Returns a polynomial mutation operator with the given parameters. } \author{ Olaf Mersmann \email{olafm@statistik.tu-dortmund.de} } emoa/man/nds_rank.Rd0000644000176200001440000000137614554271516014055 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/dominance.r \name{nds_rank} \alias{nds_rank} \alias{nondominated_ordering} \title{Nondominated sorting ranks} \usage{ nds_rank(points, partial) nondominated_ordering(points, partial) } \arguments{ \item{points}{Matrix containing points one per column.} \item{partial}{Optional integer specifying the number of points for which the rank should be calculated. Defaults to all points.} } \value{ Vector containing the ranks of the first \code{partial} individuals or all individuals. } \description{ Perform (partial) nondominated sort of the points in \code{points} and return the rank of each point. } \author{ Olaf Mersmann \email{olafm@statistik.tu-dortmund.de} } \keyword{optimize} emoa/man/normalize_points.Rd0000644000176200001440000000113214554271516015640 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/indicators.r \name{normalize_points} \alias{normalize_points} \title{Scale point cloud} \usage{ normalize_points(points, minval, maxval) } \arguments{ \item{points}{Matrix containing points, one per column.} \item{minval}{Optional lower limits for the new bounding box.} \item{maxval}{Optional upper limits for the new bounding box.} } \value{ Scaled points. } \description{ Rescale all points to lie in the box bounded by \code{minval} and \code{maxval}. } \author{ Olaf Mersmann \email{olafm@statistik.tu-dortmund.de} } emoa/man/nds_hv_selection.Rd0000644000176200001440000000156314554271516015602 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/selection.r \name{nds_hv_selection} \alias{nds_hv_selection} \alias{nds_cd_selection} \title{Selection strategies} \usage{ nds_hv_selection(values, n = 1, ...) nds_cd_selection(values, n = 1, ...) } \arguments{ \item{values}{Matrix of function values.} \item{n}{Number of individuals to select for replacement.} \item{...}{Optional parameters passed to \code{\link{hypervolume_contribution}}.} } \description{ Selection strategies for EMOA. } \details{ The currently implemented strategies are nondominated sorting followed by either hypervolume contribution or crowding distance based ranking. Both of these implementations are currently limited to selecting a single individual for replacement. } \author{ Olaf Mersmann \email{olafm@statistik.tu-dortmund.de} } \keyword{nonlinear} \keyword{optimize} emoa/man/emoa_control.Rd0000644000176200001440000000207414554271516014733 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/control.R \name{emoa_control} \alias{emoa_control} \title{Basic EMOA control parameters.} \usage{ emoa_control(f, upper, lower, ..., control, default) } \arguments{ \item{f}{Multiobjectve optimization function.} \item{upper}{Upper bounds of parameter space.} \item{lower}{Lower bounds of parameter space.} \item{...}{Further arguments passed to \code{f}.} \item{control}{List of control parameters.} \item{default}{List of default control parameters.} } \value{ The \code{control} list with suitably adjusted arguments. Missing control parameters are taken from \code{default} or, if not present there, from an internal default. } \description{ The following control parameters are recognized by \code{emoa_control}: \describe{ \item{logger}{\code{emoa_logger} object used to log events.} \item{n}{Number of parameters, defaults to the length of the longer of \code{upper} or \code{lower}.} \item{d}{Number of dimensions.} } } \author{ Olaf Mersmann \email{olafm@statistik.tu-dortmund.de} } emoa/man/dominated_hypervolume.Rd0000644000176200001440000000415214554271516016654 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/hypervolume.r \name{dominated_hypervolume} \alias{dominated_hypervolume} \alias{hypervolume_contribution} \title{Dominated Hypervolume calculation} \usage{ dominated_hypervolume(points, ref) hypervolume_contribution(points, ref) } \arguments{ \item{points}{Matrix containing the points one per column.} \item{ref}{Optional reference point. If not provided the maximum in each dimension is used.} } \value{ For \code{dominated_hypervolume} the dominated hypervolume by the points in \code{points} with respect to the reference point \code{ref}. For \code{hypervolume_contribution} a vector giving the hypervolume soley dominated by that point. } \description{ \code{dominated_hypervolume} calculates the dominated hypervolume of the points in \code{points}. } \details{ \code{hypervolume_contribution} calculates the hypervolume contribution of each point. If no reference point \code{ref} is given, one is automatically calculated by determening the maximum in each coordinate. Currently only one general algorithm is implemented due to Fonseca et.al. but work is underway to include others such as the Beume & Rudolph approach as well as the approach by Bradstreet et.al. The 1D and 2D cases are handle seperately by efficient algorithms. Calculates the exact dominated hypervolume of the points given in \code{x} subject to the reference point \code{ref}. } \references{ This code uses version 1.3 of the hypervolume code available from \url{ https://lopez-ibanez.eu/hypervolume}. For a description of the algorithm see Carlos M. Fonseca, Luis Paquete, and Manuel Lopez-Ibanez. \emph{An improved dimension-sweep algorithm for the hypervolume indicator}. In IEEE Congress on Evolutionary Computation, pages 1157-1163, Vancouver, Canada, July 2006. } \seealso{ \code{\link{nondominated_points}} to extract the pareto front approximation from a given set of points and \code{\link{nds_hv_selection}} for a selection strategy based on the hypervolume contribution of each point. } \author{ Olaf Mersmann \email{olafm@statistik.tu-dortmund.de} } \keyword{optimize} emoa/man/emoa_logger.Rd0000644000176200001440000000122214554271516014524 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/logger.R \name{emoa_logger} \alias{emoa_logger} \title{generic logger factory} \usage{ emoa_logger(output, every = 10L, ...) } \arguments{ \item{output}{function used to display logging messages.} \item{every}{number of steps of the emoa between evaluations.} \item{...}{passed to the parent logger factory.} } \value{ An \code{emoa_logger} object. } \description{ Basic logger object with a flexible output routine. } \seealso{ \code{\link{emoa_console_logger}} and \code{\link{emoa_null_logger}} for convinience wrappers around \code{emoa_logger} providing useful defaults. } emoa/man/coalesce.Rd0000644000176200001440000000100014554271516014014 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utilities.r \name{coalesce} \alias{coalesce} \title{Return first non null argument.} \usage{ coalesce(...) } \arguments{ \item{...}{List of values.} } \value{ First non null element in \code{...}. } \description{ This function is useful when processing complex arguments with multiple possible defaults based on other arguments that may or may not have been provided. } \author{ Olaf Mersmann \email{olafm@statistik.tu-dortmund.de} } emoa/man/cec2009_functions.Rd0000644000176200001440000000110014554271516015374 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/cec2009.r \name{UF1} \alias{UF1} \alias{UF2} \alias{UF3} \alias{UF4} \alias{UF5} \alias{UF6} \alias{UF7} \alias{UF8} \alias{UF9} \alias{UF10} \title{Functions from the CEC 2009 EMOA competition.} \usage{ UF1(x) UF2(x) UF3(x) UF4(x) UF5(x) UF6(x) UF7(x) UF8(x) UF9(x) UF10(x) } \arguments{ \item{x}{Parmater vector.} } \value{ Function value. } \description{ Functions from the CEC 2009 EMOA competition. } \author{ Olaf Mersmann \email{olafm@statistik.tu-dortmund.de} } \keyword{optimize} emoa/man/inbounds.Rd0000644000176200001440000000074114554271516014072 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utilities.r \name{inbounds} \alias{inbounds} \title{Clip value to a given range} \usage{ inbounds(x, l, u) } \arguments{ \item{x}{Value to clip.} \item{l}{Lower limit.} \item{u}{Upper limit.} } \value{ l if x < l, u if x > u else x. } \description{ Clip \eqn{x} to the interval \eqn{[l, u]}. This is useful to enforce box constraints. } \author{ Olaf Mersmann \email{olafm@statistik.tu-dortmund.de} } emoa/man/nondominated_points.Rd0000644000176200001440000000112114554271516016315 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/dominance.r \name{nondominated_points} \alias{nondominated_points} \title{Nondominated points} \usage{ nondominated_points(points) } \arguments{ \item{points}{Matrix of points, one per column.} } \value{ Those points in \code{points} which are not dominated by another point. } \description{ Return those points which are not dominated by another point in \code{points}. This is the Pareto front approximation of the point set. } \author{ Olaf Mersmann \email{olafm@statistik.tu-dortmund.de} } \keyword{optimize} emoa/man/unary_r2_indicator.Rd0000644000176200001440000000115514554271516016046 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/indicators.r \name{unary_r2_indicator} \alias{unary_r2_indicator} \title{Unary R2 indicator} \usage{ unary_r2_indicator(points, weights, ideal) } \arguments{ \item{points}{Matrix of points for which to calculate the indicator value stored one per column.} \item{weights}{Matrix of weight vectors stored one per column.} \item{ideal}{Ideal point of true Pareto front. If omited the ideal of \code{points} is used.} } \value{ Value of unary R2 indicator. } \description{ Unary R2 indicator } \author{ Olaf Mersmann \email{olafm@p-value.net} } emoa/man/dom_op.Rd0000644000176200001440000000147614554271516013534 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/dominance.r \name{is_dominated} \alias{is_dominated} \alias{is_maximally_dominated} \title{Pareto dominance checks.} \usage{ is_dominated(points) is_maximally_dominated(points) } \arguments{ \item{points}{Matrix containing points one per column.} } \value{ For \code{is_dominated} and \code{is_maximally_dominated} a boolean vector and for \code{\%dominates\%} a single boolean. } \description{ \code{is_dominated} returns which points from a set are dominated by another point in the set. \code{\%dominates\%} returns true if \code{x} Pareto dominates \code{y} and \code{is_maximally_dominated} returns TRUE for those points which do not dominate any other points. } \author{ Olaf Mersmann \email{olafm@statistik.tu-dortmund.de} } \keyword{optimize} emoa/man/sbx_operator.Rd0000644000176200001440000000202714554271516014757 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/sb_crossover.r \name{sbx_operator} \alias{sbx_operator} \title{Simulated binary crossover operator} \usage{ sbx_operator(n, p, lower, upper) } \arguments{ \item{n}{Distance parameter of crossover distribution (\eqn{\eta}{eta}).} \item{p}{Probability of one point crossover.} \item{lower}{Lower bounds of parameter space.} \item{upper}{Upper bounds of parameter space.} } \value{ Function with one parameter \code{x} which takes a matrix containing two sets of parameters and returns a matrix of two sets of parameters which resulted from the crossover operation. As with all \code{emoa} functions, the parameter sets are stored in the columns of \code{x}. \code{x} should therefore always have two columns and a warning will be given if it has more than two columns. } \description{ Returns a simulated binary crossover operator with the given parameters. } \seealso{ \code{\link{pm_operator}} } \author{ Olaf Mersmann \email{olafm@statistik.tu-dortmund.de} } emoa/man/cec2007.Rd0000644000176200001440000000246314554271516013317 0ustar liggesusers\name{cec2007} \Rdversion{1.1} \alias{cec2007} \docType{data} \title{CEC 2007 multiobjective optimization competition results} \description{ This data set contains the hypervolume and R2 indicator results of the 8 different algorithms that took part in the CEC 2007 multiobjective optimization benchmark. } \usage{data(cec2007)} \format{ A data frame with 456 observations of the following 9 variables. \describe{ \item{\code{algo}}{Abbreviated name of algorithm} \item{\code{fun}}{Name of benchmark function} \item{\code{d}}{Dimension of objective space} \item{\code{n}}{Number of function evaluations} \item{\code{metric}}{Name of quality metric} \item{\code{pdef}}{Unique id for each combination of \code{fun}, \code{d}, \code{n} and \code{metric}} \item{\code{best}}{Largest value of metric} \item{\code{median}}{Median value of metric} \item{\code{worst}}{Smallest value of metric} \item{\code{mean}}{Average value of metric} \item{\code{std}}{Standard deviation of metric} } } \source{ Formerly available at http://web.mysites.ntu.edu.sg/epnsugan/PublicSite/Shared\%20Documents/CEC2007-final-pdfs.zip } \examples{ \dontrun{ data(cec2007) require(lattice) print(dotplot(algo ~ median | fun + metric, cec2007, groups=cec2007$n)) } } \keyword{datasets} emoa/man/binary_indicator.Rd0000644000176200001440000000326114554271516015571 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/indicators.r \name{hypervolume_indicator} \alias{hypervolume_indicator} \alias{epsilon_indicator} \alias{r1_indicator} \alias{r2_indicator} \alias{r3_indicator} \title{Binary quality indicators} \usage{ hypervolume_indicator(points, o, ref) epsilon_indicator(points, o) r1_indicator(points, o, ideal, nadir, lambda, utility = "Tchebycheff") r2_indicator(points, o, ideal, nadir, lambda, utility = "Tchebycheff") r3_indicator(points, o, ideal, nadir, lambda, utility = "Tchebycheff") } \arguments{ \item{points}{Matrix of points for which to calculate the indicator value stored one per column.} \item{o}{Matrix of points of the reference set.} \item{ref}{Reference point, if omitted, the nadir of the point sets is used.} \item{ideal}{Ideal point of true Pareto front. If omited the ideal of both point sets is used.} \item{nadir}{Nadir of the true Pareto front. If ommited the nadir of both point sets is used.} \item{lambda}{Number of weight vectors to use in estimating the utility.} \item{utility}{Name of utility function.} } \value{ Value of the quality indicator. } \description{ Calculates the quality indicator value of the set of points given in \code{x} with respect to the set given in \code{o}. As with all functions in \code{emoa} that deal with sets of objective values these are stored by column. } \references{ Zitzler, E., Thiele, L., Laumanns, M., Fonseca, C., and Grunert da Fonseca, V (2003): Performance Assessment of Multiobjective Optimizers: An Analysis and Review. IEEE Transactions on Evolutionary Computation, 7(2), 117-132. } \author{ Olaf Mersmann \email{olafm@statistik.tu-dortmund.de} } emoa/man/emoa_console_logger.Rd0000644000176200001440000000075214554271516016255 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/logger.R \name{emoa_console_logger} \alias{emoa_console_logger} \title{console logger} \usage{ emoa_console_logger(...) } \arguments{ \item{...}{passed to \code{\link{emoa_logger}}.} } \value{ An \code{emoa_logger} object. } \description{ Logger object that outputs log messages to the console } \details{ This is a wrapper that calls \code{emoa_logger(output=output, ...)} internally and returns that logger. } emoa/man/emoa-package.Rd0000644000176200001440000000173214554271516014564 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/emoa.r \docType{package} \name{emoa-package} \alias{emoa-package} \title{The EMOA package} \description{ This package provides functions to construct evolutionary multiobjective optimization algorithms (EMOA). The long term goal is to also provide standard implementations of the most common EMOA in use today. } \details{ Without the hard work of many researchers who have published their source code under a liberal license, this package would not have been possible. In alphabetical order they are \itemize{ \item Michael H. Buselli \item Wessel Dankers \item Carlos Fonseca \item Joshua Knowles \item Huang Ling \item Wudong Liu \item Manuel Lopez-Ibanez \item Luis Paquete \item Ponnuthurai Nagaratnam Suganthany \item Santosh Tiwar \item Qingfu Zhang \item Aimin Zhou \item Shizheng Zhaoy } } \author{ Olaf Mersmann \email{olafm@statistik.tu-dortmund.de} } \keyword{package} emoa/man/steady_state_emoa_control.Rd0000644000176200001440000000200214554271516017473 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/control.R \name{steady_state_emoa_control} \alias{steady_state_emoa_control} \title{Steady state EMOA parameters} \usage{ steady_state_emoa_control(f, upper, lower, ..., control, default = list()) } \arguments{ \item{f}{Multiobjectve optimization function.} \item{upper}{Upper bounds of parameter space.} \item{lower}{Lower bounds of parameter space.} \item{...}{Further arguments passed to \code{f}.} \item{control}{List of control parameters.} \item{default}{List of default control parameters.} } \value{ The \code{control} list with suitably adjusted arguments. Missing control parameters are taken from \code{default} or, if not present there, from an internal default. } \description{ \code{steady_state_emoa_control} interprets the following control parameters: \describe{ \item{mu}{Population size.} \item{maxeval}{Maximum number of function evaluations to use.} } } \author{ Olaf Mersmann \email{olafm@statistik.tu-dortmund.de} } emoa/man/which_points_on_edge.Rd0000644000176200001440000000115714554271516016431 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/front_edge.R \name{which_points_on_edge} \alias{which_points_on_edge} \title{Determine which points are on the edge of a Pareto-front approximation.} \usage{ which_points_on_edge(front) } \arguments{ \item{front}{Pareto-front approximation.} } \value{ An integer vector containing the indicies of the points (columns) of \code{front} which are on the edge of the Pareto-front approximation. } \description{ Determine which points are on the edge of a Pareto-front approximation. } \author{ Olaf Mersmann \email{olafm@statistik.tu-dortmund.de} } emoa/man/emoa_null_logger.Rd0000644000176200001440000000050314554271516015557 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/logger.R \name{emoa_null_logger} \alias{emoa_null_logger} \title{null logger} \usage{ emoa_null_logger(...) } \arguments{ \item{...}{ignored.} } \value{ An \code{emoa_logger} object. } \description{ Logger object that discards all log events. } emoa/man/pm_control.Rd0000644000176200001440000000161714554271516014430 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/control.R \name{pm_control} \alias{pm_control} \title{Polynomial muation (PM) control parameters} \usage{ pm_control(f, upper, lower, ..., control, default = list()) } \arguments{ \item{f}{Multiobjectve optimization function.} \item{upper}{Upper bounds of parameter space.} \item{lower}{Lower bounds of parameter space.} \item{...}{Further arguments passed to \code{f}.} \item{control}{List of control parameters.} \item{default}{List of default control parameters.} } \value{ The \code{control} list with suitably adjusted arguments. Missing control parameters are taken from \code{default} or, if not present there, from an internal default. } \description{ Control parameters: \describe{ \item{pm.n}{Nu parameter of PM.} \item{pm.p}{p parameter of PM.} } } \author{ Olaf Mersmann \email{olafm@statistik.tu-dortmund.de} } emoa/man/cec2007_functions.Rd0000644000176200001440000000062614554271516015406 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/sympart.r \name{sympart} \alias{sympart} \title{Functions from the CEC 2007 EMOA competition.} \usage{ sympart(x) } \arguments{ \item{x}{Parmater vector.} } \value{ Function value. } \description{ Functions from the CEC 2007 EMOA competition. } \author{ Olaf Mersmann \email{olafm@statistik.tu-dortmund.de} } \keyword{optimize} emoa/man/crowding_distance.Rd0000644000176200001440000000065414554271516015742 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/crowding_distance.r \name{crowding_distance} \alias{crowding_distance} \title{Crowding Distance} \usage{ crowding_distance(front) } \arguments{ \item{front}{matrix of function values.} } \value{ crowding distance for each function value. } \description{ Calculate crowding distances. } \author{ Olaf Mersmann \email{olafm@statistik.tu-dortmund.de} } emoa/DESCRIPTION0000644000176200001440000000141714666617772012732 0ustar liggesusersPackage: emoa Title: Evolutionary Multiobjective Optimization Algorithms Description: Collection of building blocks for the design and analysis of evolutionary multiobjective optimization algorithms. Authors@R: c( person("Olaf", "Mersmann", role=c("aut", "cre"), comment = c(ORCID = "0000-0002-7720-4939"), email = "olafm@p-value.net")) License: GPL-2 URL: https://github.com/olafmersmann/emoa/ LazyData: yes Version: 0.5-3 Suggests: testthat Encoding: UTF-8 RoxygenNote: 7.2.3 NeedsCompilation: yes Packaged: 2024-09-05 21:21:02 UTC; olafm Author: Olaf Mersmann [aut, cre] () Maintainer: Olaf Mersmann Repository: CRAN Date/Publication: 2024-09-06 15:30:02 UTC