UFO 1.0.0
An Efficient Probabilistic 3D Mapping Framework That Embraces the Unknown
Loading...
Searching...
No Matches
ufo::Weight Struct Reference

Represents a generic scalar weight as a single float value. More...

#include <lib/core/include/ufo/core/weight.hpp>

Public Types

using value_type = float
 Underlying scalar type.
 

Public Member Functions

constexpr operator value_type () const noexcept
 Implicitly converts to the underlying scalar type.
 

Public Attributes

value_type weight {}
 The raw scalar weight (e.g., a confidence in [0, 1]).
 

Friends

constexpr auto operator<=> (Weight lhs, Weight rhs) noexcept=default
 Three-way comparison (total order on the underlying float).
 
constexpr bool operator== (Weight lhs, Weight rhs) noexcept=default
 Equality comparison.
 

Detailed Description

Represents a generic scalar weight as a single float value.

Weight is a lightweight, trivially-copyable value type with no overhead over a bare float. It is implicitly convertible to and from float, fully ordered via <=>, and supports std::ostream streaming and std::format.

Intended for use as a per-point or per-node attribute, typically as a confidence score or weight in probabilistic or semantic mapping. It pairs with Label to form a complete semantic annotation: a class ID and a measure of certainty for that class.

Definition at line 67 of file weight.hpp.

Member Typedef Documentation

◆ value_type

using ufo::Weight::value_type = float

Underlying scalar type.

Definition at line 71 of file weight.hpp.

Member Function Documentation

◆ operator value_type()

constexpr ufo::Weight::operator value_type ( ) const
inlineconstexprnoexcept

Implicitly converts to the underlying scalar type.

Returns
The weight value as a float.

Allows Weight to be used wherever a float is expected.

Definition at line 85 of file weight.hpp.

Friends And Related Symbol Documentation

◆ operator<=>

constexpr auto operator<=> ( Weight  lhs,
Weight  rhs 
)
friend

Three-way comparison (total order on the underlying float).

Parameters
[in]lhsLeft operand.
[in]rhsRight operand.
Returns
Comparison result.

◆ operator==

constexpr bool operator== ( Weight  lhs,
Weight  rhs 
)
friend

Equality comparison.

Parameters
[in]lhsLeft operand.
[in]rhsRight operand.
Returns
True if both weight values are equal.

Member Data Documentation

◆ weight

value_type ufo::Weight::weight {}

The raw scalar weight (e.g., a confidence in [0, 1]).

Definition at line 76 of file weight.hpp.


The documentation for this struct was generated from the following file: