|
| | CtcInter (Index n) |
| | Builds a neutral intersection contractor with a prescribed domain size.
|
| template<typename C> |
| | CtcInter (const C &c) |
| | Builds an intersection contractor from a single contractor.
|
| template<typename... C> |
| | CtcInter (const C &... c) |
| | Builds an intersection contractor from several contractors.
|
| | CtcInter (const Collection< CtcBase< X... > > &ctcs) |
| | Builds an intersection contractor from a collection of contractors.
|
| template<typename C> |
| | CtcInter (std::initializer_list< C > ctcs) |
| | Builds an intersection contractor from a std::initializer_list of contractors.
|
| size_t | nb () const |
| | Returns the number of stored contractors.
|
| void | contract (X &... x) const |
| | Contracts the given domain(s) by applying all stored contractors in sequence.
|
| template<typename C> |
| CtcInter< X... > & | operator&= (const C &c) |
| | Appends a contractor to the current intersection.
|
template<typename... X>
class codac2::CtcInter< X >
Sequential intersection of several contractors:
\[\mathcal{C}_{\mathrm{inter}} = \mathcal{C}_1 \cap \mathcal{C}_2 \cap \dots \cap \mathcal{C}_n.
\]
Each sub-contractor is applied successively to the current domain. If two contractors implement two constraints, then their intersection corresponds to the logical conjunction of these constraints. This corresponds to the classical intersection/composition pattern of contractor programming.
CtcInter stores a collection of contractors acting on the same contracted types and applies them one after the other. For instance, for contractors acting on a single box \([\mathbf{x}]\):
\[\left(\mathcal{C}_1 \cap \mathcal{C}_2\right)([\mathbf{x}])
:= \mathcal{C}_1([\mathbf{x}]) \cap \mathcal{C}_2([\mathbf{x}]).
\]
In practice, each stored contractor contracts the current domain in place; the next one then works on the already reduced result. It does not perform any fixpoint iteration. If the domain becomes empty at some step, the contraction stops immediately.
A CtcInter object can be built explicitly, extended incrementally with &=, or constructed implicitly with the binary & operator between two contractors.
In C++, a variadic .contract(..) function is available when the intersected contractors act on several domains rather than on a single box. Such contractors can be combined provided they are homogeneous, i.e. they act on the same sequence of input types.
- Template Parameters
-
| X | Contracted domain type(s). For the common box-contractor case, this is typically IntervalVector. |