Struct s2::metric::Metric [−][src]
pub struct Metric { /* fields omitted */ }
Methods
impl Metric
[src]
impl Metric
pub fn value(&self, level: u8) -> f64
[src]
pub fn value(&self, level: u8) -> f64
value returns the value of the metric at the given level.
pub fn min_level(&self, val: f64) -> u64
[src]
pub fn min_level(&self, val: f64) -> u64
min_level returns the minimum level such that the metric is at most the given value, or maxLevel (30) if there is no such level.
For example, MINLevel(0.1) returns the minimum level such that all cell diagonal lengths are 0.1 or smaller. The returned value is always a valid level.
In C++, this is called GetLevelForMAXValue.
pub fn max_level(&self, val: f64) -> u64
[src]
pub fn max_level(&self, val: f64) -> u64
max_level returns the maximum level such that the metric is at least the given value, or zero if there is no such level.
For example, MAXLevel(0.1) returns the maximum level such that all cells have a minimum width of 0.1 or larger. The returned value is always a valid level.
In C++, this is called GetLevelForMINValue.
pub fn closest_level(&self, val: f64) -> u64
[src]
pub fn closest_level(&self, val: f64) -> u64
closest_level returns the level at which the metric has approximately the given value. The return value is always a valid level. For example, AVG_EDGEMETRIC.closest_level(0.1) returns the level at which the average cell edge length is approximately 0.1.