28 #ifndef DOXYGEN_SHOULD_SKIP_THIS 37 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
38 INLINE StructuralConstraintSetStatic__< CONSTRAINT1, OTHER_CONSTRAINTS... >::
39 StructuralConstraintSetStatic__() {}
42 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
43 INLINE StructuralConstraintSetStatic__< CONSTRAINT1, OTHER_CONSTRAINTS... >::
44 StructuralConstraintSetStatic__(
45 const StructuralConstraintSetStatic__< CONSTRAINT1,
46 OTHER_CONSTRAINTS... >& from) :
48 StructuralConstraintSetStatic__< OTHER_CONSTRAINTS... >(from) {}
51 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
52 INLINE StructuralConstraintSetStatic__< CONSTRAINT1, OTHER_CONSTRAINTS... >::
53 ~StructuralConstraintSetStatic__() {}
56 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
57 INLINE StructuralConstraintSetStatic__< CONSTRAINT1, OTHER_CONSTRAINTS... >&
58 StructuralConstraintSetStatic__< CONSTRAINT1, OTHER_CONSTRAINTS... >::
60 const StructuralConstraintSetStatic__< CONSTRAINT1,
61 OTHER_CONSTRAINTS... >& from) {
63 next_constraints::operator=(from);
64 first_constraint::operator=(from);
71 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
73 StructuralConstraintSetStatic__< CONSTRAINT1, OTHER_CONSTRAINTS... >::
74 setGraph(
const DiGraph& graph) {
75 next_constraints::setGraph(graph);
76 first_constraint::setGraphAlone(graph);
80 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
82 StructuralConstraintSetStatic__< CONSTRAINT1, OTHER_CONSTRAINTS... >::
83 modifyGraph(
const ArcAddition& change) {
84 next_constraints::modifyGraph(change);
85 first_constraint::modifyGraphAlone(change);
89 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
91 StructuralConstraintSetStatic__< CONSTRAINT1, OTHER_CONSTRAINTS... >::
92 modifyGraph(
const ArcDeletion& change) {
93 next_constraints::modifyGraph(change);
94 first_constraint::modifyGraphAlone(change);
98 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
100 StructuralConstraintSetStatic__< CONSTRAINT1, OTHER_CONSTRAINTS... >::
101 modifyGraph(
const ArcReversal& change) {
102 next_constraints::modifyGraph(change);
103 first_constraint::modifyGraphAlone(change);
107 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
109 StructuralConstraintSetStatic__< CONSTRAINT1, OTHER_CONSTRAINTS... >::
110 modifyGraph(
const GraphChange& change) {
111 next_constraints::modifyGraph(change);
112 first_constraint::modifyGraphAlone(change);
116 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
118 StructuralConstraintSetStatic__< CONSTRAINT1, OTHER_CONSTRAINTS... >::
119 isAlwaysInvalid(
const GraphChange& change)
const {
120 return next_constraints::isAlwaysInvalid(change)
121 || first_constraint::isAlwaysInvalidAlone(change);
125 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
127 StructuralConstraintSetStatic__< CONSTRAINT1, OTHER_CONSTRAINTS... >::
128 checkArcAddition(NodeId x, NodeId y)
const {
129 return next_constraints::checkArcAddition(x, y)
130 && first_constraint::checkArcAdditionAlone(x, y);
134 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
136 StructuralConstraintSetStatic__< CONSTRAINT1, OTHER_CONSTRAINTS... >::
137 checkArcDeletion(NodeId x, NodeId y)
const {
138 return next_constraints::checkArcDeletion(x, y)
139 && first_constraint::checkArcDeletionAlone(x, y);
143 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
145 StructuralConstraintSetStatic__< CONSTRAINT1, OTHER_CONSTRAINTS... >::
146 checkArcReversal(NodeId x, NodeId y)
const {
147 return next_constraints::checkArcReversal(x, y)
148 && first_constraint::checkArcReversalAlone(x, y);
152 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
154 StructuralConstraintSetStatic__< CONSTRAINT1, OTHER_CONSTRAINTS... >::
155 checkModification(
const ArcAddition& change)
const {
156 return next_constraints::checkModification(change)
157 && first_constraint::checkModificationAlone(change);
161 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
163 StructuralConstraintSetStatic__< CONSTRAINT1, OTHER_CONSTRAINTS... >::
164 checkModification(
const ArcDeletion& change)
const {
165 return next_constraints::checkModification(change)
166 && first_constraint::checkModificationAlone(change);
170 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
172 StructuralConstraintSetStatic__< CONSTRAINT1, OTHER_CONSTRAINTS... >::
173 checkModification(
const ArcReversal& change)
const {
174 return next_constraints::checkModification(change)
175 && first_constraint::checkModificationAlone(change);
179 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
181 StructuralConstraintSetStatic__< CONSTRAINT1, OTHER_CONSTRAINTS... >::
182 checkModification(
const GraphChange& change)
const {
183 return next_constraints::checkModification(change)
184 && first_constraint::checkModificationAlone(change);
190 template <
typename CONSTRAINT >
191 INLINE StructuralConstraintSetStatic__<
192 CONSTRAINT >::StructuralConstraintSetStatic__() {}
195 template <
typename CONSTRAINT >
196 INLINE StructuralConstraintSetStatic__< CONSTRAINT >::
197 StructuralConstraintSetStatic__(
198 const StructuralConstraintSetStatic__< CONSTRAINT >& from) :
202 template <
typename CONSTRAINT >
203 INLINE StructuralConstraintSetStatic__<
204 CONSTRAINT >::~StructuralConstraintSetStatic__() {}
207 template <
typename CONSTRAINT >
208 INLINE StructuralConstraintSetStatic__< CONSTRAINT >&
209 StructuralConstraintSetStatic__< CONSTRAINT >::operator=(
210 const StructuralConstraintSetStatic__< CONSTRAINT >& from) {
211 if (
this != &from) { CONSTRAINT::operator=(from); }
217 template <
typename CONSTRAINT >
218 INLINE
void StructuralConstraintSetStatic__< CONSTRAINT >::setGraph(
219 const DiGraph& graph) {
220 first_constraint::setGraphAlone(graph);
224 template <
typename CONSTRAINT >
225 INLINE
void StructuralConstraintSetStatic__< CONSTRAINT >::modifyGraph(
226 const ArcAddition& change) {
227 first_constraint::modifyGraphAlone(change);
231 template <
typename CONSTRAINT >
232 INLINE
void StructuralConstraintSetStatic__< CONSTRAINT >::modifyGraph(
233 const ArcDeletion& change) {
234 first_constraint::modifyGraphAlone(change);
238 template <
typename CONSTRAINT >
239 INLINE
void StructuralConstraintSetStatic__< CONSTRAINT >::modifyGraph(
240 const ArcReversal& change) {
241 first_constraint::modifyGraphAlone(change);
245 template <
typename CONSTRAINT >
246 INLINE
void StructuralConstraintSetStatic__< CONSTRAINT >::modifyGraph(
247 const GraphChange& change) {
248 first_constraint::modifyGraphAlone(change);
252 template <
typename CONSTRAINT >
253 INLINE
bool StructuralConstraintSetStatic__< CONSTRAINT >::isAlwaysInvalid(
254 const GraphChange& change)
const {
255 return first_constraint::isAlwaysInvalidAlone(change);
259 template <
typename CONSTRAINT >
260 INLINE
bool StructuralConstraintSetStatic__< CONSTRAINT >::checkArcAddition(
263 return first_constraint::checkArcAdditionAlone(x, y);
267 template <
typename CONSTRAINT >
268 INLINE
bool StructuralConstraintSetStatic__< CONSTRAINT >::checkArcDeletion(
271 return first_constraint::checkArcDeletionAlone(x, y);
275 template <
typename CONSTRAINT >
276 INLINE
bool StructuralConstraintSetStatic__< CONSTRAINT >::checkArcReversal(
279 return first_constraint::checkArcReversalAlone(x, y);
283 template <
typename CONSTRAINT >
284 INLINE
bool StructuralConstraintSetStatic__< CONSTRAINT >::checkModification(
285 const ArcAddition& change)
const {
286 return first_constraint::checkModificationAlone(change);
290 template <
typename CONSTRAINT >
291 INLINE
bool StructuralConstraintSetStatic__< CONSTRAINT >::checkModification(
292 const ArcDeletion& change)
const {
293 return first_constraint::checkModificationAlone(change);
297 template <
typename CONSTRAINT >
298 INLINE
bool StructuralConstraintSetStatic__< CONSTRAINT >::checkModification(
299 const ArcReversal& change)
const {
300 return first_constraint::checkModificationAlone(change);
304 template <
typename CONSTRAINT >
305 INLINE
bool StructuralConstraintSetStatic__< CONSTRAINT >::checkModification(
306 const GraphChange& change)
const {
307 return first_constraint::checkModificationAlone(change);
313 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
314 INLINE StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::
315 StructuralConstraintSetStatic() {
316 GUM_CONSTRUCTOR(StructuralConstraintSetStatic);
320 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
321 INLINE StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::
322 StructuralConstraintSetStatic(
323 const StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >&
326 GUM_CONS_CPY(StructuralConstraintSetStatic);
330 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
331 INLINE StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::
332 ~StructuralConstraintSetStatic() {
333 GUM_DESTRUCTOR(StructuralConstraintSetStatic);
337 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
338 INLINE StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >&
339 StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::
341 const StructuralConstraintSetStatic< CONSTRAINT1,
342 OTHER_CONSTRAINTS... >& from) {
343 if (
this != &from) { constraints::operator=(from); }
349 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
351 StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::
352 setGraph(
const DiGraph& graph) {
353 constraints::setGraph(graph);
357 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
359 StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::
360 checkArcAddition(NodeId x, NodeId y)
const {
361 return constraints::checkArcAddition(x, y);
365 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
367 StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::
368 checkArcDeletion(NodeId x, NodeId y)
const {
369 return constraints::checkArcDeletion(x, y);
373 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
375 StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::
376 checkArcReversal(NodeId x, NodeId y)
const {
377 return constraints::checkArcReversal(x, y);
381 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
383 StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::
384 checkModification(
const ArcAddition& change)
const {
385 return constraints::checkModification(change);
389 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
391 StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::
392 checkModification(
const ArcDeletion& change)
const {
393 return constraints::checkModification(change);
397 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
399 StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::
400 checkModification(
const ArcReversal& change)
const {
401 return constraints::checkModification(change);
405 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
407 StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::
408 checkModification(
const GraphChange& change)
const {
409 return constraints::checkModification(change);
413 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
415 StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::
416 modifyGraph(
const ArcAddition& change) {
417 if (checkModification(change)) {
418 constraints::modifyGraph(change);
420 GUM_ERROR(OperationNotAllowed,
421 "the constraint set does not allow this arc addition between " 422 << change.node1() <<
" and " << change.node2());
427 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
429 StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::
430 modifyGraph(
const ArcDeletion& change) {
431 if (checkModification(change)) {
432 constraints::modifyGraph(change);
434 GUM_ERROR(OperationNotAllowed,
435 "the constraint set does not allow this arc deletion between " 436 << change.node1() <<
" and " << change.node2());
441 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
443 StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::
444 modifyGraph(
const ArcReversal& change) {
445 if (checkModification(change)) {
446 constraints::modifyGraph(change);
448 GUM_ERROR(OperationNotAllowed,
449 "the constraint set does not allow this arc reversal between " 450 << change.node1() <<
" and " << change.node2());
455 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
457 StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::
458 modifyGraph(
const GraphChange& change) {
459 switch (change.type()) {
460 case GraphChangeType::ARC_ADDITION:
461 modifyGraph(
reinterpret_cast<
const ArcAddition& >(change));
464 case GraphChangeType::ARC_DELETION:
465 modifyGraph(
reinterpret_cast<
const ArcDeletion& >(change));
468 case GraphChangeType::ARC_REVERSAL:
469 modifyGraph(
reinterpret_cast<
const ArcReversal& >(change));
473 GUM_ERROR(OperationNotAllowed,
474 "edge modifications are not " 475 "currently supported by constraint sets");
480 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
482 StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::
483 isAlwaysInvalid(
const GraphChange& change)
const {
484 return constraints::isAlwaysInvalid(change);
490 template <
typename CONSTRAINT >
491 INLINE StructuralConstraintSetStatic<
492 CONSTRAINT >::StructuralConstraintSetStatic() {
493 GUM_CONSTRUCTOR(StructuralConstraintSetStatic);
497 template <
typename CONSTRAINT >
499 StructuralConstraintSetStatic< CONSTRAINT >::StructuralConstraintSetStatic(
500 const StructuralConstraintSetStatic< CONSTRAINT >& from) :
502 GUM_CONS_CPY(StructuralConstraintSetStatic);
506 template <
typename CONSTRAINT >
507 INLINE StructuralConstraintSetStatic<
508 CONSTRAINT >::~StructuralConstraintSetStatic() {
509 GUM_DESTRUCTOR(StructuralConstraintSetStatic);
513 template <
typename CONSTRAINT >
514 INLINE StructuralConstraintSetStatic< CONSTRAINT >&
515 StructuralConstraintSetStatic< CONSTRAINT >::operator=(
516 const StructuralConstraintSetStatic< CONSTRAINT >& from) {
517 if (
this != &from) { constraints::operator=(from); }
523 template <
typename CONSTRAINT >
524 INLINE
void StructuralConstraintSetStatic< CONSTRAINT >::setGraph(
525 const DiGraph& graph) {
526 constraints::setGraph(graph);
530 template <
typename CONSTRAINT >
531 INLINE
bool StructuralConstraintSetStatic< CONSTRAINT >::checkArcAddition(
534 return constraints::checkArcAddition(x, y);
538 template <
typename CONSTRAINT >
539 INLINE
bool StructuralConstraintSetStatic< CONSTRAINT >::checkArcDeletion(
542 return constraints::checkArcDeletion(x, y);
546 template <
typename CONSTRAINT >
547 INLINE
bool StructuralConstraintSetStatic< CONSTRAINT >::checkArcReversal(
550 return constraints::checkArcReversal(x, y);
554 template <
typename CONSTRAINT >
555 INLINE
bool StructuralConstraintSetStatic< CONSTRAINT >::checkModification(
556 const ArcAddition& change)
const {
557 return constraints::checkModification(change);
561 template <
typename CONSTRAINT >
562 INLINE
bool StructuralConstraintSetStatic< CONSTRAINT >::checkModification(
563 const ArcDeletion& change)
const {
564 return constraints::checkModification(change);
568 template <
typename CONSTRAINT >
569 INLINE
bool StructuralConstraintSetStatic< CONSTRAINT >::checkModification(
570 const ArcReversal& change)
const {
571 return constraints::checkModification(change);
575 template <
typename CONSTRAINT >
576 INLINE
bool StructuralConstraintSetStatic< CONSTRAINT >::checkModification(
577 const GraphChange& change)
const {
578 return constraints::checkModification(change);
582 template <
typename CONSTRAINT >
583 INLINE
void StructuralConstraintSetStatic< CONSTRAINT >::modifyGraph(
584 const ArcAddition& change) {
585 if (checkModification(change)) {
586 constraints::modifyGraph(change);
588 GUM_ERROR(OperationNotAllowed,
589 "the constraint set does not allow this arc addition between " 590 << change.node1() <<
" and " << change.node2());
595 template <
typename CONSTRAINT >
596 INLINE
void StructuralConstraintSetStatic< CONSTRAINT >::modifyGraph(
597 const ArcDeletion& change) {
598 if (checkModification(change)) {
599 constraints::modifyGraph(change);
601 GUM_ERROR(OperationNotAllowed,
602 "the constraint set does not allow this arc deletion between " 603 << change.node1() <<
" and " << change.node2());
608 template <
typename CONSTRAINT >
609 INLINE
void StructuralConstraintSetStatic< CONSTRAINT >::modifyGraph(
610 const ArcReversal& change) {
611 if (checkModification(change)) {
612 constraints::modifyGraph(change);
614 GUM_ERROR(OperationNotAllowed,
615 "the constraint set does not allow this arc reversal between " 616 << change.node1() <<
" and " << change.node2());
621 template <
typename CONSTRAINT >
622 INLINE
void StructuralConstraintSetStatic< CONSTRAINT >::modifyGraph(
623 const GraphChange& change) {
624 switch (change.type()) {
625 case GraphChangeType::ARC_ADDITION:
626 modifyGraph(
reinterpret_cast<
const ArcAddition& >(change));
629 case GraphChangeType::ARC_DELETION:
630 modifyGraph(
reinterpret_cast<
const ArcDeletion& >(change));
633 case GraphChangeType::ARC_REVERSAL:
634 modifyGraph(
reinterpret_cast<
const ArcReversal& >(change));
638 GUM_ERROR(OperationNotAllowed,
639 "edge modifications are not " 640 "currently supported by constraint sets");
645 template <
typename CONSTRAINT >
646 INLINE
bool StructuralConstraintSetStatic< CONSTRAINT >::isAlwaysInvalid(
647 const GraphChange& change)
const {
648 return constraints::isAlwaysInvalid(change);