Commit 19d146f3 authored by Julien Michel's avatar Julien Michel

REFAC: Remove unused functor methods and use the void operator() form which is more efficient

parent 4a8b1889
......@@ -79,17 +79,14 @@ public:
typedef std::complex <RealType> ComplexType;
typedef typename TOutput::ValueType OutputValueType;
typedef SinclairToCovarianceMatrixFunctor<ComplexType, ComplexType, ComplexType, ComplexType, TOutput> SinclairToCovarianceFunctorType;
inline TOutput operator ()(const TInput1& Shh, const TInput2& Shv,
inline void operator ()(TOutput & result, const TInput1& Shh, const TInput2& Shv,
const TInput3& Svh, const TInput4& Svv)
{
TOutput result;
const ComplexType S_hh = static_cast<ComplexType>(Shh);
const ComplexType S_hv = static_cast<ComplexType>(Shv);
const ComplexType S_vh = static_cast<ComplexType>(Svh);
const ComplexType S_vv = static_cast<ComplexType>(Svv);
result.SetSize(m_NumberOfComponentsPerPixel);
const ComplexType jS_hv = S_hv * ComplexType(0., 1.);
const ComplexType jS_vh = S_vh * ComplexType(0., 1.);
const ComplexType jS_hh = S_hh * ComplexType(0., 1.);
......@@ -102,31 +99,21 @@ public:
const ComplexType Srl = coef*( jS_hh-S_hv+S_vh+jS_vv );
const ComplexType Srr = coef*( -S_hh+jS_hv+jS_vh+S_vv );
//const ComplexType conjSll = std::conj(Sll);
//const ComplexType conjSlr = std::conj(Slr);
//const ComplexType conjSrl = std::conj(Srl);
//const ComplexType conjSrr = std::conj(Srr);
SinclairToCovarianceFunctorType funct;
return ( funct( Sll, Slr, Srl, Srr ) );
}
unsigned int GetNumberOfComponentsPerPixel()
constexpr size_t OutputSize(...) const
{
return m_NumberOfComponentsPerPixel;
// Size of circular covariance matrix
return 10;
}
/** Constructor */
SinclairToCircularCovarianceMatrixFunctor() : m_NumberOfComponentsPerPixel(10) {}
SinclairToCircularCovarianceMatrixFunctor() {}
/** Destructor */
virtual ~SinclairToCircularCovarianceMatrixFunctor() {}
protected:
private:
unsigned int m_NumberOfComponentsPerPixel;
};
} // namespace Functor
......
......@@ -69,11 +69,9 @@ public:
typedef double RealType;
typedef std::complex <RealType> ComplexType;
typedef typename TOutput::ValueType OutputValueType;
inline TOutput operator ()(const TInput1& Shh, const TInput2& Shv,
inline void operator ()(TOutput & result, const TInput1& Shh, const TInput2& Shv,
const TInput3& Svh, const TInput4& Svv)
{
TOutput result(10);
const ComplexType S_hh = static_cast<ComplexType>(Shh);
const ComplexType S_hv = static_cast<ComplexType>(Shv);
const ComplexType S_vh = static_cast<ComplexType>(Svh);
......@@ -106,11 +104,6 @@ public:
return 10;
}
constexpr size_t GetNumberOfComponentsPerPixel()
{
return OutputSize();
}
/** Constructor */
SinclairToCoherencyMatrixFunctor() {}
......
......@@ -68,11 +68,9 @@ public:
/** Some typedefs. */
typedef typename std::complex <double> ComplexType;
typedef typename TOutput::ValueType OutputValueType;
inline TOutput operator ()(const TInput1& Shh, const TInput2& Shv,
inline void operator ()(TOutput & result, const TInput1& Shh, const TInput2& Shv,
const TInput3& Svh, const TInput4& Svv)
{
TOutput result(10);
const ComplexType S_hh = static_cast<ComplexType>(Shh);
const ComplexType S_hv = static_cast<ComplexType>(Shv);
const ComplexType S_vh = static_cast<ComplexType>(Svh);
......@@ -91,10 +89,7 @@ public:
return result;
}
constexpr size_t GetNumberOfComponentsPerPixel()
{
return OutputSize();
}
constexpr size_t OutputSize(...) const
{
// Number of components in the covariance matrix
......
......@@ -89,11 +89,9 @@ public:
typedef typename TOutput::ValueType OutputValueType;
typedef double RealType;
inline TOutput operator ()(const TInput1& Shh, const TInput2& Shv,
inline void operator ()(TOutput & result, const TInput1& Shh, const TInput2& Shv,
const TInput3& Svh, const TInput4& Svv)
{
TOutput result(16);
const ComplexType Txx = static_cast<ComplexType>(-Shh);
const ComplexType Txy = static_cast<ComplexType>(-Shv);
const ComplexType Tyx = static_cast<ComplexType>(Svh);
......@@ -130,11 +128,6 @@ public:
return 16;
}
constexpr size_t GetNumberOfComponentsPerPixel()
{
return OutputSize();
}
/** Constructor */
SinclairToMuellerMatrixFunctor() {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment