From f6357fa4c6100b66210ff3c6f46dff2d66718cad Mon Sep 17 00:00:00 2001 From: Mikael Zayenz Lagerkvist Date: Thu, 5 Nov 2026 10:33:56 +0100 Subject: [PATCH 01/80] Remove the (void) parameter lists Empty parameter lists are now (), and modernize-redundant-void-arg keeps them so. Behaviour and casts to void are unchanged. clang-tidy covers what this platform compiles; a byte-level pass covers the rest, and generated files follow their inputs. Reproduce this commit by running the following at the root of a Git tree of the parent commit: set -euo pipefail llvm=/opt/homebrew/opt/llvm@22/bin export PATH="$llvm:/opt/homebrew/opt/bison/bin:/opt/homebrew/opt/flex/bin:$PATH" export CLANG_FORMAT="$llvm/clang-format" CLANG_TIDY="$llvm/clang-tidy" root=$(pwd -P) build=build/void-args rm -rf "$build" cmake -S . -B "$build" -G Ninja -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DGECODE_ENABLE_EXPERIMENTAL=ON \ -DGECODE_ENABLE_CBS=ON -DGECODE_ENABLE_CPPROFILER=ON \ -DGECODE_ENABLE_FAULT_INJECTION=ON -DGECODE_ENABLE_AUDIT=ON \ -DGECODE_ENABLE_GIST=ON -DGECODE_ENABLE_QT=ON run-clang-tidy -clang-tidy-binary "$CLANG_TIDY" -p "$build" -j 10 -quiet \ -checks='-*,modernize-redundant-void-arg' -warnings-as-errors='-*' \ -extra-arg=-UNDEBUG -fix \ -header-filter "$root/(gecode|test|examples|tools)/" \ -exclude-header-filter '/gecode/flatzinc/(parser\.tab\.(cpp|hpp)|lexer\.yy\.cpp)$' \ -source-filter "^$root/(?!gecode/flatzinc/(parser\.tab\.cpp|lexer\.yy\.cpp)$)(gecode|test|examples|tools)/" \ > "$build/clang-tidy.log" 2>&1 python3 - <<'PY' import pathlib import re code = {".hpp", ".cpp", ".hh", ".yxx", ".lxx"} generated = {"parser.tab.cpp", "parser.tab.hpp", "lexer.yy.cpp"} files = [path for top in ("gecode", "test", "examples", "tools") for path in pathlib.Path(top).rglob("*") if path.suffix in code and path.name not in generated and "third-party" not in path.parts] files += [*pathlib.Path(".github/ci").glob("*.sh"), *pathlib.Path(".github/ci").glob("*.ps1"), pathlib.Path("misc/genvarimp.py")] before = re.compile(rb"[\w)\]}>+\-*/=!<&|^~%][ \t]*$") keyword = re.compile(rb"\b(?:return|else|do|sizeof|alignof|typeid|decltype|noexcept)[ \t]*$") gap = re.compile(rb"(?:\s+|//[^\n]*\n|/\*.*?\*/)*", re.S) after = re.compile(rb"[;{:=,)>&#]|->|(?:const|volatile|noexcept|override|final|throw|try)\b|$") def replace(match): text = match.string head = text[max(match.start() - 40, 0):match.start()] tail = gap.match(text, match.end()).end() is_list = before.search(head) and not keyword.search(head) and after.match(text, tail) return b"()" if is_list else match[0] for path in sorted(files): source = path.read_bytes() result = re.sub(rb"\(void\)", replace, source) if result != source: path.write_bytes(result) PY python3 - <<'PY' import pathlib def replace(name, old, new): path = pathlib.Path(name) text = path.read_text() assert text.count(old) == 1, old path.write_text(text.replace(old, new)) replace(".clang-tidy", " modernize-deprecated-headers,\n", " modernize-deprecated-headers,\n modernize-redundant-void-arg,\n") replace("docs/code-style.md", "## Checking changes\n", """\ An empty parameter list is `()`, also in function pointer types and `std::function` signatures. `(void)` is a C spelling and stays only in C sources, where it means something different. `modernize-redundant-void-arg` enforces the rule. A cast to `void` that discards a value, such as `(void)new (p) T()`, is a different construct and stays. `forceinline` stays lowercase, although it is a macro, so that it reads like `inline`. """) replace("docs/breaking-7.md", "- Revisit the `forceinline` portability macro and obsolete `(void)` parameter lists.\n", "") replace("docs/breaking-7.md", " compatibility aliases; see `code-style.md`.\n", """\ compatibility aliases; see `code-style.md`. - Empty parameter lists are `()`, and `forceinline` keeps its lowercase name; see `code-style.md`. """) PY cmake --build "$build" --target regenerate uv run misc/check.py format Zdev-Change-Id: Z9b69e8fd20237843076a34a448f17e293c9f0ebb980e71dbe776ea78776d21f8 --- .clang-tidy | 1 + .github/ci/32-bit-linkage-smoke.sh | 2 +- .github/ci/cmake-consumer-smoke-msys2.sh | 2 +- .github/ci/cmake-consumer-smoke-vcpkg.ps1 | 6 +- .github/ci/cmake-consumer-smoke.ps1 | 6 +- .github/ci/cmake-consumer-smoke.sh | 14 +- .github/ci/qt-gist-consumer-smoke.sh | 2 +- .github/ci/qt5-gist-consumer-smoke.sh | 2 +- docs/code-style.md | 11 + examples/all-interval.cpp | 2 +- examples/alpha.cpp | 2 +- examples/archimedean-spiral.cpp | 4 +- examples/bacp.cpp | 4 +- examples/bibd.cpp | 6 +- examples/bin-packing.cpp | 22 +- examples/black-hole.cpp | 2 +- examples/car-sequencing.cpp | 4 +- examples/cartesian-heart.cpp | 2 +- examples/colored-matrix.cpp | 18 +- examples/common-pattern.cpp | 22 +- examples/common-pattern.hh | 6 +- examples/crew.cpp | 2 +- examples/crossword.cpp | 2 +- examples/crowded-chess.cpp | 6 +- examples/descartes-folium.cpp | 4 +- examples/dominating-queens.cpp | 4 +- examples/domino.cpp | 2 +- examples/donald.cpp | 2 +- examples/efpa.cpp | 14 +- examples/eq20.cpp | 2 +- examples/fifteen-puzzle.cpp | 20 +- examples/golden-spiral.cpp | 4 +- examples/golf.cpp | 10 +- examples/golomb-ruler.cpp | 4 +- examples/graph-color.cpp | 4 +- examples/grocery.cpp | 2 +- examples/hamming.cpp | 8 +- examples/ind-set.cpp | 4 +- examples/job-shop.cpp | 42 +- examples/kakuro.cpp | 10 +- examples/knights.cpp | 12 +- examples/langford-number.cpp | 4 +- examples/magic-sequence.cpp | 2 +- examples/magic-square-partial.cpp | 2 +- examples/magic-square.cpp | 2 +- examples/minesweeper.cpp | 2 +- examples/money.cpp | 2 +- examples/multi-bin-packing.cpp | 12 +- examples/nonogram.cpp | 6 +- examples/open-route.cpp | 2 +- examples/open-shop.cpp | 6 +- examples/ortho-latin.cpp | 2 +- examples/partition.cpp | 2 +- examples/pentominoes.cpp | 2 +- examples/perfect-square.cpp | 2 +- examples/photo.cpp | 8 +- examples/qcp.cpp | 8 +- examples/queen-armies.cpp | 4 +- examples/queens.cpp | 10 +- examples/radiotherapy.cpp | 4 +- examples/sat.cpp | 2 +- examples/schurs-lemma.cpp | 4 +- examples/scowl.hpp | 20 +- examples/sports-league.cpp | 14 +- examples/steel-mill.cpp | 24 +- examples/steiner.cpp | 2 +- examples/sudoku-advanced.cpp | 6 +- examples/sudoku-instances.hh | 2 +- examples/sudoku.cpp | 2 +- examples/tsp.cpp | 24 +- examples/tsptw.cpp | 10 +- examples/warehouses.cpp | 8 +- examples/word-square.cpp | 2 +- gecode/driver.hh | 158 +++--- gecode/driver/options.cpp | 46 +- gecode/driver/options.hpp | 110 ++-- gecode/driver/script.hpp | 4 +- gecode/flatzinc.hh | 72 +-- gecode/flatzinc/ast.hh | 112 ++-- gecode/flatzinc/blackbox-backend.cpp | 6 +- gecode/flatzinc/blackbox-backend.hh | 6 +- gecode/flatzinc/blackbox-process-posix.cpp | 34 +- gecode/flatzinc/blackbox-process-windows.cpp | 26 +- gecode/flatzinc/blackbox-process.hh | 6 +- gecode/flatzinc/blackbox-propagator.cpp | 18 +- gecode/flatzinc/blackbox.hh | 8 +- gecode/flatzinc/branch.hh | 30 +- gecode/flatzinc/branch.hpp | 30 +- gecode/flatzinc/conexpr.hh | 8 +- gecode/flatzinc/flatzinc.cpp | 38 +- gecode/flatzinc/option.hh | 8 +- gecode/flatzinc/parser.hh | 6 +- gecode/flatzinc/parser.tab.cpp | 2 +- gecode/flatzinc/parser.yxx | 2 +- gecode/flatzinc/registry.cpp | 4 +- gecode/flatzinc/registry.hh | 2 +- gecode/flatzinc/varspec.hh | 8 +- gecode/float.hh | 96 ++-- gecode/float/array.hpp | 2 +- gecode/float/branch.hh | 10 +- gecode/float/branch/assign.hpp | 6 +- gecode/float/branch/merit.hpp | 6 +- gecode/float/branch/val-sel.hpp | 2 +- gecode/float/branch/val.hpp | 6 +- gecode/float/branch/var.hpp | 6 +- gecode/float/interval.hpp | 26 +- gecode/float/num.hpp | 12 +- gecode/float/rounding.hpp | 22 +- gecode/float/trace/delta.hpp | 4 +- gecode/float/trace/trace-view.hpp | 2 +- gecode/float/val.hpp | 20 +- gecode/float/var-imp.hpp | 22 +- gecode/float/var-imp/delta.hpp | 6 +- gecode/float/var-imp/float.hpp | 16 +- gecode/float/var/float.hpp | 12 +- gecode/float/view.hpp | 68 +-- gecode/float/view/float.hpp | 14 +- gecode/float/view/minus.hpp | 14 +- gecode/float/view/offset.hpp | 16 +- gecode/float/view/scale.hpp | 16 +- gecode/gist.hh | 36 +- gecode/gist/drawingcursor.cpp | 2 +- gecode/gist/drawingcursor.hh | 12 +- gecode/gist/drawingcursor.hpp | 10 +- gecode/gist/gecodelogo.cpp | 3 +- gecode/gist/gecodelogo.hh | 2 +- gecode/gist/gist.cpp | 24 +- gecode/gist/gist.hpp | 10 +- gecode/gist/layoutcursor.hh | 4 +- gecode/gist/layoutcursor.hpp | 4 +- gecode/gist/mainwindow.cpp | 10 +- gecode/gist/mainwindow.hh | 8 +- gecode/gist/node.hh | 22 +- gecode/gist/node.hpp | 22 +- gecode/gist/nodecursor.hh | 50 +- gecode/gist/nodecursor.hpp | 50 +- gecode/gist/nodestats.cpp | 2 +- gecode/gist/nodestats.hh | 2 +- gecode/gist/nodevisitor.hh | 14 +- gecode/gist/nodevisitor.hpp | 14 +- gecode/gist/preferences.cpp | 4 +- gecode/gist/preferences.hh | 4 +- gecode/gist/qtgist.cpp | 32 +- gecode/gist/qtgist.hh | 26 +- gecode/gist/spacenode.cpp | 2 +- gecode/gist/spacenode.hh | 24 +- gecode/gist/spacenode.hpp | 20 +- gecode/gist/standalone-example/mygist.cpp | 2 +- gecode/gist/textoutput.cpp | 12 +- gecode/gist/textoutput.hh | 8 +- gecode/gist/treecanvas.cpp | 84 +-- gecode/gist/treecanvas.hh | 86 +-- gecode/gist/visualnode.cpp | 6 +- gecode/gist/visualnode.hh | 32 +- gecode/gist/visualnode.hpp | 26 +- gecode/instance.hh | 14 +- gecode/instance/data.cpp | 16 +- gecode/instance/eval.hpp | 26 +- gecode/instance/impl.hpp | 50 +- gecode/instance/reader.cpp | 8 +- gecode/instance/resolve.cpp | 4 +- gecode/instance/spec.cpp | 32 +- gecode/int.hh | 304 +++++------ gecode/int/arithmetic.hh | 8 +- gecode/int/arithmetic/pow-ops.hpp | 8 +- gecode/int/array.hpp | 2 +- gecode/int/bin-packing.hh | 36 +- gecode/int/bin-packing/conflict-graph.hpp | 14 +- gecode/int/bin-packing/propagate.hpp | 16 +- gecode/int/branch.hh | 18 +- gecode/int/branch/assign.hpp | 14 +- gecode/int/branch/merit.hpp | 6 +- gecode/int/branch/val-sel.hpp | 2 +- gecode/int/branch/val.hpp | 26 +- gecode/int/branch/var.hpp | 12 +- gecode/int/branch/view-values.cpp | 2 +- gecode/int/branch/view-values.hpp | 2 +- gecode/int/channel/dom.hpp | 12 +- gecode/int/channel/link-multi.cpp | 12 +- gecode/int/channel/val.hpp | 16 +- gecode/int/count.hh | 4 +- gecode/int/count/view-base.hpp | 4 +- gecode/int/cumulative.hh | 40 +- gecode/int/cumulative/task.hpp | 30 +- gecode/int/cumulative/tree.hpp | 10 +- gecode/int/cumulatives/val.hpp | 2 +- gecode/int/distinct.hh | 12 +- gecode/int/distinct/dom-ctrl.hpp | 4 +- gecode/int/distinct/graph.hpp | 4 +- gecode/int/element.hh | 26 +- gecode/int/element/int.hpp | 26 +- gecode/int/element/pair.cpp | 12 +- gecode/int/element/view.hpp | 14 +- gecode/int/extensional-tuple-set.cpp | 16 +- gecode/int/extensional.hh | 102 ++-- gecode/int/extensional/bit-set.hpp | 24 +- gecode/int/extensional/compact.hpp | 60 +-- gecode/int/extensional/dfa.hpp | 44 +- gecode/int/extensional/layered-graph.hpp | 20 +- gecode/int/extensional/tiny-bit-set.hpp | 14 +- gecode/int/extensional/tuple-set.cpp | 10 +- gecode/int/extensional/tuple-set.hpp | 52 +- gecode/int/gcc/bnd-sup.hpp | 20 +- gecode/int/gcc/dom-sup.hpp | 148 +++--- gecode/int/gcc/view.hpp | 64 +-- gecode/int/growable-int-set.hh | 16 +- gecode/int/growable-int-set.hpp | 14 +- gecode/int/idx-view.hh | 4 +- gecode/int/idx-view.hpp | 4 +- gecode/int/int-set-1.hpp | 20 +- gecode/int/int-set.cpp | 6 +- gecode/int/inter-distance.cpp | 12 +- gecode/int/ldsb.hh | 16 +- gecode/int/ldsb/brancher.hpp | 8 +- gecode/int/ldsb/sym-imp.hpp | 2 +- gecode/int/ldsb/sym-obj.cpp | 16 +- gecode/int/linear.hh | 28 +- gecode/int/linear/bool-int.hpp | 4 +- gecode/int/linear/bool-scale.hpp | 20 +- gecode/int/linear/int-dom.hpp | 10 +- gecode/int/linear/int-noview.hpp | 26 +- gecode/int/min-distance.cpp | 2 +- gecode/int/min-distance.hpp | 2 +- gecode/int/no-overlap.hh | 34 +- gecode/int/no-overlap/box.hpp | 14 +- gecode/int/no-overlap/dim.hpp | 18 +- gecode/int/nvalues.hh | 8 +- gecode/int/nvalues/graph.hpp | 8 +- gecode/int/open-propagator.hpp | 2 +- gecode/int/open-var-list.hpp | 10 +- gecode/int/reify.hpp | 6 +- gecode/int/rel.hh | 4 +- gecode/int/rel/lq-le.hpp | 4 +- gecode/int/sequence.hh | 4 +- gecode/int/sequence/view.hpp | 24 +- gecode/int/sequence/violations.hpp | 12 +- gecode/int/sorted/sortsup.hpp | 12 +- gecode/int/support-values.hh | 20 +- gecode/int/support-values.hpp | 20 +- gecode/int/task.hh | 54 +- gecode/int/task/array.hpp | 6 +- gecode/int/task/event.hpp | 6 +- gecode/int/task/fwd-to-bwd.hpp | 12 +- gecode/int/task/iter.hpp | 8 +- gecode/int/task/man-to-opt.hpp | 8 +- gecode/int/task/tree.hpp | 10 +- gecode/int/trace/bool-delta.hpp | 10 +- gecode/int/trace/bool-trace-view.hpp | 2 +- gecode/int/trace/int-trace-view.hpp | 8 +- gecode/int/unary.hh | 82 +-- gecode/int/unary/task.hpp | 68 +-- gecode/int/unary/tree.hpp | 10 +- gecode/int/val-set.hh | 22 +- gecode/int/val-set.hpp | 22 +- gecode/int/var-imp.hpp | 98 ++-- gecode/int/var-imp/bool.hpp | 28 +- gecode/int/var-imp/delta.hpp | 10 +- gecode/int/var-imp/int.cpp | 2 +- gecode/int/var-imp/int.hpp | 54 +- gecode/int/var/bool.hpp | 24 +- gecode/int/var/int.hpp | 20 +- gecode/int/view-val-graph.hh | 74 +-- gecode/int/view-val-graph/bi-link.hpp | 14 +- gecode/int/view-val-graph/comb-ptr-flag.hpp | 6 +- gecode/int/view-val-graph/edge.hpp | 10 +- gecode/int/view-val-graph/graph.hpp | 8 +- gecode/int/view-val-graph/iter-prune-val.hpp | 6 +- gecode/int/view-val-graph/node.hpp | 30 +- gecode/int/view.hpp | 214 ++++---- gecode/int/view/bool.hpp | 28 +- gecode/int/view/cached.hpp | 24 +- gecode/int/view/constint.hpp | 42 +- gecode/int/view/int.hpp | 22 +- gecode/int/view/minus.hpp | 30 +- gecode/int/view/neg-bool.hpp | 16 +- gecode/int/view/offset.hpp | 24 +- gecode/int/view/scale.hpp | 26 +- gecode/int/view/zero.hpp | 40 +- gecode/iter/ranges-add.hpp | 8 +- gecode/iter/ranges-append.hpp | 12 +- gecode/iter/ranges-array.hpp | 26 +- gecode/iter/ranges-cache.hpp | 2 +- gecode/iter/ranges-compl.hpp | 20 +- gecode/iter/ranges-diff.hpp | 6 +- gecode/iter/ranges-empty.hpp | 26 +- gecode/iter/ranges-inter.hpp | 8 +- gecode/iter/ranges-list.hpp | 36 +- gecode/iter/ranges-map.hpp | 44 +- gecode/iter/ranges-minmax.hpp | 22 +- gecode/iter/ranges-minus.hpp | 2 +- gecode/iter/ranges-negative.hpp | 22 +- gecode/iter/ranges-offset.hpp | 22 +- gecode/iter/ranges-positive.hpp | 22 +- gecode/iter/ranges-rangelist.hpp | 22 +- gecode/iter/ranges-scale.hpp | 28 +- gecode/iter/ranges-singleton-append.hpp | 6 +- gecode/iter/ranges-singleton.hpp | 6 +- gecode/iter/ranges-size.hpp | 28 +- gecode/iter/ranges-union.hpp | 10 +- gecode/iter/ranges-values.hpp | 18 +- gecode/iter/values-array.hpp | 18 +- gecode/iter/values-bitset.hpp | 14 +- gecode/iter/values-bitsetoffset.hpp | 14 +- gecode/iter/values-inter.hpp | 18 +- gecode/iter/values-list.hpp | 24 +- gecode/iter/values-map.hpp | 14 +- gecode/iter/values-minus.hpp | 2 +- gecode/iter/values-negative.hpp | 14 +- gecode/iter/values-offset.hpp | 14 +- gecode/iter/values-positive.hpp | 14 +- gecode/iter/values-ranges.hpp | 6 +- gecode/iter/values-singleton.hpp | 14 +- gecode/iter/values-union.hpp | 16 +- gecode/iter/values-unique.hpp | 14 +- gecode/kernel/archive.cpp | 2 +- gecode/kernel/archive.hpp | 14 +- gecode/kernel/branch/action.cpp | 2 +- gecode/kernel/branch/action.hpp | 46 +- gecode/kernel/branch/afc.hpp | 12 +- gecode/kernel/branch/chb.cpp | 2 +- gecode/kernel/branch/chb.hpp | 46 +- gecode/kernel/branch/filter.hpp | 16 +- gecode/kernel/branch/merit.hpp | 20 +- gecode/kernel/branch/print.hpp | 16 +- gecode/kernel/branch/val-commit.hpp | 8 +- gecode/kernel/branch/val-sel-commit.hpp | 14 +- gecode/kernel/branch/val-sel.hpp | 10 +- gecode/kernel/branch/val.hpp | 16 +- gecode/kernel/branch/var.hpp | 32 +- gecode/kernel/branch/view-sel.hpp | 24 +- gecode/kernel/branch/view-val.hpp | 4 +- gecode/kernel/branch/view.hpp | 4 +- gecode/kernel/core.cpp | 22 +- gecode/kernel/core.hpp | 496 +++++++++--------- gecode/kernel/data/array.hpp | 148 +++--- gecode/kernel/data/rnd.hpp | 10 +- gecode/kernel/data/shared-array.hpp | 62 +-- gecode/kernel/data/shared-data.hpp | 12 +- gecode/kernel/gpi.hpp | 32 +- gecode/kernel/memory/allocators.hpp | 8 +- gecode/kernel/memory/manager.cpp | 2 +- gecode/kernel/memory/manager.hpp | 24 +- gecode/kernel/memory/region.cpp | 10 +- gecode/kernel/memory/region.hpp | 28 +- gecode/kernel/propagator/advisor.hpp | 4 +- gecode/kernel/propagator/subscribed.hpp | 12 +- gecode/kernel/range-list.hpp | 24 +- gecode/kernel/shared-object.hpp | 32 +- gecode/kernel/shared-space-data.hpp | 16 +- gecode/kernel/trace/filter.cpp | 14 +- gecode/kernel/trace/filter.hpp | 26 +- gecode/kernel/trace/recorder.hpp | 36 +- gecode/kernel/trace/tracer.hpp | 12 +- gecode/kernel/var-imp.hpp | 10 +- gecode/kernel/var.hpp | 20 +- gecode/kernel/view.hpp | 82 +-- gecode/minimodel.hh | 118 ++--- gecode/minimodel/bool-expr.cpp | 22 +- gecode/minimodel/float-arith.cpp | 2 +- gecode/minimodel/float-expr.cpp | 18 +- gecode/minimodel/float-expr.hpp | 2 +- gecode/minimodel/int-arith.cpp | 6 +- gecode/minimodel/int-expr.cpp | 22 +- gecode/minimodel/int-expr.hpp | 2 +- gecode/minimodel/ipl.hpp | 32 +- gecode/minimodel/matrix.hpp | 16 +- gecode/minimodel/reg.cpp | 54 +- gecode/minimodel/set-expr.cpp | 10 +- gecode/minimodel/set-expr.hpp | 2 +- gecode/search.hh | 198 +++---- gecode/search/astar.cpp | 16 +- gecode/search/base.hpp | 8 +- gecode/search/build.hpp | 6 +- gecode/search/cabs.cpp | 20 +- gecode/search/cpprofiler/connector.hpp | 10 +- gecode/search/cpprofiler/message.hpp | 58 +- gecode/search/cpprofiler/tracer.cpp | 8 +- gecode/search/cutoff.cpp | 48 +- gecode/search/cutoff.hpp | 8 +- gecode/search/engine.cpp | 8 +- gecode/search/heuristic.hh | 22 +- gecode/search/nogoods.hh | 2 +- gecode/search/options.cpp | 2 +- gecode/search/options.hpp | 2 +- gecode/search/par/bab.hh | 18 +- gecode/search/par/bab.hpp | 18 +- gecode/search/par/dfs.hh | 14 +- gecode/search/par/dfs.hpp | 14 +- gecode/search/par/engine.hh | 54 +- gecode/search/par/engine.hpp | 54 +- gecode/search/par/frontier.cpp | 20 +- gecode/search/par/frontier.hh | 30 +- gecode/search/par/path.hh | 38 +- gecode/search/par/path.hpp | 38 +- gecode/search/par/pbs.cpp | 2 +- gecode/search/par/pbs.hh | 58 +- gecode/search/par/pbs.hpp | 54 +- gecode/search/sebs.hpp | 2 +- gecode/search/seq/astar.hh | 6 +- gecode/search/seq/bab.hh | 8 +- gecode/search/seq/bab.hpp | 8 +- gecode/search/seq/cabs.hh | 10 +- gecode/search/seq/choice-expansion.hh | 10 +- gecode/search/seq/dead.cpp | 16 +- gecode/search/seq/dfs.hh | 8 +- gecode/search/seq/dfs.hpp | 8 +- gecode/search/seq/lds.hh | 26 +- gecode/search/seq/lds.hpp | 26 +- gecode/search/seq/path.hh | 36 +- gecode/search/seq/path.hpp | 36 +- gecode/search/seq/pbs.hh | 26 +- gecode/search/seq/pbs.hpp | 26 +- gecode/search/seq/rbs.cpp | 10 +- gecode/search/seq/rbs.hh | 16 +- gecode/search/seq/rbs.hpp | 6 +- gecode/search/statistics.hpp | 4 +- gecode/search/stop.hpp | 12 +- gecode/search/support.hh | 16 +- gecode/search/trace-recorder.hpp | 76 +-- gecode/search/tracer.cpp | 6 +- gecode/search/tracer.hpp | 52 +- gecode/search/worker-control.cpp | 12 +- gecode/search/worker.hh | 16 +- gecode/set.hh | 128 ++--- gecode/set/branch.hh | 10 +- gecode/set/branch/assign.hpp | 14 +- gecode/set/branch/merit.hpp | 6 +- gecode/set/branch/val-sel.hpp | 2 +- gecode/set/branch/val.hpp | 14 +- gecode/set/branch/var.hpp | 6 +- gecode/set/channel.hh | 2 +- gecode/set/channel/bool.hpp | 2 +- gecode/set/int/weights.hpp | 18 +- gecode/set/rel/lq.hpp | 18 +- gecode/set/trace/delta.hpp | 4 +- gecode/set/trace/trace-view.hpp | 12 +- gecode/set/var-imp.hpp | 86 +-- gecode/set/var-imp/delta.hpp | 14 +- gecode/set/var-imp/integerset.cpp | 2 +- gecode/set/var-imp/integerset.hpp | 18 +- gecode/set/var-imp/set.hpp | 18 +- gecode/set/var/set.hpp | 72 +-- gecode/set/view.hpp | 144 ++--- gecode/set/view/cached.hpp | 26 +- gecode/set/view/complement.hpp | 66 +-- gecode/set/view/const.hpp | 90 ++-- gecode/set/view/set.hpp | 26 +- gecode/set/view/singleton.hpp | 34 +- gecode/support/allocator.hpp | 2 +- gecode/support/bitset-base.hpp | 48 +- gecode/support/bitset-offset.hpp | 12 +- gecode/support/bitset.hpp | 4 +- gecode/support/block-allocator.hpp | 20 +- gecode/support/dynamic-array.hpp | 8 +- gecode/support/dynamic-queue.hpp | 24 +- gecode/support/dynamic-stack.hpp | 28 +- gecode/support/exception.cpp | 4 +- gecode/support/exception.hpp | 4 +- gecode/support/failpoint.cpp | 4 +- gecode/support/failpoint.hpp | 4 +- gecode/support/heap.hpp | 6 +- gecode/support/hw-rnd.cpp | 4 +- gecode/support/hw-rnd.hpp | 2 +- gecode/support/random.hpp | 48 +- gecode/support/ref-count.hpp | 12 +- gecode/support/run-jobs.hpp | 38 +- gecode/support/sort.hpp | 8 +- gecode/support/static-stack.hpp | 28 +- gecode/support/thread.hpp | 32 +- gecode/support/thread/thread.cpp | 12 +- gecode/support/thread/thread.hpp | 20 +- gecode/support/timer.hpp | 8 +- misc/genvarimp.py | 8 +- test/afc.cpp | 24 +- test/array.cpp | 28 +- test/assign.cpp | 16 +- test/assign.hh | 8 +- test/assign/bool.cpp | 8 +- test/assign/float.cpp | 8 +- test/assign/int.cpp | 8 +- test/assign/set.cpp | 8 +- test/branch.cpp | 28 +- test/branch.hh | 8 +- test/branch/int.cpp | 14 +- test/fault.cpp | 174 +++--- test/flatzinc.cpp | 24 +- test/flatzinc.hh | 6 +- test/flatzinc/2dpacking.cpp | 2 +- test/flatzinc/alpha.cpp | 2 +- test/flatzinc/battleships1.cpp | 2 +- test/flatzinc/battleships10.cpp | 2 +- test/flatzinc/battleships2.cpp | 2 +- test/flatzinc/battleships3.cpp | 2 +- test/flatzinc/battleships4.cpp | 2 +- test/flatzinc/battleships5.cpp | 2 +- test/flatzinc/battleships7.cpp | 2 +- test/flatzinc/battleships9.cpp | 2 +- test/flatzinc/blackbox-dll.cpp | 2 +- test/flatzinc/blackbox-exec.cpp | 2 +- test/flatzinc/blackbox.cpp | 16 +- test/flatzinc/blocksworld_instance_1.cpp | 2 +- test/flatzinc/blocksworld_instance_2.cpp | 2 +- test/flatzinc/bool_clause.cpp | 2 +- test/flatzinc/branching.cpp | 16 +- test/flatzinc/bug232.cpp | 2 +- test/flatzinc/bug319.cpp | 2 +- test/flatzinc/bugfix_r6746.cpp | 2 +- test/flatzinc/bugfix_r7854.cpp | 2 +- test/flatzinc/cumulatives.cpp | 2 +- test/flatzinc/cumulatives_full_1.cpp | 2 +- test/flatzinc/cumulatives_full_2.cpp | 2 +- test/flatzinc/cumulatives_full_3.cpp | 2 +- test/flatzinc/cumulatives_full_4.cpp | 2 +- test/flatzinc/cumulatives_full_5.cpp | 2 +- test/flatzinc/cumulatives_full_6.cpp | 2 +- test/flatzinc/cumulatives_full_7.cpp | 2 +- test/flatzinc/cumulatives_full_8.cpp | 2 +- test/flatzinc/cutstock.cpp | 2 +- test/flatzinc/empty_domain_1.cpp | 2 +- test/flatzinc/empty_domain_2.cpp | 2 +- test/flatzinc/empty_set_literal.cpp | 2 +- test/flatzinc/eq20.cpp | 2 +- test/flatzinc/factory_planning_instance.cpp | 2 +- test/flatzinc/golomb.cpp | 2 +- test/flatzinc/int_set_as_type1.cpp | 2 +- test/flatzinc/int_set_as_type2.cpp | 2 +- test/flatzinc/issue166.cpp | 2 +- test/flatzinc/issue168.cpp | 2 +- test/flatzinc/jobshop.cpp | 2 +- test/flatzinc/jobshop2x2.cpp | 2 +- test/flatzinc/knights.cpp | 2 +- test/flatzinc/langford2.cpp | 2 +- test/flatzinc/latin_squares_fd.cpp | 2 +- test/flatzinc/magicsq_3.cpp | 2 +- test/flatzinc/magicsq_4.cpp | 2 +- test/flatzinc/magicsq_5.cpp | 2 +- test/flatzinc/multidim_knapsack_simple.cpp | 2 +- test/flatzinc/native-registry.cpp | 10 +- test/flatzinc/no_warn_empty_domain.cpp | 2 +- test/flatzinc/on_restart_complete.cpp | 2 +- test/flatzinc/on_restart_last_val_bool.cpp | 2 +- test/flatzinc/on_restart_last_val_float.cpp | 2 +- test/flatzinc/on_restart_last_val_int.cpp | 6 +- test/flatzinc/on_restart_last_val_set.cpp | 2 +- test/flatzinc/on_restart_sol_bool.cpp | 2 +- test/flatzinc/on_restart_sol_float.cpp | 2 +- test/flatzinc/on_restart_sol_int.cpp | 2 +- test/flatzinc/on_restart_sol_set.cpp | 2 +- test/flatzinc/oss.cpp | 2 +- test/flatzinc/output_test.cpp | 2 +- test/flatzinc/packing.cpp | 2 +- test/flatzinc/perfsq.cpp | 2 +- test/flatzinc/perfsq2.cpp | 2 +- test/flatzinc/photo.cpp | 2 +- test/flatzinc/product_fd.cpp | 2 +- test/flatzinc/product_lp.cpp | 2 +- test/flatzinc/quasigroup_qg5.cpp | 2 +- test/flatzinc/queen_cp2.cpp | 2 +- test/flatzinc/queen_ip.cpp | 2 +- test/flatzinc/queens4.cpp | 2 +- test/flatzinc/radiation.cpp | 2 +- test/flatzinc/random_branching.cpp | 12 +- test/flatzinc/sat_arith1.cpp | 2 +- test/flatzinc/sat_array_bool_and.cpp | 2 +- test/flatzinc/sat_array_bool_or.cpp | 2 +- test/flatzinc/sat_cmp_reif.cpp | 2 +- test/flatzinc/sat_eq_reif.cpp | 2 +- test/flatzinc/shared_array_element.cpp | 2 +- test/flatzinc/simple_sat.cpp | 2 +- test/flatzinc/singHoist2.cpp | 2 +- test/flatzinc/steiner_triples.cpp | 2 +- test/flatzinc/subtyping.cpp | 2 +- test/flatzinc/sudoku.cpp | 2 +- test/flatzinc/template_design.cpp | 2 +- test/flatzinc/tenpenki_1.cpp | 2 +- test/flatzinc/tenpenki_2.cpp | 2 +- test/flatzinc/tenpenki_3.cpp | 2 +- test/flatzinc/tenpenki_4.cpp | 2 +- test/flatzinc/tenpenki_5.cpp | 2 +- test/flatzinc/tenpenki_6.cpp | 2 +- test/flatzinc/test_approx_bnb.cpp | 2 +- test/flatzinc/test_array_just_right.cpp | 2 +- .../flatzinc/test_assigned_var_bounds_bad.cpp | 2 +- test/flatzinc/test_flatzinc_output_anns.cpp | 2 +- test/flatzinc/test_fzn_arith.cpp | 2 +- test/flatzinc/test_fzn_arrays.cpp | 2 +- test/flatzinc/test_fzn_coercions.cpp | 2 +- test/flatzinc/test_fzn_comparison.cpp | 2 +- test/flatzinc/test_fzn_logic.cpp | 2 +- test/flatzinc/test_fzn_sets.cpp | 2 +- test/flatzinc/test_int_div.cpp | 2 +- test/flatzinc/test_int_mod.cpp | 2 +- test/flatzinc/test_int_ranges_as_values.cpp | 2 +- test/flatzinc/test_seq_search.cpp | 2 +- test/flatzinc/timetabling.cpp | 2 +- test/flatzinc/trucking.cpp | 2 +- test/flatzinc/warehouses.cpp | 2 +- test/flatzinc/warehouses_small.cpp | 2 +- test/flatzinc/wolf_goat_cabbage.cpp | 2 +- test/flatzinc/zebra.cpp | 2 +- test/float.cpp | 18 +- test/float.hh | 54 +- test/float.hpp | 28 +- test/float/arithmetic.cpp | 73 ++- test/float/basic.cpp | 22 +- test/float/dom.cpp | 2 +- test/float/interval.cpp | 12 +- test/float/linear.cpp | 14 +- test/float/mm-lin.cpp | 10 +- test/float/rel.cpp | 2 +- test/float/transcendental.cpp | 4 +- test/groups.cpp | 10 +- test/instance.cpp | 225 ++++---- test/int.cpp | 24 +- test/int.hh | 78 +-- test/int.hpp | 56 +- test/int/arithmetic.cpp | 98 ++-- test/int/basic.cpp | 12 +- test/int/bin-packing.cpp | 44 +- test/int/bool.cpp | 4 +- test/int/channel.cpp | 2 +- test/int/circuit.cpp | 2 +- test/int/count.cpp | 2 +- test/int/cumulative.cpp | 28 +- test/int/cumulatives.cpp | 16 +- test/int/distinct.cpp | 8 +- test/int/dom.cpp | 4 +- test/int/element.cpp | 29 +- test/int/extensional.cpp | 144 +++-- test/int/gcc.cpp | 12 +- test/int/inter-distance.cpp | 16 +- test/int/linear.cpp | 10 +- test/int/member.cpp | 2 +- test/int/min-distance.cpp | 14 +- test/int/mm-arithmetic.cpp | 4 +- test/int/mm-bool.cpp | 10 +- test/int/mm-count.cpp | 2 +- test/int/mm-lin.cpp | 12 +- test/int/mm-rel.cpp | 2 +- test/int/no-overlap.cpp | 10 +- test/int/nvalues.cpp | 4 +- test/int/open-var-list.cpp | 168 +++--- test/int/order.cpp | 2 +- test/int/rel.cpp | 2 +- test/int/sequence.cpp | 2 +- test/int/sorted.cpp | 4 +- test/int/unary.cpp | 10 +- test/int/unshare.cpp | 4 +- test/ldsb.cpp | 112 ++-- test/nogoods.cpp | 16 +- test/package/allocator/main.cpp | 2 +- test/public-float-smoke.cpp | 2 +- test/public-int-smoke.cpp | 2 +- test/public-runner-smoke.cpp | 14 +- test/public-set-smoke.cpp | 2 +- test/region.cpp | 34 +- test/search.cpp | 372 ++++++------- test/set.cpp | 22 +- test/set.hh | 62 +-- test/set.hpp | 16 +- test/set/channel.cpp | 12 +- test/set/construct.cpp | 18 +- test/set/element.cpp | 25 +- test/set/int.cpp | 6 +- test/set/mm-set.cpp | 2 +- test/set/rel-op-const.cpp | 8 +- test/set/rel-op.cpp | 6 +- test/set/rel.cpp | 2 +- test/set/sequence.cpp | 8 +- test/test.cpp | 6 +- test/test.hh | 30 +- test/test.hpp | 22 +- 672 files changed, 6466 insertions(+), 6469 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index edfd5bc727..775c56c2ee 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -17,6 +17,7 @@ Checks: >- bugprone-use-after-move, bugprone-virtual-near-miss, modernize-deprecated-headers, + modernize-redundant-void-arg, modernize-use-equals-default, modernize-use-equals-delete, modernize-use-nullptr, diff --git a/.github/ci/32-bit-linkage-smoke.sh b/.github/ci/32-bit-linkage-smoke.sh index 278a24f494..228f122eb1 100644 --- a/.github/ci/32-bit-linkage-smoke.sh +++ b/.github/ci/32-bit-linkage-smoke.sh @@ -43,7 +43,7 @@ EOF cat > "$consumer_dir/main.cpp" <<'EOF' #include -int main(void) { +int main() { Gecode::Search::Statistics statistics; Gecode::Search::Options options; diff --git a/.github/ci/cmake-consumer-smoke-msys2.sh b/.github/ci/cmake-consumer-smoke-msys2.sh index 3ae83ab693..2232c89e31 100755 --- a/.github/ci/cmake-consumer-smoke-msys2.sh +++ b/.github/ci/cmake-consumer-smoke-msys2.sh @@ -23,7 +23,7 @@ cat > "$work/main.cpp" <<'EOF' #include #include -int main(void) { +int main() { Gecode::IntArgs values(1); values[0] = 0; return values[0]; diff --git a/.github/ci/cmake-consumer-smoke-vcpkg.ps1 b/.github/ci/cmake-consumer-smoke-vcpkg.ps1 index 8f6d9fb2d7..3f7bc506bb 100644 --- a/.github/ci/cmake-consumer-smoke-vcpkg.ps1 +++ b/.github/ci/cmake-consumer-smoke-vcpkg.ps1 @@ -49,7 +49,7 @@ target_link_libraries(consumer_a PRIVATE Gecode::gecode) '@ | Set-Content -Encoding utf8 (Join-Path $work "a\CMakeLists.txt") @' #include -int main(void) { return 0; } +int main() { return 0; } '@ | Set-Content -Encoding utf8 (Join-Path $work "a\main.cpp") @' @@ -61,7 +61,7 @@ target_link_libraries(consumer_b PRIVATE Gecode::gecodedriver) '@ | Set-Content -Encoding utf8 (Join-Path $work "b\CMakeLists.txt") @' #include -int main(void) { +int main() { Gecode::Options options("consumer_b"); return options.model(); } @@ -103,7 +103,7 @@ target_link_libraries(consumer_d PRIVATE Gecode::gecodefloat) #error "Expected installed Gecode package to enable MPFR" #endif #include -int main(void) { +int main() { Gecode::Float::Rounding rounding; return rounding.exp_down(1.0) > 0.0 ? 0 : 1; } diff --git a/.github/ci/cmake-consumer-smoke.ps1 b/.github/ci/cmake-consumer-smoke.ps1 index 2897104644..fc471bf6f3 100644 --- a/.github/ci/cmake-consumer-smoke.ps1 +++ b/.github/ci/cmake-consumer-smoke.ps1 @@ -34,7 +34,7 @@ target_link_libraries(consumer_a PRIVATE Gecode::gecode) '@ | Set-Content -Encoding utf8 (Join-Path $work "a\CMakeLists.txt") @' #include -int main(void) { return 0; } +int main() { return 0; } '@ | Set-Content -Encoding utf8 (Join-Path $work "a\main.cpp") @' @@ -46,7 +46,7 @@ target_link_libraries(consumer_b PRIVATE Gecode::gecodedriver) '@ | Set-Content -Encoding utf8 (Join-Path $work "b\CMakeLists.txt") @' #include -int main(void) { +int main() { Gecode::Options options("consumer_b"); return options.model(); } @@ -131,7 +131,7 @@ target_link_libraries(manual_consumer PRIVATE "${GECODE_SUPPORT_LIBRARY}") '@ | Set-Content -Encoding utf8 (Join-Path $work "manual\CMakeLists.txt") @' #include -int main(void) { +int main() { (void) Gecode::Support::hwrnd(); return 0; } diff --git a/.github/ci/cmake-consumer-smoke.sh b/.github/ci/cmake-consumer-smoke.sh index 673c80a379..23fa593681 100644 --- a/.github/ci/cmake-consumer-smoke.sh +++ b/.github/ci/cmake-consumer-smoke.sh @@ -55,7 +55,7 @@ target_link_libraries(consumer_a PRIVATE Gecode::gecode) EOF cat > "$work/a/main.cpp" <<'EOF' #include -int main(void) { return 0; } +int main() { return 0; } EOF cat > "$work/b/CMakeLists.txt" <<'EOF' @@ -70,7 +70,7 @@ target_link_libraries(consumer_b PRIVATE Gecode::gecodedriver) EOF cat > "$work/b/main.cpp" <<'EOF' #include -int main(void) { +int main() { Gecode::Options options("consumer_b"); return options.model(); } @@ -116,7 +116,7 @@ cat > "$work/d/main.cpp" <<'EOF' #error "Expected installed Gecode package to enable MPFR" #endif #include -int main(void) { +int main() { Gecode::Float::Rounding rounding; return rounding.exp_down(1.0) > 0.0 ? 0 : 1; } @@ -145,7 +145,7 @@ cat > "$work/e/main.cpp" <<'EOF' #error "Expected installed Gecode package to enable MPFR" #endif #include -int main(void) { +int main() { Gecode::Float::Rounding rounding; return rounding.log_down(2.0) >= 0.0 ? 0 : 1; } @@ -172,7 +172,7 @@ target_link_libraries(consumer_f PRIVATE ${Gecode_LIBRARIES}) EOF cat > "$work/f/main.cpp" <<'EOF' #include -int main(void) { return Gecode::Support::Thread::npu() > 0 ? 0 : 1; } +int main() { return Gecode::Support::Thread::npu() > 0 ? 0 : 1; } EOF cat > "$work/g/CMakeLists.txt" <<'EOF' @@ -209,7 +209,7 @@ target_link_libraries(consumer_j PRIVATE ${Gecode_LIBRARIES}) EOF cat > "$work/j/main.cpp" <<'EOF' #include -int main(void) { return 0; } +int main() { return 0; } EOF cat > "$work/k/CMakeLists.txt" <<'EOF' @@ -228,7 +228,7 @@ target_link_libraries(consumer_k PRIVATE ${Gecode_LIBRARIES}) EOF cat > "$work/k/main.cpp" <<'EOF' #include -int main(void) { Gecode::Float::Rounding rounding; return rounding.sqrt_down(4.0) == 2.0 ? 0 : 1; } +int main() { Gecode::Float::Rounding rounding; return rounding.sqrt_down(4.0) == 2.0 ? 0 : 1; } EOF cat > "$work/l/CMakeLists.txt" <<'EOF' diff --git a/.github/ci/qt-gist-consumer-smoke.sh b/.github/ci/qt-gist-consumer-smoke.sh index fc4fc23fde..a3fc0368af 100644 --- a/.github/ci/qt-gist-consumer-smoke.sh +++ b/.github/ci/qt-gist-consumer-smoke.sh @@ -72,7 +72,7 @@ using FloatCompare = std::string (*)(const std::string&, Gecode::FloatVar, Gecod FloatCompare float_compare = &Gecode::Gist::Comparator::compare; #endif -int main(void) { +int main() { #ifdef GECODE_HAS_SET_VARS if (set_compare == nullptr) return 1; diff --git a/.github/ci/qt5-gist-consumer-smoke.sh b/.github/ci/qt5-gist-consumer-smoke.sh index bd3a3dcaa0..6ef2c04b5e 100644 --- a/.github/ci/qt5-gist-consumer-smoke.sh +++ b/.github/ci/qt5-gist-consumer-smoke.sh @@ -62,7 +62,7 @@ using FloatCompare = std::string (*)(const std::string&, Gecode::FloatVar, Gecod FloatCompare float_compare = &Gecode::Gist::Comparator::compare; #endif -int main(void) { +int main() { #ifdef GECODE_HAS_SET_VARS if (set_compare == nullptr) return 1; diff --git a/docs/code-style.md b/docs/code-style.md index 0e07d14a44..8d1dbea40c 100644 --- a/docs/code-style.md +++ b/docs/code-style.md @@ -119,6 +119,17 @@ All other conversions are explicit: `std::to_underlying` or `static_cast` for an array index, a bit position, a packed field, or an `int`-valued option, and `static_cast` back to the enum. +## Parameter lists and forceinline + +An empty parameter list is `()`, also in function pointer types and +`std::function` signatures. `(void)` is a C spelling and stays only in C +sources, where it means something different. +`modernize-redundant-void-arg` enforces the rule. A cast to `void` that discards +a value, such as `(void)new (p) T()`, is a different construct and stays. + +`forceinline` stays lowercase, although it is a macro, so that it reads like +`inline`. + ## Checking changes Put LLVM 22 tools on `PATH`, or set `CLANG_FORMAT` and `CLANG_TIDY` to their diff --git a/examples/all-interval.cpp b/examples/all-interval.cpp index 26fc92ef56..77c0a25c15 100644 --- a/examples/all-interval.cpp +++ b/examples/all-interval.cpp @@ -92,7 +92,7 @@ class AllInterval : public Script { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new AllInterval(*this); } /// Print solution diff --git a/examples/alpha.cpp b/examples/alpha.cpp index 827c16c0f3..87f5cf3696 100644 --- a/examples/alpha.cpp +++ b/examples/alpha.cpp @@ -107,7 +107,7 @@ class Alpha : public Script { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new Alpha(*this); } /// Print solution diff --git a/examples/archimedean-spiral.cpp b/examples/archimedean-spiral.cpp index aa91fbd0bc..ecbb255ba6 100644 --- a/examples/archimedean-spiral.cpp +++ b/examples/archimedean-spiral.cpp @@ -92,12 +92,12 @@ class ArchimedeanSpiral : public FloatMaximizeScript { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new ArchimedeanSpiral(*this); } /// Cost function FloatVar - cost(void) const override { + cost() const override { return f[0]; } /// Print solution coordinates diff --git a/examples/bacp.cpp b/examples/bacp.cpp index e7a547129a..bd90c80a85 100644 --- a/examples/bacp.cpp +++ b/examples/bacp.cpp @@ -214,12 +214,12 @@ class BACP : public IntMinimizeScript { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new BACP(*this); } /// Return solution cost IntVar - cost(void) const override { + cost() const override { return u; } /// Print solution diff --git a/examples/bibd.cpp b/examples/bibd.cpp index df844db4a6..c01caf59cb 100644 --- a/examples/bibd.cpp +++ b/examples/bibd.cpp @@ -48,7 +48,7 @@ class BIBDOptions : public Options { int b, r; ///< Derived parameters /// Derive additional parameters void - derive(void) { + derive() { b = (v * (v - 1) * lambda) / (k * (k - 1)); r = (lambda * (v - 1)) / (k - 1); } @@ -69,7 +69,7 @@ class BIBDOptions : public Options { } /// Print help message void - help(void) override { + help() override { Options::help(); std::cerr << "\t(unsigned int) default: " << v << '\n' << "\t\tparameter v" << '\n' @@ -161,7 +161,7 @@ class BIBD : public Script { /// Copy during cloning Space* - copy(void) override { + copy() override { return new BIBD(*this); } }; diff --git a/examples/bin-packing.cpp b/examples/bin-packing.cpp index a0c95f9bd9..cae930f42d 100644 --- a/examples/bin-packing.cpp +++ b/examples/bin-packing.cpp @@ -61,17 +61,17 @@ namespace { public: /// Whether a valid specification has been found bool - valid(void) const { + valid() const { return data != nullptr; } /// Return maximal capacity of a bin int - capacity(void) const { + capacity() const { return data[0]; } /// Return number of items int - items(void) const { + items() const { return data[1]; } /// Return size of item \a i @@ -91,7 +91,7 @@ namespace { } /// Compute lower bound int - clower(void) const { + clower() const { /* * The lower bound is due to: S. Martello, P. Toth. Lower bounds * and reduction procedures for the bin packing problem. @@ -136,7 +136,7 @@ namespace { } /// Compute upper bound int - cupper(void) const { + cupper() const { // Use a naive greedy algorithm const int c = capacity(), n = items(); @@ -185,7 +185,7 @@ namespace { } /// Return sum of all item sizes int - total(void) const { + total() const { int t = 0; for (int i = 0; i < items(); i++) t += size(i); @@ -193,12 +193,12 @@ namespace { } /// Return lower bound int - lower(void) const { + lower() const { return l; } /// Return upper bound int - upper(void) const { + upper() const { return u; } }; @@ -252,7 +252,7 @@ class CDBF : public Brancher { e << same[i]; } /// Destructor - ~Choice(void) override { + ~Choice() override { heap.free(same, n_same); } }; @@ -510,7 +510,7 @@ class BinPacking : public IntMinimizeScript { } /// Return cost IntVar - cost(void) const override { + cost() const override { return bins; } /// Constructor for cloning \a s @@ -521,7 +521,7 @@ class BinPacking : public IntMinimizeScript { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new BinPacking(*this); } /// Print solution diff --git a/examples/black-hole.cpp b/examples/black-hole.cpp index 38c3dd016f..39491e8598 100644 --- a/examples/black-hole.cpp +++ b/examples/black-hole.cpp @@ -285,7 +285,7 @@ class BlackHole : public Script { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new BlackHole(*this); } }; diff --git a/examples/car-sequencing.cpp b/examples/car-sequencing.cpp index 6436695ab1..1bf9b29647 100644 --- a/examples/car-sequencing.cpp +++ b/examples/car-sequencing.cpp @@ -70,7 +70,7 @@ namespace { } /// Get max stalls int - max_stalls(void) const { + max_stalls() const { return _max_stalls.value(); } }; @@ -404,7 +404,7 @@ class CarSequencing : public Script { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new CarSequencing(*this); } }; diff --git a/examples/cartesian-heart.cpp b/examples/cartesian-heart.cpp index 3c5db3894e..9bb9f016b7 100644 --- a/examples/cartesian-heart.cpp +++ b/examples/cartesian-heart.cpp @@ -82,7 +82,7 @@ class CartesianHeart : public Script { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new CartesianHeart(*this); } /// Add constraints to current model to get next solution (not too close) diff --git a/examples/colored-matrix.cpp b/examples/colored-matrix.cpp index b4c25de9f6..7fcecd4d4e 100644 --- a/examples/colored-matrix.cpp +++ b/examples/colored-matrix.cpp @@ -73,7 +73,7 @@ class ColoredMatrixOptions : public Options { /// Return height int - height(void) const { + height() const { if (_size.value() == 0U) return static_cast(_height.value()); else @@ -81,7 +81,7 @@ class ColoredMatrixOptions : public Options { } /// Return width int - width(void) const { + width() const { if (_size.value() == 0U) return static_cast(_width.value()); else @@ -89,27 +89,27 @@ class ColoredMatrixOptions : public Options { } /// Return number of colors int - colors(void) const { + colors() const { return static_cast(_colors.value()); } /// Return how to implement not all equals int - not_all_equal(void) const { + not_all_equal() const { return _not_all_equal.value(); } /// Return how to implement same or 0 int - same_or_0(void) const { + same_or_0() const { return _same_or_0.value(); } /// Return how to implement distinct except 0 int - distinct_except_0(void) const { + distinct_except_0() const { return _distinct_except_0.value(); } /// Return how to implement distinct except 0 int - no_monochrome_rectangle(void) const { + no_monochrome_rectangle() const { return _no_monochrome_rectangle.value(); } }; @@ -432,7 +432,7 @@ class ColoredMatrix : public IntMinimizeScript { /// Return cost IntVar - cost(void) const override { + cost() const override { return max_color; } @@ -460,7 +460,7 @@ class ColoredMatrix : public IntMinimizeScript { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new ColoredMatrix(*this); } }; diff --git a/examples/common-pattern.cpp b/examples/common-pattern.cpp index 961361601f..fd85dcbc59 100644 --- a/examples/common-pattern.cpp +++ b/examples/common-pattern.cpp @@ -55,7 +55,7 @@ class CommonPatternOptions : public Options { int threshold; public: - CommonPatternOptions(void) + CommonPatternOptions() : Options("CommonPattern"), _sequences("sequences", "comma-separated sequences over A..Z", "ABCBC,BABC,ABDC"), _file("file", "sequence database; one sequence per line", ""), _support("support", "minimum supporting sequences, as a percentage", "100"), @@ -85,7 +85,7 @@ class CommonPatternOptions : public Options { /// Validate external input before constructing a space void - read(void) { + read() { if (_min_length.value() < 1 || _min_length.value() > Int::Limits::max) throw std::invalid_argument("Minimum length must be a positive Gecode integer"); PatternMining::Sequences sequences; @@ -123,31 +123,31 @@ class CommonPatternOptions : public Options { } const PatternMining::Database& - database(void) const { + database() const { return *input; } const std::vector& - required(void) const { + required() const { return required_items; } int - support(void) const { + support() const { return threshold; } int - min_length(void) const { + min_length() const { return static_cast(_min_length.value()); } PatternMining::Format - format(void) const { + format() const { return static_cast(_format.value()); } bool - letters(void) const { + letters() const { return format() == PatternMining::Format::LETTERS; } PatternMining::Language - language(void) const { + language() const { const auto selected = static_cast(_language.value()); if (selected == PatternMining::Language::DEFAULT) return _motif.value() ? PatternMining::Language::MOTIF : PatternMining::Language::NONE; @@ -222,7 +222,7 @@ class CommonPattern : public IntMaximizeScript { } IntVar - cost(void) const override { + cost() const override { return pattern.length(); } @@ -232,7 +232,7 @@ class CommonPattern : public IntMaximizeScript { } Space* - copy(void) override { + copy() override { return new CommonPattern(*this); } diff --git a/examples/common-pattern.hh b/examples/common-pattern.hh index 3159166e06..4dfe749ca1 100644 --- a/examples/common-pattern.hh +++ b/examples/common-pattern.hh @@ -173,12 +173,12 @@ namespace PatternMining { } IntSet - domain(void) const { + domain() const { return IntSet(alphabet.begin(), alphabet.size()); } int - max_length(void) const { + max_length() const { int bound = 0; int start = 0; for (int end : ends) { @@ -261,7 +261,7 @@ namespace PatternMining { } int - support(void) const { + support() const { return size; } diff --git a/examples/crew.cpp b/examples/crew.cpp index cde919c25c..f4b8b0a9ab 100644 --- a/examples/crew.cpp +++ b/examples/crew.cpp @@ -169,7 +169,7 @@ class Crew : public Script { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new Crew(*this); } }; diff --git a/examples/crossword.cpp b/examples/crossword.cpp index dd101126d9..8b145295f8 100644 --- a/examples/crossword.cpp +++ b/examples/crossword.cpp @@ -269,7 +269,7 @@ class Crossword : public Script { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new Crossword(*this); } /// Print solution diff --git a/examples/crowded-chess.cpp b/examples/crowded-chess.cpp index 2470cdb1ab..7a991f4e8c 100644 --- a/examples/crowded-chess.cpp +++ b/examples/crowded-chess.cpp @@ -88,7 +88,7 @@ namespace { k.update(*this, s.k); } Space* - copy(void) override { + copy() override { return new Bishops(*this); } }; @@ -206,7 +206,7 @@ class CrowdedChess : public Script { /// Post knight-constraints void - knight_constraints(void) { + knight_constraints() { static const int kmoves[4][2] = {{-1, 2}, {1, 2}, {2, -1}, {2, 1}}; Matrix kb(knights, n, n); for (int x = n; x--;) @@ -332,7 +332,7 @@ class CrowdedChess : public Script { /// Copy during cloning Space* - copy(void) override { + copy() override { return new CrowdedChess(*this); } diff --git a/examples/descartes-folium.cpp b/examples/descartes-folium.cpp index 56288274e3..926ee89d03 100644 --- a/examples/descartes-folium.cpp +++ b/examples/descartes-folium.cpp @@ -95,12 +95,12 @@ class DescartesFolium : public FloatMaximizeScript { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new DescartesFolium(*this); } /// Cost function FloatVar - cost(void) const override { + cost() const override { return f[0]; } /// Print solution coordinates diff --git a/examples/dominating-queens.cpp b/examples/dominating-queens.cpp index 17a62a8a6b..43b5ed0d02 100644 --- a/examples/dominating-queens.cpp +++ b/examples/dominating-queens.cpp @@ -113,7 +113,7 @@ class DominatingQueens : public IntMinimizeScript { /// Return cost IntVar - cost(void) const override { + cost() const override { return q; } @@ -125,7 +125,7 @@ class DominatingQueens : public IntMinimizeScript { /// Perform copying during cloning Space* - copy(void) override { + copy() override { return new DominatingQueens(*this); } diff --git a/examples/domino.cpp b/examples/domino.cpp index 1601dcac25..47754fe5ee 100644 --- a/examples/domino.cpp +++ b/examples/domino.cpp @@ -200,7 +200,7 @@ class Domino : public Script { } /// Copy space during cloning Space* - copy(void) override { + copy() override { return new Domino(*this); } }; diff --git a/examples/donald.cpp b/examples/donald.cpp index 243e5ad111..ce83db27aa 100644 --- a/examples/donald.cpp +++ b/examples/donald.cpp @@ -95,7 +95,7 @@ class Donald : public Script { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new Donald(*this); } /// Print solution diff --git a/examples/efpa.cpp b/examples/efpa.cpp index 610ef58ea5..e76b308f32 100644 --- a/examples/efpa.cpp +++ b/examples/efpa.cpp @@ -76,33 +76,33 @@ class EFPAOptions : public Options { } /// Get v, number of sequences int - v(void) const { + v() const { return _v.value(); } /// Get q, number of symbols int - q(void) const { + q() const { return _q.value(); } /// Get lambda, sets of symbols per sequence int - l(void) const { + l() const { return _l.value(); } /// Get d, Hamming distance between sequences int - d(void) const { + d() const { return _d.value(); } /// Whether to use permutation constraints. Only active if d=4 bool - permutation(void) const { + permutation() const { return d() == 4 && _permutation.value(); } /// Whether to use symmetry breaking. bool - symmetry(void) const { + symmetry() const { return _symmetry.value(); } }; @@ -296,7 +296,7 @@ class EFPA : public Script { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new EFPA(*this); } }; diff --git a/examples/eq20.cpp b/examples/eq20.cpp index e45d0857e0..aa064d81c9 100644 --- a/examples/eq20.cpp +++ b/examples/eq20.cpp @@ -90,7 +90,7 @@ class Eq20 : public Script { } /// Perform copying during cloning Space* - copy(void) override { + copy() override { return new Eq20(*this); } /// Print solution diff --git a/examples/fifteen-puzzle.cpp b/examples/fifteen-puzzle.cpp index 3d0773d5cc..20148a04d6 100644 --- a/examples/fifteen-puzzle.cpp +++ b/examples/fifteen-puzzle.cpp @@ -55,7 +55,7 @@ class PuzzleOptions : public Options { enum { MODEL_OPEN, MODEL_FIXED }; enum { BRANCH_MIN, BRANCH_MANHATTAN }; enum { SEARCH_BAB, SEARCH_ASTAR, SEARCH_CABS }; - PuzzleOptions(void) + PuzzleOptions() : Options("FifteenPuzzle"), _scramble("scramble", "number of random slides from the goal", 12), _limit("limit", "maximum number of solution moves", 12) { add(_scramble); @@ -76,18 +76,18 @@ class PuzzleOptions : public Options { seed(1); } unsigned int - scramble(void) const { + scramble() const { return _scramble.value(); } int - limit(void) const { + limit() const { Int::Limits::check(16 * (static_cast(_limit.value()) + 1), "FifteenPuzzle::limit"); return static_cast(_limit.value()); } }; static Board -goal(void) { +goal() { return {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0}; } @@ -276,7 +276,7 @@ class OpenPuzzle : public Script { path.update(*this, s.path); } Space* - copy(void) override { + copy() override { return new OpenPuzzle(*this); } IntVarArgs @@ -287,14 +287,14 @@ class OpenPuzzle : public Script { return result; } int - depth(void) const { + depth() const { int i = 0; while (i + 1 < path.known_length() && path[i + 1].assigned()) i++; return i; } int - bound(void) const { + bound() const { const int g = depth(); const int h = manhattan(values(state(g))); return std::max(g + h, path.length().min() - 1); @@ -358,7 +358,7 @@ class FixedPuzzle : public Script { length.update(*this, s.length); } Space* - copy(void) override { + copy() override { return new FixedPuzzle(*this); } IntVarArgs @@ -369,14 +369,14 @@ class FixedPuzzle : public Script { return result; } int - depth(void) const { + depth() const { int i = 0; while (i + 1 < path.size() && path[i + 1].assigned()) i++; return i; } int - bound(void) const { + bound() const { const int g = depth(); const int h = manhattan(values(state(g))); return std::max(g + h, length.min() - 1); diff --git a/examples/golden-spiral.cpp b/examples/golden-spiral.cpp index 780d6e6a80..9771e78e50 100644 --- a/examples/golden-spiral.cpp +++ b/examples/golden-spiral.cpp @@ -100,12 +100,12 @@ class GoldenSpiral : public FloatMaximizeScript { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new GoldenSpiral(*this); } /// Cost function FloatVar - cost(void) const override { + cost() const override { return f[0]; } /// Print solution coordinates diff --git a/examples/golf.cpp b/examples/golf.cpp index 2deba902ba..f7db5f3027 100644 --- a/examples/golf.cpp +++ b/examples/golf.cpp @@ -48,7 +48,7 @@ class GolfOptions : public Options { Driver::IntOption _s; //< Number of players per group public: /// Constructor - GolfOptions(void) + GolfOptions() : Options("Golf"), _w("w", "number of weeks", 9), _g("g", "number of groups", 8), _s("s", "number of players per group", 4) { add(_w); @@ -57,17 +57,17 @@ class GolfOptions : public Options { } /// Return number of weeks int - w(void) const { + w() const { return _w.value(); } /// Return number of groups int - g(void) const { + g() const { return _g.value(); } /// Return number of players per group int - s(void) const { + s() const { return _s.value(); } }; @@ -219,7 +219,7 @@ class Golf : public Script { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new Golf(*this); } }; diff --git a/examples/golomb-ruler.cpp b/examples/golomb-ruler.cpp index 9188095bf9..a7dd82fff6 100644 --- a/examples/golomb-ruler.cpp +++ b/examples/golomb-ruler.cpp @@ -99,7 +99,7 @@ class GolombRuler : public IntMinimizeScript { /// Return cost IntVar - cost(void) const override { + cost() const override { return m[m.size() - 1]; } @@ -115,7 +115,7 @@ class GolombRuler : public IntMinimizeScript { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new GolombRuler(*this); } }; diff --git a/examples/graph-color.cpp b/examples/graph-color.cpp index e12da862cb..7c6b457117 100644 --- a/examples/graph-color.cpp +++ b/examples/graph-color.cpp @@ -320,7 +320,7 @@ class GraphColor : public IntMinimizeScript { } /// Cost function IntVar - cost(void) const override { + cost() const override { return m; } /// Constructor for cloning \a s @@ -330,7 +330,7 @@ class GraphColor : public IntMinimizeScript { } /// Copying during cloning Space* - copy(void) override { + copy() override { return new GraphColor(*this); } /// Print the solution diff --git a/examples/grocery.cpp b/examples/grocery.cpp index d976bc6c25..d42fb1fce4 100644 --- a/examples/grocery.cpp +++ b/examples/grocery.cpp @@ -85,7 +85,7 @@ class Grocery : public Script { /// Copy during cloning Space* - copy(void) override { + copy() override { return new Grocery(*this); } diff --git a/examples/hamming.cpp b/examples/hamming.cpp index 80dcaed803..cf8e21ecf0 100644 --- a/examples/hamming.cpp +++ b/examples/hamming.cpp @@ -63,17 +63,17 @@ class HammingOptions : public Options { /// Return number of bits unsigned int - bits(void) const { + bits() const { return _bits.value(); } /// Return minimum distance unsigned int - distance(void) const { + distance() const { return _distance.value(); } /// Return number of symbols unsigned int - size(void) const { + size() const { return _size.value(); } }; @@ -127,7 +127,7 @@ class Hamming : public Script { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new Hamming(*this); } }; diff --git a/examples/ind-set.cpp b/examples/ind-set.cpp index 098485fb43..b6de23b800 100644 --- a/examples/ind-set.cpp +++ b/examples/ind-set.cpp @@ -97,7 +97,7 @@ class IndSet : public IntMaximizeScript { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new IndSet(*this); } /// Print solution @@ -107,7 +107,7 @@ class IndSet : public IntMaximizeScript { } /// Return solution cost IntVar - cost(void) const override { + cost() const override { return k; } }; diff --git a/examples/job-shop.cpp b/examples/job-shop.cpp index 838d68fb97..878a31ee61 100644 --- a/examples/job-shop.cpp +++ b/examples/job-shop.cpp @@ -135,17 +135,17 @@ instances { public: /// Whether a valid specification has been found bool - valid(void) const { + valid() const { return data != nullptr; } /// Return number of jobs int - jobs(void) const { + jobs() const { return data[0]; } /// Return number of machines int - machines(void) const { + machines() const { return data[1]; } /// Return machine of step \a j in job \a i @@ -172,7 +172,7 @@ instances { } /// Compute lower bound int - clower(void) const { + clower() const { int l = 0; Region r; int* mach = r.alloc(machines()); @@ -192,7 +192,7 @@ instances { } /// Compute naive upper bound int - cupper(void) const { + cupper() const { int u = 0; for (int i = 0; i < jobs(); i++) for (int j = 0; j < machines(); j++) @@ -234,17 +234,17 @@ instances { } /// Return lower bound int - lower(void) const { + lower() const { return l; } /// Return upper bound int - upper(void) const { + upper() const { return u; } /// Return name const char* - name(void) const { + name() const { return n; } }; @@ -292,42 +292,42 @@ class JobShopOptions : public InstanceOptions { } /// Return whether to print schedule bool - verbose(void) const { + verbose() const { return _verbose.value(); } /// Return number of probes unsigned int - probes(void) const { + probes() const { return _probes.value(); } /// Return number of failures per probe unsigned int - fail_probe(void) const { + fail_probe() const { return _fail_probe.value(); } /// Return time-out for probe unsigned int - time_probe(void) const { + time_probe() const { return _time_probe.value(); } /// Return time-out for adjust unsigned int - time_adjust(void) const { + time_adjust() const { return _time_adjust.value(); } /// Return time-out for solve unsigned int - time_solve(void) const { + time_solve() const { return _time_solve.value(); } /// Return tie-breaking factor double - tbf(void) const { + tbf() const { return _tbf.value(); } /// Print help text for list of instances void - help(void) override { + help() override { InstanceOptions::help(); std::cerr << "\tAvailable instances:" << '\n' << "\t\t"; for (int i = 1; ::name[i] != nullptr; i++) { @@ -383,7 +383,7 @@ class JobShopBase : public IntMinimizeScript { } /// Do not overload machines void - post_no_overload(void) { + post_no_overload() { // Number of jobs and machines/steps int n = spec.jobs(), m = spec.machines(); @@ -408,7 +408,7 @@ class JobShopBase : public IntMinimizeScript { } /// Return cost IntVar - cost(void) const override { + cost() const override { return makespan; } /// Constructor for cloning \a s @@ -487,7 +487,7 @@ class JobShopProbe : public JobShopBase { JobShopProbe(JobShopProbe& s) : JobShopBase(s) {} /// Copy during cloning Space* - copy(void) override { + copy() override { return new JobShopProbe(*this); } }; @@ -648,7 +648,7 @@ class JobShopSolve : public JobShopBase { baction(s.baction), ichb(s.ichb), bchb(s.bchb), rnd(s.rnd) {} /// Copy during cloning Space* - copy(void) override { + copy() override { return new JobShopSolve(*this); } }; @@ -678,7 +678,7 @@ class FailTimeStop : public Search::Stop { return ts->stop(s, o); } /// Destructor - ~FailTimeStop(void) override { + ~FailTimeStop() override { delete fs; delete ts; } diff --git a/examples/kakuro.cpp b/examples/kakuro.cpp index e7b9b5d36e..36652ded2c 100644 --- a/examples/kakuro.cpp +++ b/examples/kakuro.cpp @@ -262,12 +262,12 @@ namespace { } /// Perform copying during cloning Space* - copy(void) override { + copy() override { return new DistinctLinear(*this); } /// Return a solution IntArgs - solution(void) const { + solution() const { IntArgs s(x.size()); for (int i = 0; i < x.size(); i++) s[i] = x[i].val(); @@ -305,7 +305,7 @@ namespace { Entry* cache; ///< Where all entries start public: /// Initialize cache as empty - Cache(void) : cache(nullptr) {} + Cache() : cache(nullptr) {} /// Return possibly cached Data for \a n distinct variables with sum \a c TupleSet get(int n, int c) { @@ -323,7 +323,7 @@ namespace { return cache->ts; } /// Delete cache entries - ~Cache(void) { + ~Cache() { Entry* e = cache; while (e != nullptr) { Entry* d = e; @@ -459,7 +459,7 @@ class Kakuro : public Script { } /// Perform copying during cloning Space* - copy(void) override { + copy() override { return new Kakuro(*this); } /// Print solution diff --git a/examples/knights.cpp b/examples/knights.cpp index dd4487d57f..65cb2c9627 100644 --- a/examples/knights.cpp +++ b/examples/knights.cpp @@ -287,7 +287,7 @@ class KnightsReified : public Knights { KnightsReified(KnightsReified& s) : Knights(s) {} /// Copy during cloning Space* - copy(void) override { + copy() override { return new KnightsReified(*this); } }; @@ -318,7 +318,7 @@ class KnightsCircuit : public Knights { KnightsCircuit(KnightsCircuit& s) : Knights(s) {} /// Copy during cloning Space* - copy(void) override { + copy() override { return new KnightsCircuit(*this); } }; @@ -342,7 +342,7 @@ class KnightsInspector : public Gist::Inspector { public: /// Constructor - KnightsInspector(void) : scene(nullptr), mw(nullptr) {} + KnightsInspector() : scene(nullptr), mw(nullptr) {} /// Inspect space \a s void inspect(const Space& s) override { @@ -380,7 +380,7 @@ class KnightsInspector : public Gist::Inspector { /// Set up main window void - initialize(void) { + initialize() { mw = new QMainWindow(); scene = new QGraphicsScene(); QGraphicsView* view = new QGraphicsView(scene); @@ -396,12 +396,12 @@ class KnightsInspector : public Gist::Inspector { /// Name of the inspector std::string - name(void) override { + name() override { return "Board"; } /// Finalize inspector void - finalize(void) override { + finalize() override { delete mw; mw = nullptr; } diff --git a/examples/langford-number.cpp b/examples/langford-number.cpp index 07f0e074fa..69ace7abdf 100644 --- a/examples/langford-number.cpp +++ b/examples/langford-number.cpp @@ -61,7 +61,7 @@ class LangfordNumberOptions : public Options { } /// Print help message void - help(void) override { + help() override { Options::help(); std::cerr << "\t(unsigned int) default: " << n << '\n' << "\t\tparameter n" << '\n' @@ -168,7 +168,7 @@ class LangfordNumber : public Script { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new LangfordNumber(*this); } }; diff --git a/examples/magic-sequence.cpp b/examples/magic-sequence.cpp index 65627ac33e..b12fb9ec85 100644 --- a/examples/magic-sequence.cpp +++ b/examples/magic-sequence.cpp @@ -90,7 +90,7 @@ class MagicSequence : public Script { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new MagicSequence(*this); } /// Print sequence diff --git a/examples/magic-square-partial.cpp b/examples/magic-square-partial.cpp index f21fced33a..e2be17f2b2 100644 --- a/examples/magic-square-partial.cpp +++ b/examples/magic-square-partial.cpp @@ -138,7 +138,7 @@ class MagicSquare : public Script { /// Copy during cloning Space* - copy(void) override { + copy() override { return new MagicSquare(*this); } /// Print solution diff --git a/examples/magic-square.cpp b/examples/magic-square.cpp index 9d10600cff..1de3beab4d 100644 --- a/examples/magic-square.cpp +++ b/examples/magic-square.cpp @@ -110,7 +110,7 @@ class MagicSquare : public Script { /// Copy during cloning Space* - copy(void) override { + copy() override { return new MagicSquare(*this); } /// Print solution diff --git a/examples/minesweeper.cpp b/examples/minesweeper.cpp index 5b7f2e95d2..ccc5f45d3b 100644 --- a/examples/minesweeper.cpp +++ b/examples/minesweeper.cpp @@ -136,7 +136,7 @@ class MineSweeper : public Script { } /// Copy space during cloning Space* - copy(void) override { + copy() override { return new MineSweeper(*this); } }; diff --git a/examples/money.cpp b/examples/money.cpp index 823ed987cb..2a37a6bce9 100644 --- a/examples/money.cpp +++ b/examples/money.cpp @@ -109,7 +109,7 @@ class Money : public Script { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new Money(*this); } }; diff --git a/examples/multi-bin-packing.cpp b/examples/multi-bin-packing.cpp index 5e60b43f8a..6d5edb9691 100644 --- a/examples/multi-bin-packing.cpp +++ b/examples/multi-bin-packing.cpp @@ -67,27 +67,27 @@ namespace { Spec(const char* s) : data(find(s)), n(s) {} /// Whether a valid specification has been found bool - valid(void) const { + valid() const { return data != nullptr; } /// Return dimension int - dimension(void) const { + dimension() const { return data[0]; } /// Return instance name const char* - iname(void) const { + iname() const { return n; } /// Return number of items int - items(void) const { + items() const { return data[1]; } /// Return number of bins int - bins(void) const { + bins() const { return data[2]; } /// Return item size for item \a i in dimension \a k @@ -203,7 +203,7 @@ class MultiBinPacking : public Script { } /// Perform copying during cloning Space* - copy(void) override { + copy() override { return new MultiBinPacking(*this); } /// Print solution diff --git a/examples/nonogram.cpp b/examples/nonogram.cpp index 47532b12db..388bf6b1bd 100644 --- a/examples/nonogram.cpp +++ b/examples/nonogram.cpp @@ -143,12 +143,12 @@ class Nonogram : public Script { /// Return width of board int - width(void) const { + width() const { return spec[0]; } /// Return height of board int - height(void) const { + height() const { return spec[1]; } @@ -244,7 +244,7 @@ class Nonogram : public Script { /// Copy space during cloning Space* - copy(void) override { + copy() override { return new Nonogram(*this); } diff --git a/examples/open-route.cpp b/examples/open-route.cpp index 14f5b5bfab..7a5f1a9a63 100644 --- a/examples/open-route.cpp +++ b/examples/open-route.cpp @@ -96,7 +96,7 @@ class OpenRoute : public Script { /// Perform copying during cloning Space* - copy(void) override { + copy() override { return new OpenRoute(*this); } diff --git a/examples/open-shop.cpp b/examples/open-shop.cpp index e14fe1741a..57b510b888 100644 --- a/examples/open-shop.cpp +++ b/examples/open-shop.cpp @@ -79,7 +79,7 @@ class OpenShop : public IntMinimizeScript { int p; //< Processing time /// Default constructor // NOLINTNEXTLINE(modernize-use-equals-default) - Task(void) {} + Task() {} /// Constructor Task(int j0, int m0, int p0) : j(j0), m(m0), p(p0) {} }; @@ -265,13 +265,13 @@ class OpenShop : public IntMinimizeScript { /// Perform copying during cloning Space* - copy(void) override { + copy() override { return new OpenShop(*this); } /// Minimize the makespan IntVar - cost(void) const override { + cost() const override { return makespan; } diff --git a/examples/ortho-latin.cpp b/examples/ortho-latin.cpp index 89baa02bd9..83966f8260 100644 --- a/examples/ortho-latin.cpp +++ b/examples/ortho-latin.cpp @@ -134,7 +134,7 @@ class OrthoLatinSquare : public Script { /// Copy during cloning Space* - copy(void) override { + copy() override { return new OrthoLatinSquare(*this); } /// Print solution diff --git a/examples/partition.cpp b/examples/partition.cpp index f9e32e8186..964d37774b 100644 --- a/examples/partition.cpp +++ b/examples/partition.cpp @@ -99,7 +99,7 @@ class Partition : public Script { } /// Copying during cloning Space* - copy(void) override { + copy() override { return new Partition(*this); } /// Print solution diff --git a/examples/pentominoes.cpp b/examples/pentominoes.cpp index 849eb7c58b..d1f0326410 100644 --- a/examples/pentominoes.cpp +++ b/examples/pentominoes.cpp @@ -442,7 +442,7 @@ class Pentominoes : public Script { /// Copy space during cloning Space* - copy(void) override { + copy() override { return new Pentominoes(*this); } diff --git a/examples/perfect-square.cpp b/examples/perfect-square.cpp index 0102864c94..c7e74f69ac 100644 --- a/examples/perfect-square.cpp +++ b/examples/perfect-square.cpp @@ -215,7 +215,7 @@ class PerfectSquare : public Script { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new PerfectSquare(*this); } /// Print solution diff --git a/examples/photo.cpp b/examples/photo.cpp index 72bee61b78..80d1f29b4b 100644 --- a/examples/photo.cpp +++ b/examples/photo.cpp @@ -51,12 +51,12 @@ class PhotoSpec { PhotoSpec(int i) : data(pi[i]) {} /// Return number of people int - people(void) const { + people() const { return data[0]; } /// Return number of preferences int - preferences(void) const { + preferences() const { return data[1]; } /// Access preference \a p with position \a i @@ -143,7 +143,7 @@ class Photo : public IntMinimizeScript { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new Photo(*this); } /// Print solution @@ -153,7 +153,7 @@ class Photo : public IntMinimizeScript { } /// Return solution cost IntVar - cost(void) const override { + cost() const override { return violations; } }; diff --git a/examples/qcp.cpp b/examples/qcp.cpp index f5b95fd83f..67ab5386b0 100644 --- a/examples/qcp.cpp +++ b/examples/qcp.cpp @@ -67,7 +67,7 @@ namespace { } /// Return tie-breaking factor double - tbf(void) const { + tbf() const { return _tbf.value(); } /// Set tie-breaking factor @@ -107,14 +107,14 @@ namespace { public: /// Whether a valid specification has been found bool - valid(void) const { + valid() const { return data != nullptr; } /// Initialize Spec(const char* s) : data(find(s)) {} /// Return problem size int - size(void) const { + size() const { return data[0]; } /// Whether field is pre-assigned @@ -240,7 +240,7 @@ class QCP : public Script { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new QCP(*this); } /// Print solution diff --git a/examples/queen-armies.cpp b/examples/queen-armies.cpp index 585641650c..d8d19df19e 100644 --- a/examples/queen-armies.cpp +++ b/examples/queen-armies.cpp @@ -119,12 +119,12 @@ class QueenArmies : public IntMaximizeScript { } /// Return copy during cloning Space* - copy(void) override { + copy() override { return new QueenArmies(*this); } /// Return solution cost IntVar - cost(void) const override { + cost() const override { return q; } /// Print solution diff --git a/examples/queens.cpp b/examples/queens.cpp index 3e8c00e51a..9f5479901b 100644 --- a/examples/queens.cpp +++ b/examples/queens.cpp @@ -98,7 +98,7 @@ class Queens : public Script { /// Perform copying during cloning Space* - copy(void) override { + copy() override { return new Queens(*this); } @@ -128,7 +128,7 @@ class QueensInspector : public Gist::Inspector { public: /// Constructor - QueensInspector(void) : scene(nullptr), mw(nullptr) {} + QueensInspector() : scene(nullptr), mw(nullptr) {} /// Inspect space \a s void inspect(const Space& s) override { @@ -159,7 +159,7 @@ class QueensInspector : public Gist::Inspector { /// Set up main window void - initialize(void) { + initialize() { mw = new QMainWindow(); scene = new QGraphicsScene(); QGraphicsView* view = new QGraphicsView(scene); @@ -175,12 +175,12 @@ class QueensInspector : public Gist::Inspector { /// Name of the inspector std::string - name(void) override { + name() override { return "Board"; } /// Finalize inspector void - finalize(void) override { + finalize() override { delete mw; mw = nullptr; } diff --git a/examples/radiotherapy.cpp b/examples/radiotherapy.cpp index d0a3f1110c..1b5f028635 100644 --- a/examples/radiotherapy.cpp +++ b/examples/radiotherapy.cpp @@ -182,13 +182,13 @@ class Radiotherapy : public IntMinimizeScript { /// Perform copying during cloning Space* - copy(void) override { + copy() override { return new Radiotherapy(*this); } /// Cost to be minimized IntVar - cost(void) const override { + cost() const override { return _cost; } diff --git a/examples/sat.cpp b/examples/sat.cpp index adcd2a3fa7..5acc11b8db 100644 --- a/examples/sat.cpp +++ b/examples/sat.cpp @@ -128,7 +128,7 @@ class Sat : public Script { /// Perform copying during cloning Space* - copy(void) override { + copy() override { return new Sat(*this); } diff --git a/examples/schurs-lemma.cpp b/examples/schurs-lemma.cpp index 0a6a3cff02..68d486966b 100644 --- a/examples/schurs-lemma.cpp +++ b/examples/schurs-lemma.cpp @@ -56,7 +56,7 @@ class SchurOptions : public Options { } /// Print help message void - help(void) override { + help() override { Options::help(); std::cerr << "\t(unsigned int) default: " << c << '\n' << "\t\tparameter c (number of boxes)" << '\n' @@ -111,7 +111,7 @@ class Schur : public Script { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new Schur(*this); } }; diff --git a/examples/scowl.hpp b/examples/scowl.hpp index 00d631d6e2..554b3db471 100644 --- a/examples/scowl.hpp +++ b/examples/scowl.hpp @@ -42,7 +42,7 @@ class FileSizeOptions : public Gecode::SizeOptions { /// Initialize with name \a s FileSizeOptions(const char* s); /// Return file name (nullptr if none given) - const char* file(void) const; + const char* file() const; }; /// A simple dictionary class @@ -63,7 +63,7 @@ class Dictionary { public: /// Initialize as empty dictionary - Dictionary(void); + Dictionary(); /** * \brief Perform actual initialization * @@ -72,9 +72,9 @@ class Dictionary { */ void init(const char* fn); /// Return maximal length of a word - int len(void) const; + int len() const; /// Return total number of words - int words(void) const; + int words() const; /// Return number of words with length \a l int words(int l) const; /// Return word number \a i with length \a l @@ -83,7 +83,7 @@ class Dictionary { template std::basic_ostream& print(std::basic_ostream& os) const; /// Destructor - ~Dictionary(void); + ~Dictionary(); }; /// Print statistics summary @@ -7744,11 +7744,11 @@ inline FileSizeOptions::FileSizeOptions(const char* s) add(_file); } inline const char* -FileSizeOptions::file(void) const { +FileSizeOptions::file() const { return _file.value(); } -inline Dictionary::Dictionary(void) : max_len(0), n_all_words(0), chunk(nullptr) { +inline Dictionary::Dictionary() : max_len(0), n_all_words(0), chunk(nullptr) { for (int i = 0; i < max_len; i++) { n_words[i] = 0; s_words[i] = nullptr; @@ -7872,11 +7872,11 @@ Dictionary::init(const char* fn) { } inline int -Dictionary::len(void) const { +Dictionary::len() const { return max_len; } inline int -Dictionary::words(void) const { +Dictionary::words() const { return n_all_words; } inline int @@ -7901,7 +7901,7 @@ operator<<(std::basic_ostream& os, const Dictionary& d) { return d.print(os); } -inline Dictionary::~Dictionary(void) { +inline Dictionary::~Dictionary() { if (chunk != nullptr) Gecode::heap.rfree(chunk); } diff --git a/examples/sports-league.cpp b/examples/sports-league.cpp index 3f125a2f5b..a9a3f52cb9 100644 --- a/examples/sports-league.cpp +++ b/examples/sports-league.cpp @@ -50,7 +50,7 @@ class Play { int a; ///< away team int g; ///< game number /// Default constructor - Play(void) : h(0), a(0), g(0) {} + Play() : h(0), a(0), g(0) {} }; /// Round robin schedule @@ -62,12 +62,12 @@ class RRS { Play* plays; /// Return number of weeks int - weeks(void) const { + weeks() const { return teams - 1; } /// Return number of periods int - periods(void) const { + periods() const { return teams / 2; } /// Game number for game between home team \a h and away team \a a @@ -152,7 +152,7 @@ class RRS { } } /// Delete schedule - ~RRS(void) { + ~RRS() { delete[] plays; } }; @@ -182,12 +182,12 @@ class SportsLeague : public Script { /// Return number of weeks int - weeks(void) const { + weeks() const { return teams - 1; } /// Return number of periods int - periods(void) const { + periods() const { return teams / 2; } /// Home team in period \a p and week \a w @@ -302,7 +302,7 @@ class SportsLeague : public Script { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new SportsLeague(*this); } /// Print solution diff --git a/examples/steel-mill.cpp b/examples/steel-mill.cpp index 2dd291947f..56d6a89619 100644 --- a/examples/steel-mill.cpp +++ b/examples/steel-mill.cpp @@ -85,48 +85,48 @@ class SteelMillOptions : public Options { _maxcapacity(csplib_maxcapacity), _loss(csplib_loss), _orders(&(csplib_orders[0])), _ncolors(csplib_ncolors), _norders(csplib_norders) {} /// Print help text - void help(void) override; + void help() override; /// Parse options from arguments \a argv (number is \a argc) bool parse(int& argc, char* argv[]); /// Return size unsigned int - size(void) const { + size() const { return _size; } /// Return capacities int* - capacities(void) const { + capacities() const { return _capacities; } /// Return number of capacities int - ncapacities(void) const { + ncapacities() const { return _ncapacities; } /// Return maximum of capacities int - max_capacity(void) const { + max_capacity() const { return _maxcapacity; } /// Return loss values int* - loss(void) const { + loss() const { return _loss; } /// Return orders order_t - orders(void) const { + orders() const { return _orders; } /// Return number of colors int - ncolors(void) const { + ncolors() const { return _ncolors; } /// Return number of orders int - norders(void) const { + norders() const { return _norders; } }; @@ -344,12 +344,12 @@ class SteelMill : public IntMinimizeScript { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new SteelMill(*this); } /// Return solution cost IntVar - cost(void) const override { + cost() const override { return total_cost; } @@ -491,7 +491,7 @@ main(int argc, char* argv[]) { } void -SteelMillOptions::help(void) { +SteelMillOptions::help() { Options::help(); std::cerr << "\t(string), optional" << '\n' << "\t\tBenchmark to load." << '\n' diff --git a/examples/steiner.cpp b/examples/steiner.cpp index ea41ffc782..1637fa399c 100644 --- a/examples/steiner.cpp +++ b/examples/steiner.cpp @@ -138,7 +138,7 @@ class Steiner : public Script { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new Steiner(*this); } }; diff --git a/examples/sudoku-advanced.cpp b/examples/sudoku-advanced.cpp index 2e6f3e5fa5..db68f9c665 100644 --- a/examples/sudoku-advanced.cpp +++ b/examples/sudoku-advanced.cpp @@ -179,7 +179,7 @@ class SudokuInt : virtual public Sudoku { /// Perform copying during cloning Space* - copy(void) override { + copy() override { return new SudokuInt(*this); } @@ -343,7 +343,7 @@ class SudokuSet : virtual public Sudoku { /// Perform copying during cloning Space* - copy(void) override { + copy() override { return new SudokuSet(*this); } @@ -402,7 +402,7 @@ class SudokuMixed : public SudokuInt, public SudokuSet { /// Perform copying during cloning Space* - copy(void) override { + copy() override { return new SudokuMixed(*this); } diff --git a/examples/sudoku-instances.hh b/examples/sudoku-instances.hh index 950554c381..f783f870f9 100644 --- a/examples/sudoku-instances.hh +++ b/examples/sudoku-instances.hh @@ -1852,7 +1852,7 @@ instances { } /// Whether an instance was found bool - valid(void) const { + valid() const { return nn > 0; } }; diff --git a/examples/sudoku.cpp b/examples/sudoku.cpp index 457d003020..4cb1cc0763 100644 --- a/examples/sudoku.cpp +++ b/examples/sudoku.cpp @@ -102,7 +102,7 @@ class Sudoku : public Script { /// Perform copying during cloning Space* - copy(void) override { + copy() override { return new Sudoku(*this); } diff --git a/examples/tsp.cpp b/examples/tsp.cpp index 559001cc5b..8c74a5d13a 100644 --- a/examples/tsp.cpp +++ b/examples/tsp.cpp @@ -140,32 +140,32 @@ namespace { const int* _d; ///< Distances public: /// Initialize as invalid problem instance - Problem(void); + Problem(); /// Initialize problem instance Problem(const int n, const int* d); /// Initialize problem instance with distances \a d read from a file Problem(const int n, const IntArgs& d); /// Whether the problem instance is valid - bool valid(void) const; + bool valid() const; /// Return size of instance - int size(void) const; + int size() const; /// Return distance between node \a i and \a j int d(int i, int j) const; /// Return distances - const int* d(void) const; + const int* d() const; /// Return estimate for maximal cost of a path - int max(void) const; + int max() const; }; - inline Problem::Problem(void) : _n(0), _d(nullptr) {} + inline Problem::Problem() : _n(0), _d(nullptr) {} inline Problem::Problem(const int n, const int* d) : _n(n), _d(d) {} inline Problem::Problem(const int n, const IntArgs& d) : _n(n), _s(d), _d(&_s[0]) {} inline bool - Problem::valid(void) const { + Problem::valid() const { return _n > 0; } inline int - Problem::size(void) const { + Problem::size() const { return _n; } inline int @@ -173,11 +173,11 @@ namespace { return _d[i * _n + j]; } inline const int* - Problem::d(void) const { + Problem::d() const { return _d; } inline int - Problem::max(void) const { + Problem::max() const { int m = 0; for (int i = 0; i < _n * _n; i++) m = std::max(m, _d[i]); @@ -382,7 +382,7 @@ class TSP : public IntMinimizeScript { } /// Return solution cost IntVar - cost(void) const override { + cost() const override { return total; } /// Constructor for cloning \a s @@ -392,7 +392,7 @@ class TSP : public IntMinimizeScript { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new TSP(*this); } /// Print solution diff --git a/examples/tsptw.cpp b/examples/tsptw.cpp index 8a0436332e..bb004afd82 100644 --- a/examples/tsptw.cpp +++ b/examples/tsptw.cpp @@ -158,7 +158,7 @@ check nodes[0].ready == 0 "the depot (node 0) must open at time 0" } /// Whether an instance was found bool - valid(void) const { + valid() const { return n > 0; } }; @@ -252,12 +252,12 @@ class TSPTW : public IntMinimizeScript { } /// Return cost IntVar - cost(void) const override { + cost() const override { return total; } /// Return the number of positions assigned from the start int - prefix(void) const { + prefix() const { int k = 0; while ((k < x.size()) && x[k].assigned()) k++; @@ -299,7 +299,7 @@ class TSPTW : public IntMinimizeScript { } /// Return a key for dominance std::size_t - key(void) const { + key() const { int k = prefix(); Region r; unsigned int n = static_cast(p.n); @@ -322,7 +322,7 @@ class TSPTW : public IntMinimizeScript { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new TSPTW(*this); } /// Print solution diff --git a/examples/warehouses.cpp b/examples/warehouses.cpp index 009d19fe18..6ad52ce074 100644 --- a/examples/warehouses.cpp +++ b/examples/warehouses.cpp @@ -145,7 +145,7 @@ class SumCostWarehouses : public Warehouses { } /// Return solution cost IntVar - cost(void) const override { + cost() const override { return c_total; } /// Constructor for cloning \a s @@ -154,7 +154,7 @@ class SumCostWarehouses : public Warehouses { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new SumCostWarehouses(*this); } /// Print solution @@ -185,7 +185,7 @@ class LexCostWarehouses : public Warehouses { } /// Return solution cost IntVarArgs - cost(void) const override { + cost() const override { return {c_open, c_stores}; } /// Constructor for cloning \a s @@ -195,7 +195,7 @@ class LexCostWarehouses : public Warehouses { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new LexCostWarehouses(*this); } /// Print solution diff --git a/examples/word-square.cpp b/examples/word-square.cpp index 92053ac6c0..0eaced9b33 100644 --- a/examples/word-square.cpp +++ b/examples/word-square.cpp @@ -116,7 +116,7 @@ class WordSquare : public Script { } /// Copy during cloning Space* - copy(void) override { + copy() override { return new WordSquare(*this); } /// Print solution diff --git a/gecode/driver.hh b/gecode/driver.hh index 7e9774187f..d6b0fca0db 100644 --- a/gecode/driver.hh +++ b/gecode/driver.hh @@ -130,9 +130,9 @@ namespace Gecode { /// Parse option at first position and return number of parsed arguments virtual int parse(int argc, char* argv[]) = 0; /// Print help text - virtual void help(void) = 0; + virtual void help() = 0; /// Destructor - virtual ~BaseOption(void); + virtual ~BaseOption(); /// Create heap-allocated copy of string \a s static char* strdup(const char* s); /// Create heap-allocated copy of string \a s with hyphen added @@ -151,9 +151,9 @@ namespace Gecode { RandomOption(const char* o, const char* e, uint64_t v); void value(uint64_t v); /// Construct an independent generator at the configured initial state. - Rnd rnd(void) const; + Rnd rnd() const; int parse(int argc, char* argv[]) override; - void help(void) override; + void help() override; }; /** @@ -169,13 +169,13 @@ namespace Gecode { /// Set default value to \a v void value(const char* v); /// Return current option value - const char* value(void) const; + const char* value() const; /// Parse option at first position and return number of parsed arguments int parse(int argc, char* argv[]) override; /// Print help text - void help(void) override; + void help() override; /// Destructor - ~StringValueOption(void) override; + ~StringValueOption() override; }; /** @@ -214,15 +214,15 @@ namespace Gecode { /// Set default value to \a v void value(int v); /// Return current option value - int value(void) const; + int value() const; /// Add option value for value \a v, string \a o, and help text \a h void add(int v, const char* o, const char* h = nullptr); /// Parse option at first position and return number of parsed arguments int parse(int argc, char* argv[]) override; /// Print help text - void help(void) override; + void help() override; /// Destructor - ~StringOption(void) override; + ~StringOption() override; }; /** @@ -238,11 +238,11 @@ namespace Gecode { /// Set default value to \a v void value(int v); /// Return current option value - int value(void) const; + int value() const; /// Parse option at first position and return number of parsed arguments int parse(int argc, char* argv[]) override; /// Print help text - void help(void) override; + void help() override; }; /** @@ -258,11 +258,11 @@ namespace Gecode { /// Set default value to \a v void value(unsigned int v); /// Return current option value - unsigned int value(void) const; + unsigned int value() const; /// Parse option at first position and return number of parsed arguments int parse(int argc, char* argv[]) override; /// Print help text - void help(void) override; + void help() override; }; /** @@ -278,11 +278,11 @@ namespace Gecode { /// Set default value to \a v void value(unsigned long long int v); /// Return current option value - unsigned long long int value(void) const; + unsigned long long int value() const; /// Parse option at first position and return number of parsed arguments int parse(int argc, char* argv[]) override; /// Print help text - void help(void) override; + void help() override; }; /** @@ -298,11 +298,11 @@ namespace Gecode { /// Set default value to \a v void value(double v); /// Return current option value - double value(void) const; + double value() const; /// Parse option at first position and return number of parsed arguments int parse(int argc, char* argv[]) override; /// Print help text - void help(void) override; + void help() override; }; /** @@ -318,11 +318,11 @@ namespace Gecode { /// Set default value to \a v void value(bool v); /// Return current option value - bool value(void) const; + bool value() const; /// Parse option at first position and return number of parsed arguments int parse(int argc, char* argv[]) override; /// Print help text - void help(void) override; + void help() override; }; /** @@ -338,11 +338,11 @@ namespace Gecode { /// Set default level to \a l void value(IntPropLevel l); /// Return current option value - IntPropLevel value(void) const; + IntPropLevel value() const; /// Parse option at first position and return number of parsed arguments int parse(int argc, char* argv[]) override; /// Print help text - void help(void) override; + void help() override; }; /** @@ -358,11 +358,11 @@ namespace Gecode { /// Set default trace flags to \a f void value(int f); /// Return current option value - int value(void) const; + int value() const; /// Parse option at first position and return number of parsed arguments int parse(int argc, char* argv[]) override; /// Print help text - void help(void) override; + void help() override; }; /** @@ -379,15 +379,15 @@ namespace Gecode { /// Set default port to \a p void port(unsigned int p); /// Return current port - unsigned int port(void) const; + unsigned int port() const; /// Set default execution ID to \a i void execution_id(int i); /// Return current execution ID - int execution_id(void) const; + int execution_id() const; /// Parse option at first position and return number of parsed arguments int parse(int argc, char* argv[]) override; /// Print help text - void help(void) override; + void help() override; }; } // namespace Driver @@ -404,7 +404,7 @@ namespace Gecode { /// Initialize options for script with name \a s BaseOptions(const char* s); /// Print help text - virtual void help(void); + virtual void help(); /// Add new option \a o void add(Driver::BaseOption& o); @@ -439,12 +439,12 @@ namespace Gecode { void parse_permissive(int& argc, char* argv[]); /// Return name of script - const char* name(void) const; + const char* name() const; /// Set name of script void name(const char*); /// Destructor - virtual ~BaseOptions(void); + virtual ~BaseOptions(); }; /** @@ -519,48 +519,48 @@ namespace Gecode { /// Add model option value for value \a v, string \a o, and help \a h void model(int v, const char* o, const char* h = nullptr); /// Return model value - int model(void) const; + int model() const; /// Set default symmetry value void symmetry(int v); /// Add symmetry option value for value \a v, string \a o, and help \a h void symmetry(int v, const char* o, const char* h = nullptr); /// Return symmetry value - int symmetry(void) const; + int symmetry() const; /// Set default propagation value void propagation(int v); /// Add propagation option value for value \a v, string \a o, and help \a h void propagation(int v, const char* o, const char* h = nullptr); /// Return propagation value - int propagation(void) const; + int propagation() const; /// Set default integer propagation level void ipl(IntPropLevel i); /// Return integer propagation level - IntPropLevel ipl(void) const; + IntPropLevel ipl() const; /// Set default branching value void branching(int v); /// Add branching option value for value \a v, string \a o, and help \a h void branching(int v, const char* o, const char* h = nullptr); /// Return branching value - int branching(void) const; + int branching() const; /// Set default decay factor void decay(double d); /// Return decay factor - double decay(void) const; + double decay() const; /// Set default seed value void seed(uint64_t s); /// Independent generator initialized from the seed or full-state option - Rnd rnd(void) const; + Rnd rnd() const; /// Set default step value void step(double s); /// Return step value - double step(void) const; + double step() const; //@} /// \name Search options @@ -570,97 +570,97 @@ namespace Gecode { /// Add search option value for value \a v, string \a o, and help \a h void search(int v, const char* o, const char* h = nullptr); /// Return search value - int search(void) const; + int search() const; /// Set default number of solutions to search for void solutions(unsigned long long int n); /// Return number of solutions to search for - unsigned long long int solutions(void) const; + unsigned long long int solutions() const; /// Set number of parallel threads void threads(double n); /// Return number of parallel threads - double threads(void) const; + double threads() const; /// Set default copy recomputation distance void c_d(unsigned int d); /// Return copy recomputation distance - unsigned int c_d(void) const; + unsigned int c_d() const; /// Set default adaptive recomputation distance void a_d(unsigned int d); /// Return adaptive recomputation distance - unsigned int a_d(void) const; + unsigned int a_d() const; /// Set default discrepancy limit for LDS void d_l(unsigned int d); /// Return discrepancy limit for LDS - unsigned int d_l(void) const; + unsigned int d_l() const; /// Set default node cutoff void node(unsigned long long int n); /// Return node cutoff - unsigned long long int node(void) const; + unsigned long long int node() const; /// Set default failure cutoff void fail(unsigned long long int n); /// Return failure cutoff - unsigned long long int fail(void) const; + unsigned long long int fail() const; /// Set default time cutoff void time(double t); /// Return time cutoff - double time(void) const; + double time() const; /// Set default number of assets in a portfolio void assets(unsigned int n); /// Return slice size in a portfolio - unsigned int assets(void) const; + unsigned int assets() const; /// Set default slice size in a portfolio void slice(unsigned int n); /// Return slice size in a portfolio - unsigned int slice(void) const; + unsigned int slice() const; /// Set default restart mode void restart(RestartMode r); /// Return restart mode - RestartMode restart(void) const; + RestartMode restart() const; /// Set default restart base void restart_base(double base); /// Return restart base - double restart_base(void) const; + double restart_base() const; /// Set default restart scale factor void restart_scale(unsigned int scale); /// Return restart scale factor - unsigned int restart_scale(void) const; + unsigned int restart_scale() const; /// Set default restart cutoff void restart_limit(unsigned long long int n); /// Return restart cutoff - unsigned long long int restart_limit(void) const; + unsigned long long int restart_limit() const; /// Set default nogoods posting behavior void nogoods(bool b); /// Return whether nogoods are used - bool nogoods(void) const; + bool nogoods() const; /// Set default nogoods depth limit void nogoods_limit(unsigned int l); /// Return depth limit for nogoods - unsigned int nogoods_limit(void) const; + unsigned int nogoods_limit() const; /// Set default relax probability void relax(double d); /// Return default relax probability - double relax(void) const; + double relax() const; /// Set default interrupt behavior void interrupt(bool b); /// Return interrupt behavior - bool interrupt(void) const; + bool interrupt() const; //@} /// \name Execution options @@ -668,47 +668,47 @@ namespace Gecode { /// Set default mode void mode(ScriptMode em); /// Return mode - ScriptMode mode(void) const; + ScriptMode mode() const; /// Set default number of samples void samples(unsigned int s); /// Return number of samples - unsigned int samples(void) const; + unsigned int samples() const; /// Set default number of iterations void iterations(unsigned int i); /// Return number of iterations - unsigned int iterations(void) const; + unsigned int iterations() const; /// Set whether to print only last solution found void print_last(bool p); /// Return whether to print only last solution found - bool print_last(void) const; + bool print_last() const; /// Set default output file name for solutions void out_file(const char* f); /// Get file name for solutions - const char* out_file(void) const; + const char* out_file() const; /// Set default output file name for Gecode stats void log_file(const char* f); /// Get file name for Gecode stats - const char* log_file(void) const; + const char* log_file() const; /// Set trace flags void trace(int f); /// Return trace flags - int trace(void) const; + int trace() const; #ifdef GECODE_HAS_CPPROFILER /// Set profiler execution identifier void profiler_id(int i); /// Return profiler execution id - int profiler_id(void) const; + int profiler_id() const; /// Set profiler port void profiler_port(unsigned int p); /// Return profiler execution id - unsigned int profiler_port(void) const; + unsigned int profiler_port() const; #endif //@} @@ -718,7 +718,7 @@ namespace Gecode { /// Set guidance for heuristic search (not copied) void guidance(const Search::HeuristicGuidance* g); /// Return guidance for heuristic search - const Search::HeuristicGuidance* guidance(void) const; + const Search::HeuristicGuidance* guidance() const; //@} #endif @@ -745,7 +745,7 @@ namespace Gecode { public: /// Constructor - I_(void); + I_(); /// Add inspector that reacts on node double clicks void click(Gist::Inspector* i); /// Add inspector that reacts on each new solution that is found @@ -782,7 +782,7 @@ namespace Gecode { /// Initialize options for script with name \a s SizeOptions(const char* s); /// Print help text - void help(void) override; + void help() override; /// Parse options from arguments \a argv (number is \a argc) void parse(int& argc, char* argv[]); /** @@ -802,7 +802,7 @@ namespace Gecode { /// Set default size void size(unsigned int s); /// Return size - unsigned int size(void) const; + unsigned int size() const; }; /** @@ -845,7 +845,7 @@ namespace Gecode { Driver::StringListOption _param; ///< Parameters for the spec mutable std::unique_ptr _data; ///< Data read, or null /// Forget the data read - void forget(void) const; + void forget() const; public: /// Initialize options for script with name \a s @@ -859,7 +859,7 @@ namespace Gecode { */ InstanceOptions(const char* s, const char* spec); /// Print help text - void help(void) override; + void help() override; /// Parse options from arguments \a argv (number is \a argc) void parse(int& argc, char* argv[]); /** @@ -880,7 +880,7 @@ namespace Gecode { /// Set default instance name void instance(const char* s); /// Return instance name - const char* instance(void) const; + const char* instance() const; /** * \brief Test whether the instance is the number of a built-in instance * @@ -895,17 +895,17 @@ namespace Gecode { /// Set the reader spec for instance files void spec(const char* s); /// Return the reader spec for instance files (may be null) - const char* spec(void) const; + const char* spec() const; /// Set the file with a reader spec that replaces spec() void spec_file(const char* f); /// Return the file with a reader spec (may be null) - const char* spec_file(void) const; + const char* spec_file() const; /// Set the spec parameters (\c name=value, separated by commas) void param(const char* p); /// Return the spec parameters (may be null) - const char* param(void) const; + const char* param() const; /// Test whether the instance names a readable file - bool is_file(void) const; + bool is_file() const; /** * \brief Read the instance file * @@ -913,9 +913,9 @@ namespace Gecode { * Instance::Error if there is no spec, if the file cannot be read, or * if it does not match the spec. */ - Instance::Data data(void) const; + Instance::Data data() const; /// Destructor - ~InstanceOptions(void) override; + ~InstanceOptions() override; }; } // namespace Gecode diff --git a/gecode/driver/options.cpp b/gecode/driver/options.cpp index 0e05adf8d3..65cf47baef 100644 --- a/gecode/driver/options.cpp +++ b/gecode/driver/options.cpp @@ -103,7 +103,7 @@ namespace Gecode { BaseOption::BaseOption(const char* o, const char* e) : eopt(strdup(o)), iopt(duplicate_option_flag(o)), exp(strdup(e)) {} - BaseOption::~BaseOption(void) { + BaseOption::~BaseOption() { strdel(eopt); strdel(iopt); strdel(exp); @@ -118,7 +118,7 @@ namespace Gecode { seed_given = state_given = false; } Rnd - RandomOption::rnd(void) const { + RandomOption::rnd() const { return initial; } int @@ -161,7 +161,7 @@ namespace Gecode { return 2; } void - RandomOption::help(void) { + RandomOption::help() { std::cerr << "\t" << iopt << " (64-bit decimal/hex seed, time, hw)\n" << "\t\t" << exp << "\n" << "\t-state (complete " << Support::RandomGenerator::name() << " state; mutually exclusive with " @@ -186,12 +186,12 @@ namespace Gecode { return 0; } void - StringValueOption::help(void) { + StringValueOption::help() { std::cerr << '\t' << iopt << " (string) default: " << ((cur == nullptr) ? "NONE" : cur) << '\n' << "\t\t" << exp << '\n' << std::flush; } - StringValueOption::~StringValueOption(void) { + StringValueOption::~StringValueOption() { strdel(cur); } @@ -239,7 +239,7 @@ namespace Gecode { return 0; } void - StringOption::help(void) { + StringOption::help() { if (fst == nullptr) return; std::cerr << '\t' << iopt << " ("; @@ -258,7 +258,7 @@ namespace Gecode { std::cerr << "\t\t " << v->opt << ": " << v->help << '\n' << std::flush; } - StringOption::~StringOption(void) { + StringOption::~StringOption() { Value* v = fst; while (v != nullptr) { strdel(v->opt); @@ -279,7 +279,7 @@ namespace Gecode { } void - IntOption::help(void) { + IntOption::help() { std::cerr << '\t' << iopt << " (int) default: " << cur << '\n' << "\t\t" << exp << '\n' << std::flush; } @@ -293,7 +293,7 @@ namespace Gecode { } void - UnsignedIntOption::help(void) { + UnsignedIntOption::help() { std::cerr << '\t' << iopt << " (unsigned int) default: " << cur << '\n' << "\t\t" << exp << '\n' << std::flush; @@ -309,7 +309,7 @@ namespace Gecode { } void - UnsignedLongLongIntOption::help(void) { + UnsignedLongLongIntOption::help() { std::cerr << '\t' << iopt << " (unsigned long long int) default: " << cur << '\n' << "\t\t" << exp << '\n' << std::flush; @@ -325,7 +325,7 @@ namespace Gecode { } void - DoubleOption::help(void) { + DoubleOption::help() { using namespace std; cerr << '\t' << iopt << " (double) default: " << cur << '\n' << "\t\t" << exp << '\n' << std::flush; } @@ -363,7 +363,7 @@ namespace Gecode { } void - BoolOption::help(void) { + BoolOption::help() { using namespace std; cerr << '\t' << iopt << " (optional: false, 0, true, 1) default: " << (cur ? "true" : "false") << '\n' << "\t\t" << exp << '\n' @@ -422,7 +422,7 @@ namespace Gecode { } void - IplOption::help(void) { + IplOption::help() { using namespace std; cerr << '\t' << iopt << " (def,val,bnd,dom,basic,advanced,full)" << '\n' << "\t\tdefault: "; switch (vbd(cur)) { @@ -511,7 +511,7 @@ namespace Gecode { } void - TraceOption::help(void) { + TraceOption::help() { using namespace std; cerr << '\t' << iopt << " (init,prune,fix,fail,done,propagate,commit,post,none,all,variable,general)" << " default: "; @@ -590,7 +590,7 @@ namespace Gecode { } void - ProfilerOption::help(void) { + ProfilerOption::help() { std::cerr << '\t' << iopt << " (unsigned int,int) default: " << cur_port << "," << cur_execution_id << '\n' << "\t\t" << exp << '\n' << std::flush; @@ -617,7 +617,7 @@ namespace Gecode { } void - BaseOptions::help(void) { + BaseOptions::help() { std::cerr << "Gecode configuration information:" << '\n' << " - Version: " << GECODE_VERSION << '\n' << " - Variable types: "; @@ -708,7 +708,7 @@ namespace Gecode { unrecognised(*this, argv[1]); } - BaseOptions::~BaseOptions(void) { + BaseOptions::~BaseOptions() { Driver::BaseOption::strdel(_name); } @@ -815,7 +815,7 @@ namespace Gecode { SizeOptions::SizeOptions(const char* e) : Options(e), _size(0) {} void - SizeOptions::help(void) { + SizeOptions::help() { Options::help(); std::cerr << "\t(unsigned int) default: " << size() << '\n' << "\t\twhich version/size for script" << '\n' @@ -864,7 +864,7 @@ namespace Gecode { } void - InstanceOptions::forget(void) const { + InstanceOptions::forget() const { _data.reset(); } @@ -895,7 +895,7 @@ namespace Gecode { } void - InstanceOptions::help(void) { + InstanceOptions::help() { Options::help(); std::cerr << "\t(string) default: " << ((instance() == nullptr) ? "NONE" : instance()) << '\n' << "\t\twhich instance for script (name or file)" << '\n' @@ -952,7 +952,7 @@ namespace Gecode { } bool - InstanceOptions::is_file(void) const { + InstanceOptions::is_file() const { if (instance() == nullptr) return false; // Directories can be opened on some systems, but not read @@ -963,7 +963,7 @@ namespace Gecode { } Instance::Data - InstanceOptions::data(void) const { + InstanceOptions::data() const { if (_data) return *_data; if (instance() == nullptr) @@ -982,7 +982,7 @@ namespace Gecode { return *_data; } - InstanceOptions::~InstanceOptions(void) { + InstanceOptions::~InstanceOptions() { Driver::BaseOption::strdel(_inst); Driver::BaseOption::strdel(_spec); } diff --git a/gecode/driver/options.hpp b/gecode/driver/options.hpp index 81494b30b9..cf2d01bc45 100644 --- a/gecode/driver/options.hpp +++ b/gecode/driver/options.hpp @@ -42,7 +42,7 @@ namespace Gecode { * */ inline const char* - StringValueOption::value(void) const { + StringValueOption::value() const { return cur; } @@ -57,7 +57,7 @@ namespace Gecode { cur = v; } inline int - StringOption::value(void) const { + StringOption::value() const { return cur; } @@ -71,7 +71,7 @@ namespace Gecode { cur = v; } inline int - IntOption::value(void) const { + IntOption::value() const { return cur; } @@ -86,7 +86,7 @@ namespace Gecode { cur = v; } inline unsigned int - UnsignedIntOption::value(void) const { + UnsignedIntOption::value() const { return cur; } @@ -102,7 +102,7 @@ namespace Gecode { cur = v; } inline unsigned long long int - UnsignedLongLongIntOption::value(void) const { + UnsignedLongLongIntOption::value() const { return cur; } @@ -116,7 +116,7 @@ namespace Gecode { cur = v; } inline double - DoubleOption::value(void) const { + DoubleOption::value() const { return cur; } @@ -130,7 +130,7 @@ namespace Gecode { cur = v; } inline bool - BoolOption::value(void) const { + BoolOption::value() const { return cur; } @@ -143,7 +143,7 @@ namespace Gecode { cur = ipl; } inline IntPropLevel - IplOption::value(void) const { + IplOption::value() const { return cur; } @@ -156,7 +156,7 @@ namespace Gecode { cur = f; } inline int - TraceOption::value(void) const { + TraceOption::value() const { return cur; } @@ -171,7 +171,7 @@ namespace Gecode { cur_port = p; } inline unsigned int - ProfilerOption::port(void) const { + ProfilerOption::port() const { return cur_port; } inline void @@ -179,7 +179,7 @@ namespace Gecode { cur_execution_id = i; } inline int - ProfilerOption::execution_id(void) const { + ProfilerOption::execution_id() const { return cur_execution_id; } @@ -199,7 +199,7 @@ namespace Gecode { } inline const char* - BaseOptions::name(void) const { + BaseOptions::name() const { return _name; } @@ -216,7 +216,7 @@ namespace Gecode { _model.add(v, o, h); } inline int - Options::model(void) const { + Options::model() const { return _model.value(); } @@ -229,7 +229,7 @@ namespace Gecode { _symmetry.add(v, o, h); } inline int - Options::symmetry(void) const { + Options::symmetry() const { return _symmetry.value(); } @@ -242,7 +242,7 @@ namespace Gecode { _propagation.add(v, o, h); } inline int - Options::propagation(void) const { + Options::propagation() const { return _propagation.value(); } @@ -251,7 +251,7 @@ namespace Gecode { _ipl.value(i); } inline IntPropLevel - Options::ipl(void) const { + Options::ipl() const { return _ipl.value(); } @@ -264,7 +264,7 @@ namespace Gecode { _branching.add(v, o, h); } inline int - Options::branching(void) const { + Options::branching() const { return _branching.value(); } @@ -273,7 +273,7 @@ namespace Gecode { _decay.value(d); } inline double - Options::decay(void) const { + Options::decay() const { return _decay.value(); } @@ -282,7 +282,7 @@ namespace Gecode { _seed.value(s); } inline Rnd - Options::rnd(void) const { + Options::rnd() const { return _seed.rnd(); } @@ -291,7 +291,7 @@ namespace Gecode { _step.value(s); } inline double - Options::step(void) const { + Options::step() const { return _step.value(); } @@ -308,7 +308,7 @@ namespace Gecode { _search.add(v, o, h); } inline int - Options::search(void) const { + Options::search() const { return _search.value(); } @@ -317,7 +317,7 @@ namespace Gecode { _solutions.value(n); } inline unsigned long long int - Options::solutions(void) const { + Options::solutions() const { return _solutions.value(); } @@ -326,7 +326,7 @@ namespace Gecode { _threads.value(n); } inline double - Options::threads(void) const { + Options::threads() const { return _threads.value(); } @@ -336,7 +336,7 @@ namespace Gecode { _guidance = g; } inline const Search::HeuristicGuidance* - Options::guidance(void) const { + Options::guidance() const { return _guidance; } #endif @@ -346,7 +346,7 @@ namespace Gecode { _c_d.value(d); } inline unsigned int - Options::c_d(void) const { + Options::c_d() const { return _c_d.value(); } @@ -355,7 +355,7 @@ namespace Gecode { _a_d.value(d); } inline unsigned int - Options::a_d(void) const { + Options::a_d() const { return _a_d.value(); } @@ -364,7 +364,7 @@ namespace Gecode { _d_l.value(d); } inline unsigned int - Options::d_l(void) const { + Options::d_l() const { return _d_l.value(); } @@ -373,7 +373,7 @@ namespace Gecode { _node.value(n); } inline unsigned long long int - Options::node(void) const { + Options::node() const { return _node.value(); } @@ -382,7 +382,7 @@ namespace Gecode { _fail.value(n); } inline unsigned long long int - Options::fail(void) const { + Options::fail() const { return _fail.value(); } @@ -391,7 +391,7 @@ namespace Gecode { _time.value(t); } inline double - Options::time(void) const { + Options::time() const { return _time.value(); } @@ -400,7 +400,7 @@ namespace Gecode { _assets.value(n); } inline unsigned int - Options::assets(void) const { + Options::assets() const { return _assets.value(); } @@ -409,7 +409,7 @@ namespace Gecode { _slice.value(n); } inline unsigned int - Options::slice(void) const { + Options::slice() const { return _slice.value(); } @@ -418,7 +418,7 @@ namespace Gecode { _restart.value(static_cast(rm)); } inline RestartMode - Options::restart(void) const { + Options::restart() const { return static_cast(_restart.value()); } @@ -427,7 +427,7 @@ namespace Gecode { _r_base.value(n); } inline double - Options::restart_base(void) const { + Options::restart_base() const { return _r_base.value(); } @@ -436,7 +436,7 @@ namespace Gecode { _r_scale.value(n); } inline unsigned int - Options::restart_scale(void) const { + Options::restart_scale() const { return _r_scale.value(); } @@ -445,7 +445,7 @@ namespace Gecode { _r_limit.value(n); } inline unsigned long long int - Options::restart_limit(void) const { + Options::restart_limit() const { return _r_limit.value(); } @@ -454,7 +454,7 @@ namespace Gecode { _nogoods.value(b); } inline bool - Options::nogoods(void) const { + Options::nogoods() const { return _nogoods.value(); } @@ -463,7 +463,7 @@ namespace Gecode { _nogoods_limit.value(l); } inline unsigned int - Options::nogoods_limit(void) const { + Options::nogoods_limit() const { return _nogoods_limit.value(); } @@ -472,7 +472,7 @@ namespace Gecode { _relax.value(d); } inline double - Options::relax(void) const { + Options::relax() const { return _relax.value(); } @@ -481,7 +481,7 @@ namespace Gecode { _interrupt.value(b); } inline bool - Options::interrupt(void) const { + Options::interrupt() const { return _interrupt.value(); } @@ -494,7 +494,7 @@ namespace Gecode { _mode.value(static_cast(sm)); } inline ScriptMode - Options::mode(void) const { + Options::mode() const { return static_cast(_mode.value()); } @@ -503,7 +503,7 @@ namespace Gecode { _samples.value(s); } inline unsigned int - Options::samples(void) const { + Options::samples() const { return _samples.value(); } @@ -512,7 +512,7 @@ namespace Gecode { _iterations.value(i); } inline unsigned int - Options::iterations(void) const { + Options::iterations() const { return _iterations.value(); } @@ -521,7 +521,7 @@ namespace Gecode { _print_last.value(p); } inline bool - Options::print_last(void) const { + Options::print_last() const { return _print_last.value(); } @@ -531,7 +531,7 @@ namespace Gecode { } inline const char* - Options::out_file(void) const { + Options::out_file() const { return _out_file.value(); } @@ -541,7 +541,7 @@ namespace Gecode { } inline const char* - Options::log_file(void) const { + Options::log_file() const { return _log_file.value(); } @@ -551,7 +551,7 @@ namespace Gecode { } inline int - Options::trace(void) const { + Options::trace() const { return _trace.value(); } @@ -566,7 +566,7 @@ namespace Gecode { _profiler.execution_id(i); } inline int - Options::profiler_id(void) const { + Options::profiler_id() const { return _profiler.execution_id(); } inline void @@ -574,14 +574,14 @@ namespace Gecode { _profiler.port(p); } inline unsigned int - Options::profiler_port(void) const { + Options::profiler_port() const { return _profiler.port(); } #endif #ifdef GECODE_HAS_GIST forceinline - Options::I_::I_(void) + Options::I_::I_() : _click(heap, 1), n_click(0), _solution(heap, 1), n_solution(0), _move(heap, 1), n_move(0), _compare(heap, 1), n_compare(0) {} @@ -637,7 +637,7 @@ namespace Gecode { _size = s; } inline unsigned int - SizeOptions::size(void) const { + SizeOptions::size() const { return _size; } @@ -655,22 +655,22 @@ namespace Gecode { } inline const char* - InstanceOptions::instance(void) const { + InstanceOptions::instance() const { return _inst; } inline const char* - InstanceOptions::spec(void) const { + InstanceOptions::spec() const { return _spec; } inline const char* - InstanceOptions::spec_file(void) const { + InstanceOptions::spec_file() const { return _spec_file.value(); } inline const char* - InstanceOptions::param(void) const { + InstanceOptions::param() const { return _param.value(); } } // namespace Gecode diff --git a/gecode/driver/script.hpp b/gecode/driver/script.hpp index 252fd62041..11bad11040 100644 --- a/gecode/driver/script.hpp +++ b/gecode/driver/script.hpp @@ -127,7 +127,7 @@ namespace Gecode { namespace Driver { } } /// Destructor - ~CombinedStop(void) override { + ~CombinedStop() override { delete ns; delete fs; delete ts; @@ -225,7 +225,7 @@ namespace Gecode { namespace Driver { class ScriptGetInfo : public CPProfilerSearchTracer::GetInfo { public: /// Initialize - ScriptGetInfo(void) = default; + ScriptGetInfo() = default; /// Return info for a space (which must be a script) std::string get_info(const Space& home) const override; }; diff --git a/gecode/flatzinc.hh b/gecode/flatzinc.hh index 2eca4c6977..76907b5a1c 100644 --- a/gecode/flatzinc.hh +++ b/gecode/flatzinc.hh @@ -134,7 +134,7 @@ namespace Gecode { namespace FlatZinc { #endif ) const; public: - Printer(void) : _output(nullptr) {} + Printer() : _output(nullptr) {} void init(AST::Array* output); void print(std::ostream& out, const Gecode::IntVarArray& iv, const Gecode::BoolVarArray& bv @@ -160,7 +160,7 @@ namespace Gecode { namespace FlatZinc { #endif ) const; - ~Printer(void); + ~Printer(); void add_int_var_name(const std::string& n); const std::string& @@ -328,7 +328,7 @@ namespace Gecode { namespace FlatZinc { } void - help(void) override { + help() override { std::cerr << "Gecode FlatZinc interpreter" << '\n' << " - FlatZinc text interface" << '\n' << '\n' @@ -337,65 +337,65 @@ namespace Gecode { namespace FlatZinc { } int - solutions(void) const { + solutions() const { return _solutions.value(); } bool - all_solutions(void) const { + all_solutions() const { return _all_solutions.value(); } double - threads(void) const { + threads() const { return _threads.value(); } bool - free(void) const { + free() const { return _free.value(); } unsigned int - c_d(void) const { + c_d() const { return _c_d.value(); } unsigned int - a_d(void) const { + a_d() const { return _a_d.value(); } unsigned long long int - node(void) const { + node() const { return _node.value(); } unsigned long long int - fail(void) const { + fail() const { return _fail.value(); } double - time(void) const { + time() const { return _time.value(); } Rnd - rnd(void) const { + rnd() const { return _seed.rnd(); } double - step(void) const { + step() const { return _step.value(); } const char* - output(void) const { + output() const { return _output.value(); } Gecode::ScriptMode - mode(void) const { + mode() const { return static_cast(_mode.value()); } double - decay(void) const { + decay() const { return _decay.value(); } RestartMode - restart(void) const { + restart() const { return static_cast(_restart.value()); } void @@ -403,7 +403,7 @@ namespace Gecode { namespace FlatZinc { _restart.value(static_cast(rm)); } double - restart_base(void) const { + restart_base() const { return _r_base.value(); } void @@ -411,7 +411,7 @@ namespace Gecode { namespace FlatZinc { _r_base.value(d); } unsigned int - restart_scale(void) const { + restart_scale() const { return _r_scale.value(); } void @@ -419,34 +419,34 @@ namespace Gecode { namespace FlatZinc { _r_scale.value(i); } unsigned long long int - restart_limit(void) const { + restart_limit() const { return _r_limit.value(); } bool - nogoods(void) const { + nogoods() const { return _nogoods.value(); } unsigned int - nogoods_limit(void) const { + nogoods_limit() const { return _nogoods_limit.value(); } bool - interrupt(void) const { + interrupt() const { return _interrupt.value(); } #ifdef GECODE_HAS_CPPROFILER int - profiler_id(void) const { + profiler_id() const { return _profiler.execution_id(); } unsigned int - profiler_port(void) const { + profiler_port() const { return _profiler.port(); } bool - profiler_info(void) const { + profiler_info() const { return true; } @@ -461,11 +461,11 @@ namespace Gecode { namespace FlatZinc { class BranchInformation : public SharedHandle { public: /// Constructor - BranchInformation(void); + BranchInformation(); /// Copy constructor BranchInformation(const BranchInformation& bi) = default; /// Initialise for use - void init(void); + void init(); /// Add new brancher information void add(BrancherGroup bg, const std::string& rel0, const std::string& rel1, const std::vector& n); /// Output branch information @@ -659,7 +659,7 @@ namespace Gecode { namespace FlatZinc { FlatZincSpace(Rnd& random = defrnd); /// Destructor - ~FlatZincSpace(void) override; + ~FlatZincSpace() override; /// Initialize space with given number of variables void init(int int_vars, int bool_vars, int set_vars, int float_vars); @@ -724,12 +724,12 @@ namespace Gecode { namespace FlatZinc { void shrink_arrays(Printer& p); /// Return whether to solve a satisfaction or optimization problem - Meth method(void) const; + Meth method() const; /// Return index of variable used for optimization - int opt_var(void) const; + int opt_var() const; /// Return whether variable used for optimization is integer (or float) - bool opt_var_is_int(void) const; + bool opt_var_is_int() const; /** * \brief Create branchers corresponding to the solve item annotations @@ -744,7 +744,7 @@ namespace Gecode { namespace FlatZinc { std::ostream& err = std::cerr); /// Return the solve item annotations - AST::Array* solve_annotations(void) const; + AST::Array* solve_annotations() const; /// Information for printing branches BranchInformation branch_info; @@ -752,7 +752,7 @@ namespace Gecode { namespace FlatZinc { /// Implement optimization void constrain(const Space& s) override; /// Copy function - Gecode::Space* copy(void) override; + Gecode::Space* copy() override; /// Spoke hook for restarts: on_restart and LNS spokes have partial coverage void spoke(SpokeContext& sc) override; @@ -814,7 +814,7 @@ namespace Gecode { namespace FlatZinc { Error(const std::string& where, const std::string& what, AST::Array* const ann) : msg(make_message(where, what, ann)) {} const std::string& - to_string(void) const { + to_string() const { return msg; } diff --git a/gecode/flatzinc/ast.hh b/gecode/flatzinc/ast.hh index 7cd63ee311..45b15d2dc0 100644 --- a/gecode/flatzinc/ast.hh +++ b/gecode/flatzinc/ast.hh @@ -60,7 +60,7 @@ namespace Gecode { namespace FlatZinc { namespace AST { TypeError() : _what("") {} TypeError(std::string what) : _what(std::move(what)) {} std::string - what(void) const { + what() const { return _what; } }; @@ -71,7 +71,7 @@ namespace Gecode { namespace FlatZinc { namespace AST { class GECODE_VTABLE_EXPORT Node { public: /// Destructor - virtual ~Node(void); + virtual ~Node(); /// Append \a n to an array node void append(Node* n); @@ -85,60 +85,60 @@ namespace Gecode { namespace FlatZinc { namespace AST { /// Test if node is function call with \a id bool is_call(const std::string& id); /// Return function call - Call* get_call(void); + Call* get_call(); /// Test if node is function call or array containing function call \a id bool has_call(const std::string& id); /// Return function call \a id Call* get_call(const std::string& id); /// Cast this node to an array node - Array* get_array(void); + Array* get_array(); /// Cast this node to an Atom node - Atom* get_atom(void); + Atom* get_atom(); /// Return name of variable represented by this node - std::string get_var_name(void); + std::string get_var_name(); /// Cast this node to an integer variable node - int get_int_var(void); + int get_int_var(); /// Cast this node to a Boolean variable node - int get_bool_var(void); + int get_bool_var(); /// Cast this node to a Float variable node - int get_float_var(void); + int get_float_var(); /// Cast this node to a set variable node - int get_set_var(void); + int get_set_var(); /// Cast this node to an integer node - int get_int(void); + int get_int(); /// Cast this node to a Boolean node - bool get_bool(void); + bool get_bool(); /// Cast this node to a Float node - double get_float(void); + double get_float(); /// Cast this node to a set literal node - SetLit* get_set(void); + SetLit* get_set(); /// Cast this node to a string node - std::string get_string(void); + std::string get_string(); /// Test if node is an integer variable node - bool is_int_var(void); + bool is_int_var(); /// Test if node is a Boolean variable node - bool is_bool_var(void); + bool is_bool_var(); /// Test if node is a set variable node - bool is_set_var(void); + bool is_set_var(); /// Test if node is a float variable node - bool is_float_var(void); + bool is_float_var(); /// Test if node is an integer node - bool is_int(void); + bool is_int(); /// Test if node is a float node - bool is_float(void); + bool is_float(); /// Test if node is a Boolean node - bool is_bool(void); + bool is_bool(); /// Test if node is a string node - bool is_string(void); + bool is_string(); /// Test if node is an array node - bool is_array(void); + bool is_array(); /// Test if node is a set literal node - bool is_set(void); + bool is_set(); /// Test if node is an atom node - bool is_atom(void); + bool is_atom(); /// Output string representation virtual void print(std::ostream&) = 0; @@ -182,12 +182,12 @@ namespace Gecode { namespace FlatZinc { namespace AST { int max; std::vector s; // NOLINTNEXTLINE(modernize-use-equals-default) - SetLit(void) {} + SetLit() {} SetLit(int min0, int max0) : interval(true), min(min0), max(max0) {} SetLit(const std::vector& s0) : interval(false), s(s0) {} explicit SetLit(SetLit* s0) : interval(s0->interval), min(s0->min), max(s0->max), s(s0->s) {} bool - empty(void) const { + empty() const { return ((interval && min > max) || (!interval && s.size() == 0)); } void @@ -261,7 +261,7 @@ namespace Gecode { namespace FlatZinc { namespace AST { } os << "]"; } - ~Array(void) override { + ~Array() override { for (int i = a.size(); i--;) delete a[i]; } @@ -273,7 +273,7 @@ namespace Gecode { namespace FlatZinc { namespace AST { std::string id; Node* args; Call(const std::string& id0, Node* args0) : id(id0), args(args0) {} - ~Call(void) override { + ~Call() override { delete args; } void @@ -297,7 +297,7 @@ namespace Gecode { namespace FlatZinc { namespace AST { Node* a; Node* idx; ArrayAccess(Node* a0, Node* idx0) : a(a0), idx(idx0) {} - ~ArrayAccess(void) override { + ~ArrayAccess() override { delete a; delete idx; } @@ -332,7 +332,7 @@ namespace Gecode { namespace FlatZinc { namespace AST { } }; - inline Node::~Node(void) = default; + inline Node::~Node() = default; inline void Node::append(Node* new_node) { @@ -365,7 +365,7 @@ namespace Gecode { namespace FlatZinc { namespace AST { } inline Call* - Node::get_call(void) { + Node::get_call() { if (Call* a = dynamic_cast(this)) return a; throw TypeError("call expected"); @@ -418,121 +418,121 @@ namespace Gecode { namespace FlatZinc { namespace AST { } inline Array* - Node::get_array(void) { + Node::get_array() { if (Array* a = dynamic_cast(this)) return a; throw TypeError("array expected"); } inline Atom* - Node::get_atom(void) { + Node::get_atom() { if (Atom* a = dynamic_cast(this)) return a; throw TypeError("atom expected"); } inline std::string - Node::get_var_name(void) { + Node::get_var_name() { if (Var* a = dynamic_cast(this)) return a->n; throw TypeError("variable expected"); } inline int - Node::get_int_var(void) { + Node::get_int_var() { if (IntVar* a = dynamic_cast(this)) return a->i; throw TypeError("integer variable expected"); } inline int - Node::get_bool_var(void) { + Node::get_bool_var() { if (BoolVar* a = dynamic_cast(this)) return a->i; throw TypeError("bool variable expected"); } inline int - Node::get_float_var(void) { + Node::get_float_var() { if (FloatVar* a = dynamic_cast(this)) return a->i; throw TypeError("integer variable expected"); } inline int - Node::get_set_var(void) { + Node::get_set_var() { if (SetVar* a = dynamic_cast(this)) return a->i; throw TypeError("set variable expected"); } inline int - Node::get_int(void) { + Node::get_int() { if (IntLit* a = dynamic_cast(this)) return a->i; throw TypeError("integer literal expected"); } inline bool - Node::get_bool(void) { + Node::get_bool() { if (BoolLit* a = dynamic_cast(this)) return a->b; throw TypeError("bool literal expected"); } inline double - Node::get_float(void) { + Node::get_float() { if (FloatLit* a = dynamic_cast(this)) return a->d; throw TypeError("float literal expected"); } inline SetLit* - Node::get_set(void) { + Node::get_set() { if (SetLit* a = dynamic_cast(this)) return a; throw TypeError("set literal expected"); } inline std::string - Node::get_string(void) { + Node::get_string() { if (String* a = dynamic_cast(this)) return a->s; throw TypeError("string literal expected"); } inline bool - Node::is_int_var(void) { + Node::is_int_var() { return (dynamic_cast(this) != nullptr); } inline bool - Node::is_bool_var(void) { + Node::is_bool_var() { return (dynamic_cast(this) != nullptr); } inline bool - Node::is_set_var(void) { + Node::is_set_var() { return (dynamic_cast(this) != nullptr); } inline bool - Node::is_float_var(void) { + Node::is_float_var() { return (dynamic_cast(this) != nullptr); } inline bool - Node::is_int(void) { + Node::is_int() { return (dynamic_cast(this) != nullptr); } inline bool - Node::is_bool(void) { + Node::is_bool() { return (dynamic_cast(this) != nullptr); } inline bool - Node::is_float(void) { + Node::is_float() { return (dynamic_cast(this) != nullptr); } inline bool - Node::is_set(void) { + Node::is_set() { return (dynamic_cast(this) != nullptr); } inline bool - Node::is_string(void) { + Node::is_string() { return (dynamic_cast(this) != nullptr); } inline bool - Node::is_array(void) { + Node::is_array() { return (dynamic_cast(this) != nullptr); } inline bool - Node::is_atom(void) { + Node::is_atom() { return (dynamic_cast(this) != nullptr); } diff --git a/gecode/flatzinc/blackbox-backend.cpp b/gecode/flatzinc/blackbox-backend.cpp index b953b1f1a7..3138b15359 100644 --- a/gecode/flatzinc/blackbox-backend.cpp +++ b/gecode/flatzinc/blackbox-backend.cpp @@ -347,7 +347,7 @@ namespace Gecode { namespace FlatZinc { #ifdef GECODE_HAS_THREADS BlackBoxLibrary::Instance* - BlackBoxLibrary::instance(void) { + BlackBoxLibrary::instance() { const std::thread::id owner = std::this_thread::get_id(); Support::Lock lock(mutex); // Each live thread has exclusive access to its selected instance. @@ -404,7 +404,7 @@ namespace Gecode { namespace FlatZinc { BlackBoxExec::BlackBoxExec(const std::string& program0, const std::vector& args0) : program(program0), args(args0) {} - BlackBoxExec::~BlackBoxExec(void) { + BlackBoxExec::~BlackBoxExec() { Support::Lock lock(mutex); for (BlackBoxProcessSession* s : sessions) { delete s; @@ -413,7 +413,7 @@ namespace Gecode { namespace FlatZinc { } BlackBoxProcessSession& - BlackBoxExec::session(void) { + BlackBoxExec::session() { Support::Lock lock(mutex); for (BlackBoxProcessSession* s : sessions) { if (s->owned_by_current_thread()) { diff --git a/gecode/flatzinc/blackbox-backend.hh b/gecode/flatzinc/blackbox-backend.hh index c2391995c3..59440e06df 100644 --- a/gecode/flatzinc/blackbox-backend.hh +++ b/gecode/flatzinc/blackbox-backend.hh @@ -68,7 +68,7 @@ namespace Gecode { namespace FlatZinc { /// Backend for a deterministic FlatZinc blackbox function. class BlackBoxBackend : public SharedHandle::Object { public: - ~BlackBoxBackend(void) override = default; + ~BlackBoxBackend() override = default; virtual void run(BlackBoxCall& call) = 0; void run(const std::vector& int_input, const std::vector& float_input, @@ -99,7 +99,7 @@ namespace Gecode { namespace FlatZinc { class Instance; Support::Mutex mutex; std::vector instances; - Instance* instance(void); + Instance* instance(); #endif }; @@ -116,7 +116,7 @@ namespace Gecode { namespace FlatZinc { std::vector args; Support::Mutex mutex; std::vector sessions; - BlackBoxProcessSession& session(void); + BlackBoxProcessSession& session(); }; /// Encode one request for the executable backend's line protocol. diff --git a/gecode/flatzinc/blackbox-process-posix.cpp b/gecode/flatzinc/blackbox-process-posix.cpp index acb519974e..4fbbcea890 100644 --- a/gecode/flatzinc/blackbox-process-posix.cpp +++ b/gecode/flatzinc/blackbox-process-posix.cpp @@ -86,16 +86,16 @@ namespace Gecode { namespace FlatZinc { public: explicit FileDescriptor(int fd0 = -1) : fd(fd0) {} - ~FileDescriptor(void) { + ~FileDescriptor() { reset(); } int - get(void) const { + get() const { return fd; } int - release(void) { + release() { int fd0 = fd; fd = -1; return fd0; @@ -127,21 +127,21 @@ namespace Gecode { namespace FlatZinc { bool initialized; public: - SpawnFileActions(void) : initialized(false) {} - ~SpawnFileActions(void) { + SpawnFileActions() : initialized(false) {} + ~SpawnFileActions() { if (initialized) { posix_spawn_file_actions_destroy(&actions); } } int - init(void) { + init() { int err = posix_spawn_file_actions_init(&actions); initialized = err == 0; return err; } posix_spawn_file_actions_t* - get(void) { + get() { return &actions; } }; @@ -152,21 +152,21 @@ namespace Gecode { namespace FlatZinc { bool initialized; public: - SpawnAttributes(void) : initialized(false) {} - ~SpawnAttributes(void) { + SpawnAttributes() : initialized(false) {} + ~SpawnAttributes() { if (initialized) { posix_spawnattr_destroy(&attr); } } int - init(void) { + init() { int err = posix_spawnattr_init(&attr); initialized = err == 0; return err; } posix_spawnattr_t* - get(void) { + get() { return &attr; } }; @@ -239,7 +239,7 @@ namespace Gecode { namespace FlatZinc { } static void - sleep_grace_period(void) { + sleep_grace_period() { struct timespec remaining = {0, 10000000}; while ((nanosleep(&remaining, &remaining) == -1) && (errno == EINTR)) { } @@ -295,7 +295,7 @@ namespace Gecode { namespace FlatZinc { } static void - check_sigchld(void) { + check_sigchld() { struct sigaction action; if (sigaction(SIGCHLD, nullptr, &action) != 0) { throw Error("BlackBoxExec", last_error("SIGCHLD query failed")); @@ -311,7 +311,7 @@ namespace Gecode { namespace FlatZinc { } void open_posix(const std::string& program, const std::vector& args); - void close_posix(void); + void close_posix(); public: PosixProcessSession(const std::string& program, const std::vector& args) @@ -319,7 +319,7 @@ namespace Gecode { namespace FlatZinc { open_posix(program, args); } - ~PosixProcessSession(void) override { + ~PosixProcessSession() override { close(); } @@ -372,7 +372,7 @@ namespace Gecode { namespace FlatZinc { } void - close(void) { + close() { close_posix(); } }; @@ -486,7 +486,7 @@ namespace Gecode { namespace FlatZinc { } void - PosixProcessSession::close_posix(void) { + PosixProcessSession::close_posix() { if (pipe_send != -1) { ::close(pipe_send); pipe_send = -1; diff --git a/gecode/flatzinc/blackbox-process-windows.cpp b/gecode/flatzinc/blackbox-process-windows.cpp index aa3617781e..735a65f18b 100644 --- a/gecode/flatzinc/blackbox-process-windows.cpp +++ b/gecode/flatzinc/blackbox-process-windows.cpp @@ -58,7 +58,7 @@ namespace Gecode { namespace FlatZinc { public: explicit WindowsHandle(HANDLE handle0 = nullptr) : handle(handle0) {} - ~WindowsHandle(void) { + ~WindowsHandle() { reset(); } @@ -66,22 +66,22 @@ namespace Gecode { namespace FlatZinc { WindowsHandle& operator=(const WindowsHandle&) = delete; HANDLE - get(void) const { + get() const { return handle; } HANDLE* - put(void) { + put() { reset(); return &handle; } HANDLE - release(void) { + release() { HANDLE handle0 = handle; handle = nullptr; return handle0; } bool - valid(void) const { + valid() const { return (handle != nullptr) && (handle != INVALID_HANDLE_VALUE); } void @@ -100,15 +100,15 @@ namespace Gecode { namespace FlatZinc { bool initialized; public: - WindowsAttributeList(void) : list(nullptr), initialized(false) {} - ~WindowsAttributeList(void) { + WindowsAttributeList() : list(nullptr), initialized(false) {} + ~WindowsAttributeList() { if (initialized) { DeleteProcThreadAttributeList(list); } } void - init(void) { + init() { SIZE_T size = 0; InitializeProcThreadAttributeList(nullptr, 1, 0, &size); if (size == 0) { @@ -134,7 +134,7 @@ namespace Gecode { namespace FlatZinc { } LPPROC_THREAD_ATTRIBUTE_LIST - get(void) const { + get() const { return list; } }; @@ -187,7 +187,7 @@ namespace Gecode { namespace FlatZinc { } void open_windows(const std::string& program, const std::vector& args); - void close_windows(void); + void close_windows(); public: WindowsProcessSession(const std::string& program, const std::vector& args) @@ -195,7 +195,7 @@ namespace Gecode { namespace FlatZinc { open_windows(program, args); } - ~WindowsProcessSession(void) override { + ~WindowsProcessSession() override { close(); } @@ -236,7 +236,7 @@ namespace Gecode { namespace FlatZinc { } void - close(void) { + close() { close_windows(); } }; @@ -391,7 +391,7 @@ namespace Gecode { namespace FlatZinc { } void - WindowsProcessSession::close_windows(void) { + WindowsProcessSession::close_windows() { close_handle(pipe_send); close_handle(pipe_receive); if (process != nullptr) { diff --git a/gecode/flatzinc/blackbox-process.hh b/gecode/flatzinc/blackbox-process.hh index eed6c3329f..63ef836e36 100644 --- a/gecode/flatzinc/blackbox-process.hh +++ b/gecode/flatzinc/blackbox-process.hh @@ -27,7 +27,7 @@ namespace Gecode { namespace FlatZinc { std::thread::id owner; #endif // NOLINTNEXTLINE(modernize-use-equals-default) - BlackBoxProcessSession(void) + BlackBoxProcessSession() #ifdef GECODE_HAS_THREADS : owner(std::this_thread::get_id()) #endif @@ -35,9 +35,9 @@ namespace Gecode { namespace FlatZinc { } public: - virtual ~BlackBoxProcessSession(void) = default; + virtual ~BlackBoxProcessSession() = default; bool - owned_by_current_thread(void) const { + owned_by_current_thread() const { #ifdef GECODE_HAS_THREADS return owner == std::this_thread::get_id(); #else diff --git a/gecode/flatzinc/blackbox-propagator.cpp b/gecode/flatzinc/blackbox-propagator.cpp index 7092ec7084..d96e7bc5d1 100644 --- a/gecode/flatzinc/blackbox-propagator.cpp +++ b/gecode/flatzinc/blackbox-propagator.cpp @@ -59,7 +59,7 @@ namespace Gecode { namespace FlatZinc { return static_cast(SharedHandle::operator=(handle)); } BlackBoxBackend* - operator()(void) const { + operator()() const { return static_cast(object()); } }; @@ -82,16 +82,16 @@ namespace Gecode { namespace FlatZinc { std::atomic error_recorded; public: - BlackBoxContext(void) : error_recorded(false) {} + BlackBoxContext() : error_recorded(false) {} BlackBoxHandle backend_for_constraint(const std::string& mode, const std::string& target, const std::vector& args); void fail(std::exception_ptr e); - bool failed(void) const; - void rethrow(void) const; + bool failed() const; + void rethrow() const; }; void - BlackBoxContextHandle::init(void) { + BlackBoxContextHandle::init() { if (!*this) { object(new BlackBoxContext); } @@ -109,12 +109,12 @@ namespace Gecode { namespace FlatZinc { } bool - BlackBoxContextHandle::failed(void) const { + BlackBoxContextHandle::failed() const { return static_cast(*this) && static_cast(object())->failed(); } void - BlackBoxContextHandle::rethrow(void) const { + BlackBoxContextHandle::rethrow() const { if (*this) { static_cast(object())->rethrow(); } @@ -150,12 +150,12 @@ namespace Gecode { namespace FlatZinc { } bool - BlackBoxContext::failed(void) const { + BlackBoxContext::failed() const { return error_recorded.load(std::memory_order_acquire); } void - BlackBoxContext::rethrow(void) const { + BlackBoxContext::rethrow() const { if (!error_recorded.load(std::memory_order_acquire)) { return; } diff --git a/gecode/flatzinc/blackbox.hh b/gecode/flatzinc/blackbox.hh index 734ff8fe7f..7f5d1b88c5 100644 --- a/gecode/flatzinc/blackbox.hh +++ b/gecode/flatzinc/blackbox.hh @@ -53,7 +53,7 @@ namespace Gecode { namespace FlatZinc { /// Model-local context shared by blackbox propagators and search support. class BlackBoxContextHandle : public SharedHandle { public: - BlackBoxContextHandle(void) : SharedHandle() {} + BlackBoxContextHandle() : SharedHandle() {} BlackBoxContextHandle(const BlackBoxContextHandle& handle) = default; BlackBoxContextHandle& operator=(const BlackBoxContextHandle& handle) { @@ -61,16 +61,16 @@ namespace Gecode { namespace FlatZinc { } /// Initialize this context if it is empty. - void init(void); + void init(); /// Return the backend selected for one constraint as an opaque handle. SharedHandle backend_for_constraint(const std::string& mode, const std::string& target, const std::vector& args) const; /// Record the first exception raised during blackbox propagation. void fail(std::exception_ptr e) const; /// Whether blackbox propagation raised an exception. - bool failed(void) const; + bool failed() const; /// Rethrow the first recorded propagation exception. - void rethrow(void) const; + void rethrow() const; }; /// Access to the model-local blackbox context while posting and searching. diff --git a/gecode/flatzinc/branch.hh b/gecode/flatzinc/branch.hh index 3b5a4d07c3..0dfb44c65d 100644 --- a/gecode/flatzinc/branch.hh +++ b/gecode/flatzinc/branch.hh @@ -79,19 +79,19 @@ namespace Gecode { namespace FlatZinc { /// Initialize with selection strategy \a s and CHB \a i and \a b IntBoolVarBranch(Select s, const IntCHB& i, const BoolCHB& b); /// Return selection strategy - Select select(void) const; + Select select() const; /// Return integer AFC - IntAFC int_afc(void) const; + IntAFC int_afc() const; /// Return Boolean AFC - BoolAFC bool_afc(void) const; + BoolAFC bool_afc() const; /// Return integer action - IntAction int_action(void) const; + IntAction int_action() const; /// Return Boolean action - BoolAction bool_action(void) const; + BoolAction bool_action() const; /// Return integer CHB - IntCHB int_chb(void) const; + IntCHB int_chb() const; /// Return Boolean AFC - BoolCHB bool_chb(void) const; + BoolCHB bool_chb() const; /// Expand AFC, action, and CHB void expand(Home home, const IntVarArgs& x, const BoolVarArgs& y); }; @@ -142,7 +142,7 @@ namespace Gecode { namespace FlatZinc { /// Return merit double operator()(Int::BoolView x, int i) const; /// Dispose - void dispose(void); + void dispose(); }; /// Select by maximal AFC over size @@ -163,7 +163,7 @@ namespace Gecode { namespace FlatZinc { /// Return merit double operator()(Int::BoolView x, int i) const; /// Dispose - void dispose(void); + void dispose(); }; /// Select by maximal Action @@ -184,7 +184,7 @@ namespace Gecode { namespace FlatZinc { /// Return merit double operator()(Int::BoolView x, int i) const; /// Dispose - void dispose(void); + void dispose(); }; /// Select by maximal Action over size @@ -205,7 +205,7 @@ namespace Gecode { namespace FlatZinc { /// Return merit double operator()(Int::BoolView x, int i) const; /// Dispose - void dispose(void); + void dispose(); }; /// Select by maximal CHB @@ -226,7 +226,7 @@ namespace Gecode { namespace FlatZinc { /// Return merit double operator()(Int::BoolView x, int i) const; /// Dispose - void dispose(void); + void dispose(); }; /// Select by maximal CHB over size @@ -247,7 +247,7 @@ namespace Gecode { namespace FlatZinc { /// Return merit double operator()(Int::BoolView x, int i) const; /// Dispose - void dispose(void); + void dispose(); }; /// %Choice storing position and value @@ -262,9 +262,9 @@ namespace Gecode { namespace FlatZinc { /// Initialize choice for brancher \a b, number of alternatives \a a, position \a p, and value \a n PosIntChoice(const Brancher& b, unsigned int a, int p, int n); /// Return position of view to assign - int pos(void) const; + int pos() const; /// Return value to assign to - int val(void) const; + int val() const; /// Archive into \a e void archive(Archive& e) const override; }; diff --git a/gecode/flatzinc/branch.hpp b/gecode/flatzinc/branch.hpp index 828f361c2a..9dadedc62f 100644 --- a/gecode/flatzinc/branch.hpp +++ b/gecode/flatzinc/branch.hpp @@ -49,34 +49,34 @@ namespace Gecode { namespace FlatZinc { : s(s0), int_chb_data(i), bool_chb_data(b) {} forceinline IntBoolVarBranch::Select - IntBoolVarBranch::select(void) const { + IntBoolVarBranch::select() const { return s; } forceinline IntAFC - IntBoolVarBranch::int_afc(void) const { + IntBoolVarBranch::int_afc() const { return int_afc_data; } forceinline BoolAFC - IntBoolVarBranch::bool_afc(void) const { + IntBoolVarBranch::bool_afc() const { return bool_afc_data; } forceinline IntAction - IntBoolVarBranch::int_action(void) const { + IntBoolVarBranch::int_action() const { return int_action_data; } forceinline BoolAction - IntBoolVarBranch::bool_action(void) const { + IntBoolVarBranch::bool_action() const { return bool_action_data; } forceinline IntCHB - IntBoolVarBranch::int_chb(void) const { + IntBoolVarBranch::int_chb() const { return int_chb_data; } forceinline BoolCHB - IntBoolVarBranch::bool_chb(void) const { + IntBoolVarBranch::bool_chb() const { return bool_chb_data; } forceinline void @@ -171,7 +171,7 @@ namespace Gecode { namespace FlatZinc { return x.afc(); } forceinline void - MeritMaxAFC::dispose(void) { + MeritMaxAFC::dispose() { int_afc_data.~IntAFC(); bool_afc_data.~BoolAFC(); } @@ -191,7 +191,7 @@ namespace Gecode { namespace FlatZinc { return x.afc() / 2.0; } forceinline void - MeritMaxAFCSize::dispose(void) { + MeritMaxAFCSize::dispose() { int_afc_data.~IntAFC(); bool_afc_data.~BoolAFC(); } @@ -211,7 +211,7 @@ namespace Gecode { namespace FlatZinc { return bool_action_data[i]; } forceinline void - MeritMaxAction::dispose(void) { + MeritMaxAction::dispose() { int_action_data.~IntAction(); bool_action_data.~BoolAction(); } @@ -231,7 +231,7 @@ namespace Gecode { namespace FlatZinc { return bool_action_data[i] / 2.0; } forceinline void - MeritMaxActionSize::dispose(void) { + MeritMaxActionSize::dispose() { int_action_data.~IntAction(); bool_action_data.~BoolAction(); } @@ -251,7 +251,7 @@ namespace Gecode { namespace FlatZinc { return bool_chb_data[i]; } forceinline void - MeritMaxCHB::dispose(void) { + MeritMaxCHB::dispose() { int_chb_data.~IntCHB(); bool_chb_data.~BoolCHB(); } @@ -271,7 +271,7 @@ namespace Gecode { namespace FlatZinc { return bool_chb_data[i] / 2.0; } forceinline void - MeritMaxCHBSize::dispose(void) { + MeritMaxCHBSize::dispose() { int_chb_data.~IntCHB(); bool_chb_data.~BoolCHB(); } @@ -280,11 +280,11 @@ namespace Gecode { namespace FlatZinc { PosIntChoice::PosIntChoice(const Brancher& b, unsigned int a, int p, int n) : Choice(b, a), _pos(p), _val(n) {} forceinline int - PosIntChoice::pos(void) const { + PosIntChoice::pos() const { return _pos; } forceinline int - PosIntChoice::val(void) const { + PosIntChoice::val() const { return _val; } diff --git a/gecode/flatzinc/conexpr.hh b/gecode/flatzinc/conexpr.hh index ef3f72b501..7f353e8421 100644 --- a/gecode/flatzinc/conexpr.hh +++ b/gecode/flatzinc/conexpr.hh @@ -52,9 +52,9 @@ namespace Gecode { namespace FlatZinc { /// Return argument \a i AST::Node* operator[](int i) const; /// Return number of arguments - int size(void) const; + int size() const; /// Destructor - ~ConExpr(void); + ~ConExpr(); }; forceinline @@ -67,11 +67,11 @@ namespace Gecode { namespace FlatZinc { } forceinline int - ConExpr::size(void) const { + ConExpr::size() const { return args->a.size(); } - forceinline ConExpr::~ConExpr(void) { + forceinline ConExpr::~ConExpr() { delete args; delete ann; } diff --git a/gecode/flatzinc/flatzinc.cpp b/gecode/flatzinc/flatzinc.cpp index 88496d52fb..e2ffc2a1ed 100644 --- a/gecode/flatzinc/flatzinc.cpp +++ b/gecode/flatzinc/flatzinc.cpp @@ -159,7 +159,7 @@ namespace Gecode { namespace FlatZinc { Choice(const Brancher& b, bool fail0) : Gecode::Choice(b, 1), fail(fail0) {} /// Report size occupied virtual size_t - size(void) const { + size() const { return sizeof(Choice); } /// Archive into \a e @@ -307,7 +307,7 @@ namespace Gecode { namespace FlatZinc { std::string r0; std::string r1; std::vector n; - BI(void) : r0(""), r1(""), n(0) {} + BI() : r0(""), r1(""), n(0) {} BI(const std::string& r00, const std::string& r10, const std::vector& n0) : r0(r00), r1(r10), n(n0) {} }; @@ -315,10 +315,10 @@ namespace Gecode { namespace FlatZinc { BranchInformationO(std::vector v0) : v(std::move(v0)) {} public: - BranchInformationO(void) = default; - ~BranchInformationO(void) override = default; + BranchInformationO() = default; + ~BranchInformationO() override = default; virtual SharedHandle::Object* - copy(void) const { + copy() const { return new BranchInformationO(v); } /// Add new brancher information @@ -342,10 +342,10 @@ namespace Gecode { namespace FlatZinc { #endif }; - BranchInformation::BranchInformation(void) : SharedHandle(nullptr) {} + BranchInformation::BranchInformation() : SharedHandle(nullptr) {} void - BranchInformation::init(void) { + BranchInformation::init() { assert(object() == nullptr); object(new BranchInformationO()); } @@ -817,7 +817,7 @@ namespace Gecode { namespace FlatZinc { BlackBoxContextHandle black_box_context; /// Initialize - FlatZincSpaceInitData(void) = default; + FlatZincSpaceInitData() = default; }; FlatZincSpace::FlatZincSpace(FlatZincSpace& f) @@ -1617,7 +1617,7 @@ namespace Gecode { namespace FlatZinc { } AST::Array* - FlatZincSpace::solve_annotations(void) const { + FlatZincSpace::solve_annotations() const { return _solve_annotations; } @@ -1643,7 +1643,7 @@ namespace Gecode { namespace FlatZinc { _solve_annotations = ann; } - FlatZincSpace::~FlatZincSpace(void) { + FlatZincSpace::~FlatZincSpace() { delete _init_data; delete _solve_annotations; } @@ -1698,7 +1698,7 @@ namespace Gecode { namespace FlatZinc { /// Use the print method of the template class S to print a space void inspect(const Space& node) override; /// Finalize when Gist exits - void finalize(void) override; + void finalize() override; }; template @@ -1714,7 +1714,7 @@ namespace Gecode { namespace FlatZinc { template void - FZPrintingInspector::finalize(void) { + FZPrintingInspector::finalize() { Gecode::Gist::TextOutput::finalize(); } @@ -1772,7 +1772,7 @@ namespace Gecode { namespace FlatZinc { if (installed) Driver::CombinedStop::install_ctrl_handler(true); } - ~InterruptHandlerGuard(void) { + ~InterruptHandlerGuard() { if (installed) Driver::CombinedStop::install_ctrl_handler(false); } @@ -1805,7 +1805,7 @@ namespace Gecode { namespace FlatZinc { } return ss.str(); } - ~FlatZincGetInfo(void) override = default; + ~FlatZincGetInfo() override = default; }; void @@ -2316,22 +2316,22 @@ namespace Gecode { namespace FlatZinc { } Space* - FlatZincSpace::copy(void) { + FlatZincSpace::copy() { return new FlatZincSpace(*this); } FlatZincSpace::Meth - FlatZincSpace::method(void) const { + FlatZincSpace::method() const { return _method; } int - FlatZincSpace::opt_var(void) const { + FlatZincSpace::opt_var() const { return _opt_var; } bool - FlatZincSpace::opt_var_is_int(void) const { + FlatZincSpace::opt_var_is_int() const { return _opt_var_is_int; } @@ -3192,7 +3192,7 @@ namespace Gecode { namespace FlatZinc { #endif } - Printer::~Printer(void) { + Printer::~Printer() { delete _output; } diff --git a/gecode/flatzinc/option.hh b/gecode/flatzinc/option.hh index bd3e3b3d25..df42f1b347 100644 --- a/gecode/flatzinc/option.hh +++ b/gecode/flatzinc/option.hh @@ -44,19 +44,19 @@ namespace Gecode { namespace FlatZinc { public: bool - operator()(void) const { + operator()() const { return _some; } const Val& - some(void) const { + some() const { return _v; } Val& - some(void) { + some() { return _v; } static Option - none(void) { + none() { Option o; o._some = false; new (&o._v) Val(); diff --git a/gecode/flatzinc/parser.hh b/gecode/flatzinc/parser.hh index 13d9a66123..08e97b27a8 100644 --- a/gecode/flatzinc/parser.hh +++ b/gecode/flatzinc/parser.hh @@ -107,7 +107,7 @@ namespace Gecode { namespace FlatZinc { int i; //< Value of entry or array start index /// Default constructor // NOLINTNEXTLINE(modernize-use-equals-default) - SymbolEntry(void) {} + SymbolEntry() {} /// Constructor SymbolEntry(SymbolType t0, int i0) : t(t0), i(i0) {} }; @@ -205,7 +205,7 @@ namespace Gecode { namespace FlatZinc { ParserState(char* buf0, int length0, std::ostream& err0, Gecode::FlatZinc::FlatZincSpace* fg0) : yyscanner(nullptr), buf(buf0), pos(0), length(length0), fg(fg0), had_error(false), err(err0) {} - ~ParserState(void); + ~ParserState(); void* yyscanner; const char* buf; @@ -262,7 +262,7 @@ namespace Gecode { namespace FlatZinc { } AST::Array* - get_output(void) { + get_output() { OutputOrder oo; std::sort(output_items.begin(), output_items.end(), oo); AST::Array* a = new AST::Array(); diff --git a/gecode/flatzinc/parser.tab.cpp b/gecode/flatzinc/parser.tab.cpp index 7bc2b155ce..181dc9d583 100644 --- a/gecode/flatzinc/parser.tab.cpp +++ b/gecode/flatzinc/parser.tab.cpp @@ -572,7 +572,7 @@ AST::Node* array_output(AST::Call* ann) { namespace Gecode { namespace FlatZinc { - ParserState::~ParserState(void) { + ParserState::~ParserState() { if (yyscanner) yylex_destroy(yyscanner); for (auto& var : int_vars) diff --git a/gecode/flatzinc/parser.yxx b/gecode/flatzinc/parser.yxx index eaef50d631..6893bcb245 100755 --- a/gecode/flatzinc/parser.yxx +++ b/gecode/flatzinc/parser.yxx @@ -537,7 +537,7 @@ AST::Node* array_output(AST::Call* ann) { namespace Gecode { namespace FlatZinc { - ParserState::~ParserState(void) { + ParserState::~ParserState() { if (yyscanner) yylex_destroy(yyscanner); for (auto& var : int_vars) diff --git a/gecode/flatzinc/registry.cpp b/gecode/flatzinc/registry.cpp index c565ca20f2..b1c7f0c90c 100644 --- a/gecode/flatzinc/registry.cpp +++ b/gecode/flatzinc/registry.cpp @@ -48,7 +48,7 @@ namespace Gecode { namespace FlatZinc { Registry& - registry(void) { + registry() { static Registry r; return r; } @@ -2059,7 +2059,7 @@ namespace Gecode { namespace FlatZinc { class BuiltinPosters { public: - BuiltinPosters(void) { + BuiltinPosters() { registry().add("all_different_int", &p_distinct); registry().add("all_different_offset", &p_distinct_offset); registry().add("gecode_all_different_offset_fzn", &p_distinct_offset); diff --git a/gecode/flatzinc/registry.hh b/gecode/flatzinc/registry.hh index 5120f8b102..4f1be593ca 100644 --- a/gecode/flatzinc/registry.hh +++ b/gecode/flatzinc/registry.hh @@ -55,7 +55,7 @@ namespace Gecode { namespace FlatZinc { }; /// Return global registry object - GECODE_FLATZINC_EXPORT Registry& registry(void); + GECODE_FLATZINC_EXPORT Registry& registry(); }} // namespace Gecode::FlatZinc diff --git a/gecode/flatzinc/varspec.hh b/gecode/flatzinc/varspec.hh index f2e43be4dc..98d262bba2 100644 --- a/gecode/flatzinc/varspec.hh +++ b/gecode/flatzinc/varspec.hh @@ -51,7 +51,7 @@ namespace Gecode { namespace FlatZinc { class VarSpec { public: /// Destructor - virtual ~VarSpec(void) = default; + virtual ~VarSpec() = default; /// Variable index int i; /// Whether the variable aliases another variable @@ -85,7 +85,7 @@ namespace Gecode { namespace FlatZinc { alias = true; i = eq.v; } - ~IntVarSpec(void) override { + ~IntVarSpec() override { if (!alias && !assigned && domain()) delete domain.some(); } @@ -110,7 +110,7 @@ namespace Gecode { namespace FlatZinc { alias = true; i = eq.v; } - ~BoolVarSpec(void) override { + ~BoolVarSpec() override { if (!alias && !assigned && domain()) delete domain.some(); } @@ -159,7 +159,7 @@ namespace Gecode { namespace FlatZinc { alias = true; i = eq.v; } - ~SetVarSpec(void) override { + ~SetVarSpec() override { if (!alias && upper_bound()) delete upper_bound.some(); } diff --git a/gecode/float.hh b/gecode/float.hh index a8e029013f..3c9a182a1a 100644 --- a/gecode/float.hh +++ b/gecode/float.hh @@ -122,17 +122,17 @@ namespace Gecode { } /// Return lower bound of \f$\pi/2\f$ - FloatNum pi_half_lower(void); + FloatNum pi_half_lower(); /// Return upper bound of \f$\pi/2\f$ - FloatNum pi_half_upper(void); + FloatNum pi_half_upper(); /// Return lower bound of \f$\pi\f$ - FloatNum pi_lower(void); + FloatNum pi_lower(); /// Return upper bound of \f$\pi\f$ - FloatNum pi_upper(void); + FloatNum pi_upper(); /// Return lower bound of \f$2\pi\f$ - FloatNum pi_twice_lower(void); + FloatNum pi_twice_lower(); /// Return upper bound of \f$2\pi\f$ - FloatNum pi_twice_upper(void); + FloatNum pi_twice_upper(); // Forward declaration class FloatVal; @@ -197,17 +197,17 @@ namespace Gecode { namespace Float { typedef int Mode; #endif /// Return the current rounding mode - static Mode current_mode(void); + static Mode current_mode(); /// Restore mode \a m, as returned by current_mode() static void restore_mode(Mode m); /// Round toward \f$+\infty\f$ - static void upward(void); + static void upward(); /// Round toward \f$-\infty\f$ - static void downward(void); + static void downward(); /// Round to nearest - static void to_nearest(void); + static void to_nearest(); /// Set the mode that the arithmetic operations expect between calls - static void init(void); + static void init(); //@} private: @@ -347,9 +347,9 @@ namespace Gecode { namespace Float { public: /// Save the caller's mode and initialize the rounding operations - Rounding(void); + Rounding(); /// Restore the caller's mode - ~Rounding(void); + ~Rounding(); /// A scope cannot be copied Rounding(const Rounding&) = delete; /// A scope cannot be assigned @@ -506,7 +506,7 @@ namespace Gecode { /// \name Constructors and initialization //@{ /// Default constructor - FloatVal(void) = default; + FloatVal() = default; /// Initialize with float number \a n FloatVal(const FloatNum& n); /// Initialize with lower bound \a l and upper bound \a u @@ -526,25 +526,25 @@ namespace Gecode { /// \name Value access //@{ /// Return lower bound - FloatNum min(void) const; + FloatNum min() const; /// Return upper bound - FloatNum max(void) const; + FloatNum max() const; /// Return size of float value (distance between maximum and minimum) - FloatNum size(void) const; + FloatNum size() const; /// Return median of float value - FloatNum med(void) const; + FloatNum med() const; //@} /// \name Value tests //@{ /// Test whether float is tight - bool tight(void) const; + bool tight() const; /// Test whether float is a singleton - bool singleton(void) const; + bool singleton() const; /// Test whether \a n is included bool in(FloatNum n) const; /// Test whether zero is included - bool zero_in(void) const; + bool zero_in() const; //@} /// \name Float value construction @@ -552,11 +552,11 @@ namespace Gecode { /// Return hull of \a x and \a y static FloatVal hull(FloatNum x, FloatNum y); /// Return \f$\pi/2\f$ - static FloatVal pi_half(void); + static FloatVal pi_half(); /// Return lower bound of \f$\pi\f$ - static FloatVal pi(void); + static FloatVal pi(); /// Return \f$2\pi\f$ - static FloatVal pi_twice(void); + static FloatVal pi_twice(); //@} /// \name Update operators @@ -961,7 +961,7 @@ namespace Gecode { /// \name Constructors and initialization //@{ /// Default constructor - FloatVar(void) = default; + FloatVar() = default; /// Initialize from float variable \a y FloatVar(const FloatVar& y) = default; /// Initialize from float view \a y @@ -983,15 +983,15 @@ namespace Gecode { /// \name Value access //@{ /// Return domain - FloatVal domain(void) const; + FloatVal domain() const; /// Return minimum of domain - FloatNum min(void) const; + FloatNum min() const; /// Return maximum of domain - FloatNum max(void) const; + FloatNum max() const; /// Return median of domain - FloatNum med(void) const; + FloatNum med() const; /// Return size of domain (distance between maximum and minimum) - FloatNum size(void) const; + FloatNum size() const; /** * \brief Return assigned value * @@ -999,7 +999,7 @@ namespace Gecode { * is not yet assigned. * */ - FloatVal val(void) const; + FloatVal val() const; //@} @@ -1032,7 +1032,7 @@ namespace Gecode { /// \name Constructors and initialization //@{ /// Allocate empty array - FloatValArgs(void); + FloatValArgs(); /// Allocate array with \a n elements explicit FloatValArgs(int n); /// Allocate array and copy elements from \a x @@ -1061,7 +1061,7 @@ namespace Gecode { /// \name Constructors and initialization //@{ /// Allocate empty array - FloatVarArgs(void) = default; + FloatVarArgs() = default; /// Allocate array with \a n elements explicit FloatVarArgs(int n); /// Initialize from variable argument array \a a (copy elements) @@ -1114,7 +1114,7 @@ namespace Gecode { /// \name Creation and initialization //@{ /// Default constructor (array of size 0) - FloatVarArray(void) = default; + FloatVarArray() = default; /// Allocate array for \a n float variables (variables are uninitialized) FloatVarArray(Space& home, int n); /// Initialize from float variable array \a a (share elements) @@ -1539,7 +1539,7 @@ namespace Gecode { * yet initialized AFC storage is init or the assignment operator. * */ - FloatAFC(void) = default; + FloatAFC() = default; /** * \brief Initialize for float variables \a x and decay factor \a d * @@ -1581,7 +1581,7 @@ namespace Gecode { * yet initialized action storage is init or the assignment operator. * */ - FloatAction(void) = default; + FloatAction() = default; /// Copy constructor FloatAction(const FloatAction& a) = default; /// Assignment operator @@ -1636,7 +1636,7 @@ namespace Gecode { * yet initialized CHB storage is init or the assignment operator. * */ - FloatCHB(void) = default; + FloatCHB() = default; /// Copy constructor FloatCHB(const FloatCHB& chb) = default; /// Assignment operator @@ -1724,7 +1724,7 @@ namespace Gecode { public: /// Initialize with strategy SEL_NONE - FloatVarBranch(void); + FloatVarBranch(); /// Initialize with random number generator \a r FloatVarBranch(const Rnd& r); /// Initialize with selection strategy \a s and tie-break limit function \a t @@ -1740,7 +1740,7 @@ namespace Gecode { /// Initialize with selection strategy \a s, branch merit function \a mf, and tie-break limit function \a t FloatVarBranch(Select s, FloatBranchMerit mf, BranchTbl t); /// Return selection strategy - Select select(void) const; + Select select() const; /// Expand AFC, action, and CHB void expand(Home home, const FloatVarArgs& x); }; @@ -1751,7 +1751,7 @@ namespace Gecode { */ //@{ /// Select first unassigned variable - FloatVarBranch FLOAT_VAR_NONE(void); + FloatVarBranch FLOAT_VAR_NONE(); /// Select random variable (uniform distribution, for tie breaking) FloatVarBranch FLOAT_VAR_RND(const Rnd& r); /// Select variable with least merit according to branch merit function \a bm @@ -1862,7 +1862,7 @@ namespace Gecode { /// Initialize with value function \a f and commit function \a c FloatValBranch(FloatBranchVal v, FloatBranchCommit c); /// Return selection strategy - Select select(void) const; + Select select() const; }; /** @@ -1871,9 +1871,9 @@ namespace Gecode { */ //@{ /// Select values not greater than mean of smallest and largest value - FloatValBranch FLOAT_VAL_SPLIT_MIN(void); + FloatValBranch FLOAT_VAL_SPLIT_MIN(); /// Select values greater than mean of smallest and largest value - FloatValBranch FLOAT_VAL_SPLIT_MAX(void); + FloatValBranch FLOAT_VAL_SPLIT_MAX(); /// Select values randomly which are not greater or not smaller than mean of largest and smallest value FloatValBranch FLOAT_VAL_SPLIT_RND(const Rnd& r); /** @@ -1919,7 +1919,7 @@ namespace Gecode { /// Initialize with value function \a f and commit function \a c FloatAssign(FloatBranchVal v, FloatBranchCommit c); /// Return selection strategy - Select select(void) const; + Select select() const; }; /** @@ -1928,9 +1928,9 @@ namespace Gecode { */ //@{ /// Select median value of the lower part - FloatAssign FLOAT_ASSIGN_MIN(void); + FloatAssign FLOAT_ASSIGN_MIN(); /// Select median value of the upper part - FloatAssign FLOAT_ASSIGN_MAX(void); + FloatAssign FLOAT_ASSIGN_MAX(); /// Select median value of a randomly chosen part FloatAssign FLOAT_ASSIGN_RND(const Rnd& r); /** @@ -2070,9 +2070,9 @@ namespace Gecode { /// \name Access //@{ /// Return minimum - FloatNum min(void) const; + FloatNum min() const; /// Return maximum - FloatNum max(void) const; + FloatNum max() const; //@} }; diff --git a/gecode/float/array.hpp b/gecode/float/array.hpp index 0618133a8c..935965217b 100644 --- a/gecode/float/array.hpp +++ b/gecode/float/array.hpp @@ -40,7 +40,7 @@ namespace Gecode { */ forceinline - FloatValArgs::FloatValArgs(void) + FloatValArgs::FloatValArgs() : ArgArray(0) {} forceinline diff --git a/gecode/float/branch.hh b/gecode/float/branch.hh index 79d17157af..7c3b6d8a8f 100644 --- a/gecode/float/branch.hh +++ b/gecode/float/branch.hh @@ -139,7 +139,7 @@ namespace Gecode { namespace Float { namespace Branch { /// Return AFC over size as merit for view \a x at position \a i double operator()(const Space& home, FloatView x, int i); /// Whether dispose must always be called (that is, notice is needed) - bool notice(void) const; + bool notice() const; /// Dispose view selection void dispose(Space& home); }; @@ -163,7 +163,7 @@ namespace Gecode { namespace Float { namespace Branch { /// Return action over size as merit for view \a x at position \a i double operator()(const Space& home, FloatView x, int i); /// Whether dispose must always be called (that is, notice is needed) - bool notice(void) const; + bool notice() const; /// Dispose view selection void dispose(Space& home); }; @@ -187,7 +187,7 @@ namespace Gecode { namespace Float { namespace Branch { /// Return CHB Q-score over size as merit for view \a x at position \a i double operator()(const Space& home, FloatView x, int i); /// Whether dispose must always be called (that is, notice is needed) - bool notice(void) const; + bool notice() const; /// Dispose view selection void dispose(Space& home); }; @@ -267,7 +267,7 @@ namespace Gecode { namespace Float { namespace Branch { r = r.split(a); } bool - random(void) const { + random() const { return true; } /// Constructor for initialization @@ -277,7 +277,7 @@ namespace Gecode { namespace Float { namespace Branch { /// Return value of view \a x at position \a i FloatNumBranch val(const Space& home, FloatView x, int i); /// Whether dispose must always be called (that is, notice is needed) - bool notice(void) const; + bool notice() const; /// Delete value selection void dispose(Space& home); }; diff --git a/gecode/float/branch/assign.hpp b/gecode/float/branch/assign.hpp index e38cfa3bc8..479ed650ca 100644 --- a/gecode/float/branch/assign.hpp +++ b/gecode/float/branch/assign.hpp @@ -45,17 +45,17 @@ namespace Gecode { : ValBranch(std::move(v), std::move(c)), s(SEL_VAL_COMMIT) {} forceinline FloatAssign::Select - FloatAssign::select(void) const { + FloatAssign::select() const { return s; } inline FloatAssign - FLOAT_ASSIGN_MIN(void) { + FLOAT_ASSIGN_MIN() { return FloatAssign(FloatAssign::SEL_MIN); } inline FloatAssign - FLOAT_ASSIGN_MAX(void) { + FLOAT_ASSIGN_MAX() { return FloatAssign(FloatAssign::SEL_MAX); } diff --git a/gecode/float/branch/merit.hpp b/gecode/float/branch/merit.hpp index 9ac88c3fbf..ca77c37e65 100644 --- a/gecode/float/branch/merit.hpp +++ b/gecode/float/branch/merit.hpp @@ -96,7 +96,7 @@ namespace Gecode { namespace Float { namespace Branch { return x.afc() / static_cast(x.size()); } forceinline bool - MeritAFCSize::notice(void) const { + MeritAFCSize::notice() const { return false; } forceinline void @@ -117,7 +117,7 @@ namespace Gecode { namespace Float { namespace Branch { return action[i] / static_cast(x.size()); } forceinline bool - MeritActionSize::notice(void) const { + MeritActionSize::notice() const { return true; } forceinline void @@ -137,7 +137,7 @@ namespace Gecode { namespace Float { namespace Branch { return chb[i] / static_cast(x.size()); } forceinline bool - MeritCHBSize::notice(void) const { + MeritCHBSize::notice() const { return true; } forceinline void diff --git a/gecode/float/branch/val-sel.hpp b/gecode/float/branch/val-sel.hpp index 22d8498ef7..f0f8f89b1b 100644 --- a/gecode/float/branch/val-sel.hpp +++ b/gecode/float/branch/val-sel.hpp @@ -91,7 +91,7 @@ namespace Gecode { namespace Float { namespace Branch { return nl; } forceinline bool - ValSelRnd::notice(void) const { + ValSelRnd::notice() const { return false; } forceinline void diff --git a/gecode/float/branch/val.hpp b/gecode/float/branch/val.hpp index 61d98505a5..f81c47ee9a 100644 --- a/gecode/float/branch/val.hpp +++ b/gecode/float/branch/val.hpp @@ -45,17 +45,17 @@ namespace Gecode { : ValBranch(std::move(v), std::move(c)), s(SEL_VAL_COMMIT) {} forceinline FloatValBranch::Select - FloatValBranch::select(void) const { + FloatValBranch::select() const { return s; } inline FloatValBranch - FLOAT_VAL_SPLIT_MIN(void) { + FLOAT_VAL_SPLIT_MIN() { return FloatValBranch(FloatValBranch::SEL_SPLIT_MIN); } inline FloatValBranch - FLOAT_VAL_SPLIT_MAX(void) { + FLOAT_VAL_SPLIT_MAX() { return FloatValBranch(FloatValBranch::SEL_SPLIT_MAX); } diff --git a/gecode/float/branch/var.hpp b/gecode/float/branch/var.hpp index bce2be4d63..39bc7c3708 100644 --- a/gecode/float/branch/var.hpp +++ b/gecode/float/branch/var.hpp @@ -35,7 +35,7 @@ namespace Gecode { forceinline - FloatVarBranch::FloatVarBranch(void) + FloatVarBranch::FloatVarBranch() : s(SEL_NONE) {} forceinline @@ -67,7 +67,7 @@ namespace Gecode { : VarBranch(std::move(mf), std::move(t)), s(s0) {} forceinline FloatVarBranch::Select - FloatVarBranch::select(void) const { + FloatVarBranch::select() const { return s; } @@ -100,7 +100,7 @@ namespace Gecode { } inline FloatVarBranch - FLOAT_VAR_NONE(void) { + FLOAT_VAR_NONE() { return FloatVarBranch(FloatVarBranch::SEL_NONE, nullptr); } diff --git a/gecode/float/interval.hpp b/gecode/float/interval.hpp index 1f8f2ddef7..c03e0f3a47 100644 --- a/gecode/float/interval.hpp +++ b/gecode/float/interval.hpp @@ -97,7 +97,7 @@ namespace Gecode { namespace Float { /// \name Construction and access //@{ /// Initialize as \f$[0,0]\f$ - Interval(void) = default; + Interval() = default; /// Initialize as \f$[v,v]\f$, accepting NaN explicit Interval(FloatNum v); /// Initialize as \f$[l,u]\f$, throwing unless \f$l\leq u\f$ @@ -107,19 +107,19 @@ namespace Gecode { namespace Float { /// Set to \f$[l,u]\f$, or throw and stay unchanged unless \f$l\leq u\f$ void assign(FloatNum l, FloatNum u); /// Return lower bound - FloatNum lower(void) const; + FloatNum lower() const; /// Return upper bound - FloatNum upper(void) const; + FloatNum upper() const; //@} /// \name Constants //@{ /// Return enclosure of \f$\pi/2\f$ - static Interval pi_half(void); + static Interval pi_half(); /// Return enclosure of \f$\pi\f$ - static Interval pi(void); + static Interval pi(); /// Return enclosure of \f$2\pi\f$ - static Interval pi_twice(void); + static Interval pi_twice(); //@} /// \name Update operators @@ -148,13 +148,13 @@ namespace Gecode { namespace Float { /// Throw the exception for an empty result [[noreturn]] inline void - throw_empty(void) { + throw_empty() { throw std::runtime_error("Gecode::Float::Interval: empty interval"); } /// Return \f$[-\infty,+\infty]\f$ forceinline Interval - whole(void) { + whole() { const FloatNum inf = std::numeric_limits::infinity(); return Interval::unchecked(-inf, inf); } @@ -194,24 +194,24 @@ namespace Gecode { namespace Float { } forceinline FloatNum - Interval::lower(void) const { + Interval::lower() const { return lb; } forceinline FloatNum - Interval::upper(void) const { + Interval::upper() const { return ub; } forceinline Interval - Interval::pi_half(void) { + Interval::pi_half() { return unchecked(pi_half_lower(), pi_half_upper()); } forceinline Interval - Interval::pi(void) { + Interval::pi() { return unchecked(pi_lower(), pi_upper()); } forceinline Interval - Interval::pi_twice(void) { + Interval::pi_twice() { return unchecked(pi_twice_lower(), pi_twice_upper()); } diff --git a/gecode/float/num.hpp b/gecode/float/num.hpp index d3ac156cb1..437665d2dd 100644 --- a/gecode/float/num.hpp +++ b/gecode/float/num.hpp @@ -38,27 +38,27 @@ namespace Gecode { */ forceinline FloatNum - pi_half_lower(void) { + pi_half_lower() { return 0x1.921fb54442d18p+0; } forceinline FloatNum - pi_half_upper(void) { + pi_half_upper() { return 0x1.921fb54442d19p+0; } forceinline FloatNum - pi_lower(void) { + pi_lower() { return 0x1.921fb54442d18p+1; } forceinline FloatNum - pi_upper(void) { + pi_upper() { return 0x1.921fb54442d19p+1; } forceinline FloatNum - pi_twice_lower(void) { + pi_twice_lower() { return 0x1.921fb54442d18p+2; } forceinline FloatNum - pi_twice_upper(void) { + pi_twice_upper() { return 0x1.921fb54442d19p+2; } } // namespace Gecode diff --git a/gecode/float/rounding.hpp b/gecode/float/rounding.hpp index 0a102b1d27..d315af1330 100644 --- a/gecode/float/rounding.hpp +++ b/gecode/float/rounding.hpp @@ -62,7 +62,7 @@ namespace Gecode { namespace Float { } // namespace Control87 forceinline RoundingBase::Mode - RoundingBase::current_mode(void) { + RoundingBase::current_mode() { return _control87(0, 0); } forceinline void @@ -70,22 +70,22 @@ namespace Gecode { namespace Float { _control87(m, Control87::fields); } forceinline void - RoundingBase::upward(void) { + RoundingBase::upward() { _control87(Control87::base_settings | _RC_UP, Control87::fields); } forceinline void - RoundingBase::downward(void) { + RoundingBase::downward() { _control87(Control87::base_settings | _RC_DOWN, Control87::fields); } forceinline void - RoundingBase::to_nearest(void) { + RoundingBase::to_nearest() { _control87(Control87::base_settings | _RC_NEAR, Control87::fields); } #else forceinline RoundingBase::Mode - RoundingBase::current_mode(void) { + RoundingBase::current_mode() { return std::fegetround(); } forceinline void @@ -93,33 +93,33 @@ namespace Gecode { namespace Float { std::fesetround(m); } forceinline void - RoundingBase::upward(void) { + RoundingBase::upward() { std::fesetround(FE_UPWARD); } forceinline void - RoundingBase::downward(void) { + RoundingBase::downward() { std::fesetround(FE_DOWNWARD); } forceinline void - RoundingBase::to_nearest(void) { + RoundingBase::to_nearest() { std::fesetround(FE_TONEAREST); } #endif forceinline void - RoundingBase::init(void) { + RoundingBase::init() { #ifndef GECODE_FLOAT_DIRECTED_PER_OPERATION upward(); #endif } forceinline - Rounding::Rounding(void) + Rounding::Rounding() : saved(current_mode()) { init(); } - forceinline Rounding::~Rounding(void) { + forceinline Rounding::~Rounding() { restore_mode(saved); } diff --git a/gecode/float/trace/delta.hpp b/gecode/float/trace/delta.hpp index 8820d9efee..09c9e2fde7 100644 --- a/gecode/float/trace/delta.hpp +++ b/gecode/float/trace/delta.hpp @@ -39,12 +39,12 @@ namespace Gecode { } forceinline FloatNum - FloatTraceDelta::min(void) const { + FloatTraceDelta::min() const { return n.min(d); } forceinline FloatNum - FloatTraceDelta::max(void) const { + FloatTraceDelta::max() const { return n.max(d); } diff --git a/gecode/float/trace/trace-view.hpp b/gecode/float/trace/trace-view.hpp index 432b5f1c86..c3e5745d2b 100644 --- a/gecode/float/trace/trace-view.hpp +++ b/gecode/float/trace/trace-view.hpp @@ -36,7 +36,7 @@ namespace Gecode { namespace Float { class FloatTraceView { public: /// Default constructor (initializes with no view) - FloatTraceView(void) = default; + FloatTraceView() = default; /// Duplicate view \a y FloatTraceView(Space& home, FloatView y); /// Update duplicated view from view \a y and delta \a d diff --git a/gecode/float/val.hpp b/gecode/float/val.hpp index a92108f0e2..42744b5747 100644 --- a/gecode/float/val.hpp +++ b/gecode/float/val.hpp @@ -62,29 +62,29 @@ namespace Gecode { } forceinline FloatNum - FloatVal::min(void) const { + FloatVal::min() const { return x.lower(); } forceinline FloatNum - FloatVal::max(void) const { + FloatVal::max() const { return x.upper(); } forceinline FloatNum - FloatVal::size(void) const { + FloatVal::size() const { return Float::width(x); } forceinline FloatNum - FloatVal::med(void) const { + FloatVal::med() const { Float::Rounding r; return r.median(x.lower(), x.upper()); } forceinline bool - FloatVal::tight(void) const { + FloatVal::tight() const { return (Float::singleton(x) || (nextafter(x.lower(), x.upper()) == x.upper())); } forceinline bool - FloatVal::singleton(void) const { + FloatVal::singleton() const { return Float::singleton(x); } forceinline bool @@ -92,7 +92,7 @@ namespace Gecode { return Float::in(n, x); } forceinline bool - FloatVal::zero_in(void) const { + FloatVal::zero_in() const { return Float::zero_in(x); } @@ -102,17 +102,17 @@ namespace Gecode { return h; } forceinline FloatVal - FloatVal::pi_half(void) { + FloatVal::pi_half() { FloatVal p(FloatValImpType::pi_half()); return p; } forceinline FloatVal - FloatVal::pi(void) { + FloatVal::pi() { FloatVal p(FloatValImpType::pi()); return p; } forceinline FloatVal - FloatVal::pi_twice(void) { + FloatVal::pi_twice() { FloatVal p(FloatValImpType::pi_twice()); return p; } diff --git a/gecode/float/var-imp.hpp b/gecode/float/var-imp.hpp index 30d522a39a..41661ebd48 100644 --- a/gecode/float/var-imp.hpp +++ b/gecode/float/var-imp.hpp @@ -52,15 +52,15 @@ namespace Gecode { namespace Float { FloatNum _max; ///< Largest value just pruned public: /// Create float delta as providing no information - FloatDelta(void); + FloatDelta(); /// Create float delta with \a min and \a max FloatDelta(FloatNum min, FloatNum max); private: /// Return minimum - FloatNum min(void) const; + FloatNum min() const; /// Return maximum - FloatNum max(void) const; + FloatNum max() const; }; }} // namespace Gecode::Float @@ -88,27 +88,27 @@ namespace Gecode { namespace Float { /// \name Value access //@{ /// Return domain - FloatVal domain(void) const; + FloatVal domain() const; /// Return minimum of domain - FloatNum min(void) const; + FloatNum min() const; /// Return maximum of domain - FloatNum max(void) const; + FloatNum max() const; /// Return value of domain (only if assigned) - FloatVal val(void) const; + FloatVal val() const; /// Return median of domain (closest representation) - FloatNum med(void) const; + FloatNum med() const; /// Return width of domain (distance between maximum and minimum) - FloatNum size(void) const; + FloatNum size() const; //@} /// \name Domain tests //@{ /// Test whether variable is assigned - bool assigned(void) const; + bool assigned() const; /// Test whether 0 is contained in domain - bool zero_in(void) const; + bool zero_in() const; /// Test whether \a n is contained in domain bool in(FloatNum n) const; /// Test whether \a n is contained in domain diff --git a/gecode/float/var-imp/delta.hpp b/gecode/float/var-imp/delta.hpp index e61fa1334f..d420e742f7 100644 --- a/gecode/float/var-imp/delta.hpp +++ b/gecode/float/var-imp/delta.hpp @@ -40,17 +40,17 @@ namespace Gecode { namespace Float { forceinline - FloatDelta::FloatDelta(void) + FloatDelta::FloatDelta() : _min(1), _max(0) {} forceinline FloatDelta::FloatDelta(FloatNum min, FloatNum max) : _min(min), _max(max) {} forceinline FloatNum - FloatDelta::min(void) const { + FloatDelta::min() const { return _min; } forceinline FloatNum - FloatDelta::max(void) const { + FloatDelta::max() const { return _max; } diff --git a/gecode/float/var-imp/float.hpp b/gecode/float/var-imp/float.hpp index 654c3f5b30..3c37840048 100644 --- a/gecode/float/var-imp/float.hpp +++ b/gecode/float/var-imp/float.hpp @@ -58,33 +58,33 @@ namespace Gecode { namespace Float { */ forceinline FloatVal - FloatVarImp::domain(void) const { + FloatVarImp::domain() const { return dom; } forceinline FloatNum - FloatVarImp::min(void) const { + FloatVarImp::min() const { return dom.min(); } forceinline FloatNum - FloatVarImp::max(void) const { + FloatVarImp::max() const { return dom.max(); } forceinline FloatVal - FloatVarImp::val(void) const { + FloatVarImp::val() const { return dom; } forceinline FloatNum - FloatVarImp::med(void) const { + FloatVarImp::med() const { return dom.med(); } forceinline bool - FloatVarImp::assigned(void) const { + FloatVarImp::assigned() const { return dom.tight(); } forceinline FloatNum - FloatVarImp::size(void) const { + FloatVarImp::size() const { return dom.size(); } @@ -94,7 +94,7 @@ namespace Gecode { namespace Float { */ forceinline bool - FloatVarImp::zero_in(void) const { + FloatVarImp::zero_in() const { return dom.zero_in(); } forceinline bool diff --git a/gecode/float/var/float.hpp b/gecode/float/var/float.hpp index 4fce8fb960..3232dd9d6e 100644 --- a/gecode/float/var/float.hpp +++ b/gecode/float/var/float.hpp @@ -44,31 +44,31 @@ namespace Gecode { : VarImpVar(y.varimp()) {} forceinline FloatVal - FloatVar::val(void) const { + FloatVar::val() const { if (!x->assigned()) throw Float::ValOfUnassignedVar("FloatVar::val"); return x->val(); } forceinline FloatNum - FloatVar::min(void) const { + FloatVar::min() const { return x->min(); } forceinline FloatNum - FloatVar::med(void) const { + FloatVar::med() const { return x->med(); } forceinline FloatNum - FloatVar::max(void) const { + FloatVar::max() const { return x->max(); } forceinline FloatVal - FloatVar::domain(void) const { + FloatVar::domain() const { return x->domain(); } forceinline FloatNum - FloatVar::size(void) const { + FloatVar::size() const { return x->size(); } diff --git a/gecode/float/view.hpp b/gecode/float/view.hpp index 72f01edea3..4c949b0db3 100644 --- a/gecode/float/view.hpp +++ b/gecode/float/view.hpp @@ -56,7 +56,7 @@ namespace Gecode { namespace Float { /// \name Constructors and initialization //@{ /// Default constructor - FloatView(void) = default; + FloatView() = default; /// Initialize from float variable \a y FloatView(const FloatVar& y); /// Initialize from float variable \a y @@ -66,13 +66,13 @@ namespace Gecode { namespace Float { /// \name Value access //@{ /// Return domain - FloatVal domain(void) const; + FloatVal domain() const; /// Return minimum of domain - FloatNum min(void) const; + FloatNum min() const; /// Return maximum of domain - FloatNum max(void) const; + FloatNum max() const; /// Return median of domain (closest representation) - FloatNum med(void) const; + FloatNum med() const; /** * \brief Return assigned value * @@ -80,16 +80,16 @@ namespace Gecode { namespace Float { * is not yet assigned. * */ - FloatVal val(void) const; + FloatVal val() const; /// Return size of domain (distance between maximum and minimum) - FloatNum size(void) const; + FloatNum size() const; //@} /// \name Domain tests //@{ /// Test whether 0 is contained in domain - bool zero_in(void) const; + bool zero_in() const; /// Test whether \a n is contained in domain bool in(FloatNum n) const; /// Test whether \a n is contained in domain @@ -158,7 +158,7 @@ namespace Gecode { namespace Float { /// \name Constructors and initialization //@{ /// Default constructor - MinusView(void) = default; + MinusView() = default; /// Initialize with float view \a y explicit MinusView(const FloatView& y); //@} @@ -166,13 +166,13 @@ namespace Gecode { namespace Float { /// \name Value access //@{ /// Return domain - FloatVal domain(void) const; + FloatVal domain() const; /// Return minimum of domain - FloatNum min(void) const; + FloatNum min() const; /// Return maximum of domain - FloatNum max(void) const; + FloatNum max() const; /// Return median of domain (closest representation) - FloatNum med(void) const; + FloatNum med() const; /** * \brief Return assigned value * @@ -180,16 +180,16 @@ namespace Gecode { namespace Float { * is not yet assigned. * */ - FloatVal val(void) const; + FloatVal val() const; /// Return size of domain (distance between maximum and minimum) - FloatNum size(void) const; + FloatNum size() const; //@} /// \name Domain tests //@{ /// Test whether 0 is contained in domain - bool zero_in(void) const; + bool zero_in() const; /// Test whether \a n is contained in domain bool in(FloatNum n) const; /// Test whether \a n is contained in domain @@ -268,7 +268,7 @@ namespace Gecode { namespace Float { /// \name Constructors and initialization //@{ /// Default constructor - OffsetView(void) = default; + OffsetView() = default; /// Initialize with float view \a y and an offset c explicit OffsetView(const FloatView& y, FloatNum c); //@} @@ -276,17 +276,17 @@ namespace Gecode { namespace Float { /// \name Value access //@{ /// Return offset - FloatNum offset(void) const; + FloatNum offset() const; /// Change offset to be \a n void offset(FloatNum n); /// Return domain - FloatVal domain(void) const; + FloatVal domain() const; /// Return minimum of domain - FloatNum min(void) const; + FloatNum min() const; /// Return maximum of domain - FloatNum max(void) const; + FloatNum max() const; /// Return median of domain (closest representation) - FloatNum med(void) const; + FloatNum med() const; /** * \brief Return assigned value * @@ -294,16 +294,16 @@ namespace Gecode { namespace Float { * is not yet assigned. * */ - FloatVal val(void) const; + FloatVal val() const; /// Return size of domain (distance between maximum and minimum) - FloatNum size(void) const; + FloatNum size() const; //@} /// \name Domain tests //@{ /// Test whether 0 is contained in domain - bool zero_in(void) const; + bool zero_in() const; /// Test whether \a n is contained in domain bool in(FloatNum n) const; /// Test whether \a n is contained in domain @@ -394,7 +394,7 @@ namespace Gecode { namespace Float { /// \name Constructors and initialization //@{ /// Default constructor - ScaleView(void) = default; + ScaleView() = default; /// Initialize as \f$b\cdot y\f$ ScaleView(const FloatVal& b, const FloatView& y); //@} @@ -402,15 +402,15 @@ namespace Gecode { namespace Float { /// \name Value access //@{ /// Return domain - FloatVal domain(void) const; + FloatVal domain() const; /// Return scale factor of scale view - FloatVal scale(void) const; + FloatVal scale() const; /// Return minimum of domain - FloatNum min(void) const; + FloatNum min() const; /// Return maximum of domain - FloatNum max(void) const; + FloatNum max() const; /// Return median of domain (closest representation) - FloatNum med(void) const; + FloatNum med() const; /** * \brief Return assigned value @@ -419,16 +419,16 @@ namespace Gecode { namespace Float { * is not yet assigned. * */ - FloatVal val(void) const; + FloatVal val() const; /// Return size of domain (distance between maximum and minimum) - FloatNum size(void) const; + FloatNum size() const; //@} /// \name Domain tests //@{ /// Test whether 0 is contained in domain - bool zero_in(void) const; + bool zero_in() const; /// Test whether \a n is contained in domain bool in(FloatNum n) const; /// Test whether \a n is contained in domain diff --git a/gecode/float/view/float.hpp b/gecode/float/view/float.hpp index cc27997b7c..aec1b5e4a9 100644 --- a/gecode/float/view/float.hpp +++ b/gecode/float/view/float.hpp @@ -50,28 +50,28 @@ namespace Gecode { namespace Float { * */ forceinline FloatVal - FloatView::domain(void) const { + FloatView::domain() const { return x->domain(); } forceinline FloatNum - FloatView::min(void) const { + FloatView::min() const { return x->min(); } forceinline FloatNum - FloatView::max(void) const { + FloatView::max() const { return x->max(); } forceinline FloatNum - FloatView::med(void) const { + FloatView::med() const { return x->med(); } forceinline FloatVal - FloatView::val(void) const { + FloatView::val() const { return x->val(); } forceinline FloatNum - FloatView::size(void) const { + FloatView::size() const { return x->size(); } @@ -80,7 +80,7 @@ namespace Gecode { namespace Float { * */ forceinline bool - FloatView::zero_in(void) const { + FloatView::zero_in() const { return x->zero_in(); } forceinline bool diff --git a/gecode/float/view/minus.hpp b/gecode/float/view/minus.hpp index 77b56477f5..ca2066d7eb 100644 --- a/gecode/float/view/minus.hpp +++ b/gecode/float/view/minus.hpp @@ -47,28 +47,28 @@ namespace Gecode { namespace Float { * */ forceinline FloatVal - MinusView::domain(void) const { + MinusView::domain() const { return -x.domain(); } forceinline FloatNum - MinusView::min(void) const { + MinusView::min() const { return -x.max(); } forceinline FloatNum - MinusView::max(void) const { + MinusView::max() const { return -x.min(); } forceinline FloatNum - MinusView::med(void) const { + MinusView::med() const { return -x.med(); } forceinline FloatVal - MinusView::val(void) const { + MinusView::val() const { return -x.val(); } forceinline FloatNum - MinusView::size(void) const { + MinusView::size() const { return x.size(); } @@ -77,7 +77,7 @@ namespace Gecode { namespace Float { * */ forceinline bool - MinusView::zero_in(void) const { + MinusView::zero_in() const { return x.zero_in(); } forceinline bool diff --git a/gecode/float/view/offset.hpp b/gecode/float/view/offset.hpp index 4a8ee15dfc..d54402868a 100644 --- a/gecode/float/view/offset.hpp +++ b/gecode/float/view/offset.hpp @@ -47,7 +47,7 @@ namespace Gecode { namespace Float { * */ forceinline FloatNum - OffsetView::offset(void) const { + OffsetView::offset() const { return c; } forceinline void @@ -55,28 +55,28 @@ namespace Gecode { namespace Float { c = n; } forceinline FloatVal - OffsetView::domain(void) const { + OffsetView::domain() const { return x.domain() + c; } forceinline FloatNum - OffsetView::min(void) const { + OffsetView::min() const { return x.min() + c; } forceinline FloatNum - OffsetView::max(void) const { + OffsetView::max() const { return x.max() + c; } forceinline FloatNum - OffsetView::med(void) const { + OffsetView::med() const { return x.med() + c; } forceinline FloatVal - OffsetView::val(void) const { + OffsetView::val() const { return x.val() + c; } forceinline FloatNum - OffsetView::size(void) const { + OffsetView::size() const { return x.size(); } @@ -85,7 +85,7 @@ namespace Gecode { namespace Float { * */ forceinline bool - OffsetView::zero_in(void) const { + OffsetView::zero_in() const { return x.in(-c); } forceinline bool diff --git a/gecode/float/view/scale.hpp b/gecode/float/view/scale.hpp index 5f2ff1ea9a..d5a8c1dde3 100644 --- a/gecode/float/view/scale.hpp +++ b/gecode/float/view/scale.hpp @@ -47,40 +47,40 @@ namespace Gecode { namespace Float { * */ forceinline FloatVal - ScaleView::scale(void) const { + ScaleView::scale() const { return a; } forceinline FloatVal - ScaleView::domain(void) const { + ScaleView::domain() const { return x.domain() * a; } forceinline FloatNum - ScaleView::min(void) const { + ScaleView::min() const { FloatVal c = x.min(); c *= a; return c.min(); } forceinline FloatNum - ScaleView::max(void) const { + ScaleView::max() const { FloatVal c = x.max(); c *= a; return c.max(); } forceinline FloatNum - ScaleView::med(void) const { + ScaleView::med() const { FloatVal c = x.med(); c *= a; return (c.min() + c.max()) / 2; } forceinline FloatVal - ScaleView::val(void) const { + ScaleView::val() const { FloatVal c = x.val(); c *= a; return c; } forceinline FloatNum - ScaleView::size(void) const { + ScaleView::size() const { FloatVal c = x.size(); c *= a; return c.max(); @@ -91,7 +91,7 @@ namespace Gecode { namespace Float { * */ forceinline bool - ScaleView::zero_in(void) const { + ScaleView::zero_in() const { return x.zero_in(); } forceinline bool diff --git a/gecode/gist.hh b/gecode/gist.hh index 4789c9ed88..83d3ca3a0b 100644 --- a/gecode/gist.hh +++ b/gecode/gist.hh @@ -95,11 +95,11 @@ namespace Gecode { /// Call-back function virtual void inspect(const Space& s) = 0; /// Name of the inspector - virtual std::string name(void); + virtual std::string name(); /// Clean up when Gist exits - virtual void finalize(void); + virtual void finalize(); /// Destructor - virtual ~Inspector(void); + virtual ~Inspector(); }; /** \brief Abstract base class for comparators @@ -118,11 +118,11 @@ namespace Gecode { /// Call-back function virtual void compare(const Space& s0, const Space& s1) = 0; /// Name of the comparator - virtual std::string name(void); + virtual std::string name(); /// Clean up when Gist exits - virtual void finalize(void); + virtual void finalize(); /// Destructor - virtual ~Comparator(void); + virtual ~Comparator(); //@} @@ -159,11 +159,11 @@ namespace Gecode { protected: /// Initialize the implementation object - void init(void); + void init(); /// Get the stream that is used to output text - std::ostream& get_stream(void); + std::ostream& get_stream(); /// Flush stream - void flush(void); + void flush(); /// Add html text \a s to the output void add_html(const char* s); @@ -171,11 +171,11 @@ namespace Gecode { /// Constructor TextOutput(const std::string& name); /// Clean up when Gist exits - void finalize(void); + void finalize(); /// Destructor - virtual ~TextOutput(void); + virtual ~TextOutput(); /// Name of the inspector - virtual std::string name(void); + virtual std::string name(); }; /// An inspector for printing simple text output @@ -187,9 +187,9 @@ namespace Gecode { /// Use the print method of the template class S to print a space void inspect(const Space& node) override; /// Return name - std::string name(void) override; + std::string name() override; /// Clean up when Gist exits - void finalize(void) override; + void finalize() override; }; /** @@ -210,9 +210,9 @@ namespace Gecode { /// Compare \a s0 to \a s1 void compare(const Space& s0, const Space& s1) override; /// Return name - std::string name(void) override; + std::string name() override; /// Finalize when Gist exits - void finalize(void) override; + void finalize() override; }; /// A branching that stops exploration @@ -242,7 +242,7 @@ namespace Gecode { public: /// Constructor - I_(void); + I_(); /// Add inspector that reacts on node double clicks void click(Inspector* i); /// Add inspector that reacts on each new solution that is found @@ -264,7 +264,7 @@ namespace Gecode { /// Default options GECODE_GIST_EXPORT static const Options def; /// Initialize with default values - Options(void) = default; + Options() = default; }; /// Create a new stand-alone Gist for \a root using \a bab diff --git a/gecode/gist/drawingcursor.cpp b/gecode/gist/drawingcursor.cpp index 3d6fa298e1..5dc164b99c 100644 --- a/gecode/gist/drawingcursor.cpp +++ b/gecode/gist/drawingcursor.cpp @@ -70,7 +70,7 @@ namespace Gecode { namespace Gist { } void - DrawingCursor::process_current_node(void) { + DrawingCursor::process_current_node() { Gist::VisualNode* n = node(); double parent_x = x - static_cast(n->get_offset()); double parent_y = y - static_cast(Layout::dist_y) + node_width; diff --git a/gecode/gist/drawingcursor.hh b/gecode/gist/drawingcursor.hh index 4bdc4ee755..7e56ec5c14 100644 --- a/gecode/gist/drawingcursor.hh +++ b/gecode/gist/drawingcursor.hh @@ -54,7 +54,7 @@ namespace Gecode { namespace Gist { bool copies; /// Test if current node is clipped - bool is_clipped(void); + bool is_clipped(); public: /// The color for failed nodes @@ -82,15 +82,15 @@ namespace Gecode { namespace Gist { ///\name Cursor interface //@{ /// Move cursor to parent - void move_upwards(void); + void move_upwards(); /// Test if cursor may move to child - bool may_move_downwards(void); + bool may_move_downwards(); /// Move cursor to child - void move_downwards(void); + void move_downwards(); /// Move cursor to sibling - void move_sidewards(void); + void move_sidewards(); /// Draw the node - void process_current_node(void); + void process_current_node(); //@} }; diff --git a/gecode/gist/drawingcursor.hpp b/gecode/gist/drawingcursor.hpp index e720fe8dc9..d1c4b682e5 100644 --- a/gecode/gist/drawingcursor.hpp +++ b/gecode/gist/drawingcursor.hpp @@ -33,14 +33,14 @@ namespace Gecode { namespace Gist { inline void - DrawingCursor::move_upwards(void) { + DrawingCursor::move_upwards() { x -= node()->get_offset(); y -= Layout::dist_y; NodeCursor::move_upwards(); } forceinline bool - DrawingCursor::is_clipped(void) { + DrawingCursor::is_clipped() { if (clipping_rect.width() == 0 && clipping_rect.x() == 0 && clipping_rect.height() == 0 && clipping_rect.y() == 0) return false; @@ -51,20 +51,20 @@ namespace Gecode { namespace Gist { } inline bool - DrawingCursor::may_move_downwards(void) { + DrawingCursor::may_move_downwards() { return NodeCursor::may_move_downwards() && !node()->is_hidden() && node()->children_layout_is_done() && !is_clipped(); } inline void - DrawingCursor::move_downwards(void) { + DrawingCursor::move_downwards() { NodeCursor::move_downwards(); x += node()->get_offset(); y += Layout::dist_y; } inline void - DrawingCursor::move_sidewards(void) { + DrawingCursor::move_sidewards() { x -= node()->get_offset(); NodeCursor::move_sidewards(); x += node()->get_offset(); diff --git a/gecode/gist/gecodelogo.cpp b/gecode/gist/gecodelogo.cpp index 8581a1a49f..08f3d645a3 100644 --- a/gecode/gist/gecodelogo.cpp +++ b/gecode/gist/gecodelogo.cpp @@ -391,8 +391,7 @@ namespace Gecode { namespace Gist { } // namespace - Logos::Logos(void) - : logo(_logo), logo_size(sizeof(_logo)), gist_logo(_gist_logo), gist_logo_size(sizeof(_gist_logo)) {} + Logos::Logos() : logo(_logo), logo_size(sizeof(_logo)), gist_logo(_gist_logo), gist_logo_size(sizeof(_gist_logo)) {} }} // namespace Gecode::Gist diff --git a/gecode/gist/gecodelogo.hh b/gecode/gist/gecodelogo.hh index 1122d9f1d3..b815b84a4c 100644 --- a/gecode/gist/gecodelogo.hh +++ b/gecode/gist/gecodelogo.hh @@ -49,7 +49,7 @@ namespace Gecode { namespace Gist { const unsigned int gist_logo_size; /// Constructor - Logos(void); + Logos(); }; }} // namespace Gecode::Gist diff --git a/gecode/gist/gist.cpp b/gecode/gist/gist.cpp index 2eac8fe6cc..56c45ca7e7 100644 --- a/gecode/gist/gist.cpp +++ b/gecode/gist/gist.cpp @@ -41,44 +41,44 @@ namespace Gecode { namespace Gist { std::string - Inspector::name(void) { + Inspector::name() { return "Inspector"; } void - Inspector::finalize(void) {} + Inspector::finalize() {} - Inspector::~Inspector(void) = default; + Inspector::~Inspector() = default; std::string - Comparator::name(void) { + Comparator::name() { return "Comparator"; } void - Comparator::finalize(void) {} + Comparator::finalize() {} - Comparator::~Comparator(void) = default; + Comparator::~Comparator() = default; TextOutput::TextOutput(const std::string& name) : t(nullptr), n(name) {} void - TextOutput::finalize(void) { + TextOutput::finalize() { delete t; t = nullptr; } - TextOutput::~TextOutput(void) { + TextOutput::~TextOutput() { delete t; } std::string - TextOutput::name(void) { + TextOutput::name() { return n; } void - TextOutput::init(void) { + TextOutput::init() { if (t == nullptr) { t = new TextOutputI(n); } @@ -86,12 +86,12 @@ namespace Gecode { namespace Gist { } std::ostream& - TextOutput::get_stream(void) { + TextOutput::get_stream() { return t->get_stream(); } void - TextOutput::flush(void) { + TextOutput::flush() { t->flush(); } diff --git a/gecode/gist/gist.hpp b/gecode/gist/gist.hpp index 9135e1861e..eb26114558 100644 --- a/gecode/gist/gist.hpp +++ b/gecode/gist/gist.hpp @@ -50,13 +50,13 @@ namespace Gecode { namespace Gist { template std::string - VarComparator::name(void) { + VarComparator::name() { return TextOutput::name(); } template void - VarComparator::finalize(void) { + VarComparator::finalize() { TextOutput::finalize(); } @@ -142,18 +142,18 @@ namespace Gecode { namespace Gist { template std::string - Print::name(void) { + Print::name() { return TextOutput::name(); } template void - Print::finalize(void) { + Print::finalize() { TextOutput::finalize(); } forceinline - Options::I_::I_(void) + Options::I_::I_() : _click(heap, 1), n_click(0), _solution(heap, 1), n_solution(0), _move(heap, 1), n_move(0), _compare(heap, 1), n_compare(0) {} diff --git a/gecode/gist/layoutcursor.hh b/gecode/gist/layoutcursor.hh index 1aa1904dc9..84de46deb0 100644 --- a/gecode/gist/layoutcursor.hh +++ b/gecode/gist/layoutcursor.hh @@ -47,9 +47,9 @@ namespace Gecode { namespace Gist { /// \name Cursor interface //@{ /// Test if the cursor may move to the first child node - bool may_move_downwards(void); + bool may_move_downwards(); /// Compute layout for current node - void process_current_node(void); + void process_current_node(); //@} }; diff --git a/gecode/gist/layoutcursor.hpp b/gecode/gist/layoutcursor.hpp index cb544e333c..e1c63b3be7 100644 --- a/gecode/gist/layoutcursor.hpp +++ b/gecode/gist/layoutcursor.hpp @@ -33,7 +33,7 @@ namespace Gecode { namespace Gist { forceinline bool - LayoutCursor::may_move_downwards(void) { + LayoutCursor::may_move_downwards() { return NodeCursor::may_move_downwards() && node()->is_dirty(); } @@ -41,7 +41,7 @@ namespace Gecode { namespace Gist { : NodeCursor(the_node, na) {} forceinline void - LayoutCursor::process_current_node(void) { + LayoutCursor::process_current_node() { VisualNode* current_node = node(); if (current_node->is_dirty()) { if (current_node->is_hidden()) { diff --git a/gecode/gist/mainwindow.cpp b/gecode/gist/mainwindow.cpp index 285992673a..53082ceb7f 100644 --- a/gecode/gist/mainwindow.cpp +++ b/gecode/gist/mainwindow.cpp @@ -201,7 +201,7 @@ namespace Gecode { namespace Gist { connect(c, SIGNAL(status_changed(const Statistics&, bool)), this, SLOT(status_changed(const Statistics&, bool))); - connect(c, SIGNAL(search_finished(void)), this, SLOT(close(void))); + connect(c, SIGNAL(search_finished()), this, SLOT(close())); preferences(true); show(); @@ -259,7 +259,7 @@ namespace Gecode { namespace Gist { } void - GistMainWindow::about(void) { + GistMainWindow::about() { about_gist.show(); } @@ -283,7 +283,7 @@ namespace Gecode { namespace Gist { } void - GistMainWindow::populate_inspector_selection(void) { + GistMainWindow::populate_inspector_selection() { double_click_inspectors_menu->clear(); double_click_inspectors_menu->addActions(c->double_click_inspector_group->actions()); solution_inspectors_menu->clear(); @@ -295,7 +295,7 @@ namespace Gecode { namespace Gist { } void - GistMainWindow::populate_bookmarks(void) { + GistMainWindow::populate_bookmarks() { bookmarks_menu->clear(); bookmarks_menu->addAction(c->bookmark_node); bookmarks_menu->addSeparator(); @@ -303,7 +303,7 @@ namespace Gecode { namespace Gist { } void - GistMainWindow::populate_inspectors(void) { + GistMainWindow::populate_inspectors() { inspect_node_menu->clear(); inspect_node_menu->addAction(c->inspect); inspect_node_menu->addSeparator(); diff --git a/gecode/gist/mainwindow.hh b/gecode/gist/mainwindow.hh index fac74d3d8e..c0e75a7240 100644 --- a/gecode/gist/mainwindow.hh +++ b/gecode/gist/mainwindow.hh @@ -98,15 +98,15 @@ namespace Gecode { namespace Gist { /// The status has changed (e.g., new solutions have been found) void status_changed(const Statistics& stats, bool finished); /// Open the about dialog - void about(void); + void about(); /// Open the preferences dialog void preferences(bool setup = false); /// Populate the inspector menus from the actions found in Gist - void populate_inspector_selection(void); + void populate_inspector_selection(); /// Populate the inspector menus from the actions found in Gist - void populate_inspectors(void); + void populate_inspectors(); /// Populate the bookmarks menus from the actions found in Gist - void populate_bookmarks(void); + void populate_bookmarks(); public: /// Constructor diff --git a/gecode/gist/node.hh b/gecode/gist/node.hh index e3a87d5261..96e5667053 100644 --- a/gecode/gist/node.hh +++ b/gecode/gist/node.hh @@ -65,7 +65,7 @@ namespace Gecode { namespace Gist { /// Current node number in current block int cur_t; /// Allocate new block, potentially reallocate block array - void allocate(void); + void allocate(); /// Flag whether search uses branch-and-bound bool _bab; /// Hash table mapping nodes to label text @@ -75,7 +75,7 @@ namespace Gecode { namespace Gist { /// Constructor NodeAllocatorBase(bool bab); /// Destructor - ~NodeAllocatorBase(void); + ~NodeAllocatorBase(); /// Allocate new node with parent \a p int allocate(int p); /// Allocate new root node for space \a root @@ -87,9 +87,9 @@ namespace Gecode { namespace Gist { /// Set index of best node before \a i to \a b void set_best(int i, int b); /// Return branch-and-bound flag - bool bab(void) const; + bool bab() const; /// Return branching label flag - bool show_labels(void) const; + bool show_labels() const; /// Set branching label flag void show_labels(bool b); /// Return whether node \a n has a label @@ -125,17 +125,17 @@ namespace Gecode { namespace Gist { int parent; /// Read the tag of childrenOrFirstChild - unsigned int get_tag(void) const; + unsigned int get_tag() const; /// Set the tag of childrenOrFirstChild void set_tag(unsigned int tag); /// Return childrenOrFirstChild without tag - void* get_ptr(void) const; + void* get_ptr() const; /// Return childrenOrFirstChild as integer - int get_first_child(void) const; + int get_first_child() const; protected: /// Return whether this node is undetermined - bool is_undetermined(void) const; + bool is_undetermined() const; /// Return index of child no \a n int get_child(int n) const; @@ -147,7 +147,7 @@ namespace Gecode { namespace Gist { Node(int p, bool failed = false); /// Return the parent - int get_parent(void) const; + int get_parent() const; /// Return the parent VisualNode* get_parent(const NodeAllocator& na) const; /// Return child no \a n @@ -157,13 +157,13 @@ namespace Gecode { namespace Gist { int get_index(const NodeAllocator& na) const; /// Check if this node is the root of a tree - bool is_root(void) const; + bool is_root() const; /// Set the number of children to \a n and initialize children void set_number_of_children(unsigned int n, NodeAllocator& na); /// Return the number of children - unsigned int get_number_of_children(void) const; + unsigned int get_number_of_children() const; }; }} // namespace Gecode::Gist diff --git a/gecode/gist/node.hpp b/gecode/gist/node.hpp index cb6c5d045a..a95155e03a 100644 --- a/gecode/gist/node.hpp +++ b/gecode/gist/node.hpp @@ -34,7 +34,7 @@ namespace Gecode { namespace Gist { template void - NodeAllocatorBase::allocate(void) { + NodeAllocatorBase::allocate() { cur_b++; cur_t = 0; if (cur_b == n) { @@ -54,7 +54,7 @@ namespace Gecode { namespace Gist { } template - NodeAllocatorBase::~NodeAllocatorBase(void) { + NodeAllocatorBase::~NodeAllocatorBase() { for (int i = cur_b + 1; i--;) heap.rfree(b[i]); heap.free(b, n); @@ -109,13 +109,13 @@ namespace Gecode { namespace Gist { template forceinline bool - NodeAllocatorBase::bab(void) const { + NodeAllocatorBase::bab() const { return _bab; } template forceinline bool - NodeAllocatorBase::show_labels(void) const { + NodeAllocatorBase::show_labels() const { return !labels.isEmpty(); } @@ -144,7 +144,7 @@ namespace Gecode { namespace Gist { } forceinline unsigned int - Node::get_tag(void) const { + Node::get_tag() const { return static_cast(reinterpret_cast(children_or_first_child) & 0b11); } @@ -157,12 +157,12 @@ namespace Gecode { namespace Gist { } forceinline void* - Node::get_ptr(void) const { + Node::get_ptr() const { return Support::clear_pointer_tag_bits<2>(children_or_first_child); } forceinline int - Node::get_first_child(void) const { + Node::get_first_child() const { return static_cast( (reinterpret_cast(children_or_first_child) & ~static_cast(0b11)) >> 2); @@ -177,7 +177,7 @@ namespace Gecode { namespace Gist { } forceinline int - Node::get_parent(void) const { + Node::get_parent() const { return parent; } @@ -187,7 +187,7 @@ namespace Gecode { namespace Gist { } forceinline bool - Node::is_undetermined(void) const { + Node::is_undetermined() const { return get_tag() == UNDET; } @@ -208,12 +208,12 @@ namespace Gecode { namespace Gist { } forceinline bool - Node::is_root(void) const { + Node::is_root() const { return parent == -1; } forceinline unsigned int - Node::get_number_of_children(void) const { + Node::get_number_of_children() const { switch (get_tag()) { case UNDET: case LEAF: diff --git a/gecode/gist/nodecursor.hh b/gecode/gist/nodecursor.hh index dd954e4454..6cc483dbc7 100644 --- a/gecode/gist/nodecursor.hh +++ b/gecode/gist/nodecursor.hh @@ -54,32 +54,32 @@ namespace Gecode { namespace Gist { /// Set current node to \a n void node(Node* n); /// Return start node - Node* start_node(void); + Node* start_node(); public: /// Construct cursor, initially set to \a current_node NodeCursor(Node* current_node, const typename Node::NodeAllocator& na); /// Return current node - Node* node(void); + Node* node(); /// Return current alternative - unsigned int alternative(void); + unsigned int alternative(); /// Set current alternative void alternative(unsigned int a); /// \name Cursor interface //@{ /// Test if the cursor may move to the parent node - bool may_move_upwards(void); + bool may_move_upwards(); /// Move cursor to the parent node - void move_upwards(void); + void move_upwards(); /// Test if cursor may move to the first child node - bool may_move_downwards(void); + bool may_move_downwards(); /// Move cursor to the first child node - void move_downwards(void); + void move_downwards(); /// Test if cursor may move to the first sibling - bool may_move_sidewards(void); + bool may_move_sidewards(); /// Move cursor to the first sibling - void move_sidewards(void); + void move_sidewards(); //@} }; @@ -94,9 +94,9 @@ namespace Gecode { namespace Gist { /// \name Cursor interface //@{ /// Test if the cursor may move to the first child node - bool may_move_downwards(void); + bool may_move_downwards(); /// Process node - void process_current_node(void); + void process_current_node(); //@} }; @@ -108,7 +108,7 @@ namespace Gecode { namespace Gist { /// \name Cursor interface //@{ /// Process node - void process_current_node(void); + void process_current_node(); //@} }; @@ -120,7 +120,7 @@ namespace Gecode { namespace Gist { /// \name Cursor interface //@{ /// Process node - void process_current_node(void); + void process_current_node(); //@} }; @@ -130,7 +130,7 @@ namespace Gecode { namespace Gist { /// Whether to search backwards bool back; /// Whether the current node is not a solution - bool not_on_sol(void); + bool not_on_sol(); public: /// Constructor @@ -138,17 +138,17 @@ namespace Gecode { namespace Gist { /// \name Cursor interface //@{ /// Do nothing - void process_current_node(void); + void process_current_node(); /// Test if the cursor may move to the parent node - bool may_move_upwards(void); + bool may_move_upwards(); /// Test if cursor may move to the first child node - bool may_move_downwards(void); + bool may_move_downwards(); /// Move cursor to the first child node - void move_downwards(void); + void move_downwards(); /// Test if cursor may move to the first sibling - bool may_move_sidewards(void); + bool may_move_sidewards(); /// Move cursor to the first sibling - void move_sidewards(void); + void move_sidewards(); //@} }; @@ -176,11 +176,11 @@ namespace Gecode { namespace Gist { /// \name Cursor interface //@{ /// Collect statistics - void process_current_node(void); + void process_current_node(); /// Move cursor to the first child node - void move_downwards(void); + void move_downwards(); /// Move cursor to the parent node - void move_upwards(void); + void move_upwards(); //@} }; @@ -204,7 +204,7 @@ namespace Gecode { namespace Gist { VisualNode::NodeAllocator& na); /// \name Cursor interface //@{ - void process_current_node(void); + void process_current_node(); //@} }; @@ -217,7 +217,7 @@ namespace Gecode { namespace Gist { /// \name Cursor interface //@{ /// Dispose node - void process_current_node(void); + void process_current_node(); //@} }; diff --git a/gecode/gist/nodecursor.hpp b/gecode/gist/nodecursor.hpp index 309d327a2f..a7165b9789 100644 --- a/gecode/gist/nodecursor.hpp +++ b/gecode/gist/nodecursor.hpp @@ -39,13 +39,13 @@ namespace Gecode { namespace Gist { template forceinline Node* - NodeCursor::node(void) { + NodeCursor::node() { return _node; } template forceinline unsigned int - NodeCursor::alternative(void) { + NodeCursor::alternative() { return _alternative; } @@ -57,7 +57,7 @@ namespace Gecode { namespace Gist { template forceinline Node* - NodeCursor::start_node(void) { + NodeCursor::start_node() { return _start_node; } @@ -69,13 +69,13 @@ namespace Gecode { namespace Gist { template forceinline bool - NodeCursor::may_move_upwards(void) { + NodeCursor::may_move_upwards() { return _node != _start_node && !_node->is_root(); } template forceinline void - NodeCursor::move_upwards(void) { + NodeCursor::move_upwards() { _node = static_cast(_node->get_parent(na)); if (_node->is_root()) { _alternative = 0; @@ -92,32 +92,32 @@ namespace Gecode { namespace Gist { template forceinline bool - NodeCursor::may_move_downwards(void) { + NodeCursor::may_move_downwards() { return _node->get_number_of_children() > 0; } template forceinline void - NodeCursor::move_downwards(void) { + NodeCursor::move_downwards() { _alternative = 0; _node = _node->get_child(na, 0); } template forceinline bool - NodeCursor::may_move_sidewards(void) { + NodeCursor::may_move_sidewards() { return (!_node->is_root()) && (_node != _start_node) && (_alternative < _node->get_parent(na)->get_number_of_children() - 1); } template forceinline void - NodeCursor::move_sidewards(void) { + NodeCursor::move_sidewards() { _node = static_cast(_node->get_parent(na)->get_child(na, ++_alternative)); } forceinline bool - HideFailedCursor::may_move_downwards(void) { + HideFailedCursor::may_move_downwards() { VisualNode* n = node(); return (!only_dirty || n->is_dirty()) && NodeCursor::may_move_downwards() && (n->has_solved_children() || n->get_no_of_open_children(na) > 0) && (!n->is_hidden()); @@ -128,7 +128,7 @@ namespace Gecode { namespace Gist { : NodeCursor(root, na), only_dirty(only_dirty_nodes) {} forceinline void - HideFailedCursor::process_current_node(void) { + HideFailedCursor::process_current_node() { VisualNode* n = node(); if (n->get_status() == BRANCH && !n->has_solved_children() && n->get_no_of_open_children(na) == 0) { n->set_hidden(true); @@ -142,7 +142,7 @@ namespace Gecode { namespace Gist { : NodeCursor(root, na) {} forceinline void - UnhideAllCursor::process_current_node(void) { + UnhideAllCursor::process_current_node() { VisualNode* n = node(); if (n->is_hidden()) { n->set_hidden(false); @@ -155,7 +155,7 @@ namespace Gecode { namespace Gist { : NodeCursor(root, na) {} forceinline void - UnstopAllCursor::process_current_node(void) { + UnstopAllCursor::process_current_node() { VisualNode* n = node(); if (n->get_status() == STOP) { n->set_stop(false); @@ -168,26 +168,26 @@ namespace Gecode { namespace Gist { : NodeCursor(the_node, na), back(backwards) {} forceinline void - NextSolCursor::process_current_node(void) {} + NextSolCursor::process_current_node() {} forceinline bool - NextSolCursor::not_on_sol(void) { + NextSolCursor::not_on_sol() { return node() == start_node() || node()->get_status() != SOLVED; } forceinline bool - NextSolCursor::may_move_upwards(void) { + NextSolCursor::may_move_upwards() { return not_on_sol() && !node()->is_root(); } forceinline bool - NextSolCursor::may_move_downwards(void) { + NextSolCursor::may_move_downwards() { return not_on_sol() && !(back && node() == start_node()) && node()->has_solved_children() && NodeCursor::may_move_downwards(); } forceinline void - NextSolCursor::move_downwards(void) { + NextSolCursor::move_downwards() { NodeCursor::move_downwards(); if (back) { while (NodeCursor::may_move_sidewards()) @@ -196,7 +196,7 @@ namespace Gecode { namespace Gist { } forceinline bool - NextSolCursor::may_move_sidewards(void) { + NextSolCursor::may_move_sidewards() { if (back) { return not_on_sol() && !node()->is_root() && alternative() > 0; } else { @@ -206,7 +206,7 @@ namespace Gecode { namespace Gist { } forceinline void - NextSolCursor::move_sidewards(void) { + NextSolCursor::move_sidewards() { if (back) { alternative(alternative() - 1); node(node()->get_parent(na)->get_child(na, alternative())); @@ -220,7 +220,7 @@ namespace Gecode { namespace Gist { : NodeCursor(root, na), cur_depth(0), depth(0), failed(0), solved(0), choice(0), open(0) {} forceinline void - StatCursor::process_current_node(void) { + StatCursor::process_current_node() { VisualNode* n = node(); switch (n->get_status()) { case SOLVED: @@ -241,14 +241,14 @@ namespace Gecode { namespace Gist { } forceinline void - StatCursor::move_downwards(void) { + StatCursor::move_downwards() { cur_depth++; depth = std::max(depth, cur_depth); NodeCursor::move_downwards(); } forceinline void - StatCursor::move_upwards(void) { + StatCursor::move_upwards() { cur_depth--; NodeCursor::move_upwards(); } @@ -259,7 +259,7 @@ namespace Gecode { namespace Gist { : NodeCursor(root, na), _na(na), _cur_best(cur_best), _c_d(c_d), _a_d(a_d), _clear(clear) {} forceinline void - BranchLabelCursor::process_current_node(void) { + BranchLabelCursor::process_current_node() { VisualNode* n = node(); if (!_clear) { if (!na.has_label(n)) { @@ -284,7 +284,7 @@ namespace Gecode { namespace Gist { : NodeCursor(root, na) {} forceinline void - DisposeCursor::process_current_node(void) { + DisposeCursor::process_current_node() { node()->dispose(); } diff --git a/gecode/gist/nodestats.cpp b/gecode/gist/nodestats.cpp index dfe56455b7..49265c1f8e 100644 --- a/gecode/gist/nodestats.cpp +++ b/gecode/gist/nodestats.cpp @@ -120,7 +120,7 @@ namespace Gecode { namespace Gist { } void - NodeStatInspector::show_stats(void) { + NodeStatInspector::show_stats() { show(); activateWindow(); } diff --git a/gecode/gist/nodestats.hh b/gecode/gist/nodestats.hh index 48f33ab1ee..7b73f454ee 100644 --- a/gecode/gist/nodestats.hh +++ b/gecode/gist/nodestats.hh @@ -69,7 +69,7 @@ namespace Gecode { namespace Gist { void node(const VisualNode::NodeAllocator&, VisualNode* n, const Statistics& stat, bool finished); public Q_SLOTS: /// Show this window and bring it to the front - void show_stats(void); + void show_stats(); }; }} // namespace Gecode::Gist diff --git a/gecode/gist/nodevisitor.hh b/gecode/gist/nodevisitor.hh index 7752988c82..8352179817 100644 --- a/gecode/gist/nodevisitor.hh +++ b/gecode/gist/nodevisitor.hh @@ -48,7 +48,7 @@ namespace Gecode { namespace Gist { /// Reset the cursor object to \a c0 void set_cursor(const Cursor& c0); /// Return the cursor - Cursor& get_cursor(void); + Cursor& get_cursor(); }; /// \brief Run a cursor over a tree, processing nodes in post-order @@ -57,15 +57,15 @@ namespace Gecode { namespace Gist { protected: using NodeVisitor::c; /// Move the cursor to the left-most leaf - void move_to_leaf(void); + void move_to_leaf(); public: /// Constructor PostorderNodeVisitor(const Cursor& c); /// Move cursor to next node, return true if succeeded - bool next(void); + bool next(); /// Execute visitor - void run(void); + void run(); }; /// \brief Run a cursor over a tree, processing nodes in pre-order @@ -74,15 +74,15 @@ namespace Gecode { namespace Gist { protected: using NodeVisitor::c; /// Move cursor to next node from a leaf - bool backtrack(void); + bool backtrack(); public: /// Constructor PreorderNodeVisitor(const Cursor& c); /// Move cursor to the next node, return true if succeeded - bool next(void); + bool next(); /// Execute visitor - void run(void); + void run(); }; }} // namespace Gecode::Gist diff --git a/gecode/gist/nodevisitor.hpp b/gecode/gist/nodevisitor.hpp index 2bf5b274f6..2ace1e68a9 100644 --- a/gecode/gist/nodevisitor.hpp +++ b/gecode/gist/nodevisitor.hpp @@ -45,13 +45,13 @@ namespace Gecode { namespace Gist { template forceinline Cursor& - NodeVisitor::get_cursor(void) { + NodeVisitor::get_cursor() { return c; } template forceinline void - PostorderNodeVisitor::move_to_leaf(void) { + PostorderNodeVisitor::move_to_leaf() { while (c.may_move_downwards()) { c.move_downwards(); } @@ -64,7 +64,7 @@ namespace Gecode { namespace Gist { template forceinline bool - PostorderNodeVisitor::next(void) { + PostorderNodeVisitor::next() { c.process_current_node(); if (c.may_move_sidewards()) { c.move_sidewards(); @@ -79,14 +79,14 @@ namespace Gecode { namespace Gist { template forceinline void - PostorderNodeVisitor::run(void) { + PostorderNodeVisitor::run() { while (next()) { } } template forceinline bool - PreorderNodeVisitor::backtrack(void) { + PreorderNodeVisitor::backtrack() { while (!c.may_move_sidewards() && c.may_move_upwards()) { c.move_upwards(); } @@ -103,7 +103,7 @@ namespace Gecode { namespace Gist { template forceinline bool - PreorderNodeVisitor::next(void) { + PreorderNodeVisitor::next() { c.process_current_node(); if (c.may_move_downwards()) { c.move_downwards(); @@ -117,7 +117,7 @@ namespace Gecode { namespace Gist { template forceinline void - PreorderNodeVisitor::run(void) { + PreorderNodeVisitor::run() { while (next()) { } } diff --git a/gecode/gist/preferences.cpp b/gecode/gist/preferences.cpp index c895cb5395..109c635da3 100644 --- a/gecode/gist/preferences.cpp +++ b/gecode/gist/preferences.cpp @@ -134,7 +134,7 @@ namespace Gecode { namespace Gist { } void - PreferencesDialog::write_back(void) { + PreferencesDialog::write_back() { hide_failed = hide_check->isChecked(); zoom = zoom_check->isChecked(); refresh = refresh_box->value(); @@ -156,7 +156,7 @@ namespace Gecode { namespace Gist { } void - PreferencesDialog::defaults(void) { + PreferencesDialog::defaults() { hide_failed = true; zoom = false; refresh = 500; diff --git a/gecode/gist/preferences.hh b/gecode/gist/preferences.hh index 12e6628d22..ed26147f8a 100644 --- a/gecode/gist/preferences.hh +++ b/gecode/gist/preferences.hh @@ -59,9 +59,9 @@ namespace Gecode { namespace Gist { QSpinBox* ad_box; protected Q_SLOTS: /// Write settings - void write_back(void); + void write_back(); /// Reset to defaults - void defaults(void); + void defaults(); /// Toggle slow down setting void toggle_slow(int state); diff --git a/gecode/gist/qtgist.cpp b/gecode/gist/qtgist.cpp index 22267fa8e5..25b2e2d869 100644 --- a/gecode/gist/qtgist.cpp +++ b/gecode/gist/qtgist.cpp @@ -53,8 +53,8 @@ namespace Gecode { namespace Gist { canvas->setPalette(my_palette); canvas->setObjectName("canvas"); - connect(scroll_area->horizontalScrollBar(), SIGNAL(valueChanged(int)), canvas, SLOT(scroll(void))); - connect(scroll_area->verticalScrollBar(), SIGNAL(valueChanged(int)), canvas, SLOT(scroll(void))); + connect(scroll_area->horizontalScrollBar(), SIGNAL(valueChanged(int)), canvas, SLOT(scroll())); + connect(scroll_area->verticalScrollBar(), SIGNAL(valueChanged(int)), canvas, SLOT(scroll())); QVBoxLayout* sa_layout = new QVBoxLayout(); sa_layout->setContentsMargins(0, 0, 0, 0); @@ -63,7 +63,7 @@ namespace Gecode { namespace Gist { connect(canvas, SIGNAL(solution(const Space*)), this, SIGNAL(solution(const Space*))); - connect(canvas, SIGNAL(search_finished(void)), this, SIGNAL(search_finished(void))); + connect(canvas, SIGNAL(search_finished()), this, SIGNAL(search_finished())); QPixmap my_pic; my_pic.loadFromData(zoom_to_fit_icon, sizeof(zoom_to_fit_icon)); @@ -80,7 +80,7 @@ namespace Gecode { namespace Gist { inspect_before_fp = new QAction("Inspect before fixpoint", this); inspect_before_fp->setShortcut(QKeySequence("Ctrl+Return")); - connect(inspect_before_fp, SIGNAL(triggered()), canvas, SLOT(inspect_before_fp(void))); + connect(inspect_before_fp, SIGNAL(triggered()), canvas, SLOT(inspect_before_fp())); stop = new QAction("Stop search", this); stop->setShortcut(QKeySequence("Esc")); @@ -499,7 +499,7 @@ namespace Gecode { namespace Gist { select_comparator(ncs); } - Gist::~Gist(void) { + Gist::~Gist() { delete canvas; } @@ -648,7 +648,7 @@ namespace Gecode { namespace Gist { } bool - Gist::finish(void) { + Gist::finish() { return canvas->finish(); } @@ -696,7 +696,7 @@ namespace Gecode { namespace Gist { } void - Gist::populate_bookmarks_menu(void) { + Gist::populate_bookmarks_menu() { bookmarks_menu->clear(); bookmarks_menu->addAction(bookmark_node); bookmarks_menu->addSeparator(); @@ -704,7 +704,7 @@ namespace Gecode { namespace Gist { } void - Gist::populate_inspectors(void) { + Gist::populate_inspectors() { inspect_node_menu->clear(); inspect_node_menu->addAction(inspect); inspect_node_menu->addSeparator(); @@ -724,11 +724,11 @@ namespace Gecode { namespace Gist { canvas->set_auto_zoom(b); } bool - Gist::get_auto_hide_failed(void) { + Gist::get_auto_hide_failed() { return canvas->get_auto_hide_failed(); } bool - Gist::get_auto_zoom(void) { + Gist::get_auto_zoom() { return canvas->get_auto_zoom(); } void @@ -740,7 +740,7 @@ namespace Gecode { namespace Gist { canvas->set_refresh_pause(i); } bool - Gist::get_smooth_scroll_and_zoom(void) { + Gist::get_smooth_scroll_and_zoom() { return canvas->get_smooth_scroll_and_zoom(); } void @@ -748,7 +748,7 @@ namespace Gecode { namespace Gist { canvas->set_smooth_scroll_and_zoom(b); } bool - Gist::get_move_during_search(void) { + Gist::get_move_during_search() { return canvas->get_move_during_search(); } void @@ -761,11 +761,11 @@ namespace Gecode { namespace Gist { } int - Gist::get_cd(void) { + Gist::get_cd() { return canvas->c_d; } int - Gist::get_ad(void) { + Gist::get_ad() { return canvas->a_d; } @@ -774,12 +774,12 @@ namespace Gecode { namespace Gist { canvas->set_show_copies(b); } bool - Gist::get_show_copies(void) { + Gist::get_show_copies() { return canvas->get_show_copies(); } void - Gist::show_stats(void) { + Gist::show_stats() { node_stat_inspector->show_stats(); canvas->emit_status_changed(); } diff --git a/gecode/gist/qtgist.hh b/gecode/gist/qtgist.hh index d0fca746eb..8ee1748d71 100644 --- a/gecode/gist/qtgist.hh +++ b/gecode/gist/qtgist.hh @@ -191,7 +191,7 @@ namespace Gecode { namespace Gist { /// Constructor Gist(Space* root, bool bab, QWidget* parent, const Options& opt); /// Destructor - ~Gist(void) override; + ~Gist() override; /// Add double click inspector \a i0 void add_double_click_inspector(Inspector* i0); @@ -207,36 +207,36 @@ namespace Gecode { namespace Gist { /// Set preference whether to automatically zoom to fit void set_auto_zoom(bool b); /// Return preference whether to automatically hide failed subtrees - bool get_auto_hide_failed(void); + bool get_auto_hide_failed(); /// Return preference whether to automatically zoom to fit - bool get_auto_zoom(void); + bool get_auto_zoom(); /// Set preference whether to show copies in the tree void set_show_copies(bool b); /// Return preference whether to show copies in the tree - bool get_show_copies(void); + bool get_show_copies(); /// Set refresh rate void set_refresh(int i); /// Set refresh pause in msec void set_refresh_pause(int i); /// Return preference whether to use smooth scrolling and zooming - bool get_smooth_scroll_and_zoom(void); + bool get_smooth_scroll_and_zoom(); /// Set preference whether to use smooth scrolling and zooming void set_smooth_scroll_and_zoom(bool b); /// Return preference whether to move cursor during search - bool get_move_during_search(void); + bool get_move_during_search(); /// Set preference whether to move cursor during search void set_move_during_search(bool b); /// Set recomputation parameters \a c_d and \a a_d void set_recomp_distances(int c_d, int a_d); /// Return recomputation distance - int get_cd(void); + int get_cd(); /// Return adaptive recomputation distance - int get_ad(void); + int get_ad(); /// Stop search and wait until finished - bool finish(void); + bool finish(); /// Handle resize event void resizeEvent(QResizeEvent*) override; @@ -249,7 +249,7 @@ namespace Gecode { namespace Gist { void solution(const Space*); /// Signals that %Gist is ready to be closed - void search_finished(void); + void search_finished(); private Q_SLOTS: /// Displays the context menu for a node @@ -271,11 +271,11 @@ namespace Gecode { namespace Gist { /// Reacts on removing a bookmark void remove_bookmark(int idx); /// Populate the inspector menus from the actions found in Gist - void populate_inspectors(void); + void populate_inspectors(); /// Populate the bookmarks menu - void populate_bookmarks_menu(void); + void populate_bookmarks_menu(); /// Shows node status information - void show_stats(void); + void show_stats(); /// Inspect current node with inspector described by \a a void inspect_with_action(QAction* a); /// Inspect current node with inspector described by \a a diff --git a/gecode/gist/spacenode.cpp b/gecode/gist/spacenode.cpp index 244a9a5b2e..ea0ab6fd73 100644 --- a/gecode/gist/spacenode.cpp +++ b/gecode/gist/spacenode.cpp @@ -267,7 +267,7 @@ namespace Gecode { namespace Gist { } void - SpaceNode::dispose(void) { + SpaceNode::dispose() { delete choice; delete static_cast(Support::clear_pointer_tag_bits(copy)); } diff --git a/gecode/gist/spacenode.hh b/gecode/gist/spacenode.hh index fffc3f6733..f6ab001376 100644 --- a/gecode/gist/spacenode.hh +++ b/gecode/gist/spacenode.hh @@ -70,7 +70,7 @@ namespace Gecode { namespace Gist { int max_depth; /// Constructor - Statistics(void) : solutions(0), failures(0), choices(0), undetermined(1), max_depth(0) {} + Statistics() : solutions(0), failures(0), choices(0), undetermined(1), max_depth(0) {} }; class SpaceNode; @@ -109,7 +109,7 @@ namespace Gecode { namespace Gist { void set_distance(unsigned int d); /// Return distance from copy - unsigned int get_distance(void) const; + unsigned int get_distance() const; /// Set status flag void set_flag(int flag, bool value); @@ -152,13 +152,13 @@ namespace Gecode { namespace Gist { Space* get_space(NodeAllocator& na, BestNode* cur_best, int c_d, int a_d); /// Return working space (if present). - const Space* get_working_space(void) const; + const Space* get_working_space() const; /// Clear working space and copy (if present and this is not the root). void purge(const NodeAllocator& na); /// Free allocated memory - void dispose(void); + void dispose(); /// Return whether this node is the currently best solution bool is_current_best(BestNode* cur_best); @@ -176,29 +176,29 @@ namespace Gecode { namespace Gist { int get_number_of_child_nodes(NodeAllocator& na, BestNode* cur_best, Statistics& stats, int c_d, int a_d); /// Return current status of the node - NodeStatus get_status(void) const; + NodeStatus get_status() const; /// Return whether this node still has open children - bool is_open(void); + bool is_open(); /// Return whether the subtree of this node has any failed children - bool has_failed_children(void); + bool has_failed_children(); /// Return whether the subtree of this node has any solved children - bool has_solved_children(void); + bool has_solved_children(); /// Return whether the subtree of this node has any open children - bool has_open_children(void); + bool has_open_children(); /// Return number of open children int get_no_of_open_children(const NodeAllocator& na); /// Set number of open children to \a n void set_no_of_open_children(int n); /// Return whether the node has a copy - bool has_copy(void); + bool has_copy(); /// Return whether the node has a working space - bool has_working_space(void); + bool has_working_space(); /// Return alternative number of this node int get_alternative(const NodeAllocator& na) const; /// Return choice of this node - const Choice* get_choice(void); + const Choice* get_choice(); }; }} // namespace Gecode::Gist diff --git a/gecode/gist/spacenode.hpp b/gecode/gist/spacenode.hpp index 6e8be34ee4..ca42a3eb80 100644 --- a/gecode/gist/spacenode.hpp +++ b/gecode/gist/spacenode.hpp @@ -67,7 +67,7 @@ namespace Gecode { namespace Gist { } forceinline NodeStatus - SpaceNode::get_status(void) const { + SpaceNode::get_status() const { return static_cast((status_bits & status_mask) >> 20); } @@ -80,7 +80,7 @@ namespace Gecode { namespace Gist { } forceinline unsigned int - SpaceNode::get_distance(void) const { + SpaceNode::get_distance() const { return status_bits & distance_mask; } @@ -107,7 +107,7 @@ namespace Gecode { namespace Gist { } forceinline const Space* - SpaceNode::get_working_space(void) const { + SpaceNode::get_working_space() const { assert(copy != nullptr); if (Support::marked(copy)) return static_cast(Support::unmark(copy)); @@ -132,32 +132,32 @@ namespace Gecode { namespace Gist { } forceinline bool - SpaceNode::is_open(void) { + SpaceNode::is_open() { return ((get_status() == UNDETERMINED) || get_flag(HAS_OPEN_CHILDREN)); } forceinline bool - SpaceNode::has_failed_children(void) { + SpaceNode::has_failed_children() { return get_flag(HAS_FAILED_CHILDREN); } forceinline bool - SpaceNode::has_solved_children(void) { + SpaceNode::has_solved_children() { return get_flag(HAS_SOLVED_CHILDREN); } forceinline bool - SpaceNode::has_open_children(void) { + SpaceNode::has_open_children() { return get_flag(HAS_OPEN_CHILDREN); } forceinline bool - SpaceNode::has_copy(void) { + SpaceNode::has_copy() { return copy != nullptr; } forceinline bool - SpaceNode::has_working_space(void) { + SpaceNode::has_working_space() { return copy != nullptr && Support::marked(copy); } @@ -174,7 +174,7 @@ namespace Gecode { namespace Gist { } forceinline const Choice* - SpaceNode::get_choice(void) { + SpaceNode::get_choice() { return choice; } diff --git a/gecode/gist/standalone-example/mygist.cpp b/gecode/gist/standalone-example/mygist.cpp index 6c6c8a26e5..eac33e2588 100644 --- a/gecode/gist/standalone-example/mygist.cpp +++ b/gecode/gist/standalone-example/mygist.cpp @@ -43,7 +43,7 @@ using namespace Gecode; class TestSpace : public Space { public: IntVarArray variables; - TestSpace(void) : variables(*this, 2, 0, 2) { + TestSpace() : variables(*this, 2, 0, 2) { branch(*this, variables, INT_VAR_NONE(), INT_VAL_MIN()); } TestSpace(TestSpace& other) : Space(other) { diff --git a/gecode/gist/textoutput.cpp b/gecode/gist/textoutput.cpp index 5114fc03c3..07c5b43339 100644 --- a/gecode/gist/textoutput.cpp +++ b/gecode/gist/textoutput.cpp @@ -50,7 +50,7 @@ namespace Gecode { namespace Gist { public: void - flush(void) { + flush() { QTextBlockFormat bf = editor->textCursor().blockFormat(); bf.setBottomMargin(0); editor->textCursor().setBlockFormat(bf); @@ -76,7 +76,7 @@ namespace Gecode { namespace Gist { clear(); } void - flush(void) { + flush() { _buf.flush(); } }; @@ -130,17 +130,17 @@ namespace Gecode { namespace Gist { resize(600, 300); } - TextOutputI::~TextOutputI(void) { + TextOutputI::~TextOutputI() { delete os; } std::ostream& - TextOutputI::get_stream(void) { + TextOutputI::get_stream() { return *os; } void - TextOutputI::flush(void) { + TextOutputI::flush() { static_cast(os)->flush(); } @@ -154,7 +154,7 @@ namespace Gecode { namespace Gist { } void - TextOutputI::change_stay_on_top(void) { + TextOutputI::change_stay_on_top() { QPoint p = pos(); if (stay_on_top->isChecked()) { setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint); diff --git a/gecode/gist/textoutput.hh b/gecode/gist/textoutput.hh index 12b3ae7a9a..887ef03b84 100644 --- a/gecode/gist/textoutput.hh +++ b/gecode/gist/textoutput.hh @@ -52,15 +52,15 @@ namespace Gecode { namespace Gist { /// Constructor TextOutputI(const std::string& name, QWidget* parent = nullptr); /// Destructor - ~TextOutputI(void) override; + ~TextOutputI() override; /// Return stream that prints to the text display - std::ostream& get_stream(void); + std::ostream& get_stream(); /// Add html string \a s to the output void insert_html(const QString& s); /// Flush output - void flush(void); + void flush(); protected Q_SLOTS: - void change_stay_on_top(void); + void change_stay_on_top(); }; }} // namespace Gecode::Gist diff --git a/gecode/gist/treecanvas.cpp b/gecode/gist/treecanvas.cpp index 6cc91c62f0..1ab8bfaed9 100644 --- a/gecode/gist/treecanvas.cpp +++ b/gecode/gist/treecanvas.cpp @@ -91,7 +91,7 @@ namespace Gecode { namespace Gist { connect(&searcher, SIGNAL(move_to_node(VisualNode*, bool)), this, SLOT(set_current_node(VisualNode*, bool)), Qt::BlockingQueuedConnection); - connect(&searcher, SIGNAL(search_finished(void)), this, SIGNAL(search_finished(void))); + connect(&searcher, SIGNAL(search_finished()), this, SIGNAL(search_finished())); connect(&scroll_time_line, SIGNAL(frameChanged(int)), this, SLOT(scroll(int))); #if QT_VERSION >= 0x060000 @@ -120,7 +120,7 @@ namespace Gecode { namespace Gist { update(); } - TreeCanvas::~TreeCanvas(void) { + TreeCanvas::~TreeCanvas() { if (root) { DisposeCursor dc(root, *na); PreorderNodeVisitor(dc).run(); @@ -212,7 +212,7 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::update(void) { + TreeCanvas::update() { QMutexLocker locker(&mutex); layout_mutex.lock(); if (root != nullptr) { @@ -239,7 +239,7 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::scroll(void) { + TreeCanvas::scroll() { QWidget::update(); } @@ -281,7 +281,7 @@ namespace Gecode { namespace Gist { } void - SearcherThread::update_canvas(void) { + SearcherThread::update_canvas() { t->layout_mutex.lock(); if (t->root == nullptr) return; @@ -343,7 +343,7 @@ namespace Gecode { namespace Gist { }; void - SearcherThread::run(void) { + SearcherThread::run() { { if (!node->is_open()) return; @@ -423,19 +423,19 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::search_all(void) { + TreeCanvas::search_all() { QMutexLocker locker(&mutex); searcher.search(current_node, true, this); } void - TreeCanvas::search_one(void) { + TreeCanvas::search_one() { QMutexLocker locker(&mutex); searcher.search(current_node, false, this); } void - TreeCanvas::toggle_hidden(void) { + TreeCanvas::toggle_hidden() { QMutexLocker locker(&mutex); current_node->toggle_hidden(*na); update(); @@ -444,7 +444,7 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::hide_failed(void) { + TreeCanvas::hide_failed() { QMutexLocker locker(&mutex); current_node->hide_failed(*na); update(); @@ -453,7 +453,7 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::unhide_all(void) { + TreeCanvas::unhide_all() { QMutexLocker locker(&mutex); QMutexLocker layout_locker(&layout_mutex); current_node->unhide_all(*na); @@ -463,7 +463,7 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::toggle_stop(void) { + TreeCanvas::toggle_stop() { QMutexLocker locker(&mutex); current_node->toggle_stop(*na); update(); @@ -472,7 +472,7 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::unstop_all(void) { + TreeCanvas::unstop_all() { QMutexLocker locker(&mutex); QMutexLocker layout_locker(&layout_mutex); current_node->unstop_all(*na); @@ -502,7 +502,7 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::zoom_to_fit(void) { + TreeCanvas::zoom_to_fit() { QMutexLocker locker(&layout_mutex); if (root != nullptr) { BoundingBox bb; @@ -534,7 +534,7 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::center_current_node(void) { + TreeCanvas::center_current_node() { QMutexLocker locker(&mutex); int x = 0; int y = 0; @@ -707,12 +707,12 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::inspect_before_fp(void) { + TreeCanvas::inspect_before_fp() { inspect_current_node(false); } void - TreeCanvas::label_branches(void) { + TreeCanvas::label_branches() { QMutexLocker locker(&mutex); current_node->label_branches(*na, cur_best, c_d, a_d); update(); @@ -720,7 +720,7 @@ namespace Gecode { namespace Gist { emit status_changed(current_node, stats, true); } void - TreeCanvas::label_path(void) { + TreeCanvas::label_path() { QMutexLocker locker(&mutex); current_node->label_path(*na, cur_best, c_d, a_d); update(); @@ -761,13 +761,13 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::stop_search(void) { + TreeCanvas::stop_search() { stop_search_flag = true; layout_done_timer_id = startTimer(15); } void - TreeCanvas::reset(void) { + TreeCanvas::reset() { QMutexLocker locker(&mutex); Space* root_space = root->get_status() == FAILED ? nullptr : root->get_space(*na, cur_best, c_d, a_d); if (cur_best != nullptr) { @@ -799,7 +799,7 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::bookmark_node(void) { + TreeCanvas::bookmark_node() { QMutexLocker locker(&mutex); if (!current_node->is_bookmarked()) { bool ok; @@ -822,7 +822,7 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::set_path(void) { + TreeCanvas::set_path() { QMutexLocker locker(&mutex); if (current_node == path_head) return; @@ -836,7 +836,7 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::inspect_path(void) { + TreeCanvas::inspect_path() { QMutexLocker locker(&mutex); set_current_node(root); if (current_node->is_on_path()) { @@ -852,7 +852,7 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::start_compare_nodes(void) { + TreeCanvas::start_compare_nodes() { QMutexLocker locker(&mutex); compare_nodes = true; compare_nodes_before_fp = false; @@ -860,7 +860,7 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::start_compare_nodes_before_fp(void) { + TreeCanvas::start_compare_nodes_before_fp() { QMutexLocker locker(&mutex); compare_nodes = true; compare_nodes_before_fp = true; @@ -868,12 +868,12 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::emit_status_changed(void) { + TreeCanvas::emit_status_changed() { emit status_changed(current_node, stats, true); } void - TreeCanvas::nav_up(void) { + TreeCanvas::nav_up() { QMutexLocker locker(&mutex); VisualNode* p = current_node->get_parent(*na); @@ -886,7 +886,7 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::nav_down(void) { + TreeCanvas::nav_down() { QMutexLocker locker(&mutex); if (!current_node->is_hidden()) { switch (current_node->get_status()) { @@ -908,7 +908,7 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::nav_left(void) { + TreeCanvas::nav_left() { QMutexLocker locker(&mutex); VisualNode* p = current_node->get_parent(*na); if (p != nullptr) { @@ -922,7 +922,7 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::nav_right(void) { + TreeCanvas::nav_right() { QMutexLocker locker(&mutex); VisualNode* p = current_node->get_parent(*na); if (p != nullptr) { @@ -936,7 +936,7 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::nav_root(void) { + TreeCanvas::nav_root() { QMutexLocker locker(&mutex); set_current_node(root); center_current_node(); @@ -956,7 +956,7 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::nav_prev_sol(void) { + TreeCanvas::nav_prev_sol() { nav_next_sol(true); } @@ -1010,21 +1010,21 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::export_whole_tree_pdf(void) { + TreeCanvas::export_whole_tree_pdf() { #if QT_VERSION >= 0x040400 export_node_pdf(root); #endif } void - TreeCanvas::export_pdf(void) { + TreeCanvas::export_pdf() { #if QT_VERSION >= 0x040400 export_node_pdf(current_node); #endif } void - TreeCanvas::print(void) { + TreeCanvas::print() { QPrinter printer; if (QPrintDialog(&printer, this).exec() == QDialog::Accepted) { QMutexLocker locker(&mutex); @@ -1122,7 +1122,7 @@ namespace Gecode { namespace Gist { } void - TreeCanvas::resize_to_outer(void) { + TreeCanvas::resize_to_outer() { if (auto_zoom) zoom_to_fit(); } @@ -1226,7 +1226,7 @@ namespace Gecode { namespace Gist { } bool - TreeCanvas::finish(void) { + TreeCanvas::finish() { if (finished_flag) return true; stop_search_flag = true; @@ -1357,17 +1357,17 @@ namespace Gecode { namespace Gist { show_copies = b; } bool - TreeCanvas::get_show_copies(void) { + TreeCanvas::get_show_copies() { return show_copies; } bool - TreeCanvas::get_auto_hide_failed(void) { + TreeCanvas::get_auto_hide_failed() { return auto_hide_failed; } bool - TreeCanvas::get_auto_zoom(void) { + TreeCanvas::get_auto_zoom() { return auto_zoom; } @@ -1384,7 +1384,7 @@ namespace Gecode { namespace Gist { } bool - TreeCanvas::get_smooth_scroll_and_zoom(void) { + TreeCanvas::get_smooth_scroll_and_zoom() { return smooth_scroll_and_zoom; } @@ -1394,7 +1394,7 @@ namespace Gecode { namespace Gist { } bool - TreeCanvas::get_move_during_search(void) { + TreeCanvas::get_move_during_search() { return move_during_search; } diff --git a/gecode/gist/treecanvas.hh b/gecode/gist/treecanvas.hh index 0bf679cb76..dbdee0928f 100644 --- a/gecode/gist/treecanvas.hh +++ b/gecode/gist/treecanvas.hh @@ -73,7 +73,7 @@ namespace Gecode { namespace Gist { int depth; bool a; TreeCanvas* t; - void update_canvas(void); + void update_canvas(); public: void search(VisualNode* n, bool all, TreeCanvas* ti); @@ -83,11 +83,11 @@ namespace Gecode { namespace Gist { void status_changed(bool); void scale_changed(int); void solution(const Space*); - void search_finished(void); + void search_finished(); void move_to_node(VisualNode* n, bool); protected: - void run(void) override; + void run() override; }; /// \brief A canvas that displays the search tree @@ -101,7 +101,7 @@ namespace Gecode { namespace Gist { /// Constructor TreeCanvas(Space* root_space, bool bab, QWidget* parent, const Options& opt); /// Destructor - ~TreeCanvas(void) override; + ~TreeCanvas() override; /// Add inspector \a i void add_double_click_inspector(Inspector* i); @@ -125,29 +125,29 @@ namespace Gecode { namespace Gist { void scale_tree(int scale0, int zoomx = -1, int zoomy = -1); /// Explore complete subtree of selected node - void search_all(void); + void search_all(); /// Find next solution below selected node - void search_one(void); + void search_one(); /// Toggle hidden state of selected node - void toggle_hidden(void); + void toggle_hidden(); /// Hide failed subtrees of selected node - void hide_failed(void); + void hide_failed(); /// Unhide all nodes below selected node - void unhide_all(void); + void unhide_all(); /// Do not stop at selected stop node - void toggle_stop(void); + void toggle_stop(); /// Do not stop at any stop node - void unstop_all(void); + void unstop_all(); /// Export pdf of the current subtree - void export_pdf(void); + void export_pdf(); /// Export pdf of the whole tree - void export_whole_tree_pdf(void); + void export_whole_tree_pdf(); /// Print the tree - void print(void); + void print(); /// Zoom the canvas so that the whole tree fits - void zoom_to_fit(void); + void zoom_to_fit(); /// Center the view on the currently selected node - void center_current_node(void); + void center_current_node(); /** * \brief Call the double click inspector for the currently selected node * @@ -157,46 +157,46 @@ namespace Gecode { namespace Gist { */ void inspect_current_node(bool fix = true, int inspector_no = -1); /// Calls inspect_current_node(false) - void inspect_before_fp(void); + void inspect_before_fp(); /// Label all branches in subtree under current node - void label_branches(void); + void label_branches(); /// Label all branches on path to root node - void label_path(void); + void label_path(); /// Stop current search - void stop_search(void); + void stop_search(); /// Reset - void reset(void); + void reset(); /// Move selection to the parent of the selected node - void nav_up(void); + void nav_up(); /// Move selection to the first child of the selected node - void nav_down(void); + void nav_down(); /// Move selection to the left sibling of the selected node - void nav_left(void); + void nav_left(); /// Move selection to the right sibling of the selected node - void nav_right(void); + void nav_right(); /// Move selection to the root node - void nav_root(void); + void nav_root(); /// Move selection to next solution (in DFS order) void nav_next_sol(bool back = false); /// Move selection to previous solution (in DFS order) - void nav_prev_sol(void); + void nav_prev_sol(); /// Bookmark current node - void bookmark_node(void); + void bookmark_node(); /// Set the current node to be the head of the path - void set_path(void); + void set_path(); /// Call the double click inspector for all nodes on the path from root to head of the path - void inspect_path(void); + void inspect_path(); /// Wait for click on node to compare with current node - void start_compare_nodes(void); + void start_compare_nodes(); /// Wait for click on node to compare with current node before fixpoint - void start_compare_nodes_before_fp(void); + void start_compare_nodes_before_fp(); /// Re-emit status change information for current node - void emit_status_changed(void); + void emit_status_changed(); /// Set recomputation distances void set_recomp_distances(int c_d, int a_d); @@ -205,30 +205,30 @@ namespace Gecode { namespace Gist { /// Set preference whether to automatically zoom to fit void set_auto_zoom(bool b); /// Return preference whether to automatically hide failed subtrees - bool get_auto_hide_failed(void); + bool get_auto_hide_failed(); /// Return preference whether to automatically zoom to fit - bool get_auto_zoom(void); + bool get_auto_zoom(); /// Set preference whether to show copies in the tree void set_show_copies(bool b); /// Return preference whether to show copies in the tree - bool get_show_copies(void); + bool get_show_copies(); /// Set refresh rate void set_refresh(int i); /// Set refresh pause in msec void set_refresh_pause(int i); /// Return preference whether to use smooth scrolling and zooming - bool get_smooth_scroll_and_zoom(void); + bool get_smooth_scroll_and_zoom(); /// Set preference whether to use smooth scrolling and zooming void set_smooth_scroll_and_zoom(bool b); /// Return preference whether to move cursor during search - bool get_move_during_search(void); + bool get_move_during_search(); /// Set preference whether to move cursor during search void set_move_during_search(bool b); /// Resize to the outer widget size if auto zoom is enabled - void resize_to_outer(void); + void resize_to_outer(); /// Stop search and wait for it to finish - bool finish(void); + bool finish(); Q_SIGNALS: /// The scale factor has changed @@ -242,7 +242,7 @@ namespace Gecode { namespace Gist { /// Signals that a solution has been found void solution(const Space*); /// Signals that %Gist is finished - void search_finished(void); + void search_finished(); /// Signals that a bookmark has been added void added_bookmark(const QString& id); /// Signals that a bookmark has been removed @@ -361,9 +361,9 @@ namespace Gecode { namespace Gist { public Q_SLOTS: /// Update display - void update(void); + void update(); /// React to scroll events - void scroll(void); + void scroll(); /// Layout done void layout_done(int w, int h, int scale0); /// Set the selected node to \a n diff --git a/gecode/gist/visualnode.cpp b/gecode/gist/visualnode.cpp index 3457d96eb2..85ccd0715b 100644 --- a/gecode/gist/visualnode.cpp +++ b/gecode/gist/visualnode.cpp @@ -46,7 +46,7 @@ namespace Gecode { namespace Gist { class ShapeAllocator { public: /// Constructor - ShapeAllocator(void) { + ShapeAllocator() { Shape::leaf = Shape::allocate(1); (*Shape::leaf)[0] = Extent(Layout::extent); Shape::leaf->compute_bounding_box(); @@ -56,7 +56,7 @@ namespace Gecode { namespace Gist { (*Shape::hidden)[1] = Extent(Layout::extent); Shape::hidden->compute_bounding_box(); } - ~ShapeAllocator(void) { + ~ShapeAllocator() { Shape::deallocate(Shape::leaf); Shape::deallocate(Shape::hidden); } @@ -86,7 +86,7 @@ namespace Gecode { namespace Gist { } void - VisualNode::dispose(void) { + VisualNode::dispose() { Shape::deallocate(shape); SpaceNode::dispose(); } diff --git a/gecode/gist/visualnode.hh b/gecode/gist/visualnode.hh index fe944356e6..d570c0ff1a 100644 --- a/gecode/gist/visualnode.hh +++ b/gecode/gist/visualnode.hh @@ -55,7 +55,7 @@ namespace Gecode { namespace Gist { /// Right coordinate int right; /// Default constructor - BoundingBox(void) = default; + BoundingBox() = default; }; /// \brief %Extent representing shape of a tree at one depth level @@ -66,7 +66,7 @@ namespace Gecode { namespace Gist { /// Right extent int r; /// Default constructor - Extent(void); + Extent(); /// Construct with \a l0 and \a r0 Extent(int l0, int r0); /// Construct with width \a width @@ -94,7 +94,7 @@ namespace Gecode { namespace Gist { /// Assignment operator Shape& operator=(const Shape&) = delete; /// Constructor - Shape(void) = delete; + Shape() = delete; /// Construct shape of depth \a d static Shape* allocate(int d); // Destruct @@ -106,11 +106,11 @@ namespace Gecode { namespace Gist { static Shape* hidden; /// Return depth of the shape - int depth(void) const; + int depth() const; /// Set depth of the shape to \a d (must be smaller than original depth) void set_depth(int d); /// Compute bounding box - void compute_bounding_box(void); + void compute_bounding_box(); /// Return extent at depth \a i const Extent& operator[](int i) const; /// Return extent at depth \a i @@ -118,7 +118,7 @@ namespace Gecode { namespace Gist { /// Return if extent exists at \a depth, if yes return it in \a extent bool get_extent_at_depth(int depth, Extent& extent); /// Return bounding box - const BoundingBox& get_bounding_box(void) const; + const BoundingBox& get_bounding_box() const; }; /// \brief %Node class that supports visual layout @@ -149,7 +149,7 @@ namespace Gecode { namespace Gist { VisualNode(Space* root); /// Return if node is hidden - bool is_hidden(void); + bool is_hidden(); /// Set hidden state to \a h void set_hidden(bool h); /// Set stop state to \a h @@ -159,23 +159,23 @@ namespace Gecode { namespace Gist { /// Compute layout for the subtree of this node void layout(const NodeAllocator& na); /// Return offset off this node from its parent - int get_offset(void); + int get_offset(); /// Set offset of this node, relative to its parent void set_offset(int n); /// Return whether node is marked as dirty - bool is_dirty(void); + bool is_dirty(); /// Mark node as dirty void set_dirty(bool d); /// Return whether the layout of the node's children has been completed - bool children_layout_is_done(void); + bool children_layout_is_done(); /// Mark node whether the layout of the node's children has been completed void set_children_layout_done(bool d); /// Return whether node is marked - bool is_marked(void); + bool is_marked(); /// Set mark of this node void set_marked(bool m); /// Return whether node is bookmarked - bool is_bookmarked(void); + bool is_bookmarked(); /// Set bookmark of this node void set_bookmarked(bool m); /// Set all nodes from the node to the root to be on the path @@ -183,7 +183,7 @@ namespace Gecode { namespace Gist { /// Set all nodes from the node to the root not to be on the path void un_path_up(const NodeAllocator& na); /// Return whether node is on the path - bool is_on_path(void); + bool is_on_path(); /// Return the alternative of the child that is on the path (-1 if none) int get_path_alternative(const NodeAllocator& na); /// Set whether node is on the path @@ -201,13 +201,13 @@ namespace Gecode { namespace Gist { void unstop_all(const NodeAllocator& na); /// Return the shape of this node - Shape* get_shape(void); + Shape* get_shape(); /// Set the shape of this node void set_shape(Shape* s); /// Compute the shape according to the shapes of the children void compute_shape(const NodeAllocator& na); /// Return the bounding box - BoundingBox get_bounding_box(void); + BoundingBox get_bounding_box(); /// Signal that the status has changed void changed_status(const NodeAllocator& na); /// Find a node in this subtree at coordinates \a x, \a y @@ -225,7 +225,7 @@ namespace Gecode { namespace Gist { std::string tool_tip(NodeAllocator& na, BestNode* cur_best, int c_d, int a_d); /// Free allocated memory - void dispose(void); + void dispose(); }; }} // namespace Gecode::Gist diff --git a/gecode/gist/visualnode.hpp b/gecode/gist/visualnode.hpp index 995f481863..18f42733e6 100644 --- a/gecode/gist/visualnode.hpp +++ b/gecode/gist/visualnode.hpp @@ -33,7 +33,7 @@ namespace Gecode { namespace Gist { forceinline - Extent::Extent(void) + Extent::Extent() : l(-1), r(-1) {} forceinline @@ -59,7 +59,7 @@ namespace Gecode { namespace Gist { } forceinline int - Shape::depth(void) const { + Shape::depth() const { return _depth; } @@ -110,7 +110,7 @@ namespace Gecode { namespace Gist { } forceinline void - Shape::compute_bounding_box(void) { + Shape::compute_bounding_box() { int last_left = 0; int last_right = 0; bb.left = 0; @@ -124,12 +124,12 @@ namespace Gecode { namespace Gist { } forceinline const BoundingBox& - Shape::get_bounding_box(void) const { + Shape::get_bounding_box() const { return bb; } forceinline bool - VisualNode::is_hidden(void) { + VisualNode::is_hidden() { return get_flag(HIDDEN); } @@ -147,7 +147,7 @@ namespace Gecode { namespace Gist { } forceinline int - VisualNode::get_offset(void) { + VisualNode::get_offset() { return offset; } @@ -157,7 +157,7 @@ namespace Gecode { namespace Gist { } forceinline bool - VisualNode::is_dirty(void) { + VisualNode::is_dirty() { return get_flag(DIRTY); } @@ -167,7 +167,7 @@ namespace Gecode { namespace Gist { } forceinline bool - VisualNode::children_layout_is_done(void) { + VisualNode::children_layout_is_done() { return get_flag(CHILDREN_LAYOUT_DONE); } @@ -177,7 +177,7 @@ namespace Gecode { namespace Gist { } forceinline bool - VisualNode::is_marked(void) { + VisualNode::is_marked() { return get_flag(MARKED); } @@ -187,7 +187,7 @@ namespace Gecode { namespace Gist { } forceinline bool - VisualNode::is_bookmarked(void) { + VisualNode::is_bookmarked() { return get_flag(BOOKMARKED); } @@ -197,7 +197,7 @@ namespace Gecode { namespace Gist { } forceinline bool - VisualNode::is_on_path(void) { + VisualNode::is_on_path() { return get_flag(ONPATH); } @@ -207,12 +207,12 @@ namespace Gecode { namespace Gist { } forceinline Shape* - VisualNode::get_shape(void) { + VisualNode::get_shape() { return is_hidden() ? Shape::hidden : shape; } forceinline BoundingBox - VisualNode::get_bounding_box(void) { + VisualNode::get_bounding_box() { return get_shape()->get_bounding_box(); } diff --git a/gecode/instance.hh b/gecode/instance.hh index 446c2b7e0e..63239f4914 100644 --- a/gecode/instance.hh +++ b/gecode/instance.hh @@ -335,7 +335,7 @@ namespace Gecode { namespace Instance { /// Initialize with message \a m explicit Error(const std::string& m); /// Return the full message - const char* what(void) const noexcept override; + const char* what() const noexcept override; }; /// Type of the values in a data entry @@ -361,7 +361,7 @@ namespace Gecode { namespace Instance { public: /// No parameters - Params(void); + Params(); /// Set parameter \a name to \a value void set(const std::string& name, const std::string& value); /** @@ -375,7 +375,7 @@ namespace Gecode { namespace Instance { /// Return whether \a name is set, and if so store its value in \a value bool get(const std::string& name, std::string& value) const; /// Return number of parameters - int size(void) const; + int size() const; /// Return the name of parameter \a i std::string name(int i) const; }; @@ -406,12 +406,12 @@ namespace Gecode { namespace Instance { public: /// Empty data - Data(void); + Data(); /// \name Entries //@{ /// Return number of entries - int entries(void) const; + int entries() const; /// Return name of entry \a i, in the order they were defined std::string name(int i) const; /// Test whether there is an entry \a n @@ -470,7 +470,7 @@ namespace Gecode { namespace Instance { public: /// The empty spec (reads only empty input) - Spec(void); + Spec(); /// \name Creating specs //@{ @@ -483,7 +483,7 @@ namespace Gecode { namespace Instance { /// \name Information //@{ /// Return the format name declared by the spec (may be empty) - std::string name(void) const; + std::string name() const; //@} /// \name Reading diff --git a/gecode/instance/data.cpp b/gecode/instance/data.cpp index 8b649ea99f..7046e3fedb 100644 --- a/gecode/instance/data.cpp +++ b/gecode/instance/data.cpp @@ -51,11 +51,11 @@ namespace Gecode { namespace Instance { Error::Error(const std::string& m) : Exception("Instance", m.c_str()), msg(m) {} const char* - Error::what(void) const noexcept { + Error::what() const noexcept { return msg.c_str(); } - Params::Params(void) : impl(std::make_shared()) {} + Params::Params() : impl(std::make_shared()) {} void Params::set(const std::string& name, const std::string& value) { @@ -99,7 +99,7 @@ namespace Gecode { namespace Instance { } int - Params::size(void) const { + Params::size() const { return impl->names.size(); } @@ -120,7 +120,7 @@ namespace Gecode { namespace Instance { } void - Column::skip(void) { + Column::skip() { rows++; missing = true; if (!started) @@ -180,7 +180,7 @@ namespace Gecode { namespace Instance { } Value - Column::finish(void) { + Column::finish() { if (!started) { // No rows added: every row is missing, so empty if it is a list if ((d == 0) && (rows > 0)) @@ -198,7 +198,7 @@ namespace Gecode { namespace Instance { } void - Value::index(void) { + Value::index() { // The memory of earlier starts is reused (see clear_list) while (starts.size() > depth) starts.pop(); @@ -354,10 +354,10 @@ namespace Gecode { namespace Instance { } // namespace - Data::Data(void) : impl(std::make_shared()) {} + Data::Data() : impl(std::make_shared()) {} int - Data::entries(void) const { + Data::entries() const { return impl->entries.size(); } diff --git a/gecode/instance/eval.hpp b/gecode/instance/eval.hpp index 9696e5efd3..d06c58686b 100644 --- a/gecode/instance/eval.hpp +++ b/gecode/instance/eval.hpp @@ -57,7 +57,7 @@ namespace Gecode { namespace Instance { /// The indices Seq path; /// Initialize without a repeat - RecordRef(void) : repeat(nullptr) {} + RecordRef() : repeat(nullptr) {} }; /// A part of the explanation of a failed check, such as "record 3 of @@ -91,7 +91,7 @@ namespace Gecode { namespace Instance { innermost = this; } /// Remove the binding - ~Binding(void) { + ~Binding() { innermost = outer; } }; @@ -187,7 +187,7 @@ namespace Gecode { namespace Instance { } /// Test whether only blanks precede the position on its line bool - line_start(void) const { + line_start() const { for (size_t k = start; k < pos; k++) if (!is_blank(text[k])) return false; @@ -203,7 +203,7 @@ namespace Gecode { namespace Instance { } /// Move to the end of the current line void - to_eol(void) { + to_eol() { size_t p = text.find('\n', pos); advance(p == std::string::npos ? text.size() : p); } @@ -224,7 +224,7 @@ namespace Gecode { namespace Instance { } /// Skip white space, comment lines, and everything after a stop line void - skip(void) { + skip() { for (;;) { const char* s = text.data(); size_t n = text.size(); @@ -254,20 +254,20 @@ namespace Gecode { namespace Instance { } /// Skip to the next data (see skip), and return whether there is any bool - skip_to_data(void) { + skip_to_data() { skip(); return pos < text.size(); } /// Skip blanks and separators, and return whether data follows on the line bool - skip_to_line_data(void) { + skip_to_line_data() { while (in_line(pos) && is_separator(text[pos])) pos++; return in_line(pos); } /// Return where the token at the position ends size_t - token_end(void) const { + token_end() const { size_t q = pos; if ((q < text.size()) && is_split(text[q])) return q + 1; @@ -277,7 +277,7 @@ namespace Gecode { namespace Instance { } /// Read the token at the position std::string - token(void) { + token() { size_t q = token_end(); std::string t = text.substr(pos, q - pos); advance(q); @@ -323,7 +323,7 @@ namespace Gecode { namespace Instance { } /// Return the next token without consuming it std::string - peek(void) { + peek() { size_t p0 = pos, s0 = start; int l0 = line; std::string t = skip_to_data() ? token() : std::string(); @@ -334,7 +334,7 @@ namespace Gecode { namespace Instance { } /// Return the rest of the current line without trailing blanks std::string - rest(void) const { + rest() const { size_t q = text.find('\n', pos); if (q == std::string::npos) q = text.size(); @@ -354,7 +354,7 @@ namespace Gecode { namespace Instance { } /// Return the current place Place - here(void) const { + here() const { Place p; p.pos = pos; p.line = line; @@ -379,7 +379,7 @@ namespace Gecode { namespace Instance { } /// Return where the next data starts (see skip), without moving there size_t - next_data(void) { + next_data() { size_t p0 = pos, s0 = start; int l0 = line; skip(); diff --git a/gecode/instance/impl.hpp b/gecode/instance/impl.hpp index 3c7e763e88..fb9ed4a5c2 100644 --- a/gecode/instance/impl.hpp +++ b/gecode/instance/impl.hpp @@ -149,7 +149,7 @@ namespace Gecode { namespace Instance { public: /// Empty array - Seq(void) : x(nullptr), n(0), cap(0) {} + Seq() : x(nullptr), n(0), cap(0) {} /// Copy elements of \a s Seq(const Seq& s) : Seq() { // Delegating, so that the destructor runs if a copy throws @@ -172,19 +172,19 @@ namespace Gecode { namespace Instance { return *this; } /// Release memory - ~Seq(void) { + ~Seq() { clear(); if (x != nullptr) heap.rfree(x); } /// Return number of elements int - size(void) const { + size() const { return n; } /// Test whether empty bool - empty(void) const { + empty() const { return n == 0; } /// Make room for \a m elements @@ -219,13 +219,13 @@ namespace Gecode { namespace Instance { } /// Remove last element void - pop(void) { + pop() { assert(n > 0); x[--n].~T(); } /// Remove all elements void - clear(void) { + clear() { while (n > 0) x[--n].~T(); } @@ -243,34 +243,34 @@ namespace Gecode { namespace Instance { } /// Return last element T& - back(void) { + back() { assert(n > 0); return x[n - 1]; } /// Return last element const T& - back(void) const { + back() const { assert(n > 0); return x[n - 1]; } /// Iteration support T* - begin(void) { + begin() { return x; } /// Iteration support T* - end(void) { + end() { return x + n; } /// Iteration support const T* - begin(void) const { + begin() const { return x; } /// Iteration support const T* - end(void) const { + end() const { return x + n; } }; @@ -311,7 +311,7 @@ namespace Gecode { namespace Instance { Seq strs; /// The empty integer list - Value(void) : type(ValueType::INT), depth(1) { + Value() : type(ValueType::INT), depth(1) { lengths.push(Seq()); lengths[0].push(0); } @@ -341,17 +341,17 @@ namespace Gecode { namespace Instance { /// Test whether scalar bool - is_scalar(void) const { + is_scalar() const { return depth == 0; } /// Test whether numeric scalar bool - is_number(void) const { + is_number() const { return (depth == 0) && (type != ValueType::STRING); } /// Return number of leaves int - leaves(void) const { + leaves() const { switch (type) { case ValueType::INT: return ints.size(); @@ -363,7 +363,7 @@ namespace Gecode { namespace Instance { } /// Return length of outermost list int - size(void) const { + size() const { return depth == 0 ? 0 : lengths[0][0]; } /// Return value of numeric scalar or leaf \a i as a double @@ -373,7 +373,7 @@ namespace Gecode { namespace Instance { } /// Convert integer leaves to floats void - to_float(void) { + to_float() { if (type != ValueType::INT) return; for (long long int v : ints) @@ -408,7 +408,7 @@ namespace Gecode { namespace Instance { } /// Test whether this is an empty list bool - is_empty_list(void) const { + is_empty_list() const { return (depth > 0) && (lengths[0][0] == 0); } /// Make this the empty list of type \a t, keeping the memory for reuse @@ -428,7 +428,7 @@ namespace Gecode { namespace Instance { } /// Compute \a starts, needed by range - void index(void); + void index(); /// Find leaf range of list \a pos at level \a level void range(int level, int pos, int& from, int& to) const; }; @@ -466,9 +466,9 @@ namespace Gecode { namespace Instance { /// Add a row \a v; throws ShapeError with a phrase completing the name void add(Value& v); /// Add a missing row - void skip(void); + void skip(); /// Return the array - Value finish(void); + Value finish(); }; /// A named value @@ -479,7 +479,7 @@ namespace Gecode { namespace Instance { /// Value Value value; /// Initialize as the empty integer list without a name - Entry(void) = default; + Entry() = default; /// Initialize as \a v named \a n Entry(const std::string& n, Value&& v) : name(n), value(std::move(v)) {} }; @@ -636,7 +636,7 @@ namespace Gecode { namespace Instance { explicit Type(ReadType r = ReadType::INT) : read(r), exclusive(false), named(nullptr), base(1) {} /// Test whether the type has a range, possibly through its name bool - ranged(void) const { + ranged() const { return (lo != nullptr) || (hi != nullptr) || (named != nullptr); } /// Return a use of the type defined by type statement \a d @@ -690,7 +690,7 @@ namespace Gecode { namespace Instance { /// Whether the sections statement ends after this arm bool last; /// Initialize - Arm(void) : optional(false), last(false) {} + Arm() : optional(false), last(false) {} }; /// Statement diff --git a/gecode/instance/reader.cpp b/gecode/instance/reader.cpp index 6a582b6a51..7a834100c3 100644 --- a/gecode/instance/reader.cpp +++ b/gecode/instance/reader.cpp @@ -87,7 +87,7 @@ namespace Gecode { namespace Instance { /// Upper bound, included long long int hi; /// Initialize without bounds - Range(void) : low(false), high(false), lo(0), hi(0) {} + Range() : low(false), high(false), lo(0), hi(0) {} /// Test whether \a v is in the range bool contains(long long int v) const { @@ -95,7 +95,7 @@ namespace Gecode { namespace Instance { } /// Test whether there are bounds bool - bounded(void) const { + bounded() const { return low || high; } }; @@ -111,7 +111,7 @@ namespace Gecode { namespace Instance { Domain(const Type& t, const Range& r) : type(t), range(r) {} /// Return a description of the values, for messages std::string - describe(void) const { + describe() const { std::string d = Instance::describe(type.read); if (range.bounded()) d = "an int in " + (range.low ? std::to_string(range.lo) : "") + ".." + @@ -1004,7 +1004,7 @@ namespace Gecode { namespace Instance { * the name, and may not be while the name is not defined yet. */ bool - may_be_skipped(void) const { + may_be_skipped() const { if (current == 0) return false; if (catalog) diff --git a/gecode/instance/resolve.cpp b/gecode/instance/resolve.cpp index 846821002d..0e573d2a61 100644 --- a/gecode/instance/resolve.cpp +++ b/gecode/instance/resolve.cpp @@ -222,7 +222,7 @@ namespace Gecode { namespace Instance { /// Check that the names of the records of repeats are not used /// otherwise void - check_lists(void) const { + check_lists() const { for (int i = 0; i < lists.size(); i++) { const Stmt* r = lists[i].repeat; check_name(r->list, i); @@ -408,7 +408,7 @@ namespace Gecode { namespace Instance { /// Test whether the statement visited is a check, so that record /// names in it range over their records bool - lifting(void) const { + lifting() const { return stmt->kind == Stmt::Kind::CHECK; } /// Check that the record names of check \a s range over one repeat diff --git a/gecode/instance/spec.cpp b/gecode/instance/spec.cpp index 2869fab197..74289dfb34 100644 --- a/gecode/instance/spec.cpp +++ b/gecode/instance/spec.cpp @@ -102,7 +102,7 @@ namespace Gecode { namespace Instance { /// Whether no white space precedes the token bool glued; /// Initialize - Token(void) : kind(Kind::END), i(0), f(0.0), line(0), glued(false) {} + Token() : kind(Kind::END), i(0), f(0.0), line(0), glued(false) {} }; /** @@ -449,11 +449,11 @@ namespace Gecode { namespace Instance { static const int max_nesting = 256; const Token& - peek(void) const { + peek() const { return toks[p]; } const Token& - next(void) { + next() { const Token& t = toks[p]; if (p + 1 < toks.size()) p++; @@ -482,7 +482,7 @@ namespace Gecode { namespace Instance { /// Test whether a '-' or '.' joining the words of a format name such as /// dimacs-cnf comes next bool - at_name_joiner(void) const { + at_name_joiner() const { if (!(punct("-") || punct(".")) || !peek().glued || (p + 1 >= toks.size())) return false; const Token& t = toks[p + 1]; @@ -522,7 +522,7 @@ namespace Gecode { namespace Instance { return next().text; } Pattern - pattern(void) { + pattern() { int line = peek().line; std::string s = string("a line pattern"); Pattern pat; @@ -566,7 +566,7 @@ namespace Gecode { namespace Instance { fail(std::string(what) + " are nested too deeply"); } Block - block(void) { + block() { expect_punct("{"); enter(depth, "blocks"); // The types defined in the block are only visible inside it @@ -675,7 +675,7 @@ namespace Gecode { namespace Instance { } std::unique_ptr - statement(void) { + statement() { const Token& t = peek(); each_ok = repeat_start; repeat_start = false; @@ -748,7 +748,7 @@ namespace Gecode { namespace Instance { } /// Test whether the upper bound of a range comes next bool - at_upper_bound(void) const { + at_upper_bound() const { const Token& t = peek(); switch (t.kind) { case Token::Kind::IDENT: @@ -783,7 +783,7 @@ namespace Gecode { namespace Instance { * bound of lo.. - expr(void) { + expr() { return binary(0); } /// Store the binary operator \a t in \a op, and return its precedence @@ -1084,7 +1084,7 @@ namespace Gecode { namespace Instance { return lhs; } std::unique_ptr - unary(void) { + unary() { enter(nesting, "expressions"); std::unique_ptr e; if (punct("-") || punct("!")) { @@ -1101,7 +1101,7 @@ namespace Gecode { namespace Instance { /// a ^ b, which binds tighter than unary operators and groups to the /// right; b is a unary expression, so 2^-1 is 2^(-1) std::unique_ptr - power(void) { + power() { std::unique_ptr e = postfix(); if (!punct("^")) return e; @@ -1114,7 +1114,7 @@ namespace Gecode { namespace Instance { } /// Indices and fields a[i][j].f... std::unique_ptr - postfix(void) { + postfix() { std::unique_ptr e = primary(); // Each index or field adds a level above e int levels = 0; @@ -1209,7 +1209,7 @@ namespace Gecode { namespace Instance { return e; } std::unique_ptr - primary(void) { + primary() { const Token& t = peek(); if (t.kind == Token::Kind::INT) return integer(next().i); @@ -1359,7 +1359,7 @@ namespace Gecode { namespace Instance { * */ - Spec::Spec(void) : impl(std::make_shared("", "")) {} + Spec::Spec() : impl(std::make_shared("", "")) {} Spec Spec::parse(const std::string& text, const std::string& origin) { @@ -1374,7 +1374,7 @@ namespace Gecode { namespace Instance { } std::string - Spec::name(void) const { + Spec::name() const { return impl->name; } diff --git a/gecode/int.hh b/gecode/int.hh index 7bfc318254..2954f141bd 100644 --- a/gecode/int.hh +++ b/gecode/int.hh @@ -203,7 +203,7 @@ namespace Gecode { /// Perform equality test on ranges GECODE_INT_EXPORT bool equal(const IntSetObject& so) const; /// Delete object - GECODE_INT_EXPORT ~IntSetObject(void) override; + GECODE_INT_EXPORT ~IntSetObject() override; }; /// Sort ranges according to increasing minimum class MinInc; @@ -219,14 +219,14 @@ namespace Gecode { public: #ifdef GECODE_HAS_FAULT_INJECTION /// Reset live object accounting for fault-injection tests - GECODE_INT_EXPORT static void fault_reset_allocations(void); + GECODE_INT_EXPORT static void fault_reset_allocations(); /// Return live object accounting for fault-injection tests - GECODE_INT_EXPORT static int fault_live_allocations(void); + GECODE_INT_EXPORT static int fault_live_allocations(); #endif /// \name Constructors and initialization //@{ /// Initialize as empty set - IntSet(void) = default; + IntSet() = default; /** \brief Initialize as range with minimum \a n and maximum \a m * * Note that the set is empty if \a n is larger than \a m @@ -261,7 +261,7 @@ namespace Gecode { /// \name Range access //@{ /// Return number of ranges of the specification - int ranges(void) const; + int ranges() const; /// Return minimum of range at position \a i int min(int i) const; /// Return maximum of range at position \a i @@ -275,13 +275,13 @@ namespace Gecode { /// Return whether \a n is included in the set bool in(int n) const; /// Return size (cardinality) of set - unsigned int size(void) const; + unsigned int size() const; /// Return width of set (distance between maximum and minimum) - unsigned int width(void) const; + unsigned int width() const; /// Return minimum of entire set - int min(void) const; + int min() const; /// Return maximum of entire set - int max(void) const; + int max() const; //@} /// \name Equality tests @@ -313,7 +313,7 @@ namespace Gecode { /// \name Constructors and initialization //@{ /// Default constructor - IntSetRanges(void) = default; + IntSetRanges() = default; /// Initialize with ranges for set \a s IntSetRanges(const IntSet& s); /// Initialize with ranges for set \a s @@ -323,19 +323,19 @@ namespace Gecode { /// \name Iteration control //@{ /// Test whether iterator is still at a range or done - bool operator()(void) const; + bool operator()() const; /// Move iterator to next range (if possible) - void operator++(void); + void operator++(); //@} /// \name Range access //@{ /// Return smallest value of range - int min(void) const; + int min() const; /// Return largest value of range - int max(void) const; + int max() const; /// Return width of range (distance between minimum and maximum) - unsigned int width(void) const; + unsigned int width() const; //@} }; @@ -349,7 +349,7 @@ namespace Gecode { /// \name Constructors and initialization //@{ /// Default constructor - IntSetValues(void) = default; + IntSetValues() = default; /// Initialize with values for \a s IntSetValues(const IntSet& s); /// Initialize with values for \a s @@ -406,7 +406,7 @@ namespace Gecode { /// \name Constructors and initialization //@{ /// Default constructor - IntVar(void) = default; + IntVar() = default; /// Initialize from integer variable \a y IntVar(const IntVar& y) = default; /// Initialize from integer view \a y @@ -440,11 +440,11 @@ namespace Gecode { /// \name Value access //@{ /// Return minimum of domain - int min(void) const; + int min() const; /// Return maximum of domain - int max(void) const; + int max() const; /// Return median of domain (greatest element not greater than the median) - int med(void) const; + int med() const; /** * \brief Return assigned value * @@ -452,22 +452,22 @@ namespace Gecode { * is not yet assigned. * */ - int val(void) const; + int val() const; /// Return size (cardinality) of domain - unsigned int size(void) const; + unsigned int size() const; /// Return width of domain (distance between maximum and minimum) - unsigned int width(void) const; + unsigned int width() const; /// Return regret of domain minimum (distance to next larger value) - unsigned int regret_min(void) const; + unsigned int regret_min() const; /// Return regret of domain maximum (distance to next smaller value) - unsigned int regret_max(void) const; + unsigned int regret_max() const; //@} /// \name Domain tests //@{ /// Test whether domain is a range - bool range(void) const; + bool range() const; /// Test whether \a n is contained in domain bool in(int n) const; //@} @@ -492,7 +492,7 @@ namespace Gecode { /// \name Constructors and initialization //@{ /// Default constructor - IntVarRanges(void); + IntVarRanges(); /// Initialize with ranges for integer variable \a x IntVarRanges(const IntVar& x); /// Initialize with ranges for integer variable \a x @@ -509,7 +509,7 @@ namespace Gecode { /// \name Constructors and initialization //@{ /// Default constructor - IntVarValues(void) = default; + IntVarValues() = default; /// Initialize with values for \a x IntVarValues(const IntVar& x); /// Initialize with values \a x @@ -544,7 +544,7 @@ namespace Gecode { /// \name Constructors and initialization //@{ /// Default constructor - BoolVar(void) = default; + BoolVar() = default; /// Initialize from Boolean variable \a y BoolVar(const BoolVar& y) = default; /// Initialize from Boolean view \a y @@ -566,11 +566,11 @@ namespace Gecode { /// \name Value access //@{ /// Return minimum of domain - int min(void) const; + int min() const; /// Return maximum of domain - int max(void) const; + int max() const; /// Return median of domain (greatest element not greater than the median) - int med(void) const; + int med() const; /** * \brief Return assigned value * @@ -578,22 +578,22 @@ namespace Gecode { * is not yet assigned. * */ - int val(void) const; + int val() const; /// Return size (cardinality) of domain - unsigned int size(void) const; + unsigned int size() const; /// Return width of domain (distance between maximum and minimum) - unsigned int width(void) const; + unsigned int width() const; /// Return regret of domain minimum (distance to next larger value) - unsigned int regret_min(void) const; + unsigned int regret_min() const; /// Return regret of domain maximum (distance to next smaller value) - unsigned int regret_max(void) const; + unsigned int regret_max() const; //@} /// \name Domain tests //@{ /// Test whether domain is a range - bool range(void) const; + bool range() const; /// Test whether \a n is contained in domain bool in(int n) const; //@} @@ -601,11 +601,11 @@ namespace Gecode { /// \name Boolean domain tests //@{ /// Test whether domain is zero - bool zero(void) const; + bool zero() const; /// Test whether domain is one - bool one(void) const; + bool one() const; /// Test whether domain is neither zero nor one - bool none(void) const; + bool none() const; //@} /// Assignment operator @@ -650,7 +650,7 @@ namespace Gecode { /// \name Constructors and initialization //@{ /// Allocate empty array - IntArgs(void); + IntArgs(); /// Allocate array with \a n elements explicit IntArgs(int n); /// Allocate array and copy elements from \a x @@ -678,7 +678,7 @@ namespace Gecode { /// \name Constructors and initialization //@{ /// Allocate empty array - IntVarArgs(void) = default; + IntVarArgs() = default; /// Allocate array with \a n elements explicit IntVarArgs(int n); /// Initialize from variable argument array \a a (copy elements) @@ -736,7 +736,7 @@ namespace Gecode { /// \name Constructors and initialization //@{ /// Allocate empty array - BoolVarArgs(void) = default; + BoolVarArgs() = default; /// Allocate array with \a n elements explicit BoolVarArgs(int n); /// Initialize from variable argument array \a a (copy elements) @@ -789,7 +789,7 @@ namespace Gecode { /// \name Creation and initialization //@{ /// Default constructor (array of size 0) - IntVarArray(void) = default; + IntVarArray() = default; /// Allocate array for \a n integer variables (variables are uninitialized) IntVarArray(Space& home, int n); /// Initialize from integer variable array \a a (share elements) @@ -837,7 +837,7 @@ namespace Gecode { /// \name Creation and initialization //@{ /// Default constructor (array of size 0) - BoolVarArray(void) = default; + BoolVarArray() = default; /// Allocate array for \a n Boolean variables (variables are uninitialized) BoolVarArray(Space& home, int n); /// Initialize from Boolean variable array \a a (share elements) @@ -894,7 +894,7 @@ namespace Gecode { * class Model : public Space { * public: * OpenIntVarList x; - * Model(void) : x(*this,IntSet(0,2),3) { + * Model() : x(*this,IntSet(0,2),3) { * rel(*this,x.length(),IRT_GQ,1); * distinct(*this,x); * branch(*this,x); @@ -902,7 +902,7 @@ namespace Gecode { * Model(Model& s) : Space(s) { * x.update(*this,s.x); * } - * virtual Space* copy(void) { + * virtual Space* copy() { * return new Model(*this); * } * }; @@ -957,7 +957,7 @@ namespace Gecode { */ typedef std::function x, int i)> Transition; /// Construct an uninitialized list - OpenVarList(void) = default; + OpenVarList() = default; /// Construct a list using \a create for each position OpenVarList(Space& home, Factory create, int max = Int::Limits::max); /// Construct a list using \a create and transition function \a t @@ -965,11 +965,11 @@ namespace Gecode { /// Update during cloning void update(Space& home, OpenVarList& s); /// Return the number of constructed positions (their values may be unassigned) - int known_length(void) const; + int known_length() const; /// Return variable at position \a i, where 0 <= \a i < known_length() Var operator[](int i) const; /// Return the eventual-length variable - IntVar length(void) const; + IntVar length() const; /** * \brief Append variable \a x * @@ -1044,17 +1044,17 @@ namespace Gecode { public: /// Construct an uninitialized list - OpenViewList(void) = default; + OpenViewList() = default; /// Share the source of the model list \a list explicit OpenViewList(const OpenVarList& list); /// Update during cloning void update(Space& home, OpenViewList& s); /// Return the number of constructed positions - int known_length(void) const; + int known_length() const; /// Return the view at constructed position \a i View operator[](int i) const; /// Return the eventual-length view - Int::IntView length(void) const; + Int::IntView length() const; /// Require and construct at least the first \a n positions void materialize(Space& home, int n); /// Subscribe \a p to construction of positions @@ -1080,7 +1080,7 @@ namespace Gecode { typedef std::function Domain; using OpenVarList::OpenVarList; /// Construct an uninitialized list - GECODE_INT_EXPORT OpenIntVarList(void) = default; + GECODE_INT_EXPORT OpenIntVarList() = default; /// Share an integer list constructed through a variable factory OpenIntVarList(const OpenVarList& x); /// Construct a list with maximal length \a max and full domains @@ -1112,7 +1112,7 @@ namespace Gecode { public: using OpenVarList::OpenVarList; /// Construct an uninitialized list - GECODE_INT_EXPORT OpenBoolVarList(void) = default; + GECODE_INT_EXPORT OpenBoolVarList() = default; /// Share a Boolean list constructed through a variable factory OpenBoolVarList(const OpenVarList& x); /// Construct a list with maximal length \a max and domains 0..1 @@ -1175,13 +1175,13 @@ namespace Gecode { public: /// Default constructor without proper initialization - Reify(void); + Reify(); /// Construct reification specification Reify(BoolVar x, ReifyMode rm = RM_EQV); /// Return Boolean control variable - BoolVar var(void) const; + BoolVar var() const; /// Return reification mode - ReifyMode mode(void) const; + ReifyMode mode() const; /// Set Boolean control variable void var(BoolVar x); /// Set reification mode @@ -2469,7 +2469,7 @@ namespace Gecode { int symbol; ///< symbol int o_state; ///< output state /// Default constructor - Transition(void); + Transition(); /// Initialize members Transition(int i_state0, int symbol0, int o_state0); }; @@ -2487,15 +2487,15 @@ namespace Gecode { /// Initialize to transitions of DFA \a d for symbol \a n Transitions(const DFA& d, int n); /// Test whether iterator still at a transition - bool operator()(void) const; + bool operator()() const; /// Move iterator to next transition - void operator++(void); + void operator++(); /// Return in-state of current transition - int i_state(void) const; + int i_state() const; /// Return symbol of current transition - int symbol(void) const; + int symbol() const; /// Return out-state of current transition - int o_state(void) const; + int o_state() const; }; /// Iterator for %DFA symbols class Symbols { @@ -2509,11 +2509,11 @@ namespace Gecode { /// Initialize to symbols of DFA \a d Symbols(const DFA& d); /// Test whether iterator still at a symbol - bool operator()(void) const; + bool operator()() const; /// Move iterator to next symbol - void operator++(void); + void operator++(); /// Return current symbol - int val(void) const; + int val() const; }; /** * \brief Initialize DFA @@ -2532,7 +2532,7 @@ namespace Gecode { public: friend class Transitions; /// Initialize for DFA accepting the empty word - DFA(void) = default; + DFA() = default; /** * \brief Initialize DFA * @@ -2584,23 +2584,23 @@ namespace Gecode { GECODE_INT_EXPORT bool operator==(const DFA& d) const; /// Return the number of states - int n_states(void) const; + int n_states() const; /// Return the number of transitions - int n_transitions(void) const; + int n_transitions() const; /// Return the number of symbols - unsigned int n_symbols(void) const; + unsigned int n_symbols() const; /// Return maximal degree (in-degree and out-degree) of any state - unsigned int max_degree(void) const; + unsigned int max_degree() const; /// Return the number of the first final state - int final_fst(void) const; + int final_fst() const; /// Return the number of the last final state - int final_lst(void) const; + int final_lst() const; /// Return smallest symbol in DFA - int symbol_min(void) const; + int symbol_min() const; /// Return largest symbol in DFA - int symbol_max(void) const; + int symbol_max() const; /// Return hash key - std::size_t hash(void) const; + std::size_t hash() const; }; } // namespace Gecode @@ -2677,7 +2677,7 @@ namespace Gecode { /// Begin of supports BitSetData* s; /// Return the width - unsigned int width(void) const; + unsigned int width() const; /** * \brief Return the dense supports for value \a n * @@ -2757,7 +2757,7 @@ namespace Gecode { unsigned int compressed_n_entries; /// Return newly added tuple - Tuple add(void); + Tuple add(); /// Return tuple with number \a i Tuple get(int i) const; /// Set bit \a n in bitset data \a d @@ -2772,15 +2772,15 @@ namespace Gecode { const Range* lst(int i) const; /// Finalize datastructure (disallows additions of more Tuples) GECODE_INT_EXPORT - void finalize(void); + void finalize(); /// Finalize datastructure (disallows additions of more Tuples) GECODE_INT_EXPORT void finalize(ExtensionalPropKind epk); /// Resize tuple data GECODE_INT_EXPORT - void resize(void); + void resize(); /// Release partially or fully constructed support data - void clear_support(void); + void clear_support(); /// Select the state for an empty finalized tuple set State empty_state(ExtensionalPropKind epk) const; /// Select the finalized state for the computed table layout @@ -2788,23 +2788,23 @@ namespace Gecode { bool compressed_possible, bool support_bits_sparse, unsigned long long dense_bytes) const; /// Is datastructure finalized - bool finalized(void) const; + bool finalized() const; /// Has finalization failed - bool failed(void) const; + bool failed() const; /// Is datastructure no longer mutable - bool terminal(void) const; + bool terminal() const; /// Initialize as empty tuple set with arity \a a Data(int a); /// Delete implementation GECODE_INT_EXPORT - ~Data(void) override; + ~Data() override; }; /// Get data (must be initialized and finalized) - Data& data(void) const; + Data& data() const; /// Get raw data (must be initialized) - Data& raw(void) const; + Data& raw() const; /// Add tuple \a t to tuple set GECODE_INT_EXPORT void _add(const IntArgs& t); @@ -2816,7 +2816,7 @@ namespace Gecode { /// \name Initialization //@{ /// Construct an uninitialized tuple set - TupleSet(void) = default; + TupleSet() = default; /// Initialize for a tuple set with arity \a a GECODE_INT_EXPORT TupleSet(int a); @@ -2836,7 +2836,7 @@ namespace Gecode { GECODE_INT_EXPORT TupleSet(int a, const DFA& dfa, ExtensionalPropKind epk); /// Test whether tuple set has been initialized - operator bool(void) const; + operator bool() const; /// Test whether tuple set is equal to \a t bool operator==(const TupleSet& t) const; /** @@ -2855,16 +2855,16 @@ namespace Gecode { /// Add tuple \a t to tuple set TupleSet& add(const IntArgs& t); /// Is tuple set successfully finalized - bool finalized(void) const; + bool finalized() const; /** * \brief Has tuple-set finalization failed * * A failed tuple set is terminal: no tuples can be added and * finalization cannot be attempted again. */ - bool failed(void) const; + bool failed() const; /// Finalize tuple set with dense support data - void finalize(void); + void finalize(); /// Finalize tuple set with representation \a epk /** * Explicit representation selection materializes only the selected @@ -2880,29 +2880,29 @@ namespace Gecode { /// \name Tuple access //@{ /// Arity of tuple set - int arity(void) const; + int arity() const; /// Number of tuples - int tuples(void) const; + int tuples() const; /// Return number of required bit set words - unsigned int words(void) const; + unsigned int words() const; /// Get tuple \a i Tuple operator[](int i) const; /// Return minimal value in all tuples - int min(void) const; + int min() const; /// Return maximal value in all tuples - int max(void) const; + int max() const; /// Return hash key - std::size_t hash(void) const; + std::size_t hash() const; /// Return materialized tuple-set representation - ExtensionalPropKind representation(void) const; + ExtensionalPropKind representation() const; private: /// Return number of sparse support values - unsigned int sparse_values(void) const; + unsigned int sparse_values() const; /// Return tuple-value sparse ids (size tuples()*arity()) - const unsigned int* sparse_tuple_value_ids(void) const; + const unsigned int* sparse_tuple_value_ids() const; /// Return sparse support offsets (size sparse_values()+1) - const unsigned int* sparse_support_offsets(void) const; + const unsigned int* sparse_support_offsets() const; /// Return support id for position/value, false if absent bool support_id(int p, int n, unsigned int& gid) const; /// Return sparse support tuple id range for position/value, false if absent @@ -2937,19 +2937,19 @@ namespace Gecode { /// \name Iteration control //@{ /// Test whether iterator is still at a range - bool operator()(void) const; + bool operator()() const; /// Move iterator to next range (if possible) - void operator++(void); + void operator++(); //@} /// \name %Range access //@{ /// Return smallest value of range - int min(void) const; + int min() const; /// Return largest value of range - int max(void) const; + int max() const; /// Return width of range (distance between minimum and maximum) - unsigned int width(void) const; + unsigned int width() const; //@} }; //@} @@ -3172,7 +3172,7 @@ namespace Gecode { const std::function function; ///< Computed distance Data(int n, const IntArgs& matrix); Data(int n, std::function function); - ~Data(void) override; + ~Data() override; }; public: @@ -3196,7 +3196,7 @@ namespace Gecode { */ GECODE_INT_EXPORT IntDistance(int n, std::function function); /// Number of sites - int size(void) const; + int size() const; /// Distance between valid indices \a a and \a b int operator()(int a, int b) const; }; @@ -4967,7 +4967,7 @@ namespace Gecode { * yet initialized AFC storage is init or the assignment operator. * */ - IntAFC(void) = default; + IntAFC() = default; /** * \brief Initialize for integer variables \a x and decay factor \a d * @@ -5003,7 +5003,7 @@ namespace Gecode { * yet initialized AFC storage is init or the assignment operator. * */ - BoolAFC(void) = default; + BoolAFC() = default; /** * \brief Initialize for Boolean variables \a x and decay factor \a d * @@ -5045,7 +5045,7 @@ namespace Gecode { * yet initialized action storage is init or the assignment operator. * */ - IntAction(void) = default; + IntAction() = default; /// Copy constructor IntAction(const IntAction& a) = default; /// Assignment operator @@ -5093,7 +5093,7 @@ namespace Gecode { * yet initialized action storage is init or the assignment operator. * */ - BoolAction(void) = default; + BoolAction() = default; /// Copy constructor BoolAction(const BoolAction& a) = default; /// Assignment operator @@ -5147,7 +5147,7 @@ namespace Gecode { * yet initialized CHB storage is init or the assignment operator. * */ - IntCHB(void) = default; + IntCHB() = default; /// Copy constructor IntCHB(const IntCHB& chb) = default; /// Assignment operator @@ -5190,7 +5190,7 @@ namespace Gecode { * yet initialized action storage is init or the assignment operator. * */ - BoolCHB(void) = default; + BoolCHB() = default; /// Copy constructor BoolCHB(const BoolCHB& chb) = default; /// Assignment operator @@ -5307,7 +5307,7 @@ namespace Gecode { public: /// Initialize with strategy SEL_NONE - IntVarBranch(void); + IntVarBranch(); /// Initialize with random number generator \a r IntVarBranch(const Rnd& r); /// Initialize with selection strategy \a s and tie-break limit function \a t @@ -5323,7 +5323,7 @@ namespace Gecode { /// Initialize with selection strategy \a s, branch merit function \a mf, and tie-break limit function \a t IntVarBranch(Select s, IntBranchMerit mf, BranchTbl t); /// Return selection strategy - Select select(void) const; + Select select() const; /// Expand AFC, action, and CHB void expand(Home home, const IntVarArgs& x); }; @@ -5358,7 +5358,7 @@ namespace Gecode { public: /// Initialize with strategy SEL_NONE - BoolVarBranch(void); + BoolVarBranch(); /// Initialize with random number generator \a r BoolVarBranch(const Rnd& r); /// Initialize with selection strategy \a s and tie-break limit function \a t @@ -5374,7 +5374,7 @@ namespace Gecode { /// Initialize with selection strategy \a s, branch merit function \a mf, and tie-break limit function \a t BoolVarBranch(Select s, BoolBranchMerit mf, BranchTbl t); /// Return selection strategy - Select select(void) const; + Select select() const; /// Expand decay factor into AFC or action void expand(Home home, const BoolVarArgs& x); }; @@ -5385,7 +5385,7 @@ namespace Gecode { */ //@{ /// Select first unassigned variable - IntVarBranch INT_VAR_NONE(void); + IntVarBranch INT_VAR_NONE(); /// Select random variable (uniform distribution, for tie breaking) IntVarBranch INT_VAR_RND(const Rnd& r); /// Select variable with least merit according to branch merit function \a bm @@ -5486,7 +5486,7 @@ namespace Gecode { IntVarBranch INT_VAR_REGRET_MAX_MAX(BranchTbl tbl = nullptr); /// Select first unassigned variable - BoolVarBranch BOOL_VAR_NONE(void); + BoolVarBranch BOOL_VAR_NONE(); /// Select random variable (uniform distribution, for tie breaking) BoolVarBranch BOOL_VAR_RND(const Rnd& r); /// Select variable with least merit according to branch merit function \a bm @@ -5564,7 +5564,7 @@ namespace Gecode { /// Initialize with value function \a f and commit function \a c IntValBranch(IntBranchVal v, IntBranchCommit c); /// Return selection strategy - Select select(void) const; + Select select() const; }; /** @@ -5595,7 +5595,7 @@ namespace Gecode { /// Initialize with value function \a f and commit function \a c BoolValBranch(BoolBranchVal v, BoolBranchCommit c); /// Return selection strategy - Select select(void) const; + Select select() const; }; /** @@ -5604,21 +5604,21 @@ namespace Gecode { */ //@{ /// Select smallest value - IntValBranch INT_VAL_MIN(void); + IntValBranch INT_VAL_MIN(); /// Select greatest value not greater than the median - IntValBranch INT_VAL_MED(void); + IntValBranch INT_VAL_MED(); /// Select largest value - IntValBranch INT_VAL_MAX(void); + IntValBranch INT_VAL_MAX(); /// Select random value IntValBranch INT_VAL_RND(const Rnd& r); /// Select values not greater than mean of smallest and largest value - IntValBranch INT_VAL_SPLIT_MIN(void); + IntValBranch INT_VAL_SPLIT_MIN(); /// Select values greater than mean of smallest and largest value - IntValBranch INT_VAL_SPLIT_MAX(void); + IntValBranch INT_VAL_SPLIT_MAX(); /// Select the smallest range of the variable domain if it has several ranges, otherwise select values not greater than mean of smallest and largest value - IntValBranch INT_VAL_RANGE_MIN(void); + IntValBranch INT_VAL_RANGE_MIN(); /// Select the largest range of the variable domain if it has several ranges, otherwise select values greater than mean of smallest and largest value - IntValBranch INT_VAL_RANGE_MAX(void); + IntValBranch INT_VAL_RANGE_MAX(); /** * \brief Select value as defined by the value function \a v and commit function \a c * Uses a commit function as default that posts the constraints that @@ -5627,14 +5627,14 @@ namespace Gecode { */ IntValBranch INT_VAL(IntBranchVal v, IntBranchCommit c = nullptr); /// Try all values starting from smallest - IntValBranch INT_VALUES_MIN(void); + IntValBranch INT_VALUES_MIN(); /// Try all values starting from largest - IntValBranch INT_VALUES_MAX(void); + IntValBranch INT_VALUES_MAX(); /// Select smallest value - BoolValBranch BOOL_VAL_MIN(void); + BoolValBranch BOOL_VAL_MIN(); /// Select largest value - BoolValBranch BOOL_VAL_MAX(void); + BoolValBranch BOOL_VAL_MAX(); /// Select random value BoolValBranch BOOL_VAL_RND(const Rnd& r); /** @@ -5681,7 +5681,7 @@ namespace Gecode { /// Initialize with value function \a f and commit function \a c IntAssign(IntBranchVal v, IntBranchCommit c); /// Return selection strategy - Select select(void) const; + Select select() const; }; /** @@ -5712,7 +5712,7 @@ namespace Gecode { /// Initialize with value function \a f and commit function \a c BoolAssign(BoolBranchVal v, BoolBranchCommit c); /// Return selection strategy - Select select(void) const; + Select select() const; }; /** @@ -5721,11 +5721,11 @@ namespace Gecode { */ //@{ /// Select smallest value - IntAssign INT_ASSIGN_MIN(void); + IntAssign INT_ASSIGN_MIN(); /// Select greatest value not greater than the median - IntAssign INT_ASSIGN_MED(void); + IntAssign INT_ASSIGN_MED(); /// Select largest value - IntAssign INT_ASSIGN_MAX(void); + IntAssign INT_ASSIGN_MAX(); /// Select random value IntAssign INT_ASSIGN_RND(const Rnd& r); /** @@ -5737,9 +5737,9 @@ namespace Gecode { IntAssign INT_ASSIGN(IntBranchVal v, IntBranchCommit c = nullptr); /// Select smallest value - BoolAssign BOOL_ASSIGN_MIN(void); + BoolAssign BOOL_ASSIGN_MIN(); /// Select largest value - BoolAssign BOOL_ASSIGN_MAX(void); + BoolAssign BOOL_ASSIGN_MAX(); /// Select random value BoolAssign BOOL_ASSIGN_RND(const Rnd& r); /** @@ -5966,13 +5966,13 @@ namespace Gecode { /// Symmetry object that this handle refers to. Int::LDSB::SymmetryObject* ref; /// Increment counter - void increment(void); + void increment(); /// Decrement counter - void decrement(void); + void decrement(); public: /// Default constructor - SymmetryHandle(void); + SymmetryHandle(); /// Initialies with a SymmetryObject SymmetryHandle(Int::LDSB::SymmetryObject* o); /// Copy constructor @@ -5980,7 +5980,7 @@ namespace Gecode { /// Assignment operator const SymmetryHandle& operator=(const SymmetryHandle& h); /// Destructor - ~SymmetryHandle(void); + ~SymmetryHandle(); }; class Symmetries; /// Traits of %Symmetries @@ -6244,19 +6244,19 @@ namespace Gecode { /// \name Iteration control //@{ /// Test whether iterator is still at a range or done - bool operator()(void) const; + bool operator()() const; /// Move iterator to next range (if possible) - void operator++(void); + void operator++(); //@} /// \name Range access //@{ /// Return smallest value of range - int min(void) const; + int min() const; /// Return largest value of range - int max(void) const; + int max() const; /// Return width of range (distance between minimum and maximum) - unsigned int width(void) const; + unsigned int width() const; //@} }; diff --git a/gecode/int/arithmetic.hh b/gecode/int/arithmetic.hh index 8e9cf226ef..b5f58874e9 100644 --- a/gecode/int/arithmetic.hh +++ b/gecode/int/arithmetic.hh @@ -307,9 +307,9 @@ namespace Gecode { namespace Int { namespace Arithmetic { class SqrOps { public: /// Return whether exponent is even - bool even(void) const; + bool even() const; /// Return exponent - int exp(void) const; + int exp() const; /// Set exponent to \a m void exp(int m); /// Return \f$x^2\f$ @@ -344,9 +344,9 @@ namespace Gecode { namespace Int { namespace Arithmetic { /// Initialize with exponent \a n PowOps(int n); /// Return whether exponent is even - bool even(void) const; + bool even() const; /// Return exponent - int exp(void) const; + int exp() const; /// Set exponent to \a m void exp(int m); /// Return \f$x^n\f$ where \f$n>0\f$ diff --git a/gecode/int/arithmetic/pow-ops.hpp b/gecode/int/arithmetic/pow-ops.hpp index 15a156f1eb..c10b3acce0 100644 --- a/gecode/int/arithmetic/pow-ops.hpp +++ b/gecode/int/arithmetic/pow-ops.hpp @@ -42,12 +42,12 @@ namespace Gecode { namespace Int { namespace Arithmetic { } forceinline bool - PowOps::even(void) const { + PowOps::even() const { return even(n); } forceinline int - PowOps::exp(void) const { + PowOps::exp() const { return n; } @@ -181,12 +181,12 @@ namespace Gecode { namespace Int { namespace Arithmetic { } forceinline bool - SqrOps::even(void) const { + SqrOps::even() const { return true; } forceinline int - SqrOps::exp(void) const { + SqrOps::exp() const { return 2; } diff --git a/gecode/int/array.hpp b/gecode/int/array.hpp index 3a4eff04e5..ae6c3366f2 100644 --- a/gecode/int/array.hpp +++ b/gecode/int/array.hpp @@ -38,7 +38,7 @@ namespace Gecode { */ forceinline - IntArgs::IntArgs(void) + IntArgs::IntArgs() : ArgArray(0) {} forceinline diff --git a/gecode/int/bin-packing.hh b/gecode/int/bin-packing.hh index b47b551703..6c7ef41ec5 100644 --- a/gecode/int/bin-packing.hh +++ b/gecode/int/bin-packing.hh @@ -59,16 +59,16 @@ namespace Gecode { namespace Int { namespace BinPacking { public: /// Default constructor - Item(void); + Item(); /// Constructor Item(IntView b, int s); /// Return bin of item - IntView bin(void) const; + IntView bin() const; /// Set bin of item to \a b void bin(IntView b); /// Return size of item - int size(void) const; + int size() const; /// Set size of item to \a s void size(int s); @@ -94,15 +94,15 @@ namespace Gecode { namespace Int { namespace BinPacking { public: /// Default constructor - SizeSet(void) = default; + SizeSet() = default; /// Initialize for at most \a n_max items SizeSet(Region& region, int n_max); /// Add new size \a s void add(int s); /// Return cardinality of set (number of entries) - int card(void) const; + int card() const; /// Return total size - int total(void) const; + int total() const; /// Return size of item \a i int operator[](int i) const; }; @@ -115,15 +115,15 @@ namespace Gecode { namespace Int { namespace BinPacking { public: /// Default constructor - SizeSetMinusOne(void); + SizeSetMinusOne(); /// Initialize for at most \n n_max entries SizeSetMinusOne(Region& region, int n); /// Discard size \a s void minus(int s); /// Return cardinality of set (number of entries) - int card(void) const; + int card() const; /// Return total size - int total(void) const; + int total() const; /// Return size of item \a i int operator[](int i) const; }; @@ -225,13 +225,13 @@ namespace Gecode { namespace Int { namespace BinPacking { /// Number of bins unsigned int bins; /// Return number of nodes - int nodes(void) const; + int nodes() const; /// Sets of graph nodes class NodeSet : public Support::RawBitSetBase { public: /// Keep uninitialized - NodeSet(void) = default; + NodeSet() = default; /// Initialize node set for \a n nodes NodeSet(Region& r, int n); /// Initialize node set as copy of \a ns with \a n nodes @@ -269,7 +269,7 @@ namespace Gecode { namespace Int { namespace BinPacking { /// Weight (initialized with degree before graph is reduced) unsigned int w; /// Default constructor - Node(void); + Node(); }; /// The nodes in the graph Node* node; @@ -288,13 +288,13 @@ namespace Gecode { namespace Int { namespace BinPacking { /// \name Iteration control //@{ /// Move iterator to next node (if possible) - void operator++(void); + void operator++(); //@} /// \name %Node access //@{ /// Return current node - int operator()(void) const; + int operator()() const; //@} }; @@ -331,7 +331,7 @@ namespace Gecode { namespace Int { namespace BinPacking { /// Largest clique so far Clique max; /// Report the current clique - ExecStatus clique(void); + ExecStatus clique(); /// Found a clique of node \a i ExecStatus clique(int i); /// Found a clique of nodes \a i and \a j @@ -347,11 +347,11 @@ namespace Gecode { namespace Int { namespace BinPacking { /// Test whether nodes \a i and \a j are adjacent bool adjacent(int i, int j) const; /// Post additional constraints - ExecStatus post(void); + ExecStatus post(); /// Return maximal clique found - IntSet maximum_clique(void) const; + IntSet maximum_clique() const; /// Destructor - ~ConflictGraph(void) = default; + ~ConflictGraph() = default; }; }}} // namespace Gecode::Int::BinPacking diff --git a/gecode/int/bin-packing/conflict-graph.hpp b/gecode/int/bin-packing/conflict-graph.hpp index 25f3e13d88..21cfc3a164 100644 --- a/gecode/int/bin-packing/conflict-graph.hpp +++ b/gecode/int/bin-packing/conflict-graph.hpp @@ -38,7 +38,7 @@ namespace Gecode { namespace Int { namespace BinPacking { forceinline int - ConflictGraph::nodes(void) const { + ConflictGraph::nodes() const { return b.size(); } @@ -105,17 +105,17 @@ namespace Gecode { namespace Int { namespace BinPacking { forceinline // NOLINTNEXTLINE(modernize-use-equals-default) - ConflictGraph::Node::Node(void) {} + ConflictGraph::Node::Node() {} forceinline ConflictGraph::Nodes::Nodes(const NodeSet& ns0) : ns(ns0), c(ns.next(0)) {} forceinline void - ConflictGraph::Nodes::operator++(void) { + ConflictGraph::Nodes::operator++() { c = ns.next(c + 1); } forceinline int - ConflictGraph::Nodes::operator()(void) const { + ConflictGraph::Nodes::operator()() const { return static_cast(c); } @@ -201,7 +201,7 @@ namespace Gecode { namespace Int { namespace BinPacking { } forceinline ExecStatus - ConflictGraph::clique(void) { + ConflictGraph::clique() { // Remember clique if ((cur.c > max.c) || ((cur.c == max.c) && (cur.w > max.w))) { max.n.copy(nodes(), cur.n); @@ -267,7 +267,7 @@ namespace Gecode { namespace Int { namespace BinPacking { } forceinline ExecStatus - ConflictGraph::post(void) { + ConflictGraph::post() { // Find some simple cliques of sizes 2 and 3. Region reg; { @@ -344,7 +344,7 @@ namespace Gecode { namespace Int { namespace BinPacking { } inline IntSet - ConflictGraph::maximum_clique(void) const { + ConflictGraph::maximum_clique() const { Region reg; int* n = reg.alloc(max.c); int j = 0; diff --git a/gecode/int/bin-packing/propagate.hpp b/gecode/int/bin-packing/propagate.hpp index 1bff5d7f10..7286923a1c 100644 --- a/gecode/int/bin-packing/propagate.hpp +++ b/gecode/int/bin-packing/propagate.hpp @@ -41,14 +41,14 @@ namespace Gecode { namespace Int { namespace BinPacking { * */ forceinline - Item::Item(void) + Item::Item() : s(0) {} forceinline Item::Item(IntView b, int s0) : DerivedView(b), s(s0) {} forceinline IntView - Item::bin(void) const { + Item::bin() const { return x; } forceinline void @@ -56,7 +56,7 @@ namespace Gecode { namespace Int { namespace BinPacking { x = b; } forceinline int - Item::size(void) const { + Item::size() const { return s; } forceinline void @@ -94,11 +94,11 @@ namespace Gecode { namespace Int { namespace BinPacking { s[n++] = s0; } forceinline int - SizeSet::card(void) const { + SizeSet::card() const { return n; } forceinline int - SizeSet::total(void) const { + SizeSet::total() const { return t; } forceinline int @@ -108,7 +108,7 @@ namespace Gecode { namespace Int { namespace BinPacking { forceinline // NOLINTNEXTLINE(modernize-use-equals-default) - SizeSetMinusOne::SizeSetMinusOne(void) {} + SizeSetMinusOne::SizeSetMinusOne() {} forceinline SizeSetMinusOne::SizeSetMinusOne(Region& region, int n_max) : SizeSet(region, n_max), p(-1) {} @@ -121,12 +121,12 @@ namespace Gecode { namespace Int { namespace BinPacking { assert(p < n); } forceinline int - SizeSetMinusOne::card(void) const { + SizeSetMinusOne::card() const { assert(p >= 0); return n - 1; } forceinline int - SizeSetMinusOne::total(void) const { + SizeSetMinusOne::total() const { assert(p >= 0); return t - s[p]; } diff --git a/gecode/int/branch.hh b/gecode/int/branch.hh index dd94e19f79..5ffee4c53f 100644 --- a/gecode/int/branch.hh +++ b/gecode/int/branch.hh @@ -152,7 +152,7 @@ namespace Gecode { namespace Int { namespace Branch { /// Return AFC over size as merit for view \a x at position \a i double operator()(const Space& home, View x, int i); /// Whether dispose must always be called (that is, notice is needed) - bool notice(void) const; + bool notice() const; /// Dispose view selection void dispose(Space& home); }; @@ -179,7 +179,7 @@ namespace Gecode { namespace Int { namespace Branch { /// Return action over size as merit for view \a x at position \a i double operator()(const Space& home, View x, int i); /// Whether dispose must always be called (that is, notice is needed) - bool notice(void) const; + bool notice() const; /// Dispose view selection void dispose(Space& home); }; @@ -206,7 +206,7 @@ namespace Gecode { namespace Int { namespace Branch { /// Return size over action as merit for view \a x at position \a i double operator()(const Space& home, View x, int i); /// Whether dispose must always be called (that is, notice is needed) - bool notice(void) const; + bool notice() const; /// Dispose view selection void dispose(Space& home); }; @@ -369,7 +369,7 @@ namespace Gecode { namespace Int { namespace Branch { r = r.split(a); } bool - random(void) const { + random() const { return true; } /// Constructor for initialization @@ -379,7 +379,7 @@ namespace Gecode { namespace Int { namespace Branch { /// Return value of view \a x at position \a i int val(const Space& home, View x, int i); /// Whether dispose must always be called (that is, notice is needed) - bool notice(void) const; + bool notice() const; /// Delete value selection void dispose(Space& home); }; @@ -712,16 +712,16 @@ namespace Gecode { namespace Int { namespace Branch { public: /// Default constructor - VarIdToPosO(void) = default; + VarIdToPosO() = default; /// Delete implementation - ~VarIdToPosO(void) override = default; + ~VarIdToPosO() override = default; }; public: /// Default constructor - VarIdToPos(void) = default; + VarIdToPos() = default; /// Allocation of the shared handle - void init(void); + void init(); /// Tests if a variable id is in the map bool is_in(unsigned int var_id) const; /// Returns the position of the variable id in \a x diff --git a/gecode/int/branch/assign.hpp b/gecode/int/branch/assign.hpp index e39d895e66..a74c91ff96 100644 --- a/gecode/int/branch/assign.hpp +++ b/gecode/int/branch/assign.hpp @@ -45,22 +45,22 @@ namespace Gecode { : ValBranch(std::move(v), std::move(c)), s(SEL_VAL_COMMIT) {} forceinline IntAssign::Select - IntAssign::select(void) const { + IntAssign::select() const { return s; } inline IntAssign - INT_ASSIGN_MIN(void) { + INT_ASSIGN_MIN() { return IntAssign(IntAssign::SEL_MIN); } inline IntAssign - INT_ASSIGN_MED(void) { + INT_ASSIGN_MED() { return IntAssign(IntAssign::SEL_MED); } inline IntAssign - INT_ASSIGN_MAX(void) { + INT_ASSIGN_MAX() { return IntAssign(IntAssign::SEL_MAX); } @@ -87,17 +87,17 @@ namespace Gecode { : ValBranch(std::move(v), std::move(c)), s(SEL_VAL_COMMIT) {} forceinline BoolAssign::Select - BoolAssign::select(void) const { + BoolAssign::select() const { return s; } inline BoolAssign - BOOL_ASSIGN_MIN(void) { + BOOL_ASSIGN_MIN() { return BoolAssign(BoolAssign::SEL_MIN); } inline BoolAssign - BOOL_ASSIGN_MAX(void) { + BOOL_ASSIGN_MAX() { return BoolAssign(BoolAssign::SEL_MAX); } diff --git a/gecode/int/branch/merit.hpp b/gecode/int/branch/merit.hpp index 0d74845f9c..e1a39d2f97 100644 --- a/gecode/int/branch/merit.hpp +++ b/gecode/int/branch/merit.hpp @@ -108,7 +108,7 @@ namespace Gecode { namespace Int { namespace Branch { } template forceinline bool - MeritAFCSize::notice(void) const { + MeritAFCSize::notice() const { return false; } template @@ -134,7 +134,7 @@ namespace Gecode { namespace Int { namespace Branch { } template forceinline bool - MeritActionSize::notice(void) const { + MeritActionSize::notice() const { return true; } template @@ -159,7 +159,7 @@ namespace Gecode { namespace Int { namespace Branch { } template forceinline bool - MeritCHBSize::notice(void) const { + MeritCHBSize::notice() const { return true; } template diff --git a/gecode/int/branch/val-sel.hpp b/gecode/int/branch/val-sel.hpp index 258193c933..4ee9e93402 100644 --- a/gecode/int/branch/val-sel.hpp +++ b/gecode/int/branch/val-sel.hpp @@ -111,7 +111,7 @@ namespace Gecode { namespace Int { namespace Branch { } template forceinline bool - ValSelRnd::notice(void) const { + ValSelRnd::notice() const { return !std::is_trivially_destructible::value; } template diff --git a/gecode/int/branch/val.hpp b/gecode/int/branch/val.hpp index 2423fdcd18..6cb4b02cd0 100644 --- a/gecode/int/branch/val.hpp +++ b/gecode/int/branch/val.hpp @@ -45,22 +45,22 @@ namespace Gecode { : ValBranch(std::move(v), std::move(c)), s(SEL_VAL_COMMIT) {} forceinline IntValBranch::Select - IntValBranch::select(void) const { + IntValBranch::select() const { return s; } inline IntValBranch - INT_VAL_MIN(void) { + INT_VAL_MIN() { return IntValBranch(IntValBranch::SEL_MIN); } inline IntValBranch - INT_VAL_MED(void) { + INT_VAL_MED() { return IntValBranch(IntValBranch::SEL_MED); } inline IntValBranch - INT_VAL_MAX(void) { + INT_VAL_MAX() { return IntValBranch(IntValBranch::SEL_MAX); } @@ -70,22 +70,22 @@ namespace Gecode { } inline IntValBranch - INT_VAL_SPLIT_MIN(void) { + INT_VAL_SPLIT_MIN() { return IntValBranch(IntValBranch::SEL_SPLIT_MIN); } inline IntValBranch - INT_VAL_SPLIT_MAX(void) { + INT_VAL_SPLIT_MAX() { return IntValBranch(IntValBranch::SEL_SPLIT_MAX); } inline IntValBranch - INT_VAL_RANGE_MIN(void) { + INT_VAL_RANGE_MIN() { return IntValBranch(IntValBranch::SEL_RANGE_MIN); } inline IntValBranch - INT_VAL_RANGE_MAX(void) { + INT_VAL_RANGE_MAX() { return IntValBranch(IntValBranch::SEL_RANGE_MAX); } @@ -95,12 +95,12 @@ namespace Gecode { } inline IntValBranch - INT_VALUES_MIN(void) { + INT_VALUES_MIN() { return IntValBranch(IntValBranch::SEL_VALUES_MIN); } inline IntValBranch - INT_VALUES_MAX(void) { + INT_VALUES_MAX() { return IntValBranch(IntValBranch::SEL_VALUES_MAX); } @@ -117,17 +117,17 @@ namespace Gecode { : ValBranch(std::move(v), std::move(c)), s(SEL_VAL_COMMIT) {} forceinline BoolValBranch::Select - BoolValBranch::select(void) const { + BoolValBranch::select() const { return s; } inline BoolValBranch - BOOL_VAL_MIN(void) { + BOOL_VAL_MIN() { return BoolValBranch(BoolValBranch::SEL_MIN); } inline BoolValBranch - BOOL_VAL_MAX(void) { + BOOL_VAL_MAX() { return BoolValBranch(BoolValBranch::SEL_MAX); } diff --git a/gecode/int/branch/var.hpp b/gecode/int/branch/var.hpp index ac0ddb5125..19acf339cb 100644 --- a/gecode/int/branch/var.hpp +++ b/gecode/int/branch/var.hpp @@ -35,7 +35,7 @@ namespace Gecode { forceinline - IntVarBranch::IntVarBranch(void) + IntVarBranch::IntVarBranch() : s(SEL_NONE) {} forceinline @@ -67,7 +67,7 @@ namespace Gecode { : VarBranch(std::move(mf), std::move(t)), s(s0) {} forceinline IntVarBranch::Select - IntVarBranch::select(void) const { + IntVarBranch::select() const { return s; } @@ -100,7 +100,7 @@ namespace Gecode { } inline IntVarBranch - INT_VAR_NONE(void) { + INT_VAR_NONE() { return IntVarBranch(IntVarBranch::SEL_NONE, nullptr); } @@ -310,7 +310,7 @@ namespace Gecode { } forceinline - BoolVarBranch::BoolVarBranch(void) + BoolVarBranch::BoolVarBranch() : s(SEL_NONE) {} forceinline @@ -342,7 +342,7 @@ namespace Gecode { : VarBranch(std::move(mf), std::move(t)), s(s0) {} forceinline BoolVarBranch::Select - BoolVarBranch::select(void) const { + BoolVarBranch::select() const { return s; } @@ -369,7 +369,7 @@ namespace Gecode { } inline BoolVarBranch - BOOL_VAR_NONE(void) { + BOOL_VAR_NONE() { return BoolVarBranch(BoolVarBranch::SEL_NONE, nullptr); } diff --git a/gecode/int/branch/view-values.cpp b/gecode/int/branch/view-values.cpp index 861fd642dd..405bb48f3b 100644 --- a/gecode/int/branch/view-values.cpp +++ b/gecode/int/branch/view-values.cpp @@ -59,7 +59,7 @@ namespace Gecode { namespace Int { namespace Branch { } } - PosValuesChoice::~PosValuesChoice(void) { + PosValuesChoice::~PosValuesChoice() { heap.free(pm, n + 1); } diff --git a/gecode/int/branch/view-values.hpp b/gecode/int/branch/view-values.hpp index c2ddf70e74..9c8069fdab 100644 --- a/gecode/int/branch/view-values.hpp +++ b/gecode/int/branch/view-values.hpp @@ -59,7 +59,7 @@ namespace Gecode { namespace Int { namespace Branch { int val(unsigned int a) const; /// Deallocate GECODE_INT_EXPORT - ~PosValuesChoice(void) override; + ~PosValuesChoice() override; /// Archive into \a e GECODE_INT_EXPORT void archive(Archive& e) const override; diff --git a/gecode/int/channel/dom.hpp b/gecode/int/channel/dom.hpp index 481987af0f..50c1173c83 100644 --- a/gecode/int/channel/dom.hpp +++ b/gecode/int/channel/dom.hpp @@ -56,11 +56,11 @@ namespace Gecode { namespace Int { namespace Channel { /// Update during cloning void update(Space& home, DomInfo& vcb); /// Check whether propagation for assignment is to be done - bool doval(void) const; + bool doval() const; /// Check whether propagation for domain is to be done - bool dodom(void) const; + bool dodom() const; /// Record that view got assigned - void assigned(void); + void assigned(); /// Record that one value got removed void removed(int i); /// Update the size and bounds information after pruning @@ -87,19 +87,19 @@ namespace Gecode { namespace Int { namespace Channel { template forceinline bool - DomInfo::doval(void) const { + DomInfo::doval() const { return (size != 1) && view.assigned(); } template forceinline bool - DomInfo::dodom(void) const { + DomInfo::dodom() const { return size != view.size(); } template forceinline void - DomInfo::assigned(void) { + DomInfo::assigned() { size = 1; } diff --git a/gecode/int/channel/link-multi.cpp b/gecode/int/channel/link-multi.cpp index c13a4eda7b..4b0e59d299 100644 --- a/gecode/int/channel/link-multi.cpp +++ b/gecode/int/channel/link-multi.cpp @@ -48,11 +48,11 @@ namespace Gecode { namespace Int { namespace Channel { /// Initialize iterator BoolIter(const ViewArray& x0, int o0); /// Test whether further values available - bool operator()(void) const; + bool operator()() const; /// Return value - int val(void) const; + int val() const; /// Move to the next value - void operator++(void); + void operator++(); }; forceinline @@ -62,16 +62,16 @@ namespace Gecode { namespace Int { namespace Channel { i++; } forceinline bool - BoolIter::operator()(void) const { + BoolIter::operator()() const { return i < x.size(); } forceinline int - BoolIter::val(void) const { + BoolIter::val() const { assert(x[i].zero()); return i + o; } forceinline void - BoolIter::operator++(void) { + BoolIter::operator++() { do { i++; } while ((i < x.size()) && !x[i].zero()); diff --git a/gecode/int/channel/val.hpp b/gecode/int/channel/val.hpp index fc08481bf3..2ed4e9e003 100644 --- a/gecode/int/channel/val.hpp +++ b/gecode/int/channel/val.hpp @@ -52,15 +52,15 @@ namespace Gecode { namespace Int { namespace Channel { /// Update during cloning void update(Space& home, ValInfo& vi); /// Check whether propagation for assignment is to be done - bool doval(void) const; + bool doval() const; /// Check whether propagation for domain is to be done - bool dodom(void) const; + bool dodom() const; /// Record that view got assigned - void assigned(void); + void assigned(); /// Record that one value got removed void removed(int i); /// Update the cardinality and bounds information after pruning - void done(void); + void done(); }; template @@ -79,19 +79,19 @@ namespace Gecode { namespace Int { namespace Channel { template forceinline bool - ValInfo::doval(void) const { + ValInfo::doval() const { return !a && view.assigned(); } template forceinline bool - ValInfo::dodom(void) const { + ValInfo::dodom() const { return false; } template forceinline void - ValInfo::assigned(void) { + ValInfo::assigned() { a = true; } @@ -101,7 +101,7 @@ namespace Gecode { namespace Int { namespace Channel { template forceinline void - ValInfo::done(void) {} + ValInfo::done() {} // Propagate assigned views for x template diff --git a/gecode/int/count.hh b/gecode/int/count.hh index ba75ccd5a2..5e151ca1b4 100644 --- a/gecode/int/count.hh +++ b/gecode/int/count.hh @@ -291,9 +291,9 @@ namespace Gecode { namespace Int { namespace Count { /// Count how many views are equal now void count(Space& home); /// How many views are at least equal - int at_least(void) const; + int at_least() const; /// How many views are at most equal - int at_most(void) const; + int at_most() const; /// Test whether there is sharing of \a z with \a x or \a y static bool sharing(const ViewArray& x, const VY& y, const VZ& z); }; diff --git a/gecode/int/count/view-base.hpp b/gecode/int/count/view-base.hpp index a3b0805bf2..8653acb907 100644 --- a/gecode/int/count/view-base.hpp +++ b/gecode/int/count/view-base.hpp @@ -103,13 +103,13 @@ namespace Gecode { namespace Int { namespace Count { template forceinline int - ViewBase::at_least(void) const { + ViewBase::at_least() const { return -c; } template forceinline int - ViewBase::at_most(void) const { + ViewBase::at_most() const { return x.size() - c; } diff --git a/gecode/int/cumulative.hh b/gecode/int/cumulative.hh index b05cc00d37..b684b03203 100644 --- a/gecode/int/cumulative.hh +++ b/gecode/int/cumulative.hh @@ -77,7 +77,7 @@ namespace Gecode { namespace Int { namespace Cumulative { /// \name Constructors and initialization //@{ /// Default constructor - ManFixPTask(void); + ManFixPTask(); /// Initialize task with start time \a s, processing time \a p, and required resource \a c ManFixPTask(IntVar s, int p, int c); /// Initialize task with start time \a s, processing time \a p, and required resource \a c @@ -89,9 +89,9 @@ namespace Gecode { namespace Int { namespace Cumulative { /// \name Value access //@{ /// Return required capacity - int c(void) const; + int c() const; /// Return required energy - long long int e(void) const; + long long int e() const; //@} /// \name Cloning @@ -118,7 +118,7 @@ namespace Gecode { namespace Int { namespace Cumulative { /// \name Constructors and initialization //@{ /// Default constructor - ManFixPSETask(void); + ManFixPSETask(); /** * \brief Initialize task * @@ -142,9 +142,9 @@ namespace Gecode { namespace Int { namespace Cumulative { /// \name Value access //@{ /// Return required capacity - int c(void) const; + int c() const; /// Return required energy - long long int e(void) const; + long long int e() const; //@} /// \name Cloning @@ -171,7 +171,7 @@ namespace Gecode { namespace Int { namespace Cumulative { /// \name Constructors and initialization //@{ /// Default constructor - ManFlexTask(void); + ManFlexTask(); /// Initialize with start time \a s, processing time \a p, end time \a e ManFlexTask(IntVar s, IntVar p, IntVar e, int c); /// Initialize with start time \a s, processing time \a p, end time \a e @@ -183,9 +183,9 @@ namespace Gecode { namespace Int { namespace Cumulative { /// \name Value access //@{ /// Return required capacity - int c(void) const; + int c() const; /// Return required energy - long long int e(void) const; + long long int e() const; //@} /// \name Cloning @@ -211,14 +211,14 @@ namespace Gecode { namespace Int { namespace Cumulative { /// \name Constructors and initialization //@{ /// Default constructor - OptFixPTask(void); + OptFixPTask(); /// Initialize with start time \a s, processing time \a p, required capacity \a c, and mandatory flag \a m OptFixPTask(IntVar s, int p, int c, BoolVar m); /// Initialize with start time \a s, processing time \a p, required capacity \a c, and mandatory flag \a m void init(IntVar s, int p, int c, BoolVar m); //@} /// Cast to corresponding unary task - operator Unary::OptFixPTask(void); + operator Unary::OptFixPTask(); }; /** @@ -237,14 +237,14 @@ namespace Gecode { namespace Int { namespace Cumulative { /// \name Constructors and initialization //@{ /// Default constructor - OptFixPSETask(void); + OptFixPSETask(); /// Initialize with start time \a s, processing time \a p, required capacity \a c, and mandatory flag \a m OptFixPSETask(TaskType t, IntVar s, int p, int c, BoolVar m); /// Initialize with start time \a s, processing time \a p, required capacity \a c, and mandatory flag \a m void init(TaskType t, IntVar s, int p, int c, BoolVar m); //@} /// Cast to corresponding unary task - operator Unary::OptFixPSETask(void); + operator Unary::OptFixPSETask(); }; /** @@ -263,14 +263,14 @@ namespace Gecode { namespace Int { namespace Cumulative { /// \name Constructors and initialization //@{ /// Default constructor - OptFlexTask(void); + OptFlexTask(); /// Initialize with start time \a s, processing time \a p, end time \a e, and mandatory flag \a m OptFlexTask(IntVar s, IntVar p, IntVar e, int c, BoolVar m); /// Initialize with start time \a s, processing time \a p, end time \a e, and mandatory flag \a m void init(IntVar s, IntVar p, IntVar e, int c, BoolVar m); //@} /// Cast to corresponding unary task - operator Unary::OptFlexTask(void); + operator Unary::OptFlexTask(); }; /** @@ -567,7 +567,7 @@ namespace Gecode { namespace Int { namespace Cumulative { /// Remove task with index \a i void remove(int i); /// Return energy envelope of all tasks - long long int env(void) const; + long long int env() const; }; /// Node for an extended omega tree @@ -652,13 +652,13 @@ namespace Gecode { namespace Int { namespace Cumulative { /// Remove task with index \a i from lambda void remove_lambda(int i); /// Whether has responsible task - bool lempty(void) const; + bool lempty() const; /// Return responsible task - int responsible(void) const; + int responsible() const; /// Return energy envelope of all tasks - long long int env(void) const; + long long int env() const; /// Return energy envelope of all tasks excluding lambda tasks - long long int lenv(void) const; + long long int lenv() const; }; }}} // namespace Gecode::Int::Cumulative diff --git a/gecode/int/cumulative/task.hpp b/gecode/int/cumulative/task.hpp index 6ff56e3884..7f24cdf31e 100644 --- a/gecode/int/cumulative/task.hpp +++ b/gecode/int/cumulative/task.hpp @@ -40,7 +40,7 @@ namespace Gecode { namespace Int { namespace Cumulative { forceinline // NOLINTNEXTLINE(modernize-use-equals-default) - ManFixPTask::ManFixPTask(void) {} + ManFixPTask::ManFixPTask() {} forceinline ManFixPTask::ManFixPTask(IntVar s, int p, int c) : Unary::ManFixPTask(s, p), _c(c) {} @@ -56,11 +56,11 @@ namespace Gecode { namespace Int { namespace Cumulative { } forceinline int - ManFixPTask::c(void) const { + ManFixPTask::c() const { return _c; } forceinline long long int - ManFixPTask::e(void) const { + ManFixPTask::e() const { return static_cast(pmin()) * c(); } @@ -86,7 +86,7 @@ namespace Gecode { namespace Int { namespace Cumulative { forceinline // NOLINTNEXTLINE(modernize-use-equals-default) - ManFixPSETask::ManFixPSETask(void) {} + ManFixPSETask::ManFixPSETask() {} forceinline ManFixPSETask::ManFixPSETask(TaskType t, IntVar s, int p, int c) : Unary::ManFixPSETask(t, s, p), _c(c) {} @@ -102,11 +102,11 @@ namespace Gecode { namespace Int { namespace Cumulative { } forceinline int - ManFixPSETask::c(void) const { + ManFixPSETask::c() const { return _c; } forceinline long long int - ManFixPSETask::e(void) const { + ManFixPSETask::e() const { return static_cast(pmin()) * c(); } @@ -132,7 +132,7 @@ namespace Gecode { namespace Int { namespace Cumulative { forceinline // NOLINTNEXTLINE(modernize-use-equals-default) - ManFlexTask::ManFlexTask(void) {} + ManFlexTask::ManFlexTask() {} forceinline ManFlexTask::ManFlexTask(IntVar s, IntVar p, IntVar e, int c) : Unary::ManFlexTask(s, p, e), _c(c) {} @@ -148,11 +148,11 @@ namespace Gecode { namespace Int { namespace Cumulative { } forceinline int - ManFlexTask::c(void) const { + ManFlexTask::c() const { return _c; } forceinline long long int - ManFlexTask::e(void) const { + ManFlexTask::e() const { return static_cast(pmin()) * c(); } @@ -179,7 +179,7 @@ namespace Gecode { namespace Int { namespace Cumulative { forceinline // NOLINTNEXTLINE(modernize-use-equals-default) - OptFixPTask::OptFixPTask(void) {} + OptFixPTask::OptFixPTask() {} forceinline OptFixPTask::OptFixPTask(IntVar s, int p, int c, BoolVar m) { ManFixPTask::init(s, p, c); @@ -191,7 +191,7 @@ namespace Gecode { namespace Int { namespace Cumulative { _m = m; } forceinline OptFixPTask:: - operator Unary::OptFixPTask(void) { + operator Unary::OptFixPTask() { return Unary::OptFixPTask(_s, _p, _m); } @@ -212,7 +212,7 @@ namespace Gecode { namespace Int { namespace Cumulative { forceinline // NOLINTNEXTLINE(modernize-use-equals-default) - OptFixPSETask::OptFixPSETask(void) {} + OptFixPSETask::OptFixPSETask() {} forceinline OptFixPSETask::OptFixPSETask(TaskType t, IntVar s, int p, int c, BoolVar m) { ManFixPSETask::init(t, s, p, c); @@ -224,7 +224,7 @@ namespace Gecode { namespace Int { namespace Cumulative { _m = m; } forceinline OptFixPSETask:: - operator Unary::OptFixPSETask(void) { + operator Unary::OptFixPSETask() { return Unary::OptFixPSETask(_t, _s, _p, _m); } @@ -245,7 +245,7 @@ namespace Gecode { namespace Int { namespace Cumulative { forceinline // NOLINTNEXTLINE(modernize-use-equals-default) - OptFlexTask::OptFlexTask(void) {} + OptFlexTask::OptFlexTask() {} forceinline OptFlexTask::OptFlexTask(IntVar s, IntVar p, IntVar e, int c, BoolVar m) { ManFlexTask::init(s, p, e, c); @@ -257,7 +257,7 @@ namespace Gecode { namespace Int { namespace Cumulative { _m = m; } forceinline OptFlexTask:: - operator Unary::OptFlexTask(void) { + operator Unary::OptFlexTask() { return Unary::OptFlexTask(_s, _p, _e, _m); } diff --git a/gecode/int/cumulative/tree.hpp b/gecode/int/cumulative/tree.hpp index 7075dec3ca..5ead494448 100644 --- a/gecode/int/cumulative/tree.hpp +++ b/gecode/int/cumulative/tree.hpp @@ -81,7 +81,7 @@ namespace Gecode { namespace Int { namespace Cumulative { template forceinline long long int - OmegaTree::env(void) const { + OmegaTree::env() const { return root().env; } @@ -245,25 +245,25 @@ namespace Gecode { namespace Int { namespace Cumulative { template forceinline bool - OmegaLambdaTree::lempty(void) const { + OmegaLambdaTree::lempty() const { return root().res_lenv < 0; } template forceinline int - OmegaLambdaTree::responsible(void) const { + OmegaLambdaTree::responsible() const { return root().res_lenv; } template forceinline long long int - OmegaLambdaTree::env(void) const { + OmegaLambdaTree::env() const { return root().env; } template forceinline long long int - OmegaLambdaTree::lenv(void) const { + OmegaLambdaTree::lenv() const { return root().lenv; } diff --git a/gecode/int/cumulatives/val.hpp b/gecode/int/cumulatives/val.hpp index 3397f6f72b..5269973c1a 100644 --- a/gecode/int/cumulatives/val.hpp +++ b/gecode/int/cumulatives/val.hpp @@ -133,7 +133,7 @@ namespace Gecode { namespace Int { namespace Cumulatives { // Default constructor for region-allocated memory // NOLINTNEXTLINE(modernize-use-equals-default) - Event(void) {} + Event() {} /// Order events based on date. bool diff --git a/gecode/int/distinct.hh b/gecode/int/distinct.hh index e2c50729fb..a31dc22c35 100644 --- a/gecode/int/distinct.hh +++ b/gecode/int/distinct.hh @@ -220,15 +220,15 @@ namespace Gecode { namespace Int { namespace Distinct { using ViewValGraph::Graph::scc; using ViewValGraph::Graph::match; /// Construct graph as not yet initialized - Graph(void) = default; + Graph() = default; /// Initialize graph ExecStatus init(Space& home, ViewArray& x); /// Mark edges in graph, return true if pruning is at all possible - bool mark(void); + bool mark(); /// Prune unmarked edges, \a assigned is true if a view got assigned ExecStatus prune(Space& home, bool& assigned); /// Synchronize graph with new view domains - bool sync(void); + bool sync(); }; /** @@ -249,13 +249,13 @@ namespace Gecode { namespace Int { namespace Distinct { public: /// Initialize with non-initialized view-value graph - DomCtrl(void) = default; + DomCtrl() = default; /// Check whether a view-value graph is available - bool available(void); + bool available(); /// Initialize view-value graph for views \a x ExecStatus init(Space& home, ViewArray& x); /// Synchronize available view-value graph - ExecStatus sync(void); + ExecStatus sync(); /// Perform propagation, \a assigned is true if a view gets assigned ExecStatus propagate(Space& home, bool& assigned); }; diff --git a/gecode/int/distinct/dom-ctrl.hpp b/gecode/int/distinct/dom-ctrl.hpp index 476538394b..e3e25b3a0e 100644 --- a/gecode/int/distinct/dom-ctrl.hpp +++ b/gecode/int/distinct/dom-ctrl.hpp @@ -41,7 +41,7 @@ namespace Gecode { namespace Int { namespace Distinct { template forceinline bool - DomCtrl::available(void) { + DomCtrl::available() { return g; } @@ -53,7 +53,7 @@ namespace Gecode { namespace Int { namespace Distinct { template ExecStatus - DomCtrl::sync(void) { + DomCtrl::sync() { g.purge(); return g.sync() ? ES_OK : ES_FAILED; } diff --git a/gecode/int/distinct/graph.hpp b/gecode/int/distinct/graph.hpp index 7dbf432d3b..ff982540f2 100644 --- a/gecode/int/distinct/graph.hpp +++ b/gecode/int/distinct/graph.hpp @@ -104,7 +104,7 @@ namespace Gecode { namespace Int { namespace Distinct { template forceinline bool - Graph::sync(void) { + Graph::sync() { using namespace ViewValGraph; Region r; // Stack for view nodes to be rematched @@ -169,7 +169,7 @@ namespace Gecode { namespace Int { namespace Distinct { template forceinline bool - Graph::mark(void) { + Graph::mark() { using namespace ViewValGraph; Region r; diff --git a/gecode/int/element.hh b/gecode/int/element.hh index 3e7162a946..0866e0800f 100644 --- a/gecode/int/element.hh +++ b/gecode/int/element.hh @@ -70,9 +70,9 @@ namespace Gecode { namespace Int { namespace Element { Idx idx; ///< The index Val val; ///< The value /// Mark that this pair should be removed - void mark(void); + void mark(); /// Return whether this pair is marked for removal - bool marked(void) const; + bool marked() const; }; /** * \brief Value iterator for indices in index-value map @@ -88,11 +88,11 @@ namespace Gecode { namespace Int { namespace Element { /// Initialize with start IterIdxUnmark(IdxVal* iv); /// Test whether more pairs to be iterated - bool operator()(void) const; + bool operator()() const; /// Move to next index value pair (next index) - void operator++(void); + void operator++(); /// Return index of current index value pair - Idx val(void) const; + Idx val() const; }; /** * \brief Value iterator for values in index-value map @@ -108,11 +108,11 @@ namespace Gecode { namespace Int { namespace Element { /// Initialize with start IterVal(IdxVal* iv); /// Test whether more pairs to be iterated - bool operator()(void) const; + bool operator()() const; /// Move to next index value pair (next value) - void operator++(void); + void operator++(); /// Return value of current index value pair - Val val(void) const; + Val val() const; }; /** * \brief Value iterator for values in index-value map @@ -130,11 +130,11 @@ namespace Gecode { namespace Int { namespace Element { /// Initialize with start IterValUnmark(IdxVal* iv); /// Test whether more pairs to be iterated - bool operator()(void) const; + bool operator()() const; /// Move to next index value pair (next value) - void operator++(void); + void operator++(); /// Return value of current index value pair - Val val(void) const; + Val val() const; }; /// Sorting pointers to (index,value) pairs in value order class ByVal { @@ -164,9 +164,9 @@ namespace Gecode { namespace Int { namespace Element { /// The index-value data structure IdxVal* iv; /// Prune index according to \a x0 - void prune_idx(void); + void prune_idx(); /// Prune values according to \a x1 - void prune_val(void); + void prune_val(); /// Prune when \a x1 is assigned static ExecStatus assigned_val(Space& home, IntSharedArray& c, V0 x0, V1 x1); /// Constructor for cloning \a p diff --git a/gecode/int/element/int.hpp b/gecode/int/element/int.hpp index 5b42003cc8..979ad66857 100644 --- a/gecode/int/element/int.hpp +++ b/gecode/int/element/int.hpp @@ -35,12 +35,12 @@ namespace Gecode { namespace Int { namespace Element { // Index value pairs template forceinline void - Int::IdxVal::mark(void) { + Int::IdxVal::mark() { idx = -1; } template forceinline bool - Int::IdxVal::marked(void) const { + Int::IdxVal::marked() const { return idx < 0; } @@ -57,12 +57,12 @@ namespace Gecode { namespace Int { namespace Element { } template forceinline bool - Int::IterIdxUnmark::operator()(void) const { + Int::IterIdxUnmark::operator()() const { return i != 0; } template forceinline void - Int::IterIdxUnmark::operator++(void) { + Int::IterIdxUnmark::operator++() { int p = i; i = iv[p].idx_next; while ((i != 0) && iv[i].marked()) @@ -71,7 +71,7 @@ namespace Gecode { namespace Int { namespace Element { } template forceinline Idx - Int::IterIdxUnmark::val(void) const { + Int::IterIdxUnmark::val() const { assert(!iv[i].marked()); return iv[i].idx; } @@ -82,17 +82,17 @@ namespace Gecode { namespace Int { namespace Element { : iv(iv0), i(iv[0].val_next) {} template forceinline bool - Int::IterVal::operator()(void) const { + Int::IterVal::operator()() const { return i != 0; } template forceinline void - Int::IterVal::operator++(void) { + Int::IterVal::operator++() { i = iv[i].val_next; } template forceinline Val - Int::IterVal::val(void) const { + Int::IterVal::val() const { assert(!iv[i].marked()); return iv[i].val; } @@ -109,12 +109,12 @@ namespace Gecode { namespace Int { namespace Element { } template forceinline bool - Int::IterValUnmark::operator()(void) const { + Int::IterValUnmark::operator()() const { return i != 0; } template forceinline void - Int::IterValUnmark::operator++(void) { + Int::IterValUnmark::operator++() { int p = i; i = iv[p].val_next; while ((i != 0) && iv[i].marked()) @@ -123,7 +123,7 @@ namespace Gecode { namespace Int { namespace Element { } template forceinline Val - Int::IterValUnmark::val(void) const { + Int::IterValUnmark::val() const { assert(!iv[i].marked()); return iv[i].val; } @@ -208,7 +208,7 @@ namespace Gecode { namespace Int { namespace Element { template void - Int::prune_idx(void) { + Int::prune_idx() { Idx p = 0; Idx i = iv[p].idx_next; ViewRanges v(x0); @@ -234,7 +234,7 @@ namespace Gecode { namespace Int { namespace Element { template void - Int::prune_val(void) { + Int::prune_val() { Idx p = 0; Idx i = iv[p].val_next; ViewRanges v(x1); diff --git a/gecode/int/element/pair.cpp b/gecode/int/element/pair.cpp index 4ac54533cc..6756d51865 100644 --- a/gecode/int/element/pair.cpp +++ b/gecode/int/element/pair.cpp @@ -62,15 +62,15 @@ namespace Gecode { namespace Int { namespace Element { /// \name Iteration control //@{ /// Test whether iterator is still at a value or done - bool operator()(void) const; + bool operator()() const; /// Move iterator to next value (if possible) - void operator++(void); + void operator++(); //@} /// \name Value access //@{ /// Return current value - int val(void) const; + int val() const; //@} }; @@ -80,7 +80,7 @@ namespace Gecode { namespace Int { namespace Element { : x(x0), xv(x0), yv(y0), w(w0) {} template forceinline void - PairValues::operator++(void) { + PairValues::operator++() { ++xv; if (!xv()) { xv.init(x); @@ -89,12 +89,12 @@ namespace Gecode { namespace Int { namespace Element { } template forceinline bool - PairValues::operator()(void) const { + PairValues::operator()() const { return yv(); } template forceinline int - PairValues::val(void) const { + PairValues::val() const { return xv.val() + w * yv.val(); } diff --git a/gecode/int/element/view.hpp b/gecode/int/element/view.hpp index 18432ee604..3264e1d808 100644 --- a/gecode/int/element/view.hpp +++ b/gecode/int/element/view.hpp @@ -157,12 +157,12 @@ namespace Gecode { namespace Int { namespace Element { const IdxView*cur, *end; public: - IterIdxView(void) = default; + IterIdxView() = default; IterIdxView(const IdxView*, const IdxView*); void init(const IdxView*, const IdxView*); - bool operator()(void) const; - void operator++(void); - int val(void) const; + bool operator()() const; + void operator++(); + int val() const; }; template @@ -177,17 +177,17 @@ namespace Gecode { namespace Int { namespace Element { } template forceinline bool - IterIdxView::operator()(void) const { + IterIdxView::operator()() const { return cur < end; } template forceinline void - IterIdxView::operator++(void) { + IterIdxView::operator++() { cur++; } template forceinline int - IterIdxView::val(void) const { + IterIdxView::val() const { return cur->idx; } diff --git a/gecode/int/extensional-tuple-set.cpp b/gecode/int/extensional-tuple-set.cpp index 35b44ec2b1..b8834841f7 100644 --- a/gecode/int/extensional-tuple-set.cpp +++ b/gecode/int/extensional-tuple-set.cpp @@ -79,12 +79,12 @@ namespace Gecode { namespace Int { namespace Extensional { } bool - operator()(void) const { + operator()() const { return r != e; } void - operator++(void) { + operator++() { if (value != last) { value++; return; @@ -94,7 +94,7 @@ namespace Gecode { namespace Int { namespace Extensional { } int - val(void) const { + val() const { assert(r != e); return value; } @@ -115,7 +115,7 @@ namespace Gecode { namespace Int { namespace Extensional { SparseAdvisor(Space& home, SparseAdvisor& advisor) : ViewAdvisor(home, advisor), variable(advisor.variable) {} int - index(void) const { + index() const { return variable; } void @@ -160,7 +160,7 @@ namespace Gecode { namespace Int { namespace Extensional { const unsigned int* tv; forceinline Derived& - derived(void) { + derived() { return static_cast(*this); } @@ -340,7 +340,7 @@ namespace Gecode { namespace Int { namespace Extensional { } void - init_gid_maps(void) { + init_gid_maps() { for (unsigned int i = 0U; i < n_vals; i++) gid_var[i] = -1; for (int a = 0; a < x.size(); a++) { @@ -362,7 +362,7 @@ namespace Gecode { namespace Int { namespace Extensional { } void - init_support_counts(void) { + init_support_counts() { assert(tv != nullptr); const unsigned int* offsets = TupleSetAccess::sparse_support_offsets(ts); if (offsets != nullptr) { @@ -475,7 +475,7 @@ namespace Gecode { namespace Int { namespace Extensional { } bool - at_most_one(void) const { + at_most_one() const { Advisors as(c); if (!as()) return true; diff --git a/gecode/int/extensional.hh b/gecode/int/extensional.hh index 7d719b0c84..eb8630ccfb 100644 --- a/gecode/int/extensional.hh +++ b/gecode/int/extensional.hh @@ -58,15 +58,15 @@ namespace Gecode { namespace Int { namespace Extensional { public: /// Initialize as empty support list - CompressedSupport(void); + CompressedSupport(); /// Initialize from support word range CompressedSupport(const TupleSet::CSupportWord* b0, const TupleSet::CSupportWord* e0); /// Return first support word - const TupleSet::CSupportWord* begin(void) const; + const TupleSet::CSupportWord* begin() const; /// Return one past last support word - const TupleSet::CSupportWord* end(void) const; + const TupleSet::CSupportWord* end() const; /// Whether support list is empty - bool empty(void) const; + bool empty() const; }; /** @@ -92,7 +92,7 @@ namespace Gecode { namespace Int { namespace Extensional { Degree i_deg; ///< The in-degree (number of incoming edges) Degree o_deg; ///< The out-degree (number of outgoing edges) /// Initialize with zeroes - void init(void); + void init(); }; /// %Edge defined by in-state and out-state class Edge { @@ -125,17 +125,17 @@ namespace Gecode { namespace Int { namespace Extensional { const Support* s2; ///< End of support public: /// Default constructor - LayerValues(void) = default; + LayerValues() = default; /// Initialize for support of layer \a l LayerValues(const Layer& l); /// Initialize for support of layer \a l void init(const Layer& l); /// Test whether more values supported - bool operator()(void) const; + bool operator()() const; /// Move to next supported value - void operator++(void); + void operator++(); /// Return supported value - int val(void) const; + int val() const; }; /// %Advisors for views (by position in array) class Index : public Advisor { @@ -154,9 +154,9 @@ namespace Gecode { namespace Int { namespace Extensional { int _lst; ///< Last index public: /// Initialize range as empty - IndexRange(void); + IndexRange(); /// Reset range to be empty - void reset(void); + void reset(); /// Add index \a i to range void add(int i); /// Add index range \a ir to range @@ -164,11 +164,11 @@ namespace Gecode { namespace Int { namespace Extensional { /// Shift index range by \a n elements to the left void lshift(int n); /// Test whether range is empty - bool empty(void) const; + bool empty() const; /// Return first position - int fst(void) const; + int fst() const; /// Return last position - int lst(void) const; + int lst() const; }; /// The advisor council Council c; @@ -201,7 +201,7 @@ namespace Gecode { namespace Int { namespace Extensional { /// Decrement in degree for out state of edge \a e for layer \a i bool o_dec(int i, const Edge& e); /// Perform consistency check on data structures - void audit(void); + void audit(); /// Initialize layered graph template ExecStatus initialize(Space& home, const VarArgArray& x, const DFA& dfa); @@ -285,13 +285,13 @@ namespace Gecode { namespace Int { namespace Extensional { /// Initialize during cloning (unused) BitSet(Space& home, const TinyBitSet<4U>& tbs); /// Get the number of active words - unsigned int limit(void) const; + unsigned int limit() const; /// Check whether the set is empty - bool empty(void) const; + bool empty() const; /// Make the set empty - void flush(void); + void flush(); /// Return the highest active index - unsigned int width(void) const; + unsigned int width() const; /// Clear all active words in \a mask void clear_mask(BitSetData* mask) const; /// Add \a support to \a mask @@ -316,17 +316,17 @@ namespace Gecode { namespace Int { namespace Extensional { /// Perform "nand" with compressed support list void nand_with_mask(const CompressedSupport& support); /// Return the number of ones - unsigned long long int ones(void) const; + unsigned long long int ones() const; /// Return the number of ones after intersection with \a mask unsigned long long int ones(const BitSetData* mask) const; /// Return the number of ones after intersection with compressed support list unsigned long long int ones(const CompressedSupport& support) const; /// Return an upper bound on the number of bits - unsigned long long int bits(void) const; + unsigned long long int bits() const; /// Return the number of required bit set words - unsigned int words(void) const; + unsigned int words() const; /// Return the number of required bit set words - unsigned int size(void) const; + unsigned int size() const; }; }}} // namespace Gecode::Int::Extensional @@ -355,13 +355,13 @@ namespace Gecode { namespace Int { namespace Extensional { template TinyBitSet(Space& home, const BitSet& bs); /// Get the limit - int limit(void) const; + int limit() const; /// Check whether the set is empty - bool empty(void) const; + bool empty() const; /// Make the set empty - void flush(void); + void flush(); /// Return the highest active index - unsigned int width(void) const; + unsigned int width() const; /// Clear the first \a limit words in \a mask void clear_mask(BitSetData* mask); /// Add \b to \a mask @@ -388,17 +388,17 @@ namespace Gecode { namespace Int { namespace Extensional { /// Perform "nand" with and the "or" of \a a and \a b void nand_with_masks(const BitSetData* a, const BitSetData* b); /// Return the number of ones - unsigned long long int ones(void) const; + unsigned long long int ones() const; /// Return the number of ones after intersection with \a b unsigned long long int ones(const BitSetData* b) const; /// Return the number of ones after intersection with compressed support list unsigned long long int ones(const CompressedSupport& s) const; /// Return an upper bound on the number of bits - unsigned long long int bits(void) const; + unsigned long long int bits() const; /// Return the number of required bit set words - unsigned int words(void) const; + unsigned int words() const; /// Return the total number of words - unsigned int size(void) const; + unsigned int size() const; }; }}} // namespace Gecode::Int::Extensional @@ -421,7 +421,7 @@ namespace Gecode { namespace Int { namespace Extensional { /// Initialize without storing \a i CompactAdvisorIndex(int i); /// Return a dummy index - int index(void) const; + int index() const; }; /// Compact-table advisor with a variable index @@ -433,7 +433,7 @@ namespace Gecode { namespace Int { namespace Extensional { /// Initialize with index \a i CompactAdvisorIndex(int i); /// Return the variable index - int index(void) const; + int index() const; }; /// Advisor shared by compact-table support representations @@ -454,13 +454,13 @@ namespace Gecode { namespace Int { namespace Extensional { /// Clone advisor \a a CompactAdvisor(Space& home, CompactAdvisor& a); /// Adjust supports to the current view bounds - void adjust(void); + void adjust(); /// Return the variable index - int index(void) const; + int index() const; /// Return first range of support data structure - const Range* fst(void) const; + const Range* fst() const; /// Return last range of support data structure - const Range* lst(void) const; + const Range* lst() const; /// Dispose advisor void dispose(Space& home, Council& c); }; @@ -493,15 +493,15 @@ namespace Gecode { namespace Int { namespace Extensional { /// Copy constructor CompactStatus(const CompactStatus& status) = default; /// Return status type - StatusType type(void) const; + StatusType type() const; /// Test whether only advisor \a a was touched bool single(Advisor& a) const; /// Record that advisor \a a was touched void touched(Advisor& a); /// Record that no advisor has been touched - void none(void); + void none(); /// Record that propagation is in progress - void propagating(void); + void propagating(); }; /// Shared implementation of positive compact-table propagation @@ -543,7 +543,7 @@ namespace Gecode { namespace Int { namespace Extensional { /// The value's support const BitSetData* support_words; /// Find a new value (only for negative case) - void find(void); + void find(); public: /// Initialize from initialized propagator @@ -551,13 +551,13 @@ namespace Gecode { namespace Int { namespace Extensional { /// Initialize during initialization ValidSupports(const TupleSet& ts, int i, View x); /// Move to next supports - void operator++(void); + void operator++(); /// Whether there are still supports left - bool operator()(void) const; + bool operator()() const; /// Return support representation - const BitSetData* support(void) const; + const BitSetData* support() const; /// Return supported value - int val(void) const; + int val() const; }; /// Iterator over lost supports class LostSupports { @@ -579,19 +579,19 @@ namespace Gecode { namespace Int { namespace Extensional { /// Initialize iterator for values between \a first_value and \a last_value LostSupports(const Compact& p, CTAdvisor& a, int first_value, int last_value); /// Move iterator to next value - void operator++(void); + void operator++(); /// Whether iterator is done - bool operator()(void) const; + bool operator()() const; /// Return support representation - const BitSetData* support(void) const; + const BitSetData* support() const; }; //@} /// \name Testing the number of unassigned variables //@{ /// Whether all variables are assigned - bool all(void) const; + bool all() const; /// Whether at most one variable is unassigned - bool at_most_one(void) const; + bool at_most_one() const; //@} protected: /// Number of words in supports @@ -662,7 +662,7 @@ namespace Gecode { namespace Int { namespace Extensional { /// Current table Table table; /// Check whether the table is empty - bool empty(void) const; + bool empty() const; /// Constructor for cloning \a p template PosCompact(Space& home, TableProp& p); diff --git a/gecode/int/extensional/bit-set.hpp b/gecode/int/extensional/bit-set.hpp index fb540a16da..92762dfdd9 100644 --- a/gecode/int/extensional/bit-set.hpp +++ b/gecode/int/extensional/bit-set.hpp @@ -37,7 +37,7 @@ namespace Gecode { namespace Int { namespace Extensional { forceinline - CompressedSupport::CompressedSupport(void) + CompressedSupport::CompressedSupport() : b(nullptr), e(nullptr) {} forceinline @@ -45,17 +45,17 @@ namespace Gecode { namespace Int { namespace Extensional { : b(b0), e(e0) {} forceinline const TupleSet::CSupportWord* - CompressedSupport::begin(void) const { + CompressedSupport::begin() const { return b; } forceinline const TupleSet::CSupportWord* - CompressedSupport::end(void) const { + CompressedSupport::end() const { return e; } forceinline bool - CompressedSupport::empty(void) const { + CompressedSupport::empty() const { return (b == nullptr) || (b >= e); } @@ -78,31 +78,31 @@ namespace Gecode { namespace Int { namespace Extensional { template forceinline unsigned int - BitSet::limit(void) const { + BitSet::limit() const { return static_cast(_active_words); } template forceinline bool - BitSet::empty(void) const { + BitSet::empty() const { return _active_words == 0U; } template forceinline unsigned int - BitSet::words(void) const { + BitSet::words() const { return static_cast(_active_words); } template forceinline unsigned int - BitSet::size(void) const { + BitSet::size() const { return words(); } template forceinline unsigned int - BitSet::width(void) const { + BitSet::width() const { assert(!empty()); IndexType width = _word_index[0]; for (IndexType i = 1; i < _active_words; i++) @@ -151,7 +151,7 @@ namespace Gecode { namespace Int { namespace Extensional { template forceinline void - BitSet::flush(void) { + BitSet::flush() { _active_words = 0U; assert(empty()); } @@ -435,7 +435,7 @@ namespace Gecode { namespace Int { namespace Extensional { template forceinline unsigned long long int - BitSet::ones(void) const { + BitSet::ones() const { unsigned long long int count = 0U; for (IndexType i = 0; i < _active_words; i++) count += static_cast(_word_bits[i].ones()); @@ -444,7 +444,7 @@ namespace Gecode { namespace Int { namespace Extensional { template forceinline unsigned long long int - BitSet::bits(void) const { + BitSet::bits() const { return (static_cast(_active_words) * static_cast(BitSetData::bpb)); } diff --git a/gecode/int/extensional/compact.hpp b/gecode/int/extensional/compact.hpp index 097475059d..baff8fe932 100644 --- a/gecode/int/extensional/compact.hpp +++ b/gecode/int/extensional/compact.hpp @@ -45,7 +45,7 @@ namespace Gecode { namespace Int { namespace Extensional { CompactAdvisorIndex::CompactAdvisorIndex(int) {} forceinline int - CompactAdvisorIndex::index(void) const { + CompactAdvisorIndex::index() const { return 0; } @@ -54,13 +54,13 @@ namespace Gecode { namespace Int { namespace Extensional { : _index(i) {} forceinline int - CompactAdvisorIndex::index(void) const { + CompactAdvisorIndex::index() const { return _index; } template forceinline void - CompactAdvisor::adjust(void) { + CompactAdvisor::adjust() { if (pos) { { int n = view().min(); @@ -109,19 +109,19 @@ namespace Gecode { namespace Int { namespace Extensional { template forceinline int - CompactAdvisor::index(void) const { + CompactAdvisor::index() const { return CompactAdvisorIndex::index(); } template forceinline const typename CompactAdvisor::Range* - CompactAdvisor::fst(void) const { + CompactAdvisor::fst() const { return _fst; } template forceinline const typename CompactAdvisor::Range* - CompactAdvisor::lst(void) const { + CompactAdvisor::lst() const { return _lst; } @@ -142,7 +142,7 @@ namespace Gecode { namespace Int { namespace Extensional { template forceinline typename CompactStatus::StatusType - CompactStatus::type(void) const { + CompactStatus::type() const { return static_cast(s & 0b11); } @@ -165,13 +165,13 @@ namespace Gecode { namespace Int { namespace Extensional { template forceinline void - CompactStatus::none(void) { + CompactStatus::none() { s = std::to_underlying(NONE); } template forceinline void - CompactStatus::propagating(void) { + CompactStatus::propagating() { s = std::to_underlying(PROPAGATING); } @@ -430,7 +430,7 @@ namespace Gecode { namespace Int { namespace Extensional { template forceinline void - Compact::ValidSupports::find(void) { + Compact::ValidSupports::find() { assert(!pos); assert(value <= max_value); while (true) { @@ -490,7 +490,7 @@ namespace Gecode { namespace Int { namespace Extensional { } template forceinline void - Compact::ValidSupports::operator++(void) { + Compact::ValidSupports::operator++() { value++; if (pos) { if (value <= view_ranges.max()) { @@ -517,18 +517,18 @@ namespace Gecode { namespace Int { namespace Extensional { } template forceinline bool - Compact::ValidSupports::operator()(void) const { + Compact::ValidSupports::operator()() const { return value <= max_value; } template forceinline const BitSetData* - Compact::ValidSupports::support(void) const { + Compact::ValidSupports::support() const { assert(support_words == support_range->supports(n_words, value)); return support_words; } template forceinline int - Compact::ValidSupports::val(void) const { + Compact::ValidSupports::val() const { return value; } @@ -551,7 +551,7 @@ namespace Gecode { namespace Int { namespace Extensional { } template forceinline void - Compact::LostSupports::operator++(void) { + Compact::LostSupports::operator++() { value++; support_words += n_words; while ((value <= last_value) && (value > support_range->max)) { @@ -562,12 +562,12 @@ namespace Gecode { namespace Int { namespace Extensional { } template forceinline bool - Compact::LostSupports::operator()(void) const { + Compact::LostSupports::operator()() const { return value <= last_value; } template forceinline const TupleSet::BitSetData* - Compact::LostSupports::support(void) const { + Compact::LostSupports::support() const { assert((value >= support_range->min) && (value <= support_range->max)); assert(support_words == support_range->supports(n_words, value)); return support_words; @@ -575,12 +575,12 @@ namespace Gecode { namespace Int { namespace Extensional { template forceinline bool - Compact::all(void) const { + Compact::all() const { return compact_all(c); } template forceinline bool - Compact::at_most_one(void) const { + Compact::at_most_one() const { return compact_atmostone(c); } @@ -1305,7 +1305,7 @@ namespace Gecode { namespace Int { namespace Extensional { const CSupportWord* support_end; bool valid; void - find(void) { + find() { while (view_ranges() && (support_range <= last_support_range)) { if (value < view_ranges.min()) value = view_ranges.min(); @@ -1358,20 +1358,20 @@ namespace Gecode { namespace Int { namespace Extensional { } } void - operator++(void) { + operator++() { value++; find(); } bool - operator()(void) const { + operator()() const { return valid; } int - val(void) const { + val() const { return value; } CompressedSupport - support(void) const { + support() const { return CompressedSupport(support_begin, support_end); } }; @@ -1388,7 +1388,7 @@ namespace Gecode { namespace Int { namespace Extensional { const CSupportWord* support_end; bool valid; void - find(void) { + find() { while ((value <= last_value) && (support_range <= last_support_range)) { if (value < support_range->min) value = support_range->min; @@ -1419,26 +1419,26 @@ namespace Gecode { namespace Int { namespace Extensional { find(); } void - operator++(void) { + operator++() { value++; find(); } bool - operator()(void) const { + operator()() const { return valid; } CompressedSupport - support(void) const { + support() const { return CompressedSupport(support_begin, support_end); } }; bool - all(void) const { + all() const { return compact_all(c); } bool - at_most_one(void) const { + at_most_one() const { return compact_atmostone(c); } diff --git a/gecode/int/extensional/dfa.hpp b/gecode/int/extensional/dfa.hpp index 7cab49768c..0b1e403dce 100644 --- a/gecode/int/extensional/dfa.hpp +++ b/gecode/int/extensional/dfa.hpp @@ -68,25 +68,25 @@ namespace Gecode { /// Size of table (as binary logarithm) int n_log; /// Fill hash table - void fill(void); + void fill(); /// Initialize automaton implementation with \a nt transitions DFAI(int nt); /// Delete automaton implemenentation - ~DFAI(void) override; + ~DFAI() override; }; forceinline DFA::DFAI::DFAI(int nt) : trans(nt == 0 ? nullptr : heap.alloc(nt)) {} - forceinline DFA::DFAI::~DFAI(void) { + forceinline DFA::DFAI::~DFAI() { if (n_trans > 0) heap.rfree(trans); heap.rfree(table); } forceinline void - DFA::DFAI::fill(void) { + DFA::DFAI::fill() { key = static_cast(n_states); cmb_hash(key, n_trans); cmb_hash(key, n_symbols); @@ -124,55 +124,55 @@ namespace Gecode { } forceinline int - DFA::n_states(void) const { + DFA::n_states() const { const DFAI* d = static_cast(object()); return (d == nullptr) ? 1 : d->n_states; } forceinline unsigned int - DFA::n_symbols(void) const { + DFA::n_symbols() const { const DFAI* d = static_cast(object()); return (d == nullptr) ? 0 : d->n_symbols; } forceinline int - DFA::n_transitions(void) const { + DFA::n_transitions() const { const DFAI* d = static_cast(object()); return (d == nullptr) ? 0 : d->n_trans; } forceinline unsigned int - DFA::max_degree(void) const { + DFA::max_degree() const { const DFAI* d = static_cast(object()); return (d == nullptr) ? 0 : d->max_degree; } forceinline int - DFA::final_fst(void) const { + DFA::final_fst() const { const DFAI* d = static_cast(object()); return (d == nullptr) ? 0 : d->final_fst; } forceinline int - DFA::final_lst(void) const { + DFA::final_lst() const { const DFAI* d = static_cast(object()); return (d == nullptr) ? 0 : d->final_lst; } forceinline int - DFA::symbol_min(void) const { + DFA::symbol_min() const { const DFAI* d = static_cast(object()); return ((d != nullptr) && (d->n_trans > 0)) ? d->trans[0].symbol : Int::Limits::min; } forceinline int - DFA::symbol_max(void) const { + DFA::symbol_max() const { const DFAI* d = static_cast(object()); return ((d != nullptr) && (d->n_trans > 0)) ? d->trans[d->n_trans - 1].symbol : Int::Limits::max; } forceinline std::size_t - DFA::hash(void) const { + DFA::hash() const { const DFAI* d = static_cast(object()); return (d != nullptr) ? d->key : 0; } @@ -184,7 +184,7 @@ namespace Gecode { forceinline // NOLINTNEXTLINE(modernize-use-equals-default) - DFA::Transition::Transition(void) {} + DFA::Transition::Transition() {} forceinline DFA::Transition::Transition(int i_state0, int symbol0, int o_state0) @@ -222,27 +222,27 @@ namespace Gecode { } forceinline bool - DFA::Transitions::operator()(void) const { + DFA::Transitions::operator()() const { return c_trans < e_trans; } forceinline void - DFA::Transitions::operator++(void) { + DFA::Transitions::operator++() { c_trans++; } forceinline int - DFA::Transitions::i_state(void) const { + DFA::Transitions::i_state() const { return c_trans->i_state; } forceinline int - DFA::Transitions::symbol(void) const { + DFA::Transitions::symbol() const { return c_trans->symbol; } forceinline int - DFA::Transitions::o_state(void) const { + DFA::Transitions::o_state() const { return c_trans->o_state; } @@ -263,12 +263,12 @@ namespace Gecode { } forceinline bool - DFA::Symbols::operator()(void) const { + DFA::Symbols::operator()() const { return c_trans < e_trans; } forceinline void - DFA::Symbols::operator++(void) { + DFA::Symbols::operator++() { int s = c_trans->symbol; do { c_trans++; @@ -276,7 +276,7 @@ namespace Gecode { } forceinline int - DFA::Symbols::val(void) const { + DFA::Symbols::val() const { return c_trans->symbol; } diff --git a/gecode/int/extensional/layered-graph.hpp b/gecode/int/extensional/layered-graph.hpp index 57d1855392..4e54c76a5b 100644 --- a/gecode/int/extensional/layered-graph.hpp +++ b/gecode/int/extensional/layered-graph.hpp @@ -74,7 +74,7 @@ namespace Gecode { namespace Int { namespace Extensional { */ template forceinline void - LayeredGraph::State::init(void) { + LayeredGraph::State::init() { i_deg = o_deg = 0; } @@ -126,17 +126,17 @@ namespace Gecode { namespace Int { namespace Extensional { } template forceinline bool - LayeredGraph::LayerValues ::operator()(void) const { + LayeredGraph::LayerValues ::operator()() const { return s1 < s2; } template forceinline void - LayeredGraph::LayerValues::operator++(void) { + LayeredGraph::LayerValues::operator++() { s1++; } template forceinline int - LayeredGraph::LayerValues::val(void) const { + LayeredGraph::LayerValues::val() const { return s1->val; } @@ -160,11 +160,11 @@ namespace Gecode { namespace Int { namespace Extensional { */ template forceinline - LayeredGraph::IndexRange::IndexRange(void) + LayeredGraph::IndexRange::IndexRange() : _fst(INT_MAX), _lst(INT_MIN) {} template forceinline void - LayeredGraph::IndexRange::reset(void) { + LayeredGraph::IndexRange::reset() { _fst = INT_MAX; _lst = INT_MIN; } @@ -182,7 +182,7 @@ namespace Gecode { namespace Int { namespace Extensional { } template forceinline bool - LayeredGraph::IndexRange::empty(void) const { + LayeredGraph::IndexRange::empty() const { return _fst > _lst; } template @@ -199,12 +199,12 @@ namespace Gecode { namespace Int { namespace Extensional { } template forceinline int - LayeredGraph::IndexRange::fst(void) const { + LayeredGraph::IndexRange::fst() const { return _fst; } template forceinline int - LayeredGraph::IndexRange::lst(void) const { + LayeredGraph::IndexRange::lst() const { return _lst; } @@ -223,7 +223,7 @@ namespace Gecode { namespace Int { namespace Extensional { template forceinline void - LayeredGraph::audit(void) { + LayeredGraph::audit() { #ifdef GECODE_AUDIT // Check states and edge information to be consistent unsigned int n_e = 0; // Number of edges diff --git a/gecode/int/extensional/tiny-bit-set.hpp b/gecode/int/extensional/tiny-bit-set.hpp index 036179d9df..52f2fad766 100644 --- a/gecode/int/extensional/tiny-bit-set.hpp +++ b/gecode/int/extensional/tiny-bit-set.hpp @@ -165,7 +165,7 @@ namespace Gecode { namespace Int { namespace Extensional { template forceinline void - TinyBitSet::flush(void) { + TinyBitSet::flush() { for (unsigned int i = 0U; i < sz; i++) _bits[i].init(false); assert(empty()); @@ -214,7 +214,7 @@ namespace Gecode { namespace Int { namespace Extensional { template forceinline unsigned long long int - TinyBitSet::ones(void) const { + TinyBitSet::ones() const { unsigned long long int o = 0U; for (unsigned int i = 0U; i < sz; i++) o += static_cast(_bits[i].ones()); @@ -223,13 +223,13 @@ namespace Gecode { namespace Int { namespace Extensional { template forceinline unsigned long long int - TinyBitSet::bits(void) const { + TinyBitSet::bits() const { return (static_cast(sz) * static_cast(BitSetData::bpb)); } template forceinline bool - TinyBitSet::empty(void) const { // Linear complexity... + TinyBitSet::empty() const { // Linear complexity... for (unsigned int i = 0U; i < sz; i++) if (!_bits[i].none()) return false; @@ -238,7 +238,7 @@ namespace Gecode { namespace Int { namespace Extensional { template forceinline unsigned int - TinyBitSet::width(void) const { + TinyBitSet::width() const { assert(!empty()); /// Find the index of the last non-zero word for (unsigned int i = sz; i--;) @@ -250,13 +250,13 @@ namespace Gecode { namespace Int { namespace Extensional { template forceinline unsigned int - TinyBitSet::words(void) const { + TinyBitSet::words() const { return width(); } template forceinline unsigned int - TinyBitSet::size(void) const { + TinyBitSet::size() const { return sz; } diff --git a/gecode/int/extensional/tuple-set.cpp b/gecode/int/extensional/tuple-set.cpp index 548c4c2b98..0be1b4b6a2 100644 --- a/gecode/int/extensional/tuple-set.cpp +++ b/gecode/int/extensional/tuple-set.cpp @@ -112,7 +112,7 @@ namespace Gecode { * */ void - TupleSet::Data::clear_support(void) { + TupleSet::Data::clear_support() { free_buffer(range); free_buffer(range_base); free_buffer(support); @@ -187,7 +187,7 @@ namespace Gecode { } void - TupleSet::Data::finalize(void) { + TupleSet::Data::finalize() { finalize(EPK_DENSE); } @@ -205,7 +205,7 @@ namespace Gecode { public: FinalizeGuard(Data& d0) : d(d0), committed(false) {} - ~FinalizeGuard(void) { + ~FinalizeGuard() { if (!committed) { d.clear_support(); d.n_words = 0U; @@ -563,7 +563,7 @@ namespace Gecode { } void - TupleSet::Data::resize(void) { + TupleSet::Data::resize() { assert(n_free == 0); int n = static_cast(1 + n_tuples * 1.5); if (arity > 0) @@ -571,7 +571,7 @@ namespace Gecode { n_free = n - n_tuples; } - TupleSet::Data::~Data(void) { + TupleSet::Data::~Data() { clear_support(); free_buffer(td); free_buffer(vd); diff --git a/gecode/int/extensional/tuple-set.hpp b/gecode/int/extensional/tuple-set.hpp index 6fdd3fd434..610dccc3cc 100644 --- a/gecode/int/extensional/tuple-set.hpp +++ b/gecode/int/extensional/tuple-set.hpp @@ -41,7 +41,7 @@ namespace Gecode { * */ forceinline unsigned int - TupleSet::Range::width(void) const { + TupleSet::Range::width() const { return static_cast(max - min + 1); } @@ -68,22 +68,22 @@ namespace Gecode { compressed_words(nullptr), compressed_n_entries(0U) {} forceinline bool - TupleSet::Data::finalized(void) const { + TupleSet::Data::finalized() const { return (state == TS_DENSE) || (state == TS_SPARSE) || (state == TS_DENSE_COMPRESSED); } forceinline bool - TupleSet::Data::failed(void) const { + TupleSet::Data::failed() const { return state == TS_FAILED; } forceinline bool - TupleSet::Data::terminal(void) const { + TupleSet::Data::terminal() const { return state != TS_BUILDING; } forceinline TupleSet::Tuple - TupleSet::Data::add(void) { + TupleSet::Data::add() { if (n_free == 0) resize(); assert(n_free > 0); @@ -154,12 +154,12 @@ namespace Gecode { } forceinline TupleSet:: - operator bool(void) const { + operator bool() const { return object() != nullptr; } forceinline void - TupleSet::finalize(void) { + TupleSet::finalize() { Data* d = static_cast(object()); if (d == nullptr) throw Int::UninitializedTupleSet("TupleSet::finalize()"); @@ -181,19 +181,19 @@ namespace Gecode { } forceinline bool - TupleSet::finalized(void) const { + TupleSet::finalized() const { const Data* d = static_cast(object()); return (d != nullptr) && d->finalized(); } forceinline bool - TupleSet::failed(void) const { + TupleSet::failed() const { const Data* d = static_cast(object()); return (d != nullptr) && d->failed(); } forceinline TupleSet::Data& - TupleSet::data(void) const { + TupleSet::data() const { Data* d = static_cast(object()); if (d == nullptr) throw Int::UninitializedTupleSet("TupleSet"); @@ -202,7 +202,7 @@ namespace Gecode { return *d; } forceinline TupleSet::Data& - TupleSet::raw(void) const { + TupleSet::raw() const { Data* d = static_cast(object()); if (d == nullptr) throw Int::UninitializedTupleSet("TupleSet"); @@ -214,23 +214,23 @@ namespace Gecode { return !(*this == t); } forceinline int - TupleSet::arity(void) const { + TupleSet::arity() const { return raw().arity; } forceinline int - TupleSet::tuples(void) const { + TupleSet::tuples() const { return raw().n_tuples; } forceinline unsigned int - TupleSet::words(void) const { + TupleSet::words() const { return data().n_words; } forceinline int - TupleSet::min(void) const { + TupleSet::min() const { return data().min; } forceinline int - TupleSet::max(void) const { + TupleSet::max() const { return data().max; } forceinline TupleSet::Tuple @@ -260,12 +260,12 @@ namespace Gecode { } forceinline std::size_t - TupleSet::hash(void) const { + TupleSet::hash() const { return data().key; } forceinline ExtensionalPropKind - TupleSet::representation(void) const { + TupleSet::representation() const { switch (data().state) { case Data::TS_DENSE: return EPK_DENSE; @@ -282,17 +282,17 @@ namespace Gecode { } forceinline unsigned int - TupleSet::sparse_values(void) const { + TupleSet::sparse_values() const { return data().sparse_n_vals; } forceinline const unsigned int* - TupleSet::sparse_tuple_value_ids(void) const { + TupleSet::sparse_tuple_value_ids() const { return data().sparse_tv; } forceinline const unsigned int* - TupleSet::sparse_support_offsets(void) const { + TupleSet::sparse_support_offsets() const { return data().sparse_offsets; } @@ -418,24 +418,24 @@ namespace Gecode { } forceinline bool - TupleSet::Ranges::operator()(void) const { + TupleSet::Ranges::operator()() const { return c < l; } forceinline void - TupleSet::Ranges::operator++(void) { + TupleSet::Ranges::operator++() { c++; } forceinline int - TupleSet::Ranges::min(void) const { + TupleSet::Ranges::min() const { return c->min; } forceinline int - TupleSet::Ranges::max(void) const { + TupleSet::Ranges::max() const { return c->max; } forceinline unsigned int - TupleSet::Ranges::width(void) const { + TupleSet::Ranges::width() const { return c->width(); } diff --git a/gecode/int/gcc/bnd-sup.hpp b/gecode/int/gcc/bnd-sup.hpp index d27ba66253..a537c2560d 100644 --- a/gecode/int/gcc/bnd-sup.hpp +++ b/gecode/int/gcc/bnd-sup.hpp @@ -244,22 +244,22 @@ namespace Gecode { namespace Int { namespace GCC { /// \name Initialization //@{ /// Constructor - PartialSum(void); + PartialSum(); /// Initialization void init(Space& home, ViewArray& k, bool up); /// Mark datstructure as requiring reinitialization - void reinit(void); + void reinit(); /// Test whether already initialized - operator bool(void) const; + operator bool() const; //@} /// \name Access //@{ /// Compute the maximum capacity of an interval int sumup(int from, int to) const; /// Return smallest bound of variables - int min_value(void) const; + int min_value() const; /// Return largest bound of variables - int max_value(void) const; + int max_value() const; /// Skip neighbouring array entries if their values do not differ int skip_non_null_elements_right(int v) const; /// Skip neighbouring array entries if their values do not differ @@ -288,12 +288,12 @@ namespace Gecode { namespace Int { namespace GCC { template forceinline - PartialSum::PartialSum(void) + PartialSum::PartialSum() : sum(nullptr), size(-1) {} template forceinline PartialSum:: - operator bool(void) const { + operator bool() const { return size != -1; } template @@ -365,7 +365,7 @@ namespace Gecode { namespace Int { namespace GCC { template forceinline void - PartialSum::reinit(void) { + PartialSum::reinit() { size = -1; } @@ -385,12 +385,12 @@ namespace Gecode { namespace Int { namespace GCC { template forceinline int - PartialSum::min_value(void) const { + PartialSum::min_value() const { return first_value + 3; } template forceinline int - PartialSum::max_value(void) const { + PartialSum::max_value() const { return last_value - 2; } diff --git a/gecode/int/gcc/dom-sup.hpp b/gecode/int/gcc/dom-sup.hpp index 3a4e8bc15c..872b8d059f 100644 --- a/gecode/int/gcc/dom-sup.hpp +++ b/gecode/int/gcc/dom-sup.hpp @@ -82,7 +82,7 @@ namespace Gecode { namespace Int { namespace GCC { /// \name Constructors and initialization //@{ /// Default constructor - Node(void) = default; + Node() = default; /// Constructor for index \a i that sets type to \a t Node(NodeFlag nf, int i); //@} @@ -90,19 +90,19 @@ namespace Gecode { namespace Int { namespace GCC { /// \name Access //@{ /// Return the type of the node (false for a variable node) - bool type(void) const; + bool type() const; /// Return reference to the incident edges - Edge** adj(void); + Edge** adj(); /// Return pointer to the first incident edge - Edge* first(void) const; + Edge* first() const; /// Return pointer to the last incident edge - Edge* last(void) const; + Edge* last() const; /// Return pointer to the node's inedge - Edge* inedge(void) const; + Edge* inedge() const; /// Get index of either variable or value - int index(void) const; + int index() const; /// check whether a node has been removed from the graph - bool removed(void) const; + bool removed() const; //@} /// \name Update @@ -140,7 +140,7 @@ namespace Gecode { namespace Int { namespace GCC { /// \name Constructors and initialization //@{ /// Default constructor - VarNode(void) = default; + VarNode() = default; /// Creates a variable node with index \a i VarNode(int i); //@} @@ -191,7 +191,7 @@ namespace Gecode { namespace Int { namespace GCC { /// \name Constructors and destructors //@{ /// Default constructor - ValNode(void) = default; + ValNode() = default; /** * \brief Constructor for value node * @@ -205,31 +205,31 @@ namespace Gecode { namespace Int { namespace GCC { /// \name Access //@{ /// get max cap for LBC - int maxlow(void) const; + int maxlow() const; /// Mark the value node as conflicting in case of variable cardinalities void card_conflict(int c); /// Check whether the value node is conflicting - int card_conflict(void) const; + int card_conflict() const; /// Reduce the conflict counter - void red_conflict(void); + void red_conflict(); /// increases the value counter - void inc(void); + void inc(); /// returns the current number of occurrences of the value - int kcount(void) const; + int kcount() const; /// returns the number of incident matching edges on a value node int incid_match(BC bc) const; /// returns the index in cardinality array k - int kindex(void) const; + int kindex() const; /// returns \a true if the node is matched in BC, \a false otherwise bool matched(BC bc) const; /// tests whether the node is a sink - bool sink(void) const; + bool sink() const; /// tests whether the node is a source - bool source(void) const; + bool source() const; /// return the minimal node capacity as stored in \a k - int kmin(void) const; + int kmin() const; /// return the maximal node capacity as stored in \a k - int kmax(void) const; + int kmax() const; /// return minimal or maximal capacity int kbound(BC bc) const; //@} @@ -255,7 +255,7 @@ namespace Gecode { namespace Int { namespace GCC { /// unmatch the node void unmatch(BC bc); /// node reset to original capacity values - void reset(void); + void reset(); /// set the minimal k-capacity to min void kmin(int min); /// set the maximal k-capacity to max @@ -300,7 +300,7 @@ namespace Gecode { namespace Int { namespace GCC { /// \name Constructors //@{ /// Default constructor - Edge(void) = default; + Edge() = default; /** * \brief Construct edge \f$e(x,v)\f$ from variable node \a x * and value node \a y @@ -315,7 +315,7 @@ namespace Gecode { namespace Int { namespace GCC { /// return whether the edge is matched bool matched(BC bc) const; /// return whether the edge has been deleted from the graph - bool deleted(void) const; + bool deleted() const; /** * \brief return a pointer to the next edge * If \a t is false the function returns the next edge incident on \a x @@ -323,17 +323,17 @@ namespace Gecode { namespace Int { namespace GCC { */ Edge* next(bool t) const; /// return the pointer to the next edge incident on \a x - Edge* next(void) const; + Edge* next() const; /// return the pointer to the previous edge incident on \a x - Edge* prev(void) const; + Edge* prev() const; /// return the pointer to the next edge incident on \a v - Edge* vnext(void) const; + Edge* vnext() const; /// return the pointer to the previous edge incident on \a v - Edge* vprev(void) const; + Edge* vprev() const; /// return the pointer to the variable node \a x of this edge - VarNode* get_var(void) const; + VarNode* get_var() const; /// return the pointer to the value node \a v of this edge - ValNode* get_val(void) const; + ValNode* get_val() const; /** * \brief return pointer to \a x if \a t = true otherwise return \a v * @@ -356,19 +356,19 @@ namespace Gecode { namespace Int { namespace GCC { /// Unmatch the edge and ( \a x if t=false, \a v otherwise ) void unmatch(BC bc, bool t); /// Unlink the edge from the linked list of edges - void unlink(void); + void unlink(); /// Mark the edge as deleted during synchronization - void del_edge(void); + void del_edge(); /// Insert the edge again - void insert_edge(void); + void insert_edge(); /// return the reference to the next edge incident on \a x - Edge** next_ref(void); + Edge** next_ref(); /// return the reference to the previous edge incident on \a x - Edge** prev_ref(void); + Edge** prev_ref(); /// return the reference to the next edge incident on \a v - Edge** vnext_ref(void); + Edge** vnext_ref(); /// return the reference to the previous edge incident on \a v - Edge** vprev_ref(void); + Edge** vprev_ref(); //@} /// \name Memory management @@ -462,14 +462,14 @@ namespace Gecode { namespace Int { namespace GCC { * k[i].min()\f$ */ template - ExecStatus maximum_matching(void); + ExecStatus maximum_matching(); /// Compute possible free alternating paths in the graph template - void free_alternating_paths(void); + void free_alternating_paths(); /// Compute possible strongly connected components of the graph template - void strongly_connected_components(void); + void strongly_connected_components(); /** * \brief Test whether the current maximal matching on the graph * can be augmented by an alternating path starting and ending with @@ -506,15 +506,15 @@ namespace Gecode { namespace Int { namespace GCC { : e(nullptr), fst(nullptr), lst(nullptr), ie(nullptr), idx(i), nf(static_cast(nf0)), noe(0) {} forceinline Edge** - Node::adj(void) { + Node::adj() { return &e; } forceinline Edge* - Node::first(void) const { + Node::first() const { return fst; } forceinline Edge* - Node::last(void) const { + Node::last() const { return lst; } forceinline void @@ -526,11 +526,11 @@ namespace Gecode { namespace Int { namespace GCC { lst = p; } forceinline bool - Node::type(void) const { + Node::type() const { return (nf & NF_VAL) != 0; } forceinline Edge* - Node::inedge(void) const { + Node::inedge() const { return ie; } forceinline void @@ -538,7 +538,7 @@ namespace Gecode { namespace Int { namespace GCC { ie = p; } forceinline bool - Node::removed(void) const { + Node::removed() const { return noe == 0; } forceinline void @@ -546,7 +546,7 @@ namespace Gecode { namespace Int { namespace GCC { idx = i; } forceinline int - Node::index(void) const { + Node::index() const { return idx; } @@ -624,7 +624,7 @@ namespace Gecode { namespace Int { namespace GCC { } forceinline int - ValNode::maxlow(void) const { + ValNode::maxlow() const { if (_klb == _kub) { assert(ublow == lb); } @@ -637,13 +637,13 @@ namespace Gecode { namespace Int { namespace GCC { } forceinline void - ValNode::red_conflict(void) { + ValNode::red_conflict() { noc--; assert(noc >= 0); } forceinline int - ValNode::card_conflict(void) const { + ValNode::card_conflict() const { return noc; } @@ -660,7 +660,7 @@ namespace Gecode { namespace Int { namespace GCC { } forceinline void - ValNode::reset(void) { + ValNode::reset() { lb = _klb; ublow = _kub; ub = _kub; @@ -677,12 +677,12 @@ namespace Gecode { namespace Int { namespace GCC { } forceinline int - ValNode::kmax(void) const { + ValNode::kmax() const { return _kub; } forceinline int - ValNode::kmin(void) const { + ValNode::kmin() const { return _klb; } @@ -735,12 +735,12 @@ namespace Gecode { namespace Int { namespace GCC { } forceinline void - ValNode::inc(void) { + ValNode::inc() { _kcount++; } forceinline int - ValNode::kcount(void) const { + ValNode::kcount() const { return _kcount; } @@ -755,7 +755,7 @@ namespace Gecode { namespace Int { namespace GCC { } forceinline int - ValNode::kindex(void) const { + ValNode::kindex() const { return _kidx; } @@ -769,14 +769,14 @@ namespace Gecode { namespace Int { namespace GCC { } forceinline bool - ValNode::sink(void) const { + ValNode::sink() const { // there are only incoming edges // in case of the UBC-matching return _kub - ub == noe; } forceinline bool - ValNode::source(void) const { + ValNode::source() const { // there are only incoming edges // in case of the UBC-matching return _klb - lb == noe; @@ -787,7 +787,7 @@ namespace Gecode { namespace Int { namespace GCC { * */ forceinline void - Edge::unlink(void) { + Edge::unlink() { // unlink from variable side Edge* p = prev_edge; Edge* n = next_edge; @@ -850,7 +850,7 @@ namespace Gecode { namespace Int { namespace GCC { return (ef & EF_MARKED_LBC) != 0; } forceinline Edge* - Edge::next(void) const { + Edge::next() const { return next_edge; } forceinline Edge* @@ -863,41 +863,41 @@ namespace Gecode { namespace Int { namespace GCC { } forceinline Edge* - Edge::vnext(void) const { + Edge::vnext() const { return next_vedge; } forceinline Edge** - Edge::vnext_ref(void) { + Edge::vnext_ref() { return &next_vedge; } forceinline Edge* - Edge::prev(void) const { + Edge::prev() const { return prev_edge; } forceinline Edge** - Edge::prev_ref(void) { + Edge::prev_ref() { return &prev_edge; } forceinline Edge* - Edge::vprev(void) const { + Edge::vprev() const { return prev_vedge; } forceinline Edge** - Edge::vprev_ref(void) { + Edge::vprev_ref() { return &prev_vedge; } forceinline Edge** - Edge::next_ref(void) { + Edge::next_ref() { return &next_edge; } forceinline VarNode* - Edge::get_var(void) const { + Edge::get_var() const { assert(x != nullptr); return x; } forceinline ValNode* - Edge::get_val(void) const { + Edge::get_val() const { assert(v != nullptr); return v; } @@ -958,17 +958,17 @@ namespace Gecode { namespace Int { namespace GCC { } forceinline void - Edge::del_edge(void) { + Edge::del_edge() { ef |= EF_DELETED; } forceinline void - Edge::insert_edge(void) { + Edge::insert_edge() { ef &= ~EF_DELETED; } forceinline bool - Edge::deleted(void) const { + Edge::deleted() const { return (ef & EF_DELETED) != 0; } @@ -1474,7 +1474,7 @@ namespace Gecode { namespace Int { namespace GCC { template template inline ExecStatus - VarValGraph::maximum_matching(void) { + VarValGraph::maximum_matching() { int card_match = 0; // find an initial matching in O(n*d) // greedy algorithm @@ -1540,7 +1540,7 @@ namespace Gecode { namespace Int { namespace GCC { template template forceinline void - VarValGraph::free_alternating_paths(void) { + VarValGraph::free_alternating_paths() { Region r; NodeStack ns(r, n_node); BitSet visited(r, static_cast(n_node)); @@ -1713,7 +1713,7 @@ namespace Gecode { namespace Int { namespace GCC { template template forceinline void - VarValGraph::strongly_connected_components(void) { + VarValGraph::strongly_connected_components() { Region r; BitSet inscc(r, static_cast(n_node)); BitSet in_unfinished(r, static_cast(n_node)); diff --git a/gecode/int/gcc/view.hpp b/gecode/int/gcc/view.hpp index c2737a0f69..9c23fc89e2 100644 --- a/gecode/int/gcc/view.hpp +++ b/gecode/int/gcc/view.hpp @@ -81,7 +81,7 @@ namespace Gecode { namespace Int { /// \name Initialization //@{ /// Default constructor - CardConst(void); + CardConst(); /// Initialize with \a min, \a max, and cardinality \a c void init(Space& home, int min, int max, int c); //@} @@ -89,19 +89,19 @@ namespace Gecode { namespace Int { /// \name Value access //@{ /// Return minimum of domain - int min(void) const; + int min() const; /// Return maximum of domain - int max(void) const; + int max() const; /// Return cardinality - int card(void) const; + int card() const; /// Return the number of times the value occurs - int counter(void) const; + int counter() const; //@} /// \name Domain tests ///@{ /// Test whether view is assigned - bool assigned(void) const; + bool assigned() const; //@} /// \name Domain update by value @@ -109,7 +109,7 @@ namespace Gecode { namespace Int { /// Set counter to \a n void counter(int n); /// Increment counter - ModEvent inc(void); + ModEvent inc(); /// Restrict domain values to be less or equal than \a n ModEvent lq(Space& home, int n); /// Restrict domain values to be greater or equal than \a n @@ -135,7 +135,7 @@ namespace Gecode { namespace Int { ///@} /// Return used IntView (cannot be used) - IntView base(void) const; + IntView base() const; }; /// Cardinality integer view @@ -153,7 +153,7 @@ namespace Gecode { namespace Int { /// \name Initialization //@{ /// Default constructor - CardView(void); + CardView(); /// Initialize with integer view \a y and value \a c void init(const IntView& y, int c); /// Initialize for set \a s and cardinality \a c @@ -163,15 +163,15 @@ namespace Gecode { namespace Int { /// \name Value access //@{ /// Return minimum of domain - int min(void) const; + int min() const; /// Return maximum of domain - int max(void) const; + int max() const; /// Return size (cardinality) of domain - unsigned int size(void) const; + unsigned int size() const; /// Return the number of times the value occurs - int counter(void) const; + int counter() const; /// Return cardinality - int card(void) const; + int card() const; ///@} /// \name Domain update by value @@ -179,7 +179,7 @@ namespace Gecode { namespace Int { /// Set the counter to the number of times value \a n occurs void counter(int n); /// Increment counter - ModEvent inc(void); + ModEvent inc(); /// Restrict domain values to be less or equal than \a n ModEvent lq(Space& home, int n); /// Restrict domain values to be greater or equal than \a n @@ -214,7 +214,7 @@ namespace Gecode { namespace Int { */ forceinline // NOLINTNEXTLINE(modernize-use-equals-default) - CardConst::CardConst(void) {} + CardConst::CardConst() {} forceinline void CardConst::init(Space&, int min, int max, int c) { _min = min; @@ -224,23 +224,23 @@ namespace Gecode { namespace Int { } forceinline int - CardConst::min(void) const { + CardConst::min() const { return _min; } forceinline int - CardConst::max(void) const { + CardConst::max() const { return _max; } forceinline int - CardConst::card(void) const { + CardConst::card() const { return _card; } forceinline int - CardConst::counter(void) const { + CardConst::counter() const { return _counter; } forceinline bool - CardConst::assigned(void) const { + CardConst::assigned() const { return _min == _max; } @@ -249,7 +249,7 @@ namespace Gecode { namespace Int { _counter = n; } forceinline ModEvent - CardConst::inc(void) { + CardConst::inc() { if (++_counter > _max) return ME_INT_FAILED; return ME_INT_NONE; @@ -289,7 +289,7 @@ namespace Gecode { namespace Int { } forceinline IntView - CardConst::base(void) const { + CardConst::base() const { GECODE_NEVER; return IntView(); } @@ -300,7 +300,7 @@ namespace Gecode { namespace Int { */ forceinline // NOLINTNEXTLINE(modernize-use-equals-default) - CardView::CardView(void) {} + CardView::CardView() {} forceinline void CardView::init(const IntView& y, int c) { x = y; @@ -315,23 +315,23 @@ namespace Gecode { namespace Int { } forceinline int - CardView::counter(void) const { + CardView::counter() const { return _counter; } forceinline int - CardView::card(void) const { + CardView::card() const { return _card; } forceinline int - CardView::min(void) const { + CardView::min() const { return x.min(); } forceinline int - CardView::max(void) const { + CardView::max() const { return x.max(); } forceinline unsigned int - CardView::size(void) const { + CardView::size() const { return x.size(); } @@ -340,7 +340,7 @@ namespace Gecode { namespace Int { _counter = n; } forceinline ModEvent - CardView::inc(void) { + CardView::inc() { if (++_counter > this->max()) return ME_INT_FAILED; return ME_GEN_NONE; @@ -392,7 +392,7 @@ namespace Gecode { namespace Int { /// \name Constructors and initialization ///@{ /// Default constructor - ViewRanges(void); + ViewRanges(); /// Initialize with ranges for view \a x ViewRanges(const GCC::CardView& x); /// Initialize with ranges for view \a x @@ -401,7 +401,7 @@ namespace Gecode { namespace Int { }; forceinline - ViewRanges::ViewRanges(void) + ViewRanges::ViewRanges() : Gecode::Int::ViewRanges() {} forceinline diff --git a/gecode/int/growable-int-set.hh b/gecode/int/growable-int-set.hh index f37b377728..1592d71314 100644 --- a/gecode/int/growable-int-set.hh +++ b/gecode/int/growable-int-set.hh @@ -49,14 +49,14 @@ namespace Gecode { namespace Int { int min; int max; // NOLINTNEXTLINE(modernize-use-equals-default) - Range(void) {} + Range() {} }; Range* _ranges; unsigned int _count; unsigned int _capacity; /// Largest capacity supported by both counts and allocation sizes - static unsigned int max_capacity(void); + static unsigned int max_capacity(); /// Ensure capacity, copying only initialized ranges void reserve(Space& home, unsigned int required); /// First range whose maximum is at least value @@ -68,7 +68,7 @@ namespace Gecode { namespace Int { GrowableIntSet(const GrowableIntSet&) = delete; GrowableIntSet& operator=(const GrowableIntSet&) = delete; /// Initialize an empty set - GrowableIntSet(void); + GrowableIntSet(); /// Test membership bool in(int value) const; /** \brief Add the ranges from a copyable, independent canonical iterator @@ -92,11 +92,11 @@ namespace Gecode { namespace Int { public: GrowableIntSetRanges(const GrowableIntSet& set); - bool operator()(void) const; - void operator++(void); - int min(void) const; - int max(void) const; - unsigned int width(void) const; + bool operator()() const; + void operator++(); + int min() const; + int max() const; + unsigned int width() const; }; }} // namespace Gecode::Int diff --git a/gecode/int/growable-int-set.hpp b/gecode/int/growable-int-set.hpp index e4426bd28c..cb88ffda4d 100644 --- a/gecode/int/growable-int-set.hpp +++ b/gecode/int/growable-int-set.hpp @@ -33,11 +33,11 @@ namespace Gecode { namespace Int { forceinline - GrowableIntSet::GrowableIntSet(void) + GrowableIntSet::GrowableIntSet() : _ranges(nullptr), _count(0), _capacity(0) {} forceinline unsigned int - GrowableIntSet::max_capacity(void) { + GrowableIntSet::max_capacity() { return static_cast( std::min(static_cast(std::numeric_limits::max()), static_cast(std::numeric_limits::max()) / sizeof(Range))); @@ -180,27 +180,27 @@ namespace Gecode { namespace Int { : current(set._ranges), end((set._count == 0) ? set._ranges : set._ranges + set._count) {} forceinline bool - GrowableIntSetRanges::operator()(void) const { + GrowableIntSetRanges::operator()() const { return current != end; } forceinline void - GrowableIntSetRanges::operator++(void) { + GrowableIntSetRanges::operator++() { ++current; } forceinline int - GrowableIntSetRanges::min(void) const { + GrowableIntSetRanges::min() const { return current->min; } forceinline int - GrowableIntSetRanges::max(void) const { + GrowableIntSetRanges::max() const { return current->max; } forceinline unsigned int - GrowableIntSetRanges::width(void) const { + GrowableIntSetRanges::width() const { return static_cast(current->max) - static_cast(current->min) + 1U; } diff --git a/gecode/int/idx-view.hh b/gecode/int/idx-view.hh index 40085fa2dd..8bc1442458 100644 --- a/gecode/int/idx-view.hh +++ b/gecode/int/idx-view.hh @@ -72,7 +72,7 @@ namespace Gecode { namespace Int { public: /// Default constructor - IdxViewArray(void); + IdxViewArray(); /// Copy constructor IdxViewArray(const IdxViewArray&); /// Construct an IdxViewArray from \a x @@ -81,7 +81,7 @@ namespace Gecode { namespace Int { IdxViewArray(Space& home, int n); /// Return the current size - int size(void) const; + int size() const; /// Set the size to \a n void size(int n); diff --git a/gecode/int/idx-view.hpp b/gecode/int/idx-view.hpp index 4c128542f9..ecbcb2350a 100644 --- a/gecode/int/idx-view.hpp +++ b/gecode/int/idx-view.hpp @@ -69,7 +69,7 @@ namespace Gecode { namespace Int { template forceinline - IdxViewArray::IdxViewArray(void) + IdxViewArray::IdxViewArray() : xs(nullptr), n(0) {} template @@ -105,7 +105,7 @@ namespace Gecode { namespace Int { template forceinline int - IdxViewArray::size(void) const { + IdxViewArray::size() const { return n; } diff --git a/gecode/int/int-set-1.hpp b/gecode/int/int-set-1.hpp index f39d5678d9..bdbf8b1d53 100644 --- a/gecode/int/int-set-1.hpp +++ b/gecode/int/int-set-1.hpp @@ -171,7 +171,7 @@ namespace Gecode { } forceinline int - IntSet::ranges(void) const { + IntSet::ranges() const { IntSetObject* o = static_cast(object()); return (o == nullptr) ? 0 : o->n; } @@ -186,25 +186,25 @@ namespace Gecode { } forceinline int - IntSet::min(void) const { + IntSet::min() const { IntSetObject* o = static_cast(object()); return (o == nullptr) ? Int::Limits::max : o->r[0].min; } forceinline int - IntSet::max(void) const { + IntSet::max() const { IntSetObject* o = static_cast(object()); return (o == nullptr) ? Int::Limits::min : o->r[o->n - 1].max; } forceinline unsigned int - IntSet::size(void) const { + IntSet::size() const { IntSetObject* o = static_cast(object()); return (o == nullptr) ? 0U : o->size; } forceinline unsigned int - IntSet::width(void) const { + IntSet::width() const { IntSetObject* o = static_cast(object()); return (o == nullptr) ? 0U : static_cast(max()) - static_cast(min()) + 1U; } @@ -243,24 +243,24 @@ namespace Gecode { } forceinline void - IntSetRanges::operator++(void) { + IntSetRanges::operator++() { i++; } forceinline bool - IntSetRanges::operator()(void) const { + IntSetRanges::operator()() const { return i < e; } forceinline int - IntSetRanges::min(void) const { + IntSetRanges::min() const { return i->min; } forceinline int - IntSetRanges::max(void) const { + IntSetRanges::max() const { return i->max; } forceinline unsigned int - IntSetRanges::width(void) const { + IntSetRanges::width() const { return static_cast(i->max) - static_cast(i->min) + 1U; } diff --git a/gecode/int/int-set.cpp b/gecode/int/int-set.cpp index a5761ac38d..f58497d4a4 100644 --- a/gecode/int/int-set.cpp +++ b/gecode/int/int-set.cpp @@ -57,12 +57,12 @@ namespace Gecode { } void - IntSet::fault_reset_allocations(void) { + IntSet::fault_reset_allocations() { IntSetObject::fault_live_objects.store(0, std::memory_order_relaxed); } int - IntSet::fault_live_allocations(void) { + IntSet::fault_live_allocations() { return IntSetObject::fault_live_objects.load(std::memory_order_relaxed); } #endif @@ -112,7 +112,7 @@ namespace Gecode { return true; } - IntSet::IntSetObject::~IntSetObject(void) { + IntSet::IntSetObject::~IntSetObject() { if (r != nullptr) heap.free(r, n); } diff --git a/gecode/int/inter-distance.cpp b/gecode/int/inter-distance.cpp index 784d463a19..73b2d0c967 100644 --- a/gecode/int/inter-distance.cpp +++ b/gecode/int/inter-distance.cpp @@ -167,7 +167,7 @@ namespace Gecode { namespace Int { namespace InterDistance { /// First active key, or the end rank int - first_active(void) const { + first_active() const { return next_active(0); } /// First active key greater than key, or the end rank @@ -499,7 +499,7 @@ namespace Gecode { namespace Int { namespace InterDistance { private: /// Sort task pointers and record release ranks void - sort_tasks(void) { + sort_tasks() { for (int i = 0; i < n; i++) min_sorted[i] = max_sorted[i] = tasks + i; std::sort(min_sorted, min_sorted + n, [](const Task* a, const Task* b) { @@ -569,7 +569,7 @@ namespace Gecode { namespace Int { namespace InterDistance { /// Tabulate earliest completions outside the forbidden start regions void - compute_earliest_completions(void) { + compute_earliest_completions() { for (int i = 0; i < n; i++) { ect_table[i] = min_sorted[i]->min; int er = 0; @@ -603,7 +603,7 @@ namespace Gecode { namespace Int { namespace InterDistance { /// Initialize the adjustment list and the groups of variable bounds void - initialize_adjustments(void) { + initialize_adjustments() { const Time infinity = std::numeric_limits