Skip to content

Commit

Permalink
melon title
Browse files Browse the repository at this point in the history
  • Loading branch information
fhamonic committed Oct 29, 2024
1 parent 7ed09f0 commit 71141c9
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ![MELON](misc/melon_96.png)
# ![MELON](misc/melon_title.png)

MELON stands for Modern and Efficient Library for Optimization in Networks.
The goal of this project is to provide a graph library using modern C ++ functionalities in order to be more user-friendly than the [Boost.Graph library](https://www.boost.org/doc/libs/release/libs/graph/) while being as performant as the [LEMON Graph library](https://lemon.cs.elte.hu/trac/lemon) which is unfortunately not maintained and does not compile with C++ 20.
Expand Down
19 changes: 8 additions & 11 deletions include/melon/algorithm/bentley_ottmann.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,22 @@ class bentley_ottmann {
std::get<1>(std::declval<segment_type>()))>;
using line_type = typename _Traits::line_type;
using intersection_type = typename _Traits::intersection_type;

using event_cmp = coordinate_system::point_xy_comparator;

static constexpr auto compute_sweepline_intersection(
const intersection_type & event_point, const line_type & line) {
return std::make_tuple(
std::get<0>(event_point),
(std::get<2>(line) - std::get<0>(line) * std::get<0>(event_point)) /
std::get<1>(line));
}
using sweepline_intersection_type =
std::decay_t<decltype(compute_sweepline_intersection(
std::declval<intersection_type>(), std::declval<line_type>()))>;
using sweepline_intersection_y_type = std::decay_t<decltype(std::get<1>(
std::declval<sweepline_intersection_type>()))>;

struct segment_entry {
using sweepline_intersection_type =
std::decay_t<decltype(compute_sweepline_intersection(
std::declval<intersection_type>(), std::declval<line_type>()))>;

using sweepline_y_intersection_type = std::decay_t<decltype(std::get<1>(
std::declval<sweepline_intersection_type>()))>;
using event_cmp = coordinate_system::point_xy_comparator;

struct segment_entry {
mutable sweepline_intersection_type sweepline_intersection;
const line_type line;
const segment_type segment;
Expand All @@ -97,7 +94,7 @@ class bentley_ottmann {
segment_entry & operator=(const segment_entry &) = default;
segment_entry & operator=(segment_entry &&) = default;

[[nodiscard]] constexpr const sweepline_y_intersection_type
[[nodiscard]] constexpr const sweepline_intersection_y_type
sweepline_y_intersection(const intersection_type & event_point) const {
if(std::get<1>(line) == 0) return std::get<1>(event_point);
if(std::get<0>(sweepline_intersection) == std::get<0>(event_point))
Expand Down
Binary file removed misc/melon_128.png
Binary file not shown.
Binary file removed misc/melon_128.xcf
Binary file not shown.
Binary file removed misc/melon_96.png
Binary file not shown.
Binary file added misc/melon_title.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/melon_title.xcf
Binary file not shown.

0 comments on commit 71141c9

Please sign in to comment.