29#ifndef ROOT_TMVA_Option
30#define ROOT_TMVA_Option
74 virtual void Print( std::ostream&,
Int_t levelofdetail=0 )
const = 0;
116 virtual void Print ( std::ostream&,
Int_t levelofdetail=0 )
const;
140 std::stringstream str;
141 str << std::scientific <<
Value(
i);
149 virtual void Print( std::ostream&,
Int_t levelofdetail=0 )
const;
176 std::stringstream str;
177 str << std::scientific << this->
Value();
183 return Value() ?
"True" :
"False";
188 return Value(
i) ?
"True" :
"False";
196 std::stringstream str(val.
Data());
207 typename std::vector<T>::const_iterator predefIt;
209 for (;predefIt!=
fPreDefs.end(); predefIt++)
210 if ( (*predefIt)==val )
return kTRUE;
223 std::vector<TString>::const_iterator predefIt;
225 for (;predefIt!=
fPreDefs.end(); predefIt++) {
228 if (s==tVal) { foundPreDef =
kTRUE;
break; }
245 Log() << kFATAL <<
"<AddPreDefVal> predefined values for Option<Bool_t> don't make sense"
253 Log() << kFATAL <<
"<AddPreDefVal> predefined values for Option<Float_t> don't make sense"
273 os <<
" " << this->
TheName() <<
"[" <<
i <<
"]: " <<
"\"" << this->
GetValue(
i) <<
"\"";
274 if (
i!=
fSize-1) os << std::endl;
285 os << std::endl <<
"PreDefined - possible values are:" << std::endl;
286 typename std::vector<T>::const_iterator predefIt;
288 for (;predefIt!=
fPreDefs.end(); predefIt++) {
290 os <<
" - " << (*predefIt) << std::endl;
301 std::stringstream str(val.
Data());
316 std::stringstream str(val.
Data());
328 std::vector<TString>::const_iterator predefIt;
330 for (;predefIt!=
fPreDefs.end(); predefIt++) {
333 if (s==tVal) { valToSet = *predefIt;
break; }
337 std::stringstream str(valToSet.
Data());
347 if (valToSet==
"1" || valToSet==
"true" || valToSet==
"ktrue" || valToSet==
"t") {
348 this->
Value() =
true;
350 else if (valToSet==
"0" || valToSet==
"false" || valToSet==
"kfalse" || valToSet==
"f") {
351 this->
Value() =
false;
354 Log() << kFATAL <<
"<SetValueLocal> value \'" << val
355 <<
"\' can not be interpreted as boolean" <<
Endl;
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
#define ClassDef(name, id)
void Print(GNN_Data &d, std::string txt="")
ostringstream derivative to redirect and format output
virtual const char * TheName() const
OptionBase(const TString &name, const TString &desc)
constructor
virtual Bool_t SetValue(const TString &vs, Int_t i=-1)
set value for option
virtual Bool_t IsPreDefinedVal(const TString &) const =0
virtual Bool_t IsArrayOpt() const =0
const TString fDescription
virtual void SetValueLocal(const TString &vs, Int_t i=-1)=0
virtual Bool_t HasPreDefinedVal() const =0
const TString & Description() const
virtual const char * GetName() const
Returns name of object.
virtual Int_t GetArraySize() const =0
virtual void Print(std::ostream &, Int_t levelofdetail=0) const =0
friend class Configurable
virtual TString GetValue(Int_t i=-1) const =0
Option(T *&ref, Int_t size, const TString &name, const TString &desc)
TString GetValue(Int_t i) const
virtual Int_t GetArraySize() const
const T & Value(Int_t i) const
virtual Bool_t IsArrayOpt() const
virtual void PrintPreDefs(std::ostream &, Int_t levelofdetail=0) const
virtual Bool_t HasPreDefinedVal() const
virtual void SetValueLocal(const TString &val, Int_t i=-1)
virtual Bool_t IsPreDefinedVal(const TString &) const
virtual TString GetValue(Int_t i=-1) const
std::vector< T > fPreDefs
virtual void AddPreDefVal(const T &)
virtual void Print(std::ostream &, Int_t levelofdetail=0) const
Option(T &ref, const TString &name, const TString &desc)
virtual Int_t GetArraySize() const
virtual Bool_t IsArrayOpt() const
virtual const T & Value(Int_t i=-1) const
virtual Bool_t IsPreDefinedValLocal(const T &) const
virtual void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
TObject()
TObject constructor.
void ToLower()
Change string to lower-case.
const char * Data() const
create variable transformations
MsgLogger & Endl(MsgLogger &ml)