BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
GeneticRange.h
Go to the documentation of this file.
1
// @(#)root/tmva $Id$
2
// Author: Peter Speckmayer
3
4
/**********************************************************************************
5
* Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6
* Package: TMVA *
7
* Class : GeneticRange *
8
* Web : http://tmva.sourceforge.net *
9
* *
10
* Description: *
11
* Range definition for genetic algorithm *
12
* *
13
* Authors (alphabetical): *
14
* Peter Speckmayer <speckmay@mail.cern.ch> - CERN, Switzerland *
15
* *
16
* Copyright (c) 2005: *
17
* CERN, Switzerland *
18
* MPI-K Heidelberg, Germany *
19
* *
20
* Redistribution and use in source and binary forms, with or without *
21
* modification, are permitted according to the terms listed in LICENSE *
22
* (http://tmva.sourceforge.net/LICENSE) *
23
**********************************************************************************/
24
25
#ifndef ROOT_TMVA_GeneticRange
26
#define ROOT_TMVA_GeneticRange
27
28
//////////////////////////////////////////////////////////////////////////
29
// //
30
// GeneticRange //
31
// //
32
// Range definition for genetic algorithm //
33
// //
34
//////////////////////////////////////////////////////////////////////////
35
36
#include "
TMVA/Interval.h
"
37
38
class
TRandom3
;
39
40
namespace
TMVA
{
41
42
class
GeneticRange
{
43
44
public
:
45
46
GeneticRange
(
TRandom3
* rnd,
Interval
*interval );
47
virtual
~GeneticRange
();
48
49
Double_t
Random
(
Bool_t
near =
kFALSE
,
Double_t
value=0,
Double_t
spread=0.1,
Bool_t
mirror=
kFALSE
);
50
Double_t
RandomDiscrete
();
51
52
Double_t
GetFrom
() {
return
fFrom
; }
53
Double_t
GetTo
() {
return
fTo
; }
54
Double_t
GetTotalLength
() {
return
fTotalLength
; }
55
56
private
:
57
58
Double_t
fFrom
,
fTo
;
// the constraints of the coefficient
59
Int_t
fNbins
;
60
61
Interval
*
fInterval
;
// holds the complete information of the interval
62
Double_t
fTotalLength
;
// the distance between the lower and upper constraints
63
64
// maps the values thrown outside of the ]from,to] interval back to the interval
65
// the values which leave the range on the from-side, are mapped in to the to-side
66
Double_t
ReMap
(
Double_t
val );
67
68
// same as before, but the values leaving the allowed range, are mirrored into the range.
69
Double_t
ReMapMirror
(
Double_t
val );
70
71
TRandom3
*
fRandomGenerator
;
// the randomGenerator for calculating the new values
72
73
ClassDef
(
GeneticRange
,0);
// Range definition for genetic algorithm
74
};
75
76
}
// namespace TMVA
77
78
#endif
Interval.h
Int_t
int Int_t
Definition:
RtypesCore.h:41
kFALSE
const Bool_t kFALSE
Definition:
RtypesCore.h:88
Bool_t
bool Bool_t
Definition:
RtypesCore.h:59
Double_t
double Double_t
Definition:
RtypesCore.h:55
TMVA::GeneticRange
Definition:
GeneticRange.h:42
TMVA::GeneticRange::fTotalLength
Double_t fTotalLength
Definition:
GeneticRange.h:62
TMVA::GeneticRange::fNbins
Int_t fNbins
Definition:
GeneticRange.h:59
TMVA::GeneticRange::ClassDef
ClassDef(GeneticRange, 0)
TMVA::GeneticRange::GeneticRange
GeneticRange(TRandom3 *rnd, Interval *interval)
TMVA::GeneticRange::ReMap
Double_t ReMap(Double_t val)
TMVA::GeneticRange::GetTotalLength
Double_t GetTotalLength()
Definition:
GeneticRange.h:54
TMVA::GeneticRange::fInterval
Interval * fInterval
Definition:
GeneticRange.h:61
TMVA::GeneticRange::RandomDiscrete
Double_t RandomDiscrete()
TMVA::GeneticRange::Random
Double_t Random(Bool_t near=kFALSE, Double_t value=0, Double_t spread=0.1, Bool_t mirror=kFALSE)
TMVA::GeneticRange::ReMapMirror
Double_t ReMapMirror(Double_t val)
TMVA::GeneticRange::GetFrom
Double_t GetFrom()
Definition:
GeneticRange.h:52
TMVA::GeneticRange::GetTo
Double_t GetTo()
Definition:
GeneticRange.h:53
TMVA::GeneticRange::~GeneticRange
virtual ~GeneticRange()
TMVA::GeneticRange::fFrom
Double_t fFrom
Definition:
GeneticRange.h:58
TMVA::GeneticRange::fRandomGenerator
TRandom3 * fRandomGenerator
Definition:
GeneticRange.h:71
TMVA::GeneticRange::fTo
Double_t fTo
Definition:
GeneticRange.h:58
TMVA::Interval
Definition:
Interval.h:65
TRandom3
Definition:
TRandom3.h:27
TMVA
Definition:
GeneticMinimizer.h:21
Fit
3rdparty
RootMinimizers
TMVA
GeneticRange.h
Generated by
1.9.1