OTB  9.0.0
Orfeo Toolbox
otbEuclideanDistanceMetricWithMissingValue.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
3  * Copyright (C) 2007-2012 Institut Mines Telecom / Telecom Bretagne
4  *
5  * This file is part of Orfeo Toolbox
6  *
7  * https://www.orfeo-toolbox.org/
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 
23 #ifndef otbEuclideanDistanceMetricWithMissingValue_h
24 #define otbEuclideanDistanceMetricWithMissingValue_h
25 
27 
28 namespace otb
29 {
30 
31 namespace Statistics
32 {
33 
50 template <class TVector>
52 {
53 public:
57  typedef itk::SmartPointer<Self> Pointer;
58  typedef itk::SmartPointer<const Self> ConstPointer;
59 
61 
64 
66  itkNewMacro(Self);
67 
69  typedef typename TVector::ValueType ValueType;
70 
72  double Evaluate(const TVector& x) const override
73  {
74  return ::std::sqrt(Superclass::Evaluate(x));
75  }
76 
78  double Evaluate(const TVector& x1, const TVector& x2) const override
79  {
80  return ::std::sqrt(Superclass::Evaluate(x1, x2));
81  }
82 
85  double Evaluate(const ValueType& a, const ValueType& b) const
86  {
87  return ::std::sqrt(Superclass::Evaluate(a, b));
88  }
89 
92  bool IsWithinRange(const TVector& x, const double radius) const
93  {
94  return Superclass::IsWithinRange(x, radius);
95  }
96 
97 protected:
99  {
100  }
102  {
103  }
104 }; // end of class
105 
106 } // end namespace statistics
107 
108 } // end namespace otb
109 
110 #endif
otb::Statistics::EuclideanDistanceMetricWithMissingValue::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbEuclideanDistanceMetricWithMissingValue.h:57
otb::Statistics::EuclideanDistanceMetricWithMissingValuePow2::MeasurementVectorSizeType
Superclass::MeasurementVectorSizeType MeasurementVectorSizeType
Definition: otbEuclideanDistanceMetricWithMissingValuePow2.h:61
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::Statistics::EuclideanDistanceMetricWithMissingValue::Superclass
otb::Statistics::EuclideanDistanceMetricWithMissingValuePow2< TVector > Superclass
Definition: otbEuclideanDistanceMetricWithMissingValue.h:56
otb::Statistics::EuclideanDistanceMetricWithMissingValue::EuclideanDistanceMetricWithMissingValue
EuclideanDistanceMetricWithMissingValue()
Definition: otbEuclideanDistanceMetricWithMissingValue.h:98
otb::Statistics::EuclideanDistanceMetricWithMissingValue::Evaluate
double Evaluate(const TVector &x) const override
Definition: otbEuclideanDistanceMetricWithMissingValue.h:72
otb::Statistics::EuclideanDistanceMetricWithMissingValue::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbEuclideanDistanceMetricWithMissingValue.h:58
otb::Statistics::EuclideanDistanceMetricWithMissingValue::MeasurementVectorSizeType
Superclass::MeasurementVectorSizeType MeasurementVectorSizeType
Definition: otbEuclideanDistanceMetricWithMissingValue.h:60
otb::Statistics::EuclideanDistanceMetricWithMissingValue::ValueType
TVector::ValueType ValueType
Definition: otbEuclideanDistanceMetricWithMissingValue.h:66
otb::Statistics::EuclideanDistanceMetricWithMissingValue::~EuclideanDistanceMetricWithMissingValue
~EuclideanDistanceMetricWithMissingValue() override
Definition: otbEuclideanDistanceMetricWithMissingValue.h:101
otb::Statistics::EuclideanDistanceMetricWithMissingValue
Euclidean distance function facing missing value.
Definition: otbEuclideanDistanceMetricWithMissingValue.h:51
otb::Statistics::EuclideanDistanceMetricWithMissingValuePow2
Euclidean comparison distance function facing missing value. The square root is not performed in this...
Definition: otbEuclideanDistanceMetricWithMissingValuePow2.h:53
otb::Statistics::EuclideanDistanceMetricWithMissingValue::Evaluate
double Evaluate(const TVector &x1, const TVector &x2) const override
Definition: otbEuclideanDistanceMetricWithMissingValue.h:78
otbEuclideanDistanceMetricWithMissingValuePow2.h
otb::Statistics::EuclideanDistanceMetricWithMissingValue::Self
EuclideanDistanceMetricWithMissingValue Self
Definition: otbEuclideanDistanceMetricWithMissingValue.h:55
otb::Statistics::EuclideanDistanceMetricWithMissingValue::Evaluate
double Evaluate(const ValueType &a, const ValueType &b) const
Definition: otbEuclideanDistanceMetricWithMissingValue.h:85
otb::Statistics::EuclideanDistanceMetricWithMissingValue::IsWithinRange
bool IsWithinRange(const TVector &x, const double radius) const
Definition: otbEuclideanDistanceMetricWithMissingValue.h:92