<commit_before>#ifndef MPEL_COMMON_H
#define MPEL_COMMON_H
#include "types.hpp"
#include <exception>
#include <opencv2/opencv.hpp>

namespace mpel {

struct UnimplementedException : public std::exception {
    const char* what() const throw() { return "Unimplemented Functionality"; }
};

Map load_map_from_image(std::string filename);

double distance(PointRef a, PointRef b);
double distance(SegmentRef s, PointRef a);
double distance(PointRef a, SegmentRef s);

bool is_collision(MapRef map, PointRef pt);
bool is_collision(MapRef map, SegmentRef s);

bool on_segment(SegmentRef s, PointRef p);

std::vector<Segment> get_map_segments(MapRef map, double eps = 10);

Path subdivide_path(PathRef path, double len = 40);

Point random_free_space_point(const Map& map);
Point mark_point(const Workspace& ws);
}
#endif<commit_msg>Added doxygen info to common.hpp<commit_after>#ifndef MPEL_COMMON_H
#define MPEL_COMMON_H
#include "types.hpp"
#include <exception>
#include <opencv2/opencv.hpp>

namespace mpel {

/// Exception thrown whenever an unimplemented feature is used
struct UnimplementedException : public std::exception {
    const char* what() const throw() { return "Unimplemented Functionality"; }
};

/// Helper function to load a map stored as an image
Map load_map_from_image(std::string filename);

/// Compute distance between two points
double distance(PointRef a, PointRef b);
/// Compute perpendicular distance between a segment and a point
double distance(SegmentRef s, PointRef a);
/// Compute perpendicular distance between a segment and a point
double distance(PointRef a, SegmentRef s);

/// Check if a point is colliding with an obstacle in a map
bool is_collision(MapRef map, PointRef pt);

/// Check if a segment is colliding with an obstacle in a map
bool is_collision(MapRef map, SegmentRef s);

/// Check if a given point lies in a segment
bool on_segment(SegmentRef s, PointRef p);

/**
 * \brief Get a list of obstacle boundaries in the map.
 *
 * \param eps Specifies the maximum allowed error in pixels when
 * approximating curved obstacles in the map
 */
std::vector<Segment> get_map_segments(MapRef map, double eps = 10);

Path subdivide_path(PathRef path, double len = 40);

/// Returns a random non-colliding point in the map
Point random_free_space_point(const Map& map);

/// Opens a window to mark a point in a map
Point mark_point(const Workspace& ws);
}
#endif
{'fraction_non_alphanumeric': 0.09079550187421907, 'fraction_numerical': 0.004164931278633903, 'mean_word_length': 5.20671834625323, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4002533', 'n_tokens_mistral': 749, 'n_tokens_neox': 723, 'n_words': 277}