[Positioning] Add Request::ss_square_distance()
This commit is contained in:
parent
c525372ed3
commit
3aae38c409
|
@ -52,6 +52,9 @@ get_all_measurements() const
|
|||
/**
|
||||
* Before to compute the distance, all the measurements containted in
|
||||
* #requests are put together, as if it was one big request.
|
||||
*
|
||||
* Note: to compute the distance between two requests, one should use
|
||||
* Request::ss_square_distance().
|
||||
*/
|
||||
float ReferencePoint::ss_square_distance(const Request &source) const
|
||||
{
|
||||
|
|
|
@ -58,6 +58,24 @@ void Request::clear()
|
|||
|
||||
|
||||
|
||||
/* *** Operations *** */
|
||||
|
||||
|
||||
float Request::ss_square_distance(const Request &source) const
|
||||
{
|
||||
unordered_map<string, Measurement>
|
||||
source_measurements(source.measurements),
|
||||
my_measurements(measurements) ;
|
||||
|
||||
PosUtil::complete_with_dummy_measurements(
|
||||
my_measurements, source_measurements) ;
|
||||
|
||||
return PosUtil::ss_square_distance(
|
||||
my_measurements, source_measurements) ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* *** Operators *** */
|
||||
|
||||
|
||||
|
|
|
@ -30,7 +30,10 @@ protected:
|
|||
/// standard positioning request)
|
||||
Point3D *real_position ;
|
||||
|
||||
/** @name Write accessors */
|
||||
//@{
|
||||
void clear_real_position(void) ;
|
||||
//@}
|
||||
|
||||
public:
|
||||
Request(const Mobile *_mobile = NULL,
|
||||
|
@ -83,6 +86,12 @@ public:
|
|||
void clear(void) ;
|
||||
//@}
|
||||
|
||||
/** @name Operations */
|
||||
//@{
|
||||
/// Compute the distance between two Request
|
||||
float ss_square_distance(const Request &source) const ;
|
||||
//@}
|
||||
|
||||
/** @name Operators */
|
||||
//@{
|
||||
const Request& operator=(const Request &source) ;
|
||||
|
|
Loading…
Reference in New Issue