ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
CxxUtils
CxxUtils
FloatCompressor.h
Go to the documentation of this file.
1
// Dear emacs, this is -*- c++ -*-
2
3
/*
4
Copyright (C) 2002-2026 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
13
#include <cstdint>
14
15
16
17
namespace
CxxUtils
{
18
31
class
FloatCompressor
{
32
33
public
:
35
FloatCompressor
(
unsigned
int
mantissaBits = 7 );
36
38
float
reduceFloatPrecision
(
float
value )
const
;
39
40
41
private
:
43
unsigned
int
m_mantissaBits
{};
45
uint32_t
m_mantissaBitmask
{};
46
49
50
// Half of the LSB-value after cutting the lower 32 - Ntotal bits
51
uint32_t
m_rounding
{};
53
uint32_t
m_vmax
{};
54
56
57
};
// class FloatCompressor
58
59
}
// namespace CxxUtils
60
61
#endif
// CXXUTILS_FLOATCOMPRESSOR_H
CxxUtils::FloatCompressor::m_mantissaBits
unsigned int m_mantissaBits
Number of mantissa bits to keep.
Definition
FloatCompressor.h:43
CxxUtils::FloatCompressor::m_vmax
uint32_t m_vmax
Largest possible positive 32bit float minus the rounding.
Definition
FloatCompressor.h:53
CxxUtils::FloatCompressor::m_rounding
uint32_t m_rounding
Definition
FloatCompressor.h:51
CxxUtils::FloatCompressor::m_mantissaBitmask
uint32_t m_mantissaBitmask
Bitmask for zeroing out the non-interesting bits.
Definition
FloatCompressor.h:45
CxxUtils::FloatCompressor::reduceFloatPrecision
float reduceFloatPrecision(float value) const
Function returning a reduced precision float value.
Definition
FloatCompressor.cxx:100
CxxUtils::FloatCompressor::FloatCompressor
FloatCompressor(unsigned int mantissaBits=7)
Constructor with the number of mantissa bits to retain.
Definition
FloatCompressor.cxx:20
CxxUtils
Definition
aligned_vector.h:29
Generated on
for ATLAS Offline Software by
1.17.0