Bläddra i källkod

Merge branch 'master' of dbv.inf-cv.uni-jena.de:nice/nice-vislearning

Johannes Ruehle 11 år sedan
förälder
incheckning
04f4d7163d
36 ändrade filer med 160 tillägg och 38 borttagningar
  1. 4 0
      baselib/progs/scaleKernelMatrix.cpp
  2. 5 0
      baselib/progs/testProgressBar.cpp
  3. 5 0
      cbaselib/ClassNames.cpp
  4. 8 0
      cbaselib/ClassNames.h
  5. 29 0
      cbaselib/Example.cpp
  6. 1 0
      cbaselib/Example.h
  7. 4 0
      cbaselib/progs/calcCurves.cpp
  8. 4 0
      cbaselib/progs/createNormTrainingSet.cpp
  9. 4 0
      cbaselib/progs/splitLabeledSetVector.cpp
  10. 4 0
      cbaselib/progs/statisticsTrainingSet.cpp
  11. 5 0
      cbaselib/progs/testCachedExample.cpp
  12. 4 0
      cbaselib/progs/testLabeledSet.cpp
  13. 1 1
      classifier/fpclassifier/logisticregression/libdepend.inc
  14. 1 1
      classifier/fpclassifier/randomforest/libdepend.inc
  15. 7 7
      classifier/kernelclassifier/LaplaceApproximation.cpp
  16. 2 2
      classifier/kernelclassifier/libdepend.inc
  17. 2 2
      classifier/libdepend.inc
  18. 5 0
      classifier/progs/toyExampleUnsupervisedGP.cpp
  19. 2 2
      classifier/vclassifier/libdepend.inc
  20. 5 1
      featureLearning/progs/testFeatureLearning.cpp
  21. 2 2
      features/localfeatures/libdepend.inc
  22. 5 1
      features/localfeatures/progs/computeLocalFeatures.cpp
  23. 2 2
      features/localfeatures/progs/sift-driver.cpp
  24. 3 3
      features/regionfeatures/libdepend.inc
  25. 2 1
      features/simplefeatures/libdepend.inc
  26. 2 0
      features/simplefeatures/matlab/libdepend.inc
  27. 2 0
      features/simplefeatures/progs/libdepend.inc
  28. 11 0
      features/simplefeatures/progs/progCodebookRandomForest.cpp
  29. 3 3
      math/cluster/libdepend.inc
  30. 5 0
      math/cluster/progs/testKMeans.cpp
  31. 5 0
      math/pdf/PDFGaussian.h
  32. 1 1
      mrf/mrfmin/libdepend.inc
  33. 4 0
      optimization/mapestimation/progs/testDirichlet.cpp
  34. 4 0
      regression/gpregression/progs/testKernelOptimization.cpp
  35. 6 7
      regression/npregression/RegKNN.cpp
  36. 1 2
      regression/splineregression/CRSplineReg.cpp

+ 4 - 0
baselib/progs/scaleKernelMatrix.cpp

@@ -19,7 +19,11 @@ using namespace NICE;
 */
 */
 int main (int argc, char **argv)
 int main (int argc, char **argv)
 {   
 {   
+#ifndef __clang__
+#ifndef __llvm__
     std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
     std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
+#endif
+#endif
 
 
     Config conf ( argc, argv );
     Config conf ( argc, argv );
     
     

+ 5 - 0
baselib/progs/testProgressBar.cpp

@@ -34,7 +34,12 @@ using namespace std;
 
 
 int main(int argc, char **argv)
 int main(int argc, char **argv)
 {
 {
+#ifndef __clang__
+#ifndef __llvm__
 	std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
 	std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
+#endif
+#endif
+
 	Config mainconf(argc, argv);
 	Config mainconf(argc, argv);
 
 
 	OBJREC::ProgressBar P;
 	OBJREC::ProgressBar P;

+ 5 - 0
cbaselib/ClassNames.cpp

@@ -395,7 +395,12 @@ void ClassNames::getClassnoFromColor ( int & classno, int r, int g, int b ) cons
   boost::unordered_map<long, int>::const_iterator i = tbl_color_classno.find ( color );
   boost::unordered_map<long, int>::const_iterator i = tbl_color_classno.find ( color );
 #else
 #else
 //  __gnu_cxx::hash_map<long, int>::const_iterator i = tbl_color_classno.find ( color );
 //  __gnu_cxx::hash_map<long, int>::const_iterator i = tbl_color_classno.find ( color );
+#ifdef __clang__
+  std::unordered_map<long, int>::const_iterator i = tbl_color_classno.find(color);
+#else
   std::tr1::unordered_map<long, int>::const_iterator i = tbl_color_classno.find ( color );  
   std::tr1::unordered_map<long, int>::const_iterator i = tbl_color_classno.find ( color );  
+#endif
+
 #endif
 #endif
 
 
   if ( i == tbl_color_classno.end() )
   if ( i == tbl_color_classno.end() )

+ 8 - 0
cbaselib/ClassNames.h

@@ -23,8 +23,12 @@
 #endif
 #endif
 #else
 #else
 //#include <ext/hash_map>
 //#include <ext/hash_map>
+#ifdef __clang__
+#include <unordered_map>
+#else
 #include <tr1/unordered_map>
 #include <tr1/unordered_map>
 #endif
 #endif
+#endif
 
 
 #include "core/basics/Config.h"
 #include "core/basics/Config.h"
 #include "core/basics/Persistent.h"
 #include "core/basics/Persistent.h"
@@ -46,7 +50,11 @@ class ClassNames : public NICE::Persistent
     boost::unordered_map<long, int> tbl_color_classno;
     boost::unordered_map<long, int> tbl_color_classno;
 #else
 #else
 //	__gnu_cxx::hash_map<long, int> tbl_color_classno;
 //	__gnu_cxx::hash_map<long, int> tbl_color_classno;
+#ifdef __clang__
+    std::unordered_map<long, int> tbl_color_classno;
+#else
     std::tr1::unordered_map<long, int> tbl_color_classno;
     std::tr1::unordered_map<long, int> tbl_color_classno;
+#endif
 #endif
 #endif
     std::map<int, long> tbl_classno_color;
     std::map<int, long> tbl_classno_color;
 
 

+ 29 - 0
cbaselib/Example.cpp

@@ -1,5 +1,9 @@
 #include "Example.h"
 #include "Example.h"
 
 
+#ifdef NICE_USELIB_OPENMP
+#include <omp.h>
+#endif
+
 using namespace OBJREC;
 using namespace OBJREC;
 using namespace std;
 using namespace std;
 using namespace NICE;
 using namespace NICE;
@@ -216,3 +220,28 @@ bool Examples::wrapExamplesAroundFeatureMatrix(const Matrix &p_MatFeaturesColumW
 
 
     return true;
     return true;
 }
 }
+
+bool Examples::wrapExamplesAroundFeatureMatrix(const Matrix &p_MatFeaturesColumWiseSamples, const VectorT<int> &p_VecLabels, Examples &p_Examples)
+{
+    size_t t_iNumSamples  = p_MatFeaturesColumWiseSamples.cols();
+    size_t t_iNumFeatures = p_MatFeaturesColumWiseSamples.rows();
+
+    if(p_VecLabels.size() != t_iNumSamples) // for every columnwise sample there need to be a label
+        return false;
+    p_Examples.resize( t_iNumSamples );
+    const double *pDataPtr = p_MatFeaturesColumWiseSamples.getDataPointer();
+    
+#ifdef NICE_USELIB_OPENMP
+#pragma omp parallel for default(none) shared(p_VecLabels, p_Examples, t_iNumFeatures, t_iNumSamples, pDataPtr)
+#endif
+    for (size_t i = 0; i < t_iNumSamples; i++)
+    {
+	const double *pDataIteration = pDataPtr + (i * t_iNumFeatures);
+        NICE::Vector *t_pVecTrainData = new NICE::Vector( (double*) pDataIteration , t_iNumFeatures, VectorBase::external);
+        // OBJREC::Example t_Example(t_pVecTrainData, t_fWeight);
+
+	p_Examples[i] = std::pair<int, OBJREC::Example>( p_VecLabels[i], OBJREC::Example(t_pVecTrainData, 1.0) ) ;
+    }
+
+    return true;
+}

+ 1 - 0
cbaselib/Example.h

@@ -151,6 +151,7 @@ class Examples : public std::vector< std::pair<int, Example> >
      * @author Johannes Ruehle
      * @author Johannes Ruehle
      */
      */
     static bool wrapExamplesAroundFeatureMatrix(const NICE::Matrix &p_MatFeaturesColumWiseSamples, const NICE::Vector &p_VecLabels, Examples &p_Examples);
     static bool wrapExamplesAroundFeatureMatrix(const NICE::Matrix &p_MatFeaturesColumWiseSamples, const NICE::Vector &p_VecLabels, Examples &p_Examples);
+    static bool wrapExamplesAroundFeatureMatrix(const NICE::Matrix &p_MatFeaturesColumWiseSamples, const NICE::VectorT<int> &p_VecLabels, Examples &p_Examples);
 };
 };
 
 
 
 

+ 4 - 0
cbaselib/progs/calcCurves.cpp

@@ -49,7 +49,11 @@ void readResults ( const string & resultsfn, vector<pair<double, int> > & result
 */
 */
 int main (int argc, char **argv)
 int main (int argc, char **argv)
 {   
 {   
+#ifndef __clang__
+#ifndef __llvm__
     std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
     std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
+#endif
+#endif
 
 
 	Config conf ( argc, argv );
 	Config conf ( argc, argv );
 
 

+ 4 - 0
cbaselib/progs/createNormTrainingSet.cpp

@@ -47,7 +47,11 @@ using namespace std;
 */
 */
 int main (int argc, char **argv)
 int main (int argc, char **argv)
 {   
 {   
+#ifndef __clang__
+#ifndef __llvm__
     std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
     std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
+#endif
+#endif
 
 
     char configfile [300];
     char configfile [300];
     char objectclass_c [1024];
     char objectclass_c [1024];

+ 4 - 0
cbaselib/progs/splitLabeledSetVector.cpp

@@ -88,7 +88,11 @@ void normalizeLabeledSetVector(const LabeledSetVector &teachSet,
  */
  */
 int main(int argc, char **argv)
 int main(int argc, char **argv)
 {
 {
+#ifndef __clang__
+#ifndef __llvm__
 	std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
 	std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
+#endif
+#endif
 
 
 	Config conf(argc, argv);
 	Config conf(argc, argv);
 
 

+ 4 - 0
cbaselib/progs/statisticsTrainingSet.cpp

@@ -42,7 +42,11 @@ using namespace std;
 */
 */
 int main (int argc, char **argv)
 int main (int argc, char **argv)
 {   
 {   
+#ifndef __clang__
+#ifndef __llvm__
     std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
     std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
+#endif
+#endif
 
 
     char configfile [300];
     char configfile [300];
     char objectclass_c [1024];
     char objectclass_c [1024];

+ 5 - 0
cbaselib/progs/testCachedExample.cpp

@@ -20,7 +20,12 @@ using namespace std;
 
 
 int main ( int argc, char **argv )
 int main ( int argc, char **argv )
 {
 {
+#ifndef __clang__
+#ifndef __llvm__
   std::set_terminate ( __gnu_cxx::__verbose_terminate_handler );
   std::set_terminate ( __gnu_cxx::__verbose_terminate_handler );
+#endif
+#endif
+
 
 
   char configfile [300];
   char configfile [300];
 
 

+ 4 - 0
cbaselib/progs/testLabeledSet.cpp

@@ -26,7 +26,11 @@ using namespace std;
 */
 */
 int main ( int argc, char **argv )
 int main ( int argc, char **argv )
 {
 {
+#ifndef __clang__
+#ifndef __llvm__
   std::set_terminate ( __gnu_cxx::__verbose_terminate_handler );
   std::set_terminate ( __gnu_cxx::__verbose_terminate_handler );
+#endif
+#endif
 
 
   char configfile [300];
   char configfile [300];
 
 

+ 1 - 1
classifier/fpclassifier/logisticregression/libdepend.inc

@@ -1,4 +1,4 @@
-$(call PKG_DEPEND_EXT,OPENMP)
+# $(call PKG_DEPEND_EXT,OPENMP)
 $(call PKG_DEPEND_INT,vislearning/classifier/classifierbase)
 $(call PKG_DEPEND_INT,vislearning/classifier/classifierbase)
 $(call PKG_DEPEND_INT,vislearning/features/fpfeatures)
 $(call PKG_DEPEND_INT,vislearning/features/fpfeatures)
 $(call PKG_DEPEND_INT,vislearning/optimization/mapestimation)
 $(call PKG_DEPEND_INT,vislearning/optimization/mapestimation)

+ 1 - 1
classifier/fpclassifier/randomforest/libdepend.inc

@@ -1,4 +1,4 @@
-$(call PKG_DEPEND_EXT,OPENMP)
+# $(call PKG_DEPEND_EXT,OPENMP)
 $(call PKG_DEPEND_INT,vislearning/classifier/classifierbase)
 $(call PKG_DEPEND_INT,vislearning/classifier/classifierbase)
 $(call PKG_DEPEND_INT,vislearning/features/fpfeatures)
 $(call PKG_DEPEND_INT,vislearning/features/fpfeatures)
 $(call PKG_DEPEND_INT,vislearning/optimization/mapestimation)
 $(call PKG_DEPEND_INT,vislearning/optimization/mapestimation)

+ 7 - 7
classifier/kernelclassifier/LaplaceApproximation.cpp

@@ -6,12 +6,12 @@
 
 
 */
 */
 #include <iostream>
 #include <iostream>
+#include <cmath>
 
 
 #include "core/vector/Algorithms.h"
 #include "core/vector/Algorithms.h"
 #include "LaplaceApproximation.h"
 #include "LaplaceApproximation.h"
 #include "LHCumulativeGauss.h"
 #include "LHCumulativeGauss.h"
 
 
-using namespace std;
 using namespace NICE;
 using namespace NICE;
 using namespace OBJREC;
 using namespace OBJREC;
 
 
@@ -24,7 +24,7 @@ LaplaceApproximation::LaplaceApproximation()
 	verbose = false;
 	verbose = false;
 }
 }
 
 
-LaplaceApproximation::LaplaceApproximation( const Config *conf, const string & section )
+LaplaceApproximation::LaplaceApproximation( const Config *conf, const std::string & section )
 {
 {
 	maxiterations = conf->gI(section, "laplace_max_iterations", 40 );
 	maxiterations = conf->gI(section, "laplace_max_iterations", 40 );
 	minimumDelta = conf->gD(section, "laplace_minimum_delta", 1e-14 );
 	minimumDelta = conf->gD(section, "laplace_minimum_delta", 1e-14 );
@@ -110,7 +110,7 @@ void LaplaceApproximation::approximate ( KernelData *kernelData, const Vector &
 
 
 		// gradient of the objective function is gradientL - a
 		// gradient of the objective function is gradientL - a
 		if ( verbose )
 		if ( verbose )
-			cerr << "findModeLaplace: gradient norm = " << (gradientL - a).normL2() << endl;
+			std::cerr << "findModeLaplace: gradient norm = " << (gradientL - a).normL2() << std::endl;
 
 
 		mode = kernelMatrix * a;
 		mode = kernelMatrix * a;
 	
 	
@@ -126,8 +126,8 @@ void LaplaceApproximation::approximate ( KernelData *kernelData, const Vector &
 		{
 		{
 			if ( verbose ) 
 			if ( verbose ) 
 			{
 			{
-				cerr << "findModeLaplace: log likelihood is positive infinity...we cannot optimize any more in this case." << endl;
-				cerr << "findModeLaplace: mode = " << mode << endl;
+				std::cerr << "findModeLaplace: log likelihood is positive infinity...we cannot optimize any more in this case." << std::endl;
+				std::cerr << "findModeLaplace: mode = " << mode << std::endl;
 			}
 			}
 			break;
 			break;
 		}
 		}
@@ -145,11 +145,11 @@ void LaplaceApproximation::approximate ( KernelData *kernelData, const Vector &
 		objective += loglikelihood;
 		objective += loglikelihood;
 
 
 		if ( verbose ) 
 		if ( verbose ) 
-			cerr << "findModeLaplace: objective = " << objective << endl;
+			std::cerr << "findModeLaplace: objective = " << objective << std::endl;
 
 
 		double delta = fabs(oldobjective-objective)/(fabs(objective)+1);
 		double delta = fabs(oldobjective-objective)/(fabs(objective)+1);
 		if ( verbose )
 		if ( verbose )
-			cerr << "findModeLaplace: delta = " << delta << endl;
+			std::cerr << "findModeLaplace: delta = " << delta << std::endl;
 		if ( delta < minimumDelta ) {
 		if ( delta < minimumDelta ) {
 			break;
 			break;
 		}
 		}

+ 2 - 2
classifier/kernelclassifier/libdepend.inc

@@ -1,5 +1,5 @@
-$(call PKG_DEPEND_EXT,SVMLIGHT)
-$(call PKG_DEPEND_EXT,OPENMP)
+# $(call PKG_DEPEND_EXT,SVMLIGHT)
+# $(call PKG_DEPEND_EXT,OPENMP)
 $(call PKG_DEPEND_INT,core/optimization)
 $(call PKG_DEPEND_INT,core/optimization)
 $(call PKG_DEPEND_INT,vislearning/cbaselib)
 $(call PKG_DEPEND_INT,vislearning/cbaselib)
 $(call PKG_DEPEND_INT,vislearning/classifier/classifierbase)
 $(call PKG_DEPEND_INT,vislearning/classifier/classifierbase)

+ 2 - 2
classifier/libdepend.inc

@@ -1,5 +1,5 @@
 # we need both statements
 # we need both statements
 # (1) set the flag (see Makefile.config)
 # (1) set the flag (see Makefile.config)
-$(call PKG_DEPEND_EXT,NICEDTSVM)
+# $(call PKG_DEPEND_EXT,NICEDTSVM)
 # (2) build in a dependent manner
 # (2) build in a dependent manner
-$(call PKG_DEPEND_INT,nice-dtsvm)
+# $(call PKG_DEPEND_INT,nice-dtsvm)

+ 5 - 0
classifier/progs/toyExampleUnsupervisedGP.cpp

@@ -83,7 +83,12 @@ void markBoundary ( const NICE::Image & imgclassno, NICE::Image & mark )
 */
 */
 int main (int argc, char **argv)
 int main (int argc, char **argv)
 {   
 {   
+#ifndef __clang__
+#ifndef __llvm__
     std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
     std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
+#endif
+#endif
+
 
 
     Config conf ( argc, argv );
     Config conf ( argc, argv );
     conf.store(cout);
     conf.store(cout);

+ 2 - 2
classifier/vclassifier/libdepend.inc

@@ -1,4 +1,4 @@
-$(call PKG_DEPEND_EXT,ICE)
-$(call PKG_DEPEND_EXT,SVMLIGHT)
+# $(call PKG_DEPEND_EXT,ICE)
+# $(call PKG_DEPEND_EXT,SVMLIGHT)
 $(call PKG_DEPEND_INT,vislearning/cbaselib)
 $(call PKG_DEPEND_INT,vislearning/cbaselib)
 $(call PKG_DEPEND_INT,vislearning/classifier/classifierbase)
 $(call PKG_DEPEND_INT,vislearning/classifier/classifierbase)

+ 5 - 1
featureLearning/progs/testFeatureLearning.cpp

@@ -38,7 +38,11 @@ using namespace OBJREC;
 */
 */
 int main( int argc, char **argv )
 int main( int argc, char **argv )
 {
 {
+#ifndef __clang__
+#ifndef __llvm__
   std::set_terminate( __gnu_cxx::__verbose_terminate_handler );
   std::set_terminate( __gnu_cxx::__verbose_terminate_handler );
+#endif
+#endif
 
 
   Config * conf = new Config ( argc, argv );
   Config * conf = new Config ( argc, argv );
   
   
@@ -343,4 +347,4 @@ int main( int argc, char **argv )
     delete conf;
     delete conf;
   
   
    return 0;
    return 0;
-}
+}

+ 2 - 2
features/localfeatures/libdepend.inc

@@ -1,5 +1,5 @@
-$(call PKG_DEPEND_EXT,CUDASIFT)
-$(call PKG_DEPEND_EXT,OPENMP)
+# $(call PKG_DEPEND_EXT,CUDASIFT)
+# $(call PKG_DEPEND_EXT,OPENMP)
 $(call PKG_DEPEND_INT,core)
 $(call PKG_DEPEND_INT,core)
 $(call PKG_DEPEND_INT,vislearning/baselib)
 $(call PKG_DEPEND_INT,vislearning/baselib)
 $(call PKG_DEPEND_INT,vislearning/image)
 $(call PKG_DEPEND_INT,vislearning/image)

+ 5 - 1
features/localfeatures/progs/computeLocalFeatures.cpp

@@ -38,7 +38,11 @@ using namespace OBJREC;
 */
 */
 int main( int argc, char **argv )
 int main( int argc, char **argv )
 {
 {
+#ifndef __clang__
+#ifndef __llvm__
   std::set_terminate( __gnu_cxx::__verbose_terminate_handler );
   std::set_terminate( __gnu_cxx::__verbose_terminate_handler );
+#endif
+#endif
 
 
   NICE::Config * conf = new NICE::Config ( argc, argv );
   NICE::Config * conf = new NICE::Config ( argc, argv );
   
   
@@ -131,4 +135,4 @@ int main( int argc, char **argv )
 
 
   
   
    return 0;
    return 0;
-}
+}

+ 2 - 2
features/localfeatures/progs/sift-driver.cpp

@@ -18,7 +18,7 @@
 
 
 extern "C" {
 extern "C" {
 #include<getopt.h>
 #include<getopt.h>
-#if defined (VL_MAC)
+#if defined(__clang__) || defined(__llvm__)
 #include<libgen.h>
 #include<libgen.h>
 #else
 #else
 #include<string.h>
 #include<string.h>
@@ -438,7 +438,7 @@ main(int argc, char** argv)
 	// the basename
 	// the basename
 	if(outputFilenamePrefix.size() != 0) {
 	if(outputFilenamePrefix.size() != 0) {
 	  outputFilename = outputFilenamePrefix + 
 	  outputFilename = outputFilenamePrefix + 
-	    std::string(basename(outputFilename.c_str())) ;
+	    std::string(basename((char*)outputFilename.c_str())) ;
 	}
 	}
 	
 	
       // remove .pgm extension, add .key
       // remove .pgm extension, add .key

+ 3 - 3
features/regionfeatures/libdepend.inc

@@ -1,4 +1,4 @@
-$(call PKG_DEPEND_EXT,ICE)
-$(call PKG_DEPEND_EXT,OPENMP)
-$(call PKG_DEPEND_INT,vislearning/segmentation)
+# $(call PKG_DEPEND_EXT,ICE)
+# $(call PKG_DEPEND_EXT,OPENMP)
+$(call PKG_DEPEND_INT,segmentation)
 $(call PKG_DEPEND_INT,vislearning/features/fbase)
 $(call PKG_DEPEND_INT,vislearning/features/fbase)

+ 2 - 1
features/simplefeatures/libdepend.inc

@@ -1,5 +1,6 @@
 $(call PKG_DEPEND_INT,vislearning/optimization)
 $(call PKG_DEPEND_INT,vislearning/optimization)
-$(call PKG_DEPEND_INT,vislearning/fourier)
+# This does not exist..
+# $(call PKG_DEPEND_INT,vislearning/fourier)
 $(call PKG_DEPEND_INT,vislearning/features/localfeatures)
 $(call PKG_DEPEND_INT,vislearning/features/localfeatures)
 $(call FILE_DEPEND_EXT,FCGetFeature.o,ICE)
 $(call FILE_DEPEND_EXT,FCGetFeature.o,ICE)
 $(call FILE_DEPEND_EXT,FCGetFeature,ICE)
 $(call FILE_DEPEND_EXT,FCGetFeature,ICE)

+ 2 - 0
features/simplefeatures/matlab/libdepend.inc

@@ -0,0 +1,2 @@
+$(call PKG_DEPEND_EXT,MEX)
+

+ 2 - 0
features/simplefeatures/progs/libdepend.inc

@@ -0,0 +1,2 @@
+$(call PKG_DEPEND_EXT,MATIO)
+$(call PKG_DEPEND_EXT,HDF5)

+ 11 - 0
features/simplefeatures/progs/progCodebookRandomForest.cpp

@@ -19,6 +19,7 @@
 
 
 #include "vislearning/cbaselib/FeaturePool.h"
 #include "vislearning/cbaselib/FeaturePool.h"
 
 
+#ifdef NICE_USELIB_MATIO
 #include <core/matlabAccess/MatFileIO.h>
 #include <core/matlabAccess/MatFileIO.h>
 
 
 const bool verbose = false;
 const bool verbose = false;
@@ -317,9 +318,16 @@ bool generateHistogram( const structCommands &p_Command)
 }
 }
 
 
 
 
+#endif
 int main(int argc, char **argv)
 int main(int argc, char **argv)
 {
 {
+
+#ifdef NICE_USELIB_MATIO
+#ifndef __clang__
+#ifndef __llvm__
     std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
     std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
+#endif
+#endif
 
 
     structCommands sCommand;
     structCommands sCommand;
 
 
@@ -389,6 +397,9 @@ int main(int argc, char **argv)
     {
     {
         std::cerr << "exception occured: " << e.what() << std::endl;
         std::cerr << "exception occured: " << e.what() << std::endl;
     }
     }
+#else
+    return -1;
+#endif	
 
 
     return 0;
     return 0;
 }
 }

+ 3 - 3
math/cluster/libdepend.inc

@@ -1,3 +1,3 @@
-$(call PKG_DEPEND_EXT,OPENMP)
-$(call PKG_DEPEND_EXT,ICE)
-$(call PKG_DEPEND_INT,vislearning/math/mathbase)
+# $(call PKG_DEPEND_EXT,OPENMP)
+# $(call PKG_DEPEND_EXT,ICE)
+$(call PKG_DEPEND_INT,vislearning/math/mathbase)

+ 5 - 0
math/cluster/progs/testKMeans.cpp

@@ -30,7 +30,12 @@ using namespace OBJREC;
 
 
 int main(int argc, char **argv)
 int main(int argc, char **argv)
 {
 {
+#ifndef __clang__
+#ifndef __llvm__
 	std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
 	std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
+#endif
+#endif
+
 	NICE::Image panel(200, 200);
 	NICE::Image panel(200, 200);
 	NICE::Image overlay(panel.width(), panel.height());
 	NICE::Image overlay(panel.width(), panel.height());
 	panel.set(255);
 	panel.set(255);

+ 5 - 0
math/pdf/PDFGaussian.h

@@ -31,8 +31,13 @@ class PDFGaussian : public PDF
 	/** empty constructor */
 	/** empty constructor */
 	PDFGaussian ( int dimension );
 	PDFGaussian ( int dimension );
 
 
+#if __cplusplus >= 201103L
+	static constexpr double logdetEPS = 0.0;
+	static constexpr double regEPS = 1e-7;
+#else
 	static const double logdetEPS = 0.0;
 	static const double logdetEPS = 0.0;
 	static const double regEPS = 1e-7;
 	static const double regEPS = 1e-7;
+#endif
 	static NICE::Matrix RobustInverse ( const NICE::Matrix & M, double & logdet );
 	static NICE::Matrix RobustInverse ( const NICE::Matrix & M, double & logdet );
 
 
     public:
     public:

+ 1 - 1
mrf/mrfmin/libdepend.inc

@@ -1 +1 @@
-$(call PKG_DEPEND_EXT,ICE)
+# $(call PKG_DEPEND_EXT,ICE)

+ 4 - 0
optimization/mapestimation/progs/testDirichlet.cpp

@@ -139,7 +139,11 @@ void simulation ( int samplesCount )
 
 
 int main (int argc, char **argv)
 int main (int argc, char **argv)
 {   
 {   
+#ifndef __clang__
+#ifndef __llvm__
     std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
     std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
+#endif
+#endif
 
 
     char configfile [300];
     char configfile [300];
 
 

+ 4 - 0
regression/gpregression/progs/testKernelOptimization.cpp

@@ -110,7 +110,11 @@ void testKernelDeriv ( KernelData *kernelData, ParameterizedKernel & kernelFunct
 */
 */
 int main (int argc, char **argv)
 int main (int argc, char **argv)
 {   
 {   
+#ifndef __clang__
+#ifndef __llvm__
     std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
     std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
+#endif
+#endif
 
 
     Config conf ( argc, argv );
     Config conf ( argc, argv );
     
     

+ 6 - 7
regression/npregression/RegKNN.cpp

@@ -18,7 +18,6 @@
 
 
 using namespace OBJREC;
 using namespace OBJREC;
 
 
-using namespace std;
 using namespace NICE;
 using namespace NICE;
 
 
 
 
@@ -67,7 +66,7 @@ void RegKNN::teach ( const NICE::Vector & x, const double & y )
     if ( isnan(x[i]) ) 
     if ( isnan(x[i]) ) 
     {
     {
         fprintf (stderr, "There is a NAN value within this vector: x[%d] = %f\n", (int)i, x[i]);
         fprintf (stderr, "There is a NAN value within this vector: x[%d] = %f\n", (int)i, x[i]);
-        cerr << x << endl;
+        std::cerr << x << std::endl;
         exit(-1);
         exit(-1);
     }
     }
 
 
@@ -96,8 +95,8 @@ double RegKNN::predict ( const NICE::Vector & x )
     if ( isnan(distance) )
     if ( isnan(distance) )
     {
     {
       fprintf (stderr, "RegKNN::predict: NAN value found !!\n");
       fprintf (stderr, "RegKNN::predict: NAN value found !!\n");
-      cerr << x << endl;
-      cerr << dataSet[i] << endl;
+      std::cerr << x << std::endl;
+      std::cerr << dataSet[i] << std::endl;
     }
     }
 // #pragma omp critical      
 // #pragma omp critical      
     distances[i] = distance;     
     distances[i] = distance;     
@@ -110,13 +109,13 @@ double RegKNN::predict ( const NICE::Vector & x )
     
     
   if ( dataSet.size() < K )
   if ( dataSet.size() < K )
   {
   {
-    cerr << K << endl;
+    std::cerr << K << std::endl;
     K = dataSet.size();
     K = dataSet.size();
-    cerr<<"RegKNN: Not enough datapoints! Setting K to: "<< K <<endl;
+    std::cerr<<"RegKNN: Not enough datapoints! Setting K to: "<< K << std::endl;
   }
   }
 
 
   if ( distances[ind[0]] == 0.0 ) {
   if ( distances[ind[0]] == 0.0 ) {
-    cerr<<"RegKNN: Warning: datapoint was already seen during training... using its label as prediction."<<endl;
+    std::cerr<<"RegKNN: Warning: datapoint was already seen during training... using its label as prediction."<< std::endl;
     return labelSet[ind[0]];  
     return labelSet[ind[0]];  
   }
   }
 
 

+ 1 - 2
regression/splineregression/CRSplineReg.cpp

@@ -18,7 +18,6 @@
 
 
 using namespace OBJREC;
 using namespace OBJREC;
 
 
-using namespace std;
 using namespace NICE;
 using namespace NICE;
 
 
 CRSplineReg::CRSplineReg (  const NICE::Config *_conf )
 CRSplineReg::CRSplineReg (  const NICE::Config *_conf )
@@ -69,7 +68,7 @@ void CRSplineReg::teach ( const NICE::Vector & x, const double & y )
       if ( isnan(x[i]) ) 
       if ( isnan(x[i]) ) 
       {
       {
           fprintf (stderr, "There is a NAN value in within this vector: x[%d] = %f\n", (int)i, x[i]);
           fprintf (stderr, "There is a NAN value in within this vector: x[%d] = %f\n", (int)i, x[i]);
-          cerr << x << endl;
+          std::cerr << x << std::endl;
           exit(-1);
           exit(-1);
       }
       }