Loading [MathJax]/extensions/tex2jax.js
hej
is hosted by
Hepforge
,
IPPP Durham
HEJ
2.3.0
High energy resummation for hadron colliders
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
Functions
a
c
d
f
g
h
i
j
l
m
n
o
p
r
s
t
Variables
Typedefs
Enumerations
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
s
t
u
w
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
z
~
Functions
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
z
~
Variables
a
b
c
d
e
f
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Typedefs
Related Functions
Files
File List
File Members
All
Macros
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
include
HEJ
Fraction.hh
Go to the documentation of this file.
1
8
#pragma once
9
10
#include <stdexcept>
11
#include <string>
12
#include <type_traits>
13
14
namespace
HEJ
{
15
17
template
<
18
class
Real,
19
typename
= std::enable_if_t<std::is_floating_point<Real>::value>
20
>
21
class
Fraction
{
22
public
:
23
Fraction
() =
default
;
24
25
explicit
Fraction
(Real r): f_{r} {
26
if
(f_ < 0 || f_ > 1) {
27
throw
std::invalid_argument{
28
std::to_string
(f_) +
" is not between 0 and 1"
29
};
30
}
31
}
32
33
Fraction
&
operator=
(Real r) {
34
f_ =
Fraction
{r};
35
return
*
this
;
36
}
37
38
operator
Real()
const
{
39
return
f_;
40
}
41
42
private
:
43
Real f_;
44
};
45
}
// namespace HEJ
HEJ::Fraction
Class for floating point numbers between 0 and 1.
Definition:
Fraction.hh:21
HEJ::Fraction::Fraction
Fraction()=default
HEJ::Fraction::operator=
Fraction & operator=(Real r)
Definition:
Fraction.hh:33
HEJ::Fraction::Fraction
Fraction(Real r)
Definition:
Fraction.hh:25
HEJ
Main HEJ 2 Namespace.
Definition:
mainpage.dox:1
HEJ::to_string
std::string to_string(Event const &ev)
Generated by
1.9.1