Project
Loading...
Searching...
No Matches
test_ransHistograms.cxx File Reference

test class that allows to build histogram of symbols from a source message More...

#include <cassert>
#include <boost/test/unit_test.hpp>
#include <boost/mp11.hpp>
#include <gsl/span>
#include <fmt/format.h>
#include "rANS/histogram.h"
#include "rANS/internal/transform/algorithm.h"
#include "rANS/internal/common/typetraits.h"
#include "rANS/compat.h"

Go to the source code of this file.

Classes

struct  boost::test_tools::tt_detail::print_log_value<::std::pair< F, S > >
 

Namespaces

namespace  boost
 
namespace  boost::test_tools
 
namespace  boost::test_tools::tt_detail
 

Macros

#define BOOST_TEST_MODULE   Utility test
 
#define BOOST_TEST_MAIN
 
#define BOOST_TEST_DYN_LINK
 

Typedefs

using small_dense_histogram_types = mp::mp_list< DenseHistogram< char >, DenseHistogram< uint8_t >, DenseHistogram< int8_t >, DenseHistogram< uint16_t >, DenseHistogram< int16_t > >
 
using large_dense_histogram_types = mp::mp_list< DenseHistogram< int32_t > >
 
using adaptive_histogram_types = mp::mp_list< AdaptiveHistogram< uint32_t >, AdaptiveHistogram< int32_t > >
 
using sparse_histograms = mp::mp_list< SparseHistogram< uint32_t >, SparseHistogram< int32_t > >
 
using histogram_types = mp::mp_flatten< mp::mp_list< small_dense_histogram_types, large_dense_histogram_types, adaptive_histogram_types, sparse_histograms > >
 
using variable_histograms_types = mp::mp_flatten< mp::mp_list< large_dense_histogram_types, adaptive_histogram_types, sparse_histograms > >
 
using renorm_types = mp::mp_list< DenseHistogram< uint8_t >, DenseHistogram< uint32_t >, AdaptiveHistogram< int32_t >, SparseHistogram< int32_t > >
 
using legacy_renorm_types = mp::mp_list< DenseHistogram< uint8_t >, DenseHistogram< uint32_t > >
 

Functions

template<typename histogram_T >
void checkEquivalent (const histogram_T &a, const histogram_T &b)
 
template<class histogram_T , typename map_T >
size_t getTableSize (const map_T &resultsMap)
 
template<class histogram_T , typename map_T >
auto getOffset (const map_T &resultsMap) -> typename map_T::key_type
 
 BOOST_AUTO_TEST_CASE_TEMPLATE (test_emptyTablesSmall, histogram_T, small_dense_histogram_types)
 
 BOOST_AUTO_TEST_CASE_TEMPLATE (test_emptyTablesLarge, histogram_T, variable_histograms_types)
 
 BOOST_AUTO_TEST_CASE_TEMPLATE (test_addSamples, histogram_T, histogram_types)
 
 BOOST_AUTO_TEST_CASE_TEMPLATE (test_addFrequencies, histogram_T, histogram_types)
 
 BOOST_AUTO_TEST_CASE_TEMPLATE (test_addFrequenciesSignChange, histogram_T, histogram_types)
 
 BOOST_AUTO_TEST_CASE_TEMPLATE (test_renorm, histogram_T, renorm_types)
 
 BOOST_AUTO_TEST_CASE_TEMPLATE (test_renormLegacy, histogram_T, legacy_renorm_types)
 
 BOOST_AUTO_TEST_CASE (test_ExpectedCodewordLength)
 

Detailed Description

test class that allows to build histogram of symbols from a source message

Author
Michael Lettrich

Definition in file test_ransHistograms.cxx.

Macro Definition Documentation

◆ BOOST_TEST_DYN_LINK

#define BOOST_TEST_DYN_LINK

Definition at line 18 of file test_ransHistograms.cxx.

◆ BOOST_TEST_MAIN

#define BOOST_TEST_MAIN

Definition at line 17 of file test_ransHistograms.cxx.

◆ BOOST_TEST_MODULE

#define BOOST_TEST_MODULE   Utility test

Definition at line 16 of file test_ransHistograms.cxx.

Typedef Documentation

◆ adaptive_histogram_types

using adaptive_histogram_types = mp::mp_list<AdaptiveHistogram<uint32_t>, AdaptiveHistogram<int32_t> >

Definition at line 46 of file test_ransHistograms.cxx.

◆ histogram_types

◆ large_dense_histogram_types

using large_dense_histogram_types = mp::mp_list<DenseHistogram<int32_t> >

Definition at line 44 of file test_ransHistograms.cxx.

◆ legacy_renorm_types

using legacy_renorm_types = mp::mp_list<DenseHistogram<uint8_t>, DenseHistogram<uint32_t> >

Definition at line 460 of file test_ransHistograms.cxx.

◆ renorm_types

using renorm_types = mp::mp_list<DenseHistogram<uint8_t>, DenseHistogram<uint32_t>, AdaptiveHistogram<int32_t>, SparseHistogram<int32_t> >

Definition at line 438 of file test_ransHistograms.cxx.

◆ small_dense_histogram_types

using small_dense_histogram_types = mp::mp_list< DenseHistogram<char>, DenseHistogram<uint8_t>, DenseHistogram<int8_t>, DenseHistogram<uint16_t>, DenseHistogram<int16_t> >

Definition at line 37 of file test_ransHistograms.cxx.

◆ sparse_histograms

using sparse_histograms = mp::mp_list<SparseHistogram<uint32_t>, SparseHistogram<int32_t> >

Definition at line 49 of file test_ransHistograms.cxx.

◆ variable_histograms_types

Function Documentation

◆ BOOST_AUTO_TEST_CASE()

BOOST_AUTO_TEST_CASE ( test_ExpectedCodewordLength  )

Definition at line 477 of file test_ransHistograms.cxx.

◆ BOOST_AUTO_TEST_CASE_TEMPLATE() [1/7]

BOOST_AUTO_TEST_CASE_TEMPLATE ( test_addFrequencies  ,
histogram_T  ,
histogram_types   
)

Definition at line 272 of file test_ransHistograms.cxx.

◆ BOOST_AUTO_TEST_CASE_TEMPLATE() [2/7]

BOOST_AUTO_TEST_CASE_TEMPLATE ( test_addFrequenciesSignChange  ,
histogram_T  ,
histogram_types   
)

Definition at line 348 of file test_ransHistograms.cxx.

◆ BOOST_AUTO_TEST_CASE_TEMPLATE() [3/7]

BOOST_AUTO_TEST_CASE_TEMPLATE ( test_addSamples  ,
histogram_T  ,
histogram_types   
)

Definition at line 166 of file test_ransHistograms.cxx.

◆ BOOST_AUTO_TEST_CASE_TEMPLATE() [4/7]

BOOST_AUTO_TEST_CASE_TEMPLATE ( test_emptyTablesLarge  ,
histogram_T  ,
variable_histograms_types   
)

Definition at line 154 of file test_ransHistograms.cxx.

◆ BOOST_AUTO_TEST_CASE_TEMPLATE() [5/7]

BOOST_AUTO_TEST_CASE_TEMPLATE ( test_emptyTablesSmall  ,
histogram_T  ,
small_dense_histogram_types   
)

Definition at line 142 of file test_ransHistograms.cxx.

◆ BOOST_AUTO_TEST_CASE_TEMPLATE() [6/7]

BOOST_AUTO_TEST_CASE_TEMPLATE ( test_renorm  ,
histogram_T  ,
renorm_types   
)

Definition at line 440 of file test_ransHistograms.cxx.

◆ BOOST_AUTO_TEST_CASE_TEMPLATE() [7/7]

BOOST_AUTO_TEST_CASE_TEMPLATE ( test_renormLegacy  ,
histogram_T  ,
legacy_renorm_types   
)

Definition at line 462 of file test_ransHistograms.cxx.

◆ checkEquivalent()

template<typename histogram_T >
void checkEquivalent ( const histogram_T &  a,
const histogram_T &  b 
)

Definition at line 78 of file test_ransHistograms.cxx.

◆ getOffset()

template<class histogram_T , typename map_T >
auto getOffset ( const map_T &  resultsMap) -> typename map_T::key_type

Definition at line 114 of file test_ransHistograms.cxx.

◆ getTableSize()

template<class histogram_T , typename map_T >
size_t getTableSize ( const map_T &  resultsMap)

Definition at line 88 of file test_ransHistograms.cxx.