ATLAS Offline Software
FloatCompressor.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id: FloatCompressor.h 789425 2016-12-13 10:50:12Z krasznaa $
8 #ifndef CXXUTILS_FLOATCOMPRESSOR_H
9 #define CXXUTILS_FLOATCOMPRESSOR_H
10 
11 // System include(s):
12 extern "C" {
13 # include <stdint.h>
14 }
15 
16 namespace CxxUtils {
17 
31 
32  public:
34  FloatCompressor( unsigned int mantissaBits = 7 );
35 
37  float reduceFloatPrecision( float value ) const;
38 
40  union floatint_t {
41  float fvalue;
43  };
44 
45  private:
47  unsigned int m_mantissaBits;
50 
53 
54  // Half of the LSB-value after cutting the lower 32 - Ntotal bits
58 
60 
61  }; // class FloatCompressor
62 
63 } // namespace CxxUtils
64 
65 #endif // CXXUTILS_FLOATCOMPRESSOR_H
CxxUtils::FloatCompressor::m_mantissaBits
unsigned int m_mantissaBits
Number of mantissa bits to keep.
Definition: FloatCompressor.h:47
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
athena.value
value
Definition: athena.py:122
CxxUtils::FloatCompressor::m_rounding
uint32_t m_rounding
Definition: FloatCompressor.h:55
CxxUtils::FloatCompressor
Class implementing a lossy float compression.
Definition: FloatCompressor.h:30
CxxUtils::FloatCompressor::reduceFloatPrecision
float reduceFloatPrecision(float value) const
Function returning a reduced precision float value.
Definition: FloatCompressor.cxx:98
CxxUtils
Definition: aligned_vector.h:29
CxxUtils::FloatCompressor::floatint_t
Type used in the compression.
Definition: FloatCompressor.h:40
CxxUtils::FloatCompressor::m_vmax
uint32_t m_vmax
Largest possible positive 32bit float minus the rounding.
Definition: FloatCompressor.h:57
CxxUtils::FloatCompressor::floatint_t::fvalue
float fvalue
Definition: FloatCompressor.h:41
CxxUtils::FloatCompressor::floatint_t::ivalue
uint32_t ivalue
Definition: FloatCompressor.h:42
CxxUtils::FloatCompressor::FloatCompressor
FloatCompressor(unsigned int mantissaBits=7)
Constructor with the number of mantissa bits to retain.
Definition: FloatCompressor.cxx:18
CxxUtils::FloatCompressor::m_mantissaBitmask
uint32_t m_mantissaBitmask
Bitmask for zeroing out the non-interesting bits.
Definition: FloatCompressor.h:49