pub struct IndexMapping {
pub gamma: f64,
pub index_offset: f64,
pub interpolation: i32,
}Expand description
How to map positive values to the bins they belong to.
Fields§
§gamma: f64The gamma parameter of the mapping, such that bin index that a value v belongs to is roughly equal to log(v)/log(gamma).
index_offset: f64An offset that can be used to shift all bin indexes.
interpolation: i32To speed up the computation of the index a value belongs to, the computation of the log may be approximated using the fact that the log to the base 2 of powers of 2 can be computed at a low cost from the binary representation of the input value. Other values can be approximated by interpolating between successive powers of 2 (linearly, quadratically or cubically). NONE means that the log is to be computed exactly (no interpolation).
Implementations§
Source§impl IndexMapping
impl IndexMapping
Sourcepub fn interpolation(&self) -> Interpolation
pub fn interpolation(&self) -> Interpolation
Returns the enum value of interpolation, or the default if the field is set to an invalid enum value.
Sourcepub fn set_interpolation(&mut self, value: Interpolation)
pub fn set_interpolation(&mut self, value: Interpolation)
Sets interpolation to the provided enum value.
Trait Implementations§
Source§impl Clone for IndexMapping
impl Clone for IndexMapping
Source§fn clone(&self) -> IndexMapping
fn clone(&self) -> IndexMapping
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IndexMapping
impl Debug for IndexMapping
Source§impl Default for IndexMapping
impl Default for IndexMapping
Source§impl Message for IndexMapping
impl Message for IndexMapping
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.