SecreC 2 language  2.8.0 (2023.09)
Language and standard library reference
Functions

Functions

template<domain D>
D int32 histogram (D int32[[1]] data, D bool[[1]] isAvailable)
 
template<domain D>
D int64 histogram (D int64[[1]] data, D bool[[1]] isAvailable)
 
template<domain D>
D float32 histogram (D float32[[1]] data, D bool[[1]] isAvailable)
 
template<domain D>
D float64 histogram (D float64[[1]] data, D bool[[1]] isAvailable)
 

Detailed Description

Create a histogram.

Note
D - any protection domain
Supported types - int32 / int64 / float32 / float64
Parameters
data- input vector
isAvailable- vector indicating which elements of the input vector are available
Returns
returns a matrix where the first row contains histogram bin boundaries and the second row contains counts for each bin (note that the last element of the second row is always 0 because for n bins we have n+1 boundaries). An element x belongs to a bin with boundaries (a, b) if a < x <= b.
Leakage
Leaks the minimum and maximum values in the input
Leaks the number of missing values in the input

Function Documentation

◆ histogram() [1/4]

D float32 histogram ( D float32[[1]]  data,
D bool[[1]]  isAvailable 
)

◆ histogram() [2/4]

D float64 histogram ( D float64[[1]]  data,
D bool[[1]]  isAvailable 
)

◆ histogram() [3/4]

D int32 histogram ( D int32[[1]]  data,
D bool[[1]]  isAvailable 
)

◆ histogram() [4/4]

D int64 histogram ( D int64[[1]]  data,
D bool[[1]]  isAvailable 
)