this repo has no description
at develop 21 kB view raw
1/* 2 * Main authors: 3 * Christian Schulte <schulte@gecode.org> 4 * Guido Tack <tack@gecode.org> 5 * 6 * Copyright: 7 * Christian Schulte, 2005 8 * Guido Tack, 2005 9 * 10 * This file is part of Gecode, the generic constraint 11 * development environment: 12 * http://www.gecode.org 13 * 14 * Permission is hereby granted, free of charge, to any person obtaining 15 * a copy of this software and associated documentation files (the 16 * "Software"), to deal in the Software without restriction, including 17 * without limitation the rights to use, copy, modify, merge, publish, 18 * distribute, sublicense, and/or sell copies of the Software, and to 19 * permit persons to whom the Software is furnished to do so, subject to 20 * the following conditions: 21 * 22 * The above copyright notice and this permission notice shall be 23 * included in all copies or substantial portions of the Software. 24 * 25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 29 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 30 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 31 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 32 * 33 */ 34 35/* 36 * No code, just contains the group definitions of the 37 * Doxygen-generated documentation 38 */ 39 40#define GECODE_DOXYGEN_WORKAROUNDS 1 41 42/** 43 * \defgroup Task Functionality by programming task 44 */ 45 46/** 47 * \defgroup TaskModel Programming models 48 * \ingroup Task 49 */ 50 51/** 52 * \defgroup TaskModelScript Setting up scripts 53 * 54 * Scripts (or models) are programmed by inheriting from the class 55 * Gecode::Space. For many examples see \ref Example. 56 * 57 * \ingroup TaskModel 58 */ 59 60/** 61 * \defgroup TaskModelInt Using integer variables and constraints 62 * \ingroup TaskModel 63 */ 64 65/** 66 * \defgroup TaskModelIntVars Integer variables 67 * \ingroup TaskModelInt 68 */ 69 70/** 71 * \defgroup TaskModelSearch Search engines 72 * 73 * Defines search engines. All search engines (but Gecode::LDS, where 74 * it is not needed) support recomputation. The behaviour of recomputation 75 * is controlled by a passing a search option object (see the class 76 * Gecode::Search::Options). 77 * 78 * Requires \code #include <gecode/search.hh> \endcode 79 * \ingroup TaskModel 80 */ 81 82/** 83 * \defgroup TaskGist Gist: the Gecode Interactive Search Tool 84 * \ingroup TaskModel 85 */ 86 87/** 88 * \defgroup TaskModelSet Using integer set variables and constraints 89 * \ingroup TaskModel 90 */ 91 92/** 93 * \defgroup TaskModelSetVars Set variables 94 * \ingroup TaskModelSet 95 */ 96 97/** 98 * \defgroup TaskModelFloat Using float variables and constraints 99 * \ingroup TaskModel 100 */ 101 102/** 103 * \defgroup TaskModelFloatVars Float variables 104 * \ingroup TaskModelSet 105 */ 106 107/** 108 * \defgroup TaskModelMiniModel Direct modeling support 109 * \ingroup TaskModel 110 */ 111 112/** 113 * \defgroup TaskDriver Script commandline driver 114 * \ingroup TaskModel 115 */ 116 117/** 118 * \defgroup TaskGroup Propagator and brancher groups 119 * \ingroup TaskModel 120 */ 121 122/** 123 * \defgroup TaskTrace Tracing constraint propagation 124 * \ingroup TaskModel 125 */ 126 127/** 128 * \defgroup TaskSearch Programming search engines 129 * \ingroup Task 130 */ 131 132/** 133 * \defgroup TaskActor Programming actors 134 * \ingroup Task 135 */ 136 137/** 138 * \defgroup TaskActorInt Programming integer actors 139 * \ingroup TaskActor 140 */ 141 142/** 143 * \defgroup TaskActorSet Programming set actors 144 * \ingroup TaskActor 145 */ 146 147/** 148 * \defgroup TaskActorFloat Programming float actors 149 * \ingroup TaskActor 150 */ 151 152/** 153 * \defgroup TaskVar Programming variables 154 * \ingroup Task 155 */ 156 157/** 158 * \defgroup TaskVarView Programming views for variables 159 * \ingroup TaskVar 160 */ 161 162/** 163 * \defgroup TaskTest Testing 164 * \ingroup Task 165 */ 166 167/** 168 * \defgroup Func Common functionality 169 */ 170 171/** 172 * \defgroup FuncMem Memory management 173 * \ingroup Func 174 */ 175 176/** 177 * \defgroup FuncThrow Gecode exceptions 178 * \ingroup Func 179 */ 180 181/** 182 * \defgroup FuncSupport Support algorithms and datastructures 183 * 184 * These are some common datastructures used in the implementation of 185 * %Gecode. Maybe they can be also useful to others. 186 * 187 * In order to use them, one needs to include the appropriate header-file 188 * as described in the class and function documentation. 189 * \ingroup Func 190 */ 191 192/** 193 * \defgroup FuncIter Range and value iterators 194 * 195 * Both range and value iterators have a rather simple interface 196 * for controlling iteration (which deviates from what you might be 197 * used to from other iterators). 198 * 199 * The application operator (if \c i is an iterator, it is invoked by \c i() ) 200 * tests whether an iterator has not yet reached 201 * its end (in this case, \c true is returned). The prefix 202 * increment operator (if \c i is an iterator, this is invoked as \c ++i) 203 * moves the iterator to the next element (either next value or next range). 204 * 205 * Value iterators provide access to the value by the member function 206 * \c val(). Range iterators provide access to the smallest, largest, and 207 * width of the current range by \c min(), \c max(), and \c width() 208 * respectively. 209 * 210 * Requires \code #include <gecode/iter.hh> \endcode 211 * \ingroup Func 212 */ 213 214/** 215 * \defgroup FuncIterRanges Range iterators 216 * 217 * A range iterator provides incremental access to a sequence of increasing 218 * ranges. 219 * 220 * Requires \code #include <gecode/iter.hh> \endcode 221 * \ingroup FuncIter 222 */ 223 224/** 225 * \defgroup FuncIterRangesVirt Range iterators with virtual member functions 226 * 227 * A range iterator provides incremental access to a sequence of increasing 228 * ranges. Iterators with virtual member functions have to be used when 229 * they are combined dynamically, and the actual types hence cannot be 230 * specified as template arguments. 231 * 232 * Requires \code #include <gecode/iter.hh> \endcode 233 * \ingroup FuncIterRanges 234 */ 235 236/** 237 * \defgroup FuncIterValues Value iterators 238 * 239 * A value iterator provides incremental access to a sequence of increasing 240 * values. 241 * 242 * Requires \code #include <gecode/iter.hh> \endcode 243 * \ingroup FuncIter 244 */ 245 246/** 247 * \defgroup FuncIterValuesVirt Value iterators with virtual member functions 248 * 249 * A value iterator provides incremental access to a sequence of increasing 250 * values. Iterators with virtual member functions have to be used when 251 * they are combined dynamically, and the actual types hence cannot be 252 * specified as template arguments. 253 * 254 * Requires \code #include <gecode/iter.hh> \endcode 255 * \ingroup FuncIterValues 256 */ 257 258/** 259 * \defgroup Other Other available functionality 260 * 261 */ 262 263/** 264 * \defgroup FuncKernelProp Generic propagators 265 * 266 * This module contains a description of all predefined generic 267 * propagators. 268 * \ingroup Other 269 */ 270 271/** 272 * \defgroup FuncIntProp Integer propagators 273 * 274 * This module contains a description of all predefined integer 275 * propagators. They can be reused, for example, for rewriting 276 * newly defined integer propagators into already available 277 * propagators. 278 * \ingroup Other 279 */ 280 281/** 282 * \defgroup FuncSetProp Set propagators 283 * 284 * This module contains a description of all predefined finite set 285 * propagators. They can be reused, for example, for rewriting 286 * newly defined finite set propagators into already available 287 * propagators. 288 * \ingroup Other 289 */ 290 291/** 292 * \defgroup FuncFloatProp Float propagators 293 * 294 * This module contains a description of all predefined float 295 * propagators. They can be reused, for example, for rewriting 296 * newly defined float propagators into already available 297 * propagators. 298 * \ingroup Other 299 */ 300 301/** 302 * \defgroup Example Example scripts (models) 303 * 304 * All scripts are compiled into simple standalone programs. All 305 * programs understand the several generic and problem-specific 306 * commandline options. An overview of the options is available 307 * by invoking the standalone programs with the <code>-help</code> 308 * commandline option. 309 * 310 */ 311 312/* 313 * Collect some definitions for which no reasonable place exists 314 * 315 */ 316 317/** 318 * \namespace Gecode::Support 319 * \brief %Support algorithms and datastructures 320 */ 321 322/** 323 * \namespace Gecode::Kernel 324 * \brief %Kernel functionality 325 */ 326 327/** 328 * \namespace Gecode::Search 329 * \brief %Search engines 330 */ 331 332/** 333 * \mainpage %Gecode Reference Documentation 334 * 335 * This document provides reference information about 336 * <A HREF="http://www.gecode.org">%Gecode</A>. 337 * The documentation is structured into three major groups: 338 * getting started, common programming tasks, and 339 * available functionality. 340 * 341 * This document corresponds to %Gecode version @VERSION@, please consult 342 * the changelog for \ref SectionChangeList "recent changes". 343 * 344 * \section SecStart Getting started 345 * 346 * For your fist steps with %Gecode, including detailed instructions on 347 * installing the library and compiling against it, please refer to the 348 * document <A HREF="http://www.gecode.org/doc-latest/MPG.pdf">Modeling and 349 * Programming with Gecode</A>. 350 * 351 * You may also want to have a look at our \ref PageNotation as well as 352 * our \ref Example. 353 * 354 * \section SecByTask Programming tasks 355 * 356 * Documentation is available for the following tasks: 357 * - \ref TaskModel 358 * - \ref TaskSearch 359 * - \ref TaskActor "Programming propagators and branchers" 360 * - \ref TaskVar 361 * - \ref TaskTest 362 * 363 * \section SecByFunc Available functionality 364 * 365 * The most important functionality is: 366 * - \ref FuncMem 367 * - \ref FuncThrow 368 * 369 * The complete functionality can be found \ref Func "here". 370 * 371 * The part \ref Other documents existing propagators, variable 372 * implementations, and so on which serves as documentation of examples. 373 * 374 * \section SecIndex List and index content 375 * 376 * Additionally, the documentation also features the following parts: 377 * - \ref PageLic 378 * - \ref PageChange 379 * 380 * The following lists and indices are available 381 * - \ref PageCodeStat 382 * - <a class="el" href="modules.html">List of all modules</a> 383 * - <a class="el" href="annotated.html">List of all classes including brief documentation</a> 384 * - <a class="el" href="namespaces.html">List of all namespaces including brief documentation</a> 385 * - <a class="el" href="files.html">List of all files</a> 386 * - <a class="el" href="hierarchy.html">Class hierarchy</a> 387 * - <a class="el" href="classes.html">Alphabetical class index</a> 388 * - <a class="el" href="namespacemembers.html">Namespace members</a> 389 * - <a class="el" href="functions.html">Class members</a> 390 * - <a class="el" href="globals.html">File members</a> 391 */ 392 393/** 394 * \page PageNotation Notational conventions 395 * 396 * Throughout this reference documentation we use some notational conventions 397 * designed to keep the documentation concise yet understandable. Please 398 * read the following carefully. 399 * 400 * \section NotationArray Array notation 401 * 402 * We allow ourselves to refer to the \f$i\f$-th element of an array \f$x\f$ 403 * by \f$x_i\f$. The size of an array \f$x\f$ (either provided by a member 404 * function \c %size() or clear from context) is denoted \f$|x|\f$. 405 * 406 * \section NotationHome The home space 407 * 408 * Many functions and member functions take an argument \a home of 409 * type \c Space&. The home space serves as manager to many 410 * operations used by variables, views, propagators, spaces, and so 411 * on. It provides 412 * services such as failure management, propagation control, 413 * memory management, and so on. To keep the documentation concise 414 * the home space is not documented for functions 415 * and member functions. 416 * 417 * \section NotationShare Sharing in update and copy 418 * 419 * In member functions that either copy or update an object during 420 * cloning, an argument \a share of type \c bool is available. This 421 * Boolean value controls whether during cloning the data structure at 422 * hand will be shared among the newly created cloned space and the original 423 * or whether two independent copies are created. Some functions (such 424 * as \c copy for spaces (Gecode::Space) or \c copy for propagators 425 * (Gecode::Propagator) also feature this argument. Here it is used 426 * to pass on the Boolean value to other datastructures used inside spaces 427 * or propagators. 428 * 429 * The actual value the \a share argument has is defined by the search 430 * engine: when a search engine uses the \a clone member function of 431 * a space it decides whether sharing is to be used in the cloning of 432 * the space or not. If the search engine is single-threaded, it will 433 * use full sharing (\a share will be true). Only if the search engine 434 * uses concurrency or parallelism with more than a single thread, 435 * it will pass false as value. This means that by not sharing data structures 436 * among spaces which are to be used in different threads, all parts of 437 * %Gecode but the actual search engine do not need to provide concurrency 438 * control. 439 * 440 * As examples for data structures which are sensitive to sharing, consider 441 * Gecode::SharedArray, Gecode::IntSet, and Gecode::DFA. 442 */ 443 444/** 445 * \page PageHowToChange_2 How to Change from %Gecode 1.3.1 to %Gecode 2.0.x 446 * 447 448As %Gecode 2.0.0 is a major revision of %Gecode, your programs that are written 449for %Gecode 1.3.1 are likely to require some modifications before they work 450again. All modifications are straightforward, though. 451 452This short summary shows how to adapt your models and linker invocation, for 453changes to propagator implementations, etc, please consult the changelog. 454 455\section SecChange2IntBool IntVar and BoolVar 456 457Boolean variables (BoolVar) are not any longer integer variables 458(IntVar). The same holds for variable arrays (BoolVarArray, 459IntVarArray). So, you can not mix Boolean and integer variables 460in the same array (use two different arrays) and you can not cast 461between them. If you want to link the value of a BoolVar to the 462value of an IntVar you have to use a \ref TaskModelIntChannel 463"channel constraint". Posting constraints remains unchanged, as 464all constraints offer two overloaded versions (one for IntVar, 465one for BoolVar). 466 467\section SecChange2Regular Regular constraint 468 469The regular constraint has been renamed to extensional (after 470all, it is an extensionally specified constraint). The old name 471is still available in the MiniModel module. 472 473If you want to use regular expressions, you have to add 474 \code #include <gecode/int/minimodel.hh> \endcode 475to your file as they moved to the MiniModel module. 476 477\section SecChange2Bool Boolean constraints 478 479In order to make the interface to Boolean constraints more 480regular and similar to set constraints, Boolean constraints are 481available as rel constraints. That is, instead of 482 \code bool_and(home, x, y, z); \endcode 483you have to write 484 \code rel(home, x, BOT_AND, y, z); \endcode 485Likewise, for arrays you have to write 486 \code rel(home, BOT_AND, x, y); \endcode 487instead of 488 \code bool_and(home, x, y); \endcode 489More information is available \ref TaskModelIntRelBool "here". 490 491\section SecChange2Branching Branching 492 493Values and types for selecting how to branch have been made uniform. 494Replace BVAL_* by INT_VAL_*, BVAR_* by INT_VAR_*, and so on. 495 496\section SecChange2GCC Global cardinality constraint 497 498The interface for the global cardinality constraint has been 499simplified. The constraint is now called count. Please check the 500documentation for \ref TaskModelIntCount "details". 501 502\section SecChange2Sorted Sortedness constraint 503 504The sortedness constraint has been renamed to sorted. 505 506\section SecChange2Linking Linking 507 508Some generic functionality has been put into its own library (\code 509libgecodesupport \endcode on Unix systems, \code GecodeSupport.dll \endcode on 510Windows). You have to link against this library now. 511 512*/ 513 514/** 515 * \page PageHowToChange_3 How to Change from %Gecode 2.2.2 to %Gecode 3.0.0 516 * 517 518As %Gecode 3.0.0 is a major revision, your programs that 519are written for %Gecode 2.2.2 are likely to require some 520modifications before they work again. All modifications are 521straightforward, though. 522 523This short summary shows how to adapt your models, for changes to 524propagator implementations, etc, please consult the changelog. 525 526\section SecChange3Param Passing parameters 527 528Now everything is passed as reference (Space, Propagator, 529ModEventDelta, Advisor, Branching, and BranchingDesc). 530 531The reason for this massive change is to be more C++ compliant 532and make the interfaces more consistent (at some places things were passed as 533references and at other places as pointers, for no obvious and 534explainable reason). Routines that create objects rather than 535pass them (such as copy, clone, or description) still return a 536pointer to an object (so that it can actually be deleted!). 537 538You will have to rewrite your models and other programs using 539%Gecode. For models this is easy enough: 540 - Replace "(Space* home" by "(Space& home". 541 - Replace "home->" by "home.". 542 - Replace "(this" by "(*this". 543 . 544That should do the trick for 99% of the models. 545 546For the other changes, just lookout for the changes in types and 547that "this" becomes "*this" now. 548 549 550\section SecChange3Set Set constrains 551 552Element and convexity constraints on set variables have a more 553uniform interface, and the match constrained has been renamed to 554channel. 555 556The values for variable and value selection for branching have 557been made consistent and extended. 558The following values have been renamed: 559 - SET_VAR_MIN_CARD -> SET_VAR_SIZE_MIN 560 - SET_VAR_MAX_CARD -> SET_VAR_SIZE_MAX 561 - SET_VAR_MIN_UNKNOWN_ELEM -> SET_VAR_MIN_MIN 562 - SET_VAR_MAX_UNKNOWN_ELEM -> SET_VAR_MAX_MAX 563 - SET_VAL_MIN -> SET_VAL_MIN_INC 564 - SET_VAL_MAX -> SET_VAL_MAX_INC 565 . 566Tie-breaking and random selection is now supported. 567 568\section SecChange3Files Naming scheme for files 569 570All files with extension .cc have been renamed to .cpp, and .icc 571has become .hpp. This avoids conflicts as .icc is typically used 572for other file types. All include directives are now specified 573using <...> notation instead of "...", so that %Gecode headers do 574not clutter the include namespace of a client program. 575 576\section SecChange3 Constrain method for best solution search 577 578The constrain method used for best solution search must be 579virtual and takes an argument of type const Space& rather than 580Space* as argument. 581 582*/ 583 584/** 585 * \page PageHowToChange_4 How to Change from %Gecode 3.7.3 to %Gecode 4.0.0 586 * 587 588As %Gecode 4.0.0 is a major revision, your programs that 589are written for %Gecode 3.7.3 are likely to require some 590modifications before they work again. 591 592\section SecChange4NewBranch Changed branching parameters 593 594The pre-defined variable-value branchings have been extended 595considerably and hence some changes are required. 596 597In order to change, you have to add () to all variants of 598INT_VAR, INT_VAL, INT_ASSIGN, SET_VAR, SET_VAL, and 599SET_ASSIGN. For example, INT_VAR_MIN_MIN becomes the function 600call INT_VAR_MIN_MIN() and INT_VAL_MIN becomes the function 601call INT_VAL_MIN(). Some of these functions expect additional 602arguments and can take also optional arguments (this replaces the 603VarBranchOptions and ValBranchOptions). Please read MPG for 604details. 605 606\section SecChange4SizeBranch Branchings treat SIZE differently 607 608Variable selection for branching used the quotient of size 609divided by degree, accumulated failure count, or activity. 610Now the inverse is used. That is, for example, it is not any longer 611INT_VAR_SIZE_DEGREE_MIN() but INT_VAR_DEGREE_SIZE_MAX() (that is, 612largest degree divided by size). 613 614That looks like an annoying change but is in fact essential: the 615strategies using accumulated failure count and activity now could 616have run into division by zero issues. And just changing the 617implementation is not good enough because the values of these 618measures can now be exposed during tie-breaking. 619 620 621/** 622 * \page PageHowToChange_5 How to Change from %Gecode 4.4.0 to %Gecode 5.0.0 623 * 624 625As %Gecode 5.0.0 is a major revision, your programs that 626are written for %Gecode 4.4.0 are likely to require some 627modifications, yet very few, before they work again. 628 629\section SecChange5Handle Removed Brancher Handles 630 631Brancher handles have been removed as they can be expressed 632easily by brancher groups, please consult MPG for details. 633 634\section SecChange5IPL New Integer Propagation Levels 635 636The concept of integer consistency level "IntConLevel" has been 637replaced by integer propagation level "IntPropLevel". In most cases 638it should be sufficient to: 639 - search and replace ICL_ by IPL_. 640 - search and replace IntConLevel by IntPropLevel. 641 - use the commandline option -ipl rather than -icl. 642 643Integer propagation levels are more expressive than integer 644consistency levels. They can also express other propagation 645preferences such as speed, memory, basic, or advanced. Please 646consult MPG for details. 647 648*/ 649 650/** 651 * \page PageHowToChange_6 How to Change from %Gecode 5.1.0 to %Gecode 6.0.0 652 * 653 654As %Gecode 6.0.0 is a major revision, you will have to change 655programs that are written for %Gecode 5.1.0. The big change is 656that the Boolean argument "share" during cloning is not any 657longer needed. That means you have to remove the argument from 658both the definition of and the calls to the following functions, 659where this applies to pretty much all objects used by Gecode such 660as spaces, scripts (that means your models), propagators, 661branchers, variables, views, and so on: 662 - in constructors used during cloning, and 663 - in copy functions used during cloning, and 664 - in update functions used during cloning. 665 666*/