Program Listing for File Entropy.h
↰ Return to documentation for file (ADS/compression/Entropy.h)
/*--------------------------------------------------------------------------*/
/*----------------------------- File Entropy.h -----------------------------*/
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
/*----------------------------- DEFINITIONS --------------------------------*/
/*--------------------------------------------------------------------------*/
#ifndef __ADS_Entropy
#define __ADS_Entropy
/* self-identification: #endif constant */
/*--------------------------------------------------------------------------*/
/*------------------------------ INCLUDES ----------------------------------*/
/*--------------------------------------------------------------------------*/
#include "ADS/Contract.h"
#include <cmath>
#include <cstddef>
#include <map>
#include <string>
#include <string_view>
/*--------------------------------------------------------------------------*/
/*--------------------------- NAMESPACE ------------------------------------*/
/*--------------------------------------------------------------------------*/
namespace ADS {
template< class C , class F >
[[nodiscard]] double entropy( const std::map< C , F > & freq );
[[nodiscard]] inline double entropy( std::string_view s );
[[nodiscard]] inline double entropy( std::string_view s , std::size_t k );
/*--------------------------------------------------------------------------*/
} // end( namespace ADS )
/*--------------------------------------------------------------------------*/
/*-------------------------- IMPLEMENTATION --------------------------------*/
/*--------------------------------------------------------------------------*/
#include "ADS/compression/impl/Entropy.tpp"
/*--------------------------------------------------------------------------*/
#endif /* Entropy.h included */
/*--------------------------------------------------------------------------*/
/*--------------------------- End File Entropy.h ---------------------------*/
/*--------------------------------------------------------------------------*/