From a48fc05187e647d6bcc8df0ce812e4be0d8eeb28 Mon Sep 17 00:00:00 2001 From: Eckhard von Toerne <evt@physik.uni-bonn.de> Date: Thu, 17 Mar 2011 10:57:49 +0000 Subject: [PATCH] copying tmva/dev to trunk, fix compile error under windows, avoid use of math.h git-svn-id: http://root.cern.ch/svn/root/trunk@38477 27541ba8-7e3a-0410-8455-c3a389f83636 --- tmva/src/CrossEntropy.cxx | 5 +++-- tmva/src/MethodBase.cxx | 10 ++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/tmva/src/CrossEntropy.cxx b/tmva/src/CrossEntropy.cxx index 4839265bba2..0200f66549d 100644 --- a/tmva/src/CrossEntropy.cxx +++ b/tmva/src/CrossEntropy.cxx @@ -32,7 +32,8 @@ // -p log (p) - (1-p)log(1-p); p=purity //_______________________________________________________________________ -#include <math.h> +//#include <math.h> +#include <TMath.h> #include "TMVA/CrossEntropy.h" ClassImp(TMVA::CrossEntropy) @@ -46,5 +47,5 @@ Double_t TMVA::CrossEntropy::GetSeparationIndex( const Double_t &s, const Doubl Double_t p = s/(s+b); if (p<=0 || p >=1) return 0; // return - ( p * log (p) + (1-p)*log(1-p) ); - return - ( p * log2 (p) + (1-p)*log2(1-p) ); + return - ( p * TMath::Log2(p) + (1-p)*TMath::Log2(1-p) ); } diff --git a/tmva/src/MethodBase.cxx b/tmva/src/MethodBase.cxx index 08dfe86cbca..4c0ce72e32c 100644 --- a/tmva/src/MethodBase.cxx +++ b/tmva/src/MethodBase.cxx @@ -469,7 +469,7 @@ void TMVA::MethodBase::CreateVariableTransforms(const TString& trafoDefinitionIn if (trafoDefinition == "None") // no transformations return; - // workaround for transformations to complicated to be handled by makeclass/Reader, ToDo fix this in a later release + // workaround for transformations to complicated to be handled by makeclass // count number of transformations with incomplete set of variables TString trafoDefinitionCheck(trafoDefinitionIn); int npartial = 0, ntrafo=0; @@ -478,7 +478,13 @@ void TMVA::MethodBase::CreateVariableTransforms(const TString& trafoDefinitionIn if( ch == "(" ) npartial++; if( ch == "+" || ch == ",") ntrafo++; } - if (npartial>1) log << kFATAL << "sorry, the booking of multiple partial variable transformations is not yet implemented, please book a less complicated variable transform than: "<<trafoDefinitionIn<< Endl; //ToDo make kFATAL + if (npartial>1){ + log << kFATAL << "The booking of multiple partial variable transformations is not yet implemented in makeclass, the creation of a standalone class file is suppressed. The transformation in question is: "<<trafoDefinitionIn<< Endl; // ToDo make info and do not write the standalone class + // + // this does not work since this function is static + // fDisableWriting=true; // disable creation of stand-alone class + // ToDo we need to tell the transformation that it cannot write itself + } // workaround end Int_t parenthesisCount = 0; -- GitLab