Skip to content

Commit c5392b6

Browse files
committed
constraint_solver: fix doxygen
1 parent 1c02976 commit c5392b6

File tree

2 files changed

+90
-87
lines changed

2 files changed

+90
-87
lines changed

ortools/constraint_solver/constraint_solver.h

Lines changed: 54 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -11,59 +11,60 @@
1111
// See the License for the specific language governing permissions and
1212
// limitations under the License.
1313

14-
/// Declaration of the core objects for the constraint solver.
15-
///
16-
/// The literature around constraint programming is extremely dense but one
17-
/// can find some basic introductions in the following links:
18-
/// - http://en.wikipedia.org/wiki/Constraint_programming
19-
/// - http://kti.mff.cuni.cz/~bartak/constraints/index.html
20-
///
21-
/// Here is a very simple Constraint Programming problem:
22-
///
23-
/// If we see 56 legs and 20 heads, how many two-legged pheasants
24-
/// and four-legged rabbits are we looking at?
25-
///
26-
/// Here is some simple Constraint Programming code to find out:
27-
///
28-
/// void pheasant() {
29-
/// Solver s("pheasant");
30-
/// // Create integer variables to represent the number of pheasants and
31-
/// // rabbits, with a minimum of 0 and a maximum of 20.
32-
/// IntVar* const p = s.MakeIntVar(0, 20, "pheasant"));
33-
/// IntVar* const r = s.MakeIntVar(0, 20, "rabbit"));
34-
/// // The number of heads is the sum of pheasants and rabbits.
35-
/// IntExpr* const heads = s.MakeSum(p, r);
36-
/// // The number of legs is the sum of pheasants * 2 and rabbits * 4.
37-
/// IntExpr* const legs = s.MakeSum(s.MakeProd(p, 2), s.MakeProd(r, 4));
38-
/// // Constraints: the number of legs is 56 and heads is 20.
39-
/// Constraint* const ct_legs = s.MakeEquality(legs, 56);
40-
/// Constraint* const ct_heads = s.MakeEquality(heads, 20);
41-
/// s.AddConstraint(ct_legs);
42-
/// s.AddConstraint(ct_heads);
43-
/// DecisionBuilder* const db = s.MakePhase(p, r,
44-
/// Solver::CHOOSE_FIRST_UNBOUND,
45-
/// Solver::ASSIGN_MIN_VALUE);
46-
/// s.NewSearch(db);
47-
/// CHECK(s.NextSolution());
48-
/// LOG(INFO) << "rabbits -> " << r->Value() << ", pheasants -> "
49-
/// << p->Value();
50-
/// LOG(INFO) << s.DebugString();
51-
/// s.EndSearch();
52-
/// }
53-
///
54-
/// which outputs:
55-
///
56-
/// rabbits -> 8, pheasants -> 12
57-
/// Solver(name = "pheasant",
58-
/// state = OUTSIDE_SEARCH,
59-
/// branches = 0,
60-
/// fails = 0,
61-
/// decisions = 0
62-
/// propagation loops = 11,
63-
/// demons Run = 25,
64-
/// Run time = 0 ms)
65-
///
66-
///
14+
/** @file constraint_solver.h
15+
* Declaration of the core objects for the constraint solver.
16+
*
17+
* The literature around constraint programming is extremely dense but one
18+
* can find some basic introductions in the following links:
19+
* - http://en.wikipedia.org/wiki/Constraint_programming
20+
* - http://kti.mff.cuni.cz/~bartak/constraints/index.html
21+
*
22+
* Here is a very simple Constraint Programming problem:
23+
*
24+
* If we see 56 legs and 20 heads, how many two-legged pheasants
25+
* and four-legged rabbits are we looking at?
26+
*
27+
* Here is some simple Constraint Programming code to find out:
28+
* @code{.cpp}
29+
* void pheasant() {
30+
* Solver s("pheasant");
31+
* // Create integer variables to represent the number of pheasants and
32+
* // rabbits, with a minimum of 0 and a maximum of 20.
33+
* IntVar* const p = s.MakeIntVar(0, 20, "pheasant"));
34+
* IntVar* const r = s.MakeIntVar(0, 20, "rabbit"));
35+
* // The number of heads is the sum of pheasants and rabbits.
36+
* IntExpr* const heads = s.MakeSum(p, r);
37+
* // The number of legs is the sum of pheasants * 2 and rabbits * 4.
38+
* IntExpr* const legs = s.MakeSum(s.MakeProd(p, 2), s.MakeProd(r, 4));
39+
* // Constraints: the number of legs is 56 and heads is 20.
40+
* Constraint* const ct_legs = s.MakeEquality(legs, 56);
41+
* Constraint* const ct_heads = s.MakeEquality(heads, 20);
42+
* s.AddConstraint(ct_legs);
43+
* s.AddConstraint(ct_heads);
44+
* DecisionBuilder* const db = s.MakePhase(p, r,
45+
* Solver::CHOOSE_FIRST_UNBOUND,
46+
* Solver::ASSIGN_MIN_VALUE);
47+
* s.NewSearch(db);
48+
* CHECK(s.NextSolution());
49+
* LOG(INFO) << "rabbits -> " << r->Value() << ", pheasants -> "
50+
* << p->Value();
51+
* LOG(INFO) << s.DebugString();
52+
* s.EndSearch();
53+
* }
54+
* @endcode
55+
* which outputs:
56+
@verbatim
57+
rabbits -> 8, pheasants -> 12
58+
Solver(name = "pheasant",
59+
state = OUTSIDE_SEARCH,
60+
branches = 0,
61+
fails = 0,
62+
decisions = 0
63+
propagation loops = 11,
64+
demons Run = 25,
65+
Run time = 0 ms)
66+
@endverbatim
67+
*/
6768

6869
#ifndef ORTOOLS_CONSTRAINT_SOLVER_CONSTRAINT_SOLVER_H_
6970
#define ORTOOLS_CONSTRAINT_SOLVER_CONSTRAINT_SOLVER_H_

ortools/constraint_solver/constraint_solveri.h

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,40 +11,42 @@
1111
// See the License for the specific language governing permissions and
1212
// limitations under the License.
1313

14-
/// Collection of objects used to extend the Constraint Solver library.
15-
///
16-
/// This file contains a set of objects that simplifies writing extensions
17-
/// of the library.
18-
///
19-
/// The main objects that define extensions are:
20-
/// - BaseIntExpr, the base class of all expressions that are not variables.
21-
/// - SimpleRevFIFO, a reversible FIFO list with templatized values.
22-
/// A reversible data structure is a data structure that reverts its
23-
/// modifications when the search is going up in the search tree, usually
24-
/// after a failure occurs.
25-
/// - RevImmutableMultiMap, a reversible immutable multimap.
26-
/// - MakeConstraintDemon<n> and MakeDelayedConstraintDemon<n> to wrap methods
27-
/// of a constraint as a demon.
28-
/// - RevSwitch, a reversible flip-once switch.
29-
/// - SmallRevBitSet, RevBitSet, and RevBitMatrix: reversible 1D or 2D
30-
/// bitsets.
31-
/// - LocalSearchOperator, IntVarLocalSearchOperator, ChangeValue and
32-
/// PathOperator, to create new local search operators.
33-
/// - LocalSearchFilter and IntVarLocalSearchFilter, to create new local
34-
/// search filters.
35-
/// - BaseLns, to write Large Neighborhood Search operators.
36-
/// - SymmetryBreaker, to describe model symmetries that will be broken during
37-
/// search using the 'Symmetry Breaking During Search' framework
38-
/// see Gent, I. P., Harvey, W., & Kelsey, T. (2002).
39-
/// Groups and Constraints: Symmetry Breaking During Search.
40-
/// Principles and Practice of Constraint Programming CP2002
41-
/// (Vol. 2470, pp. 415-430). Springer. Retrieved from
42-
/// http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.11.1442.
43-
///
44-
/// Then, there are some internal classes that are used throughout the solver
45-
/// and exposed in this file:
46-
/// - SearchLog, the root class of all periodic outputs during search.
47-
/// - ModelCache, A caching layer to avoid creating twice the same object.
14+
/** @file constraint_solveri.h
15+
* Collection of objects used to extend the Constraint Solver library.
16+
*
17+
* This file contains a set of objects that simplifies writing extensions
18+
* of the library.
19+
*
20+
* The main objects that define extensions are:
21+
* - BaseIntExpr, the base class of all expressions that are not variables.
22+
* - SimpleRevFIFO, a reversible FIFO list with templatized values.
23+
* A reversible data structure is a data structure that reverts its
24+
* modifications when the search is going up in the search tree, usually
25+
* after a failure occurs.
26+
* - RevImmutableMultiMap, a reversible immutable multimap.
27+
* - MakeConstraintDemon<n> and MakeDelayedConstraintDemon<n> to wrap methods
28+
* of a constraint as a demon.
29+
* - RevSwitch, a reversible flip-once switch.
30+
* - SmallRevBitSet, RevBitSet, and RevBitMatrix: reversible 1D or 2D
31+
* bitsets.
32+
* - LocalSearchOperator, IntVarLocalSearchOperator, ChangeValue and
33+
* PathOperator, to create new local search operators.
34+
* - LocalSearchFilter and IntVarLocalSearchFilter, to create new local
35+
* search filters.
36+
* - BaseLns, to write Large Neighborhood Search operators.
37+
* - SymmetryBreaker, to describe model symmetries that will be broken during
38+
* search using the 'Symmetry Breaking During Search' framework
39+
* see Gent, I. P., Harvey, W., & Kelsey, T. (2002).
40+
* Groups and Constraints: Symmetry Breaking During Search.
41+
* Principles and Practice of Constraint Programming CP2002
42+
* (Vol. 2470, pp. 415-430). Springer. Retrieved from
43+
* http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.11.1442.
44+
*
45+
* Then, there are some internal classes that are used throughout the solver
46+
* and exposed in this file:
47+
* - SearchLog, the root class of all periodic outputs during search.
48+
* - ModelCache, A caching layer to avoid creating twice the same object.
49+
*/
4850

4951
#ifndef ORTOOLS_CONSTRAINT_SOLVER_CONSTRAINT_SOLVERI_H_
5052
#define ORTOOLS_CONSTRAINT_SOLVER_CONSTRAINT_SOLVERI_H_

0 commit comments

Comments
 (0)