UFO 1.0.0
An Efficient Probabilistic 3D Mapping Framework That Embraces the Unknown
Loading...
Searching...
No Matches
confidence.hpp
1
41#ifndef UFO_CORE_CONFIDENCE_HPP
42#define UFO_CORE_CONFIDENCE_HPP
43
44// STL
45#include <format>
46#include <ostream>
47
48namespace ufo
49{
66struct Confidence {
70 using value_type = float;
71
76
84 [[nodiscard]] constexpr operator value_type() const noexcept { return confidence; }
85
93 [[nodiscard]] friend constexpr auto operator<=>(Confidence lhs,
94 Confidence rhs) noexcept = default;
95
103 [[nodiscard]] friend constexpr bool operator==(Confidence lhs,
104 Confidence rhs) noexcept = default;
105};
106
119inline std::ostream& operator<<(std::ostream& out, Confidence c)
120{
121 return out << c.confidence;
122}
123} // namespace ufo
124
125template <>
126struct std::formatter<ufo::Confidence> : std::formatter<ufo::Confidence::value_type> {
127 auto format(ufo::Confidence v, std::format_context& ctx) const
128 {
129 return std::formatter<ufo::Confidence::value_type>::format(v.confidence, ctx);
130 }
131};
132
133#endif // UFO_CORE_CONFIDENCE_HPP
All vision-related classes and functions.
Definition cloud.hpp:49
Represents a confidence score as a single float value.
friend constexpr bool operator==(Confidence lhs, Confidence rhs) noexcept=default
Equality comparison.
float value_type
Underlying scalar type.
value_type confidence
The confidence score (e.g., a value in [0, 1]).
friend constexpr auto operator<=>(Confidence lhs, Confidence rhs) noexcept=default
Three-way comparison (total order on the underlying float).