55#pragma once
66
77#include " hgl/constants.hpp"
8+ #include " hgl/directional_tags.hpp"
89#include " hgl/hypergraph_traits.hpp"
910#include " hgl/util.hpp"
1011
@@ -332,16 +333,48 @@ class hypergraph final {
332333
333334 // --- incidence methods ---
334335
335- void bind (const types::id_type vertex_id, const types::id_type hyperedge_id) {
336+ void bind (const types::id_type vertex_id, const types::id_type hyperedge_id)
337+ requires std::same_as<directional_tag, undirected_t>
338+ {
336339 this ->_verify_vertex_id (vertex_id);
337340 this ->_verify_hyperedge_id (hyperedge_id);
338341 this ->_impl .bind (vertex_id, hyperedge_id);
339342 }
340343
341- gl_attr_force_inline void bind (const vertex_type& vertex, const hyperedge_type& hyperedge) {
344+ gl_attr_force_inline void bind (const vertex_type& vertex, const hyperedge_type& hyperedge)
345+ requires std::same_as<directional_tag, undirected_t>
346+ {
342347 this ->bind (vertex.id (), hyperedge.id ());
343348 }
344349
350+ void bind_head (const types::id_type vertex_id, const types::id_type hyperedge_id)
351+ requires std::same_as<directional_tag, bf_directed_t>
352+ {
353+ this ->_verify_vertex_id (vertex_id);
354+ this ->_verify_hyperedge_id (hyperedge_id);
355+ this ->_impl .bind_head (vertex_id, hyperedge_id);
356+ }
357+
358+ gl_attr_force_inline void bind_head (const vertex_type& vertex, const hyperedge_type& hyperedge)
359+ requires std::same_as<directional_tag, bf_directed_t>
360+ {
361+ this ->bind_head (vertex.id (), hyperedge.id ());
362+ }
363+
364+ void bind_tail (const types::id_type vertex_id, const types::id_type hyperedge_id)
365+ requires std::same_as<directional_tag, bf_directed_t>
366+ {
367+ this ->_verify_vertex_id (vertex_id);
368+ this ->_verify_hyperedge_id (hyperedge_id);
369+ this ->_impl .bind_tail (vertex_id, hyperedge_id);
370+ }
371+
372+ gl_attr_force_inline void bind_tail (const vertex_type& vertex, const hyperedge_type& hyperedge)
373+ requires std::same_as<directional_tag, bf_directed_t>
374+ {
375+ this ->bind_tail (vertex.id (), hyperedge.id ());
376+ }
377+
345378 void unbind (const types::id_type vertex_id, const types::id_type hyperedge_id) {
346379 this ->_verify_vertex_id (vertex_id);
347380 this ->_verify_hyperedge_id (hyperedge_id);
@@ -366,6 +399,40 @@ class hypergraph final {
366399 return this ->are_incident (vertex.id (), hyperedge.id ());
367400 }
368401
402+ [[nodiscard]] bool is_tail (const types::id_type vertex_id, const types::id_type hyperedge_id)
403+ const
404+ requires std::same_as<directional_tag, bf_directed_t>
405+ {
406+ this ->_verify_vertex_id (vertex_id);
407+ this ->_verify_hyperedge_id (hyperedge_id);
408+ return this ->_impl .is_tail (vertex_id, hyperedge_id);
409+ }
410+
411+ [[nodiscard]] gl_attr_force_inline bool is_tail (
412+ const vertex_type& vertex, const hyperedge_type& hyperedge
413+ ) const
414+ requires std::same_as<directional_tag, bf_directed_t>
415+ {
416+ return this ->is_tail (vertex.id (), hyperedge.id ());
417+ }
418+
419+ [[nodiscard]] bool is_head (const types::id_type vertex_id, const types::id_type hyperedge_id)
420+ const
421+ requires std::same_as<directional_tag, bf_directed_t>
422+ {
423+ this ->_verify_vertex_id (vertex_id);
424+ this ->_verify_hyperedge_id (hyperedge_id);
425+ return this ->_impl .is_head (vertex_id, hyperedge_id);
426+ }
427+
428+ [[nodiscard]] gl_attr_force_inline bool is_head (
429+ const vertex_type& vertex, const hyperedge_type& hyperedge
430+ ) const
431+ requires std::same_as<directional_tag, bf_directed_t>
432+ {
433+ return this ->is_head (vertex.id (), hyperedge.id ());
434+ }
435+
369436 [[nodiscard]] auto incident_hyperedges (const types::id_type vertex_id) {
370437 this ->_verify_vertex_id (vertex_id);
371438 return this ->_impl .incident_hyperedges (vertex_id)
@@ -385,6 +452,60 @@ class hypergraph final {
385452 return this ->degree (vertex.id ());
386453 }
387454
455+ [[nodiscard]] auto outgoing_hyperedges (const types::id_type vertex_id)
456+ requires std::same_as<directional_tag, bf_directed_t>
457+ {
458+ this ->_verify_vertex_id (vertex_id);
459+ return this ->_impl .outgoing_hyperedges (vertex_id)
460+ | std::views::transform (this ->_create_hyperedge_descriptor ());
461+ }
462+
463+ [[nodiscard]] gl_attr_force_inline auto outgoing_hyperedges (const vertex_type& vertex)
464+ requires std::same_as<directional_tag, bf_directed_t>
465+ {
466+ return this ->outgoing_hyperedges (vertex.id ());
467+ }
468+
469+ [[nodiscard]] types::size_type out_degree (const types::id_type vertex_id) const
470+ requires std::same_as<directional_tag, bf_directed_t>
471+ {
472+ this ->_verify_vertex_id (vertex_id);
473+ return this ->_impl .out_degree (vertex_id);
474+ }
475+
476+ [[nodiscard]] gl_attr_force_inline types::size_type out_degree (const vertex_type& vertex) const
477+ requires std::same_as<directional_tag, bf_directed_t>
478+ {
479+ return this ->out_degree (vertex.id ());
480+ }
481+
482+ [[nodiscard]] auto incoming_hyperedges (const types::id_type vertex_id)
483+ requires std::same_as<directional_tag, bf_directed_t>
484+ {
485+ this ->_verify_vertex_id (vertex_id);
486+ return this ->_impl .incoming_hyperedges (vertex_id)
487+ | std::views::transform (this ->_create_hyperedge_descriptor ());
488+ }
489+
490+ [[nodiscard]] gl_attr_force_inline auto incoming_hyperedges (const vertex_type& vertex)
491+ requires std::same_as<directional_tag, bf_directed_t>
492+ {
493+ return this ->incoming_hyperedges (vertex.id ());
494+ }
495+
496+ [[nodiscard]] types::size_type in_degree (const types::id_type vertex_id) const
497+ requires std::same_as<directional_tag, bf_directed_t>
498+ {
499+ this ->_verify_vertex_id (vertex_id);
500+ return this ->_impl .in_degree (vertex_id);
501+ }
502+
503+ [[nodiscard]] gl_attr_force_inline types::size_type in_degree (const vertex_type& vertex) const
504+ requires std::same_as<directional_tag, bf_directed_t>
505+ {
506+ return this ->in_degree (vertex.id ());
507+ }
508+
388509 [[nodiscard]] auto incident_vertices (const types::id_type hyperedge_id) {
389510 this ->_verify_hyperedge_id (hyperedge_id);
390511 return this ->_impl .incident_vertices (hyperedge_id)
@@ -406,6 +527,62 @@ class hypergraph final {
406527 return this ->hyperedge_size (hyperedge.id ());
407528 }
408529
530+ [[nodiscard]] auto tail_vertices (const types::id_type hyperedge_id)
531+ requires std::same_as<directional_tag, bf_directed_t>
532+ {
533+ this ->_verify_hyperedge_id (hyperedge_id);
534+ return this ->_impl .tail_vertices (hyperedge_id)
535+ | std::views::transform (this ->_create_vertex_descriptor ());
536+ }
537+
538+ [[nodiscard]] gl_attr_force_inline auto tail_vertices (const hyperedge_type& hyperedge)
539+ requires std::same_as<directional_tag, bf_directed_t>
540+ {
541+ return this ->tail_vertices (hyperedge.id ());
542+ }
543+
544+ [[nodiscard]] types::size_type tail_size (const types::id_type hyperedge_id) const
545+ requires std::same_as<directional_tag, bf_directed_t>
546+ {
547+ this ->_verify_hyperedge_id (hyperedge_id);
548+ return this ->_impl .tail_size (hyperedge_id);
549+ }
550+
551+ [[nodiscard]] gl_attr_force_inline types::size_type tail_size (const hyperedge_type& hyperedge
552+ ) const
553+ requires std::same_as<directional_tag, bf_directed_t>
554+ {
555+ return this ->tail_size (hyperedge.id ());
556+ }
557+
558+ [[nodiscard]] auto head_vertices (const types::id_type hyperedge_id)
559+ requires std::same_as<directional_tag, bf_directed_t>
560+ {
561+ this ->_verify_hyperedge_id (hyperedge_id);
562+ return this ->_impl .head_vertices (hyperedge_id)
563+ | std::views::transform (this ->_create_vertex_descriptor ());
564+ }
565+
566+ [[nodiscard]] gl_attr_force_inline auto head_vertices (const hyperedge_type& hyperedge)
567+ requires std::same_as<directional_tag, bf_directed_t>
568+ {
569+ return this ->head_vertices (hyperedge.id ());
570+ }
571+
572+ [[nodiscard]] types::size_type head_size (const types::id_type hyperedge_id) const
573+ requires std::same_as<directional_tag, bf_directed_t>
574+ {
575+ this ->_verify_hyperedge_id (hyperedge_id);
576+ return this ->_impl .head_size (hyperedge_id);
577+ }
578+
579+ [[nodiscard]] gl_attr_force_inline types::size_type head_size (const hyperedge_type& hyperedge
580+ ) const
581+ requires std::same_as<directional_tag, bf_directed_t>
582+ {
583+ return this ->head_size (hyperedge.id ());
584+ }
585+
409586private:
410587 // --- vertex methods ---
411588
0 commit comments