Jelajahi Sumber

Merge branch 'mex-support' of dbv.inf-cv.uni-jena.de:nice/nice-vislearning into ercdevbranch

Johannes Ruehle 11 tahun lalu
induk
melakukan
e8a7c158c1

+ 2 - 0
CMakeLists.txt

@@ -18,6 +18,8 @@ nice_build_library()
 
 nice_add_progs()
 
+nice_add_mexes()
+
 nice_add_unittests()
 
 #####

+ 2 - 0
features/simplefeatures/matlab/CodebookRandomForestMex.cpp

@@ -1,3 +1,4 @@
+#ifdef NICE_USELIB_MEX
 /** 
 * @file GPHIKRegressionMex.cpp
 * @author Alexander Freytag
@@ -441,3 +442,4 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
     mexErrMsgTxt( errorMsg.c_str() );
 
 }
+#endif

+ 2 - 0
features/simplefeatures/matlab/testHelperDataConversionMex.cpp

@@ -1,3 +1,4 @@
+#ifdef NICE_USELIB_MEX
 /** 
 * @file GPHIKClassifierMex.cpp
 * @author Alexander Freytag
@@ -99,3 +100,4 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
     mexErrMsgTxt( errorMsg.c_str() );
 
 }
+#endif

+ 0 - 5
list_exclude_from_build.cmake

@@ -1,5 +0,0 @@
-SET(list_exclude_from_build_SRC
-features/simplefeatures/matlab/CodebookRandomForestMex.cpp
-features/simplefeatures/matlab/testHelperDataConversionMex.cpp
-)
-

+ 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 */