28 #ifndef DOXYGEN_SHOULD_SKIP_THIS 37 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
39 _StructuralConstraintSetStatic_< CONSTRAINT1,
40 OTHER_CONSTRAINTS... >::_StructuralConstraintSetStatic_() {}
43 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
44 INLINE _StructuralConstraintSetStatic_< CONSTRAINT1, OTHER_CONSTRAINTS... >::
45 _StructuralConstraintSetStatic_(
46 const _StructuralConstraintSetStatic_< CONSTRAINT1, OTHER_CONSTRAINTS... >& from) :
48 _StructuralConstraintSetStatic_< OTHER_CONSTRAINTS... >(from) {}
51 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
53 _StructuralConstraintSetStatic_< CONSTRAINT1,
54 OTHER_CONSTRAINTS... >::~_StructuralConstraintSetStatic_() {
58 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
59 INLINE _StructuralConstraintSetStatic_< CONSTRAINT1, OTHER_CONSTRAINTS... >&
60 _StructuralConstraintSetStatic_< CONSTRAINT1, OTHER_CONSTRAINTS... >::operator=(
61 const _StructuralConstraintSetStatic_< CONSTRAINT1, OTHER_CONSTRAINTS... >& from) {
63 next_constraints::operator=(from);
64 first_constraint::operator=(from);
71 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
72 INLINE
void _StructuralConstraintSetStatic_< CONSTRAINT1, OTHER_CONSTRAINTS... >::setGraph(
73 const DiGraph& graph) {
74 next_constraints::setGraph(graph);
75 first_constraint::setGraphAlone(graph);
79 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
80 INLINE
void _StructuralConstraintSetStatic_< CONSTRAINT1, OTHER_CONSTRAINTS... >::modifyGraph(
81 const ArcAddition& change) {
82 next_constraints::modifyGraph(change);
83 first_constraint::modifyGraphAlone(change);
87 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
88 INLINE
void _StructuralConstraintSetStatic_< CONSTRAINT1, OTHER_CONSTRAINTS... >::modifyGraph(
89 const ArcDeletion& change) {
90 next_constraints::modifyGraph(change);
91 first_constraint::modifyGraphAlone(change);
95 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
96 INLINE
void _StructuralConstraintSetStatic_< CONSTRAINT1, OTHER_CONSTRAINTS... >::modifyGraph(
97 const ArcReversal& change) {
98 next_constraints::modifyGraph(change);
99 first_constraint::modifyGraphAlone(change);
103 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
104 INLINE
void _StructuralConstraintSetStatic_< CONSTRAINT1, OTHER_CONSTRAINTS... >::modifyGraph(
105 const GraphChange& change) {
106 next_constraints::modifyGraph(change);
107 first_constraint::modifyGraphAlone(change);
111 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
113 _StructuralConstraintSetStatic_< CONSTRAINT1, OTHER_CONSTRAINTS... >::isAlwaysInvalid(
114 const GraphChange& change)
const {
115 return next_constraints::isAlwaysInvalid(change)
116 || first_constraint::isAlwaysInvalidAlone(change);
120 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
122 _StructuralConstraintSetStatic_< CONSTRAINT1, OTHER_CONSTRAINTS... >::checkArcAddition(
125 return next_constraints::checkArcAddition(x, y)
126 && first_constraint::checkArcAdditionAlone(x, y);
130 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
132 _StructuralConstraintSetStatic_< CONSTRAINT1, OTHER_CONSTRAINTS... >::checkArcDeletion(
135 return next_constraints::checkArcDeletion(x, y)
136 && first_constraint::checkArcDeletionAlone(x, y);
140 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
142 _StructuralConstraintSetStatic_< CONSTRAINT1, OTHER_CONSTRAINTS... >::checkArcReversal(
145 return next_constraints::checkArcReversal(x, y)
146 && first_constraint::checkArcReversalAlone(x, y);
150 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
152 _StructuralConstraintSetStatic_< CONSTRAINT1, OTHER_CONSTRAINTS... >::checkModification(
153 const ArcAddition& change)
const {
154 return next_constraints::checkModification(change)
155 && first_constraint::checkModificationAlone(change);
159 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
161 _StructuralConstraintSetStatic_< CONSTRAINT1, OTHER_CONSTRAINTS... >::checkModification(
162 const ArcDeletion& change)
const {
163 return next_constraints::checkModification(change)
164 && first_constraint::checkModificationAlone(change);
168 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
170 _StructuralConstraintSetStatic_< CONSTRAINT1, OTHER_CONSTRAINTS... >::checkModification(
171 const ArcReversal& change)
const {
172 return next_constraints::checkModification(change)
173 && first_constraint::checkModificationAlone(change);
177 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
179 _StructuralConstraintSetStatic_< CONSTRAINT1, OTHER_CONSTRAINTS... >::checkModification(
180 const GraphChange& change)
const {
181 return next_constraints::checkModification(change)
182 && first_constraint::checkModificationAlone(change);
188 template <
typename CONSTRAINT >
189 INLINE _StructuralConstraintSetStatic_< CONSTRAINT >::_StructuralConstraintSetStatic_() {}
192 template <
typename CONSTRAINT >
193 INLINE _StructuralConstraintSetStatic_< CONSTRAINT >::_StructuralConstraintSetStatic_(
194 const _StructuralConstraintSetStatic_< CONSTRAINT >& from) :
198 template <
typename CONSTRAINT >
199 INLINE _StructuralConstraintSetStatic_< CONSTRAINT >::~_StructuralConstraintSetStatic_() {}
202 template <
typename CONSTRAINT >
203 INLINE _StructuralConstraintSetStatic_< CONSTRAINT >&
204 _StructuralConstraintSetStatic_< CONSTRAINT >::operator=(
205 const _StructuralConstraintSetStatic_< CONSTRAINT >& from) {
206 if (
this != &from) { CONSTRAINT::operator=(from); }
212 template <
typename CONSTRAINT >
213 INLINE
void _StructuralConstraintSetStatic_< CONSTRAINT >::setGraph(
const DiGraph& graph) {
214 first_constraint::setGraphAlone(graph);
218 template <
typename CONSTRAINT >
220 _StructuralConstraintSetStatic_< CONSTRAINT >::modifyGraph(
const ArcAddition& change) {
221 first_constraint::modifyGraphAlone(change);
225 template <
typename CONSTRAINT >
227 _StructuralConstraintSetStatic_< CONSTRAINT >::modifyGraph(
const ArcDeletion& change) {
228 first_constraint::modifyGraphAlone(change);
232 template <
typename CONSTRAINT >
234 _StructuralConstraintSetStatic_< CONSTRAINT >::modifyGraph(
const ArcReversal& change) {
235 first_constraint::modifyGraphAlone(change);
239 template <
typename CONSTRAINT >
241 _StructuralConstraintSetStatic_< CONSTRAINT >::modifyGraph(
const GraphChange& change) {
242 first_constraint::modifyGraphAlone(change);
246 template <
typename CONSTRAINT >
247 INLINE
bool _StructuralConstraintSetStatic_< CONSTRAINT >::isAlwaysInvalid(
248 const GraphChange& change)
const {
249 return first_constraint::isAlwaysInvalidAlone(change);
253 template <
typename CONSTRAINT >
254 INLINE
bool _StructuralConstraintSetStatic_< CONSTRAINT >::checkArcAddition(NodeId x,
256 return first_constraint::checkArcAdditionAlone(x, y);
260 template <
typename CONSTRAINT >
261 INLINE
bool _StructuralConstraintSetStatic_< CONSTRAINT >::checkArcDeletion(NodeId x,
263 return first_constraint::checkArcDeletionAlone(x, y);
267 template <
typename CONSTRAINT >
268 INLINE
bool _StructuralConstraintSetStatic_< CONSTRAINT >::checkArcReversal(NodeId x,
270 return first_constraint::checkArcReversalAlone(x, y);
274 template <
typename CONSTRAINT >
275 INLINE
bool _StructuralConstraintSetStatic_< CONSTRAINT >::checkModification(
276 const ArcAddition& change)
const {
277 return first_constraint::checkModificationAlone(change);
281 template <
typename CONSTRAINT >
282 INLINE
bool _StructuralConstraintSetStatic_< CONSTRAINT >::checkModification(
283 const ArcDeletion& change)
const {
284 return first_constraint::checkModificationAlone(change);
288 template <
typename CONSTRAINT >
289 INLINE
bool _StructuralConstraintSetStatic_< CONSTRAINT >::checkModification(
290 const ArcReversal& change)
const {
291 return first_constraint::checkModificationAlone(change);
295 template <
typename CONSTRAINT >
296 INLINE
bool _StructuralConstraintSetStatic_< CONSTRAINT >::checkModification(
297 const GraphChange& change)
const {
298 return first_constraint::checkModificationAlone(change);
304 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
305 INLINE StructuralConstraintSetStatic< CONSTRAINT1,
306 OTHER_CONSTRAINTS... >::StructuralConstraintSetStatic() {
307 GUM_CONSTRUCTOR(StructuralConstraintSetStatic);
311 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
312 INLINE StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::
313 StructuralConstraintSetStatic(
314 const StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >& from) :
316 GUM_CONS_CPY(StructuralConstraintSetStatic);
320 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
321 INLINE StructuralConstraintSetStatic< CONSTRAINT1,
322 OTHER_CONSTRAINTS... >::~StructuralConstraintSetStatic() {
323 GUM_DESTRUCTOR(StructuralConstraintSetStatic);
327 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
328 INLINE StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >&
329 StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::operator=(
330 const StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >& from) {
331 if (
this != &from) { constraints::operator=(from); }
337 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
338 INLINE
void StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::setGraph(
339 const DiGraph& graph) {
340 constraints::setGraph(graph);
344 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
346 StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::checkArcAddition(
349 return constraints::checkArcAddition(x, y);
353 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
355 StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::checkArcDeletion(
358 return constraints::checkArcDeletion(x, y);
362 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
364 StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::checkArcReversal(
367 return constraints::checkArcReversal(x, y);
371 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
373 StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::checkModification(
374 const ArcAddition& change)
const {
375 return constraints::checkModification(change);
379 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
381 StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::checkModification(
382 const ArcDeletion& change)
const {
383 return constraints::checkModification(change);
387 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
389 StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::checkModification(
390 const ArcReversal& change)
const {
391 return constraints::checkModification(change);
395 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
397 StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::checkModification(
398 const GraphChange& change)
const {
399 return constraints::checkModification(change);
403 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
404 INLINE
void StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::modifyGraph(
405 const ArcAddition& change) {
406 if (checkModification(change)) {
407 constraints::modifyGraph(change);
409 GUM_ERROR(OperationNotAllowed,
410 "the constraint set does not allow this arc addition between " 411 << change.node1() <<
" and " << change.node2());
416 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
417 INLINE
void StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::modifyGraph(
418 const ArcDeletion& change) {
419 if (checkModification(change)) {
420 constraints::modifyGraph(change);
422 GUM_ERROR(OperationNotAllowed,
423 "the constraint set does not allow this arc deletion between " 424 << change.node1() <<
" and " << change.node2());
429 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
430 INLINE
void StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::modifyGraph(
431 const ArcReversal& change) {
432 if (checkModification(change)) {
433 constraints::modifyGraph(change);
435 GUM_ERROR(OperationNotAllowed,
436 "the constraint set does not allow this arc reversal between " 437 << change.node1() <<
" and " << change.node2());
442 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
443 INLINE
void StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::modifyGraph(
444 const GraphChange& change) {
445 switch (change.type()) {
446 case GraphChangeType::ARC_ADDITION:
447 modifyGraph(
reinterpret_cast<
const ArcAddition& >(change));
450 case GraphChangeType::ARC_DELETION:
451 modifyGraph(
reinterpret_cast<
const ArcDeletion& >(change));
454 case GraphChangeType::ARC_REVERSAL:
455 modifyGraph(
reinterpret_cast<
const ArcReversal& >(change));
459 GUM_ERROR(OperationNotAllowed,
460 "edge modifications are not " 461 "currently supported by constraint sets");
466 template <
typename CONSTRAINT1,
typename... OTHER_CONSTRAINTS >
467 INLINE
bool StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... >::isAlwaysInvalid(
468 const GraphChange& change)
const {
469 return constraints::isAlwaysInvalid(change);
475 template <
typename CONSTRAINT >
476 INLINE StructuralConstraintSetStatic< CONSTRAINT >::StructuralConstraintSetStatic() {
477 GUM_CONSTRUCTOR(StructuralConstraintSetStatic);
481 template <
typename CONSTRAINT >
482 INLINE StructuralConstraintSetStatic< CONSTRAINT >::StructuralConstraintSetStatic(
483 const StructuralConstraintSetStatic< CONSTRAINT >& from) :
485 GUM_CONS_CPY(StructuralConstraintSetStatic);
489 template <
typename CONSTRAINT >
490 INLINE StructuralConstraintSetStatic< CONSTRAINT >::~StructuralConstraintSetStatic() {
491 GUM_DESTRUCTOR(StructuralConstraintSetStatic);
495 template <
typename CONSTRAINT >
496 INLINE StructuralConstraintSetStatic< CONSTRAINT >&
497 StructuralConstraintSetStatic< CONSTRAINT >::operator=(
498 const StructuralConstraintSetStatic< CONSTRAINT >& from) {
499 if (
this != &from) { constraints::operator=(from); }
505 template <
typename CONSTRAINT >
506 INLINE
void StructuralConstraintSetStatic< CONSTRAINT >::setGraph(
const DiGraph& graph) {
507 constraints::setGraph(graph);
511 template <
typename CONSTRAINT >
512 INLINE
bool StructuralConstraintSetStatic< CONSTRAINT >::checkArcAddition(NodeId x,
514 return constraints::checkArcAddition(x, y);
518 template <
typename CONSTRAINT >
519 INLINE
bool StructuralConstraintSetStatic< CONSTRAINT >::checkArcDeletion(NodeId x,
521 return constraints::checkArcDeletion(x, y);
525 template <
typename CONSTRAINT >
526 INLINE
bool StructuralConstraintSetStatic< CONSTRAINT >::checkArcReversal(NodeId x,
528 return constraints::checkArcReversal(x, y);
532 template <
typename CONSTRAINT >
533 INLINE
bool StructuralConstraintSetStatic< CONSTRAINT >::checkModification(
534 const ArcAddition& change)
const {
535 return constraints::checkModification(change);
539 template <
typename CONSTRAINT >
540 INLINE
bool StructuralConstraintSetStatic< CONSTRAINT >::checkModification(
541 const ArcDeletion& change)
const {
542 return constraints::checkModification(change);
546 template <
typename CONSTRAINT >
547 INLINE
bool StructuralConstraintSetStatic< CONSTRAINT >::checkModification(
548 const ArcReversal& change)
const {
549 return constraints::checkModification(change);
553 template <
typename CONSTRAINT >
554 INLINE
bool StructuralConstraintSetStatic< CONSTRAINT >::checkModification(
555 const GraphChange& change)
const {
556 return constraints::checkModification(change);
560 template <
typename CONSTRAINT >
562 StructuralConstraintSetStatic< CONSTRAINT >::modifyGraph(
const ArcAddition& change) {
563 if (checkModification(change)) {
564 constraints::modifyGraph(change);
566 GUM_ERROR(OperationNotAllowed,
567 "the constraint set does not allow this arc addition between " 568 << change.node1() <<
" and " << change.node2());
573 template <
typename CONSTRAINT >
575 StructuralConstraintSetStatic< CONSTRAINT >::modifyGraph(
const ArcDeletion& change) {
576 if (checkModification(change)) {
577 constraints::modifyGraph(change);
579 GUM_ERROR(OperationNotAllowed,
580 "the constraint set does not allow this arc deletion between " 581 << change.node1() <<
" and " << change.node2());
586 template <
typename CONSTRAINT >
588 StructuralConstraintSetStatic< CONSTRAINT >::modifyGraph(
const ArcReversal& change) {
589 if (checkModification(change)) {
590 constraints::modifyGraph(change);
592 GUM_ERROR(OperationNotAllowed,
593 "the constraint set does not allow this arc reversal between " 594 << change.node1() <<
" and " << change.node2());
599 template <
typename CONSTRAINT >
601 StructuralConstraintSetStatic< CONSTRAINT >::modifyGraph(
const GraphChange& change) {
602 switch (change.type()) {
603 case GraphChangeType::ARC_ADDITION:
604 modifyGraph(
reinterpret_cast<
const ArcAddition& >(change));
607 case GraphChangeType::ARC_DELETION:
608 modifyGraph(
reinterpret_cast<
const ArcDeletion& >(change));
611 case GraphChangeType::ARC_REVERSAL:
612 modifyGraph(
reinterpret_cast<
const ArcReversal& >(change));
616 GUM_ERROR(OperationNotAllowed,
617 "edge modifications are not " 618 "currently supported by constraint sets");
623 template <
typename CONSTRAINT >
624 INLINE
bool StructuralConstraintSetStatic< CONSTRAINT >::isAlwaysInvalid(
625 const GraphChange& change)
const {
626 return constraints::isAlwaysInvalid(change);