MulAgg.inl
Go to the documentation of this file.
1 namespace iv
2 {
3 
4 template< class Float >
6  current( 1.0 ),
7  count( 0 )
8 {
9 }
10 
11 template< class Float >
12 MulAgg< Float >::MulAgg( Float current, int count ) :
13  current( current ),
14  count( count )
15 {
16 }
17 
18 template< class Float >
20 {
21  Float current = this->current * value;
22  int count = this->count + 1;
23  if( count == 0 )
24  current = 1.0;
25  return MulAgg< Float >( current, count );
26 }
27 
28 template< class Float >
30 {
31  Float current = this->current / value;
32  int count = this->count - 1;
33  if( count == 0 )
34  current = 1.0;
35  return MulAgg< Float >( current, count );
36 }
37 
38 template< class Float >
40 {
41  return this->current;
42 }
43 
44 template< class Float >
46 {
47  return this->count;
48 }
49 
50 }