IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
RadialBasisKernel.h
1 // RadialBasisKernel.h:
3 // --------------------
4 //
14 
15 #ifndef __IPSDKMATH_RADIALBASISKERNEL_H__
16 #define __IPSDKMATH_RADIALBASISKERNEL_H__
17 
22 
23 namespace ipsdk {
24 namespace math {
25 namespace clustering {
26 
29 
31 {
32 protected:
34  RadialBasisKernel(const ipReal64 sigma);
35 
36 public:
39 
40 // methods
41 public:
45  static RadialBasisKernel createKernel(const ipReal64 sigma);
46 
48  inline ipReal64 getSigma() const
49  {
50  return _sigma;
51  }
52 
54  IPSDK_FORCEINLINE ipReal64 value(const Vector& v) const
55  {
56  return 1;
57  }
58 
61  IPSDK_FORCEINLINE ipReal64 value(const Vector& v0,
62  const Vector& v1) const
63  {
64  // compute distance between points
65  const ipReal64 dist = comparable_distance(v0, v1);
66 
67  return std::exp(_factor * dist);
68  }
69 
70 // attributes
71 protected:
74 
77 };
78 
81 
82 } // end of namespace clustering
83 } // end of namespace math
84 } // end of namespace ipsdk
85 
86 #endif // __IPSDKMATH_RADIALBASISKERNEL_H__
Definition: RadialBasisKernel.h:30
Definition of import/export macro for library.
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
boost::numeric::ublas::vector< ipReal64 > Vector
vector type associated to library
Definition: LinearAlgebraTypes.h:36
#define IPSDKMATH_API
Import/Export macro for library IPSDKMath.
Definition: IPSDKMathExports.h:27
ipReal64 _sigma
standard deviation for RBF kernel
Definition: RadialBasisKernel.h:73
Predefined types for clustering algorithm.
ipReal64 _factor
multiplication factor for function computation
Definition: RadialBasisKernel.h:76
IPSDK_FORCEINLINE ipReal64 comparable_distance(const ipsdk::math::Vector &v0, const ipsdk::math::Vector &v1)
function allowing to compute comparable distance between two vectors
Definition: LinearAlgebraUtils.h:33
Utility functions for linear algebra operations management.
ipReal64 getSigma() const
retrieve standard deviation for RBF kernel
Definition: RadialBasisKernel.h:48