Skip to content

Commit

Permalink
minor maintainance
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoern-andres committed Feb 9, 2015
1 parent 1c3c608 commit 466e87c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CMakeLists.txt.user

14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ else()
message("doxygen not found")
endif()

##############################################################################
# C++11 support
##############################################################################
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Some functionality will not be available.")
endif()

##############################################################################
# MSVC-specific settings
##############################################################################
Expand Down
1 change: 1 addition & 0 deletions include/andres/marray.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
#define MARRAY_HXX

#include <cassert>
#include <cstddef>
#include <stdexcept> // runtime_error
#include <limits>
#include <string>
Expand Down
3 changes: 2 additions & 1 deletion include/andres/ml/decision-trees.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,8 @@ DecisionForest<FEATURE, LABEL, PROBABILITY>::learn(
const size_t numberOfDecisionTrees
) {
typedef std::default_random_engine RandomEngine;
learn<RandomEngine>(features, labels, numberOfDecisionTrees, RandomEngine());
RandomEngine randomEngine;
learn<RandomEngine>(features, labels, numberOfDecisionTrees, randomEngine);
}

/// Learns a decision forest from labeled samples as described by Breiman (2001).
Expand Down
2 changes: 1 addition & 1 deletion src/unittest/ml/test-decision-trees.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int main() {
// define random feature matrix
std::default_random_engine RandomNumberGenerator;
typedef double Feature;
std::uniform_int_distribution<double> randomDistribution(0.0, 1.0);
std::uniform_real_distribution<double> randomDistribution(0.0, 1.0);
const size_t shape[] = {numberOfSamples, numberOfFeatures};
andres::Marray<Feature> features(shape, shape + 2);
for(size_t sample = 0; sample < numberOfSamples; ++sample)
Expand Down

0 comments on commit 466e87c

Please sign in to comment.