Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
art
art
test
Integration
product-aggregation
physics-workflow
Fraction.h
Go to the documentation of this file.
1
#ifndef art_test_Integration_product_aggregation_physics_workflow_Fraction_h
2
#define art_test_Integration_product_aggregation_physics_workflow_Fraction_h
3
4
namespace
arttest
{
5
6
class
Fraction
{
7
public
:
8
Fraction
() =
default
;
9
10
Fraction
(
unsigned
const
num
,
unsigned
const
denom)
11
:
num_
{num},
denom_
{denom}
12
{}
13
14
double
15
value
()
const
16
{
17
return
denom_
== 0. ? 0. :
static_cast<
double
>
(
num_
) /
denom_
;
18
}
19
20
double
21
numerator
()
const
22
{
23
return
num_
;
24
}
25
26
void
27
aggregate
(
Fraction
const
&
f
)
28
{
29
num_
+= f.
num_
;
30
denom_
+= f.
denom_
;
31
}
32
33
private
:
34
unsigned
num_
{-1u};
35
unsigned
denom_
{-1u};
36
};
37
38
}
// namespace arttest
39
40
#endif
/* art_test_Integration_product_aggregation_physics_workflow_Fraction_h */
41
42
// Local variables:
43
// mode: c++
44
// End:
arttest::Fraction::Fraction
Fraction()=default
keras_to_tensorflow.f
f
Definition:
keras_to_tensorflow.py:140
art::test::num
int num(int)
Definition:
DummyFunctionTool_tool.cc:6
arttest::Fraction::Fraction
Fraction(unsigned const num, unsigned const denom)
Definition:
Fraction.h:10
arttest::Fraction::denom_
unsigned denom_
Definition:
Fraction.h:35
arttest
Definition:
GroupSelector_t.h:4
arttest::Fraction::num_
unsigned num_
Definition:
Fraction.h:34
arttest::Fraction
Definition:
Fraction.h:6
arttest::Fraction::aggregate
void aggregate(Fraction const &f)
Definition:
Fraction.h:27
arttest::Fraction::numerator
double numerator() const
Definition:
Fraction.h:21
arttest::Fraction::value
double value() const
Definition:
Fraction.h:15
Generated by
1.8.11