SigUtil  0.95
Utility modules for modern C++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sig::Histgram< T, Bin > Class Template Reference

ヒストグラム More...

Public Member Functions

 Histgram (T min, T max)
 コンストラクタ More...
 
void count (T value)
 要素をbinに振り分けてカウント More...
 
template<class C , typename std::enable_if< impl::container_traits< C >::exist >::type *& = enabler>
void count (C const &values)
 
bool is_over_range () const
 bin外の要素が存在したか More...
 
auto get_count () const -> std::array< uint, Bin >
 頻度を取得 More...
 
auto get_count (uint bin) const -> Maybe< std::tuple< uint, int, int >>
 bin番目(0 ~ Bin-1)の頻度を取得 More...
 
void print () const
 標準出力へ出力 More...
 
void print (FilepassString const &file_pass) const
 ファイルへ出力 More...
 

Detailed Description

template<class T, size_t Bin>
class sig::Histgram< T, Bin >

ヒストグラム

Template Parameters
T要素の型
Bin度数
std::vector<int> data{-100, -10, -6, -5, -1, 0, 3, 5, 5, 6, 6, 6, 7, 9, 10};
sig::Histgram<int, 10> hist(-10, 10); //int型、ビン数10、[-10~10)の範囲の数値を集計
hist.count(data);
hist.print();
-- Histgram --
[-∞,-10):0
[-10, -8):1 |
[ -8, -6):0
[ -6, -4):2 ||
[ -4, -2):0
[ -2, 0):1 |
[ 0, 2):1 |
[ 2, 4):1 |
[ 4, 6):2 ||
[ 6, 8):4 ||||
[ 8, 10):1 |
[ 10,+∞):1 |

Definition at line 53 of file histgram.hpp.

Constructor & Destructor Documentation

template<class T, size_t Bin>
sig::Histgram< T, Bin >::Histgram ( min,
max 
)
inline

コンストラクタ

Parameters
minヒストグラムの範囲の最小値
maxヒストグラムの範囲の最大値

Definition at line 131 of file histgram.hpp.

Member Function Documentation

template<class T, size_t Bin>
void sig::Histgram< T, Bin >::count ( value)
inline

要素をbinに振り分けてカウント

Definition at line 141 of file histgram.hpp.

template<class T, size_t Bin>
template<class C , typename std::enable_if< impl::container_traits< C >::exist >::type *& = enabler>
void sig::Histgram< T, Bin >::count ( C const &  values)
inline

Definition at line 154 of file histgram.hpp.

template<class T, size_t Bin>
auto sig::Histgram< T, Bin >::get_count ( ) const -> std::array<uint, Bin>
inline

頻度を取得

Definition at line 164 of file histgram.hpp.

template<class T, size_t Bin>
auto sig::Histgram< T, Bin >::get_count ( uint  bin) const -> Maybe<std::tuple<uint, int, int>>
inline

bin番目(0 ~ Bin-1)の頻度を取得

Parameters
binビン番号
Returns
tuple<頻度, 範囲最小値(以上), 範囲最大値(未満)>

Definition at line 177 of file histgram.hpp.

template<class T, size_t Bin>
bool sig::Histgram< T, Bin >::is_over_range ( ) const
inline

bin外の要素が存在したか

Definition at line 159 of file histgram.hpp.

template<class T, size_t Bin>
void sig::Histgram< T, Bin >::print ( ) const
inline

標準出力へ出力

Definition at line 185 of file histgram.hpp.

template<class T, size_t Bin>
void sig::Histgram< T, Bin >::print ( FilepassString const &  file_pass) const
inline

ファイルへ出力

Definition at line 188 of file histgram.hpp.


The documentation for this class was generated from the following file: