Commits

Ruben Martinez-Cantin committed ebcc6b9

Cleanning windows mess

Comments (0)

Files changed (7)

 *.log
 *.out
 *.so
-*~
-#*#
+*~
   ./src/gauss_distribution.cpp
   ./src/student_t_distribution.cpp
   )
+
 SET(UTILS_SRC
   ./utils/parser.cpp
   )
 
 LINK_DIRECTORIES( ${CMAKE_SOURCE_DIR}/lib )
 
-IF(BUILD_NLOPT)
-  ADD_SUBDIRECTORY(nlopt)
-  include_directories(${CMAKE_SOURCE_DIR}/nlopt/api)
-ENDIF(BUILD_NLOPT)
+# IF(BUILD_NLOPT)
+#   ADD_SUBDIRECTORY(nlopt)
+#   include_directories(${CMAKE_SOURCE_DIR}/nlopt/api)
+# ENDIF(BUILD_NLOPT)
 
 IF(BUILD_SHARED_LIBS)
-	ADD_LIBRARY(bayesopt SHARED ${BAYESOPT_SRCS}   
-	${WRAPPPERS_SRC} ${UTILS_SRC} ${PYTHON_SRC} )
-	IF(WIN32)
-		#SET_TARGET_PROPERTIES(bayesopt PROPERTIES DEFINE_SYMBOL "COMPILE_DLL")
-		# In new versions of CMAKE they use a different system and the symbol is not defined
-		#SET_TARGET_PROPERTIES(bayesopt PROPERTIES DEFINE_SYMBOL "bayesopt_EXPORT")
-		ADD_DEFINITIONS(-DCOMPILE_DLL)	
-		ADD_DEFINITIONS(-Dbayesopt_EXPORT )
-	ELSE()
-		SET_TARGET_PROPERTIES(bayesopt PROPERTIES PREFIX "" SUFFIX ".so")
-	ENDIF()
+  ADD_LIBRARY(bayesopt SHARED ${BAYESOPT_SRCS}   
+    ${WRAPPPERS_SRC} ${UTILS_SRC} ${PYTHON_SRC} )
+  IF(WIN32)
+    ADD_DEFINITIONS(-DBAYESOPT_DLL)	
+    # In new versions of CMAKE they use a different system and the
+    # symbol is not defined
+    ADD_DEFINITIONS(-Dbayesopt_EXPORT )
+  ELSE()
+    SET_TARGET_PROPERTIES(bayesopt PROPERTIES PREFIX "" SUFFIX ".so")
+  ENDIF()
 ELSE()
-	ADD_LIBRARY(bayesopt STATIC ${BAYESOPT_SRCS}   
-	${WRAPPPERS_SRC} ${UTILS_SRC} ${PYTHON_SRC} )
+  ADD_LIBRARY(bayesopt STATIC ${BAYESOPT_SRCS}   
+    ${WRAPPPERS_SRC} ${UTILS_SRC} ${PYTHON_SRC} )
 ENDIF()
 
 IF((BUILD_SHARED_LIBS OR MATLAB_COMPATIBLE) AND NOT WIN32)
-	SET_TARGET_PROPERTIES(bayesopt PROPERTIES COMPILE_FLAGS "-fPIC")
+  SET_TARGET_PROPERTIES(bayesopt PROPERTIES COMPILE_FLAGS "-fPIC")
 ENDIF()
   
 
 IF(BUILD_NLOPT)
+  ADD_SUBDIRECTORY(nlopt)
+  include_directories(${CMAKE_SOURCE_DIR}/nlopt/api)
   add_dependencies(bayesopt nlopt)
   SET(EXT_LIBS nlopt)
 ELSE(BUILD_NLOPT)
 #ADD_EXECUTABLE(parsetest ./utils/parser.cpp ./app/testparser.cpp)
 
 
-INSTALL(FILES ./include/bayesoptcont.hpp 
-              ./include/bayesoptdisc.hpp 
-	      ./wrappers/bayesoptwpr.h 
-	DESTINATION include)
+INSTALL(FILES 
+  ./include/bayesoptcont.hpp 
+  ./include/bayesoptdisc.hpp 
+  ./wrappers/bayesoptwpr.h 
+  DESTINATION include
+)
 
 INSTALL(
   TARGETS bayesopt
   matrixd xPoints(nPoints,n);
   vecOfvec xP;
 
-  const size_t nPinArr = n*nPoints;
   //Thanks to the quirks of Visual Studio, the following expression is invalid,
   //so we have to replace it by a literal.
   //WARNING: Make sure to update the size of the array if the number of points
   //or dimensions change.
-  //double xPointsArray[nPinArr];
+#ifdef _MSC_VER
   double xPointsArray[6000];
-
+#else
+  const size_t nPinArr = n*nPoints;
+  double xPointsArray[nPinArr];
+#endif
+  
   bayesopt::utils::lhs(xPoints,mtRandom);
 
   for(size_t i = 0; i<nPoints; ++i)

include/dll_stuff.h

 #define  _DLL_STUFF_HPP_
 
 /* WINDOWS DLLs stuff */
-#if defined (_WIN32) && defined (COMPILE_DLL)
+#if defined (_WIN32) && defined (BAYESOPT_DLL)
   #if defined(bayesopt_EXPORTS)
     #define  BAYESOPT_API __declspec(dllexport)
   #else

include/kernel_atomic.hpp

 		    size_t component)
     {
       assert(false);
-	  return 0.0;
-	};
+      return 0.0;
+    };
   };
 
   /** \brief Linear kernel. */
 		    size_t component)
     {
       assert(false); //TODO: 
-	  return 0.0;
+      return 0.0;
     };
   };
 

include/nonparametricprocess.hpp

      * Computes the negative score of the data using cross correlation.
      * @return negative score
      */
-    double negativeCrossCorrelation();
+    double negativeCrossValidation();
 
     /** 
      * \brief Computes the negative log prior of the hyperparameters.

src/nonparametricprocess.cpp

 
 
 
-  double NonParametricProcess::negativeCrossCorrelation()
+  double NonParametricProcess::negativeCrossValidation()
   {
     // This is highly ineffient implementation for comparison purposes.
     size_t n = mGPXX.size();
 	result = negativeLogLikelihood()+negativeLogPrior();
 	break;
       case L_LOO:
-	result = negativeCrossCorrelation(); break;
+	result = negativeCrossValidation(); break;
       default:
 	FILE_LOG(logERROR) << "Learning type not supported";
       }