瀏覽代碼

Removed double OBJREC::Kernel and KernelExp classes, migrated headers

Clemens-Alexander Brust 11 年之前
父節點
當前提交
0652aec806
共有 5 個文件被更改,包括 1 次插入210 次删除
  1. 0 84
      math/distances/Kernel.cpp
  2. 0 43
      math/distances/Kernel.h
  3. 0 37
      math/distances/KernelExp.cpp
  4. 0 45
      math/distances/KernelExp.h
  5. 1 1
      math/distances/KernelStd.h

+ 0 - 84
math/distances/Kernel.cpp

@@ -1,84 +0,0 @@
-/** 
-* @file Kernel.cpp
-* @brief Interface for Mercer Kernels
-* @author Erik Rodner
-* @date 10/24/2007
-
-*/
-
-#include <iostream>
-
-#include "vislearning/math/distances/Kernel.h"
-
-using namespace OBJREC;
-
-using namespace std;
-using namespace NICE;
-
-
-
-Kernel::Kernel( bool _symmetric ) 
-{
-    symmetric = _symmetric;
-}
-
-Kernel::~Kernel()
-{
-}
-
-	
-void Kernel::calcGramMatrix ( const VVector & vecSet, NICE::Matrix & G ) const
-{
-	G.resize(vecSet.size(), vecSet.size());
-    if ( symmetric )
-    {
-		int ii = 0;
-		for ( VVector::const_iterator i  = vecSet.begin();
-							   i != vecSet.end();
-							   i++, ii++ )
-		{
-			const NICE::Vector & x = *i;
-			int jj = ii;
-			for ( VVector::const_iterator j  = i;
-							   j != vecSet.end();
-							   j++, jj++ )
-			{
-				const NICE::Vector & y = *j;
-				double kval = K(x,y);
-				G(ii, jj) = kval;
-				G(jj, ii) = kval;
-			}
-		}
-    } else {
-		int ii = 0;
-		for ( VVector::const_iterator i  = vecSet.begin();
-							   i != vecSet.end();
-							   i++, ii++ )
-		{
-			const NICE::Vector & x = *i;
-			int jj = 0;
-			for ( VVector::const_iterator j  = vecSet.begin();
-							   j != vecSet.end();
-								   j++, jj++ )
-			{
-				const NICE::Vector & y = *j;
-				double kval = K(x,y);
-				G(ii, jj) = kval;
-			}
-		}
-    }
-}
-	
-void Kernel::calcKernelVector ( const VVector & vecSet, const NICE::Vector & y, NICE::Vector & kstar ) const
-{
-	kstar.resize(vecSet.size());
-	int ii = 0;
-	for ( VVector::const_iterator i  = vecSet.begin();
-						   i != vecSet.end();
-						   i++, ii++ )
-	{
-			const NICE::Vector & x = *i;
-			double kval = K(x, y);
-			kstar[ii] = kval;
-	}
-}

+ 0 - 43
math/distances/Kernel.h

@@ -1,43 +0,0 @@
-/** 
-* @file Kernel.h
-* @brief Interface for Mercer Kernels
-* @author Erik Rodner
-* @date 10/24/2007
-
-*/
-#ifndef KERNELINCLUDE
-#define KERNELINCLUDE
-
-#include "core/vector/VectorT.h"
-#include "core/vector/MatrixT.h"
-
-#include "core/vector/VVector.h"
-  
-/** Interface for Mercer Kernels */
-
-namespace OBJREC {
-
-class Kernel
-{
-    protected:
-	bool symmetric;
-
-    public:
-  
-	/** simple constructor */
-	Kernel( bool symmetric );
-      
-	/** simple destructor */
-	virtual ~Kernel();
-
-	virtual double K (const NICE::Vector & x, const NICE::Vector & y) const = 0;
-
-	void calcGramMatrix ( const NICE::VVector & vecSet, NICE::Matrix & G ) const;
-	void calcKernelVector ( const NICE::VVector & vecSet, const NICE::Vector & y, NICE::Vector & kstar ) const;
-     
-};
-
-
-} // namespace
-
-#endif

+ 0 - 37
math/distances/KernelExp.cpp

@@ -1,37 +0,0 @@
-/** 
-* @file KernelExp.cpp
-* @brief Interface for the popular exponential mercer kernels
-* @author Erik Rodner
-* @date 10/24/2007
-
-*/
-#include <iostream>
-
-#include <math.h>
-#include "vislearning/math/distances/KernelExp.h"
-
-using namespace OBJREC;
-
-using namespace std;
-// refactor-nice.pl: check this substitution
-// old: using namespace ice;
-using namespace NICE;
-
-
-
-KernelExp::KernelExp( NICE::VectorDistance<double> *_kInside, double _a ) : Kernel( true )
-{
-    kInside = _kInside;
-    a = _a;
-}
-
-KernelExp::~KernelExp()
-{
-	delete kInside;
-}
-
-	
-double KernelExp::K (const NICE::Vector & x, const NICE::Vector & y) const
-{
-    return exp( - kInside->calculate (x,y) / a );
-}

+ 0 - 45
math/distances/KernelExp.h

@@ -1,45 +0,0 @@
-/** 
-* @file KernelExp.h
-* @brief Interface for the popular exponential mercer kernels
-* @author Erik Rodner
-* @date 10/24/2007
-
-*/
-#ifndef KERNELEXPINCLUDE
-#define KERNELEXPINCLUDE
-
-#include "core/vector/VectorT.h"
-#include "core/vector/MatrixT.h"
-
-#include "Kernel.h"
-
-#include <core/vector/Distance.h>
-
-/** Interface for the popular exponential mercer kernels */
-
-namespace OBJREC {
-
-class KernelExp : public Kernel
-{
-
-    protected:
-	NICE::VectorDistance<double> *kInside;
-	double a;
-
-    public:
-  
-	/** simple constructor */
-	KernelExp( NICE::VectorDistance<double> *_kInside, double _a );
-      
-	/** simple destructor */
-	virtual ~KernelExp();
-     
-	// refactor-nice.pl: check this substitution
-	// old: double K (const Vector & x, const Vector & y) const;
-	double K (const NICE::Vector & x, const NICE::Vector & y) const;
-};
-
-
-} // namespace
-
-#endif

+ 1 - 1
math/distances/KernelStd.h

@@ -11,7 +11,7 @@
 #include "core/vector/VectorT.h"
 #include "core/vector/MatrixT.h"
   
-#include "Kernel.h"
+#include "vislearning/math/kernels/Kernel.h"
 
 /** Standard kernel */