Trait moc::qty::MocQty

source ·
pub trait MocQty<T>: MocableQty
where T: Idx,
{ const MAX_DEPTH: u8 = _; const MAX_SHIFT: u32 = _;
Show 15 methods // Provided methods fn n_cells_max() -> T { ... } fn n_cells(depth: u8) -> T { ... } fn delta_depth_max_from_n_bits(n_bits: u8) -> u8 { ... } fn delta_depth_max_from_n_bits_unchecked(n_bits: u8) -> u8 { ... } fn delta_with_depth_max(depth: u8) -> u8 { ... } fn shift_from_depth_max(depth: u8) -> u8 { ... } fn get_msb(x: T) -> u32 { ... } fn get_lsb(x: T) -> u32 { ... } fn compute_min_depth(x: T) -> u8 { ... } fn from_uniq_gen(uniq: T) -> (u8, T) { ... } fn to_uniq_gen(depth: u8, idx: T) -> T { ... } fn sentinel_bit(depth: u8) -> T { ... } fn uniq_gen_to_range(uniq: T) -> Range<T> { ... } fn to_zuniq(depth: u8, idx: T) -> T { ... } fn from_zuniq(zuniq: T) -> (u8, T) { ... }
}
Expand description

A quantity with its exact integer representation.

Provided Associated Constants§

source

const MAX_DEPTH: u8 = _

source

const MAX_SHIFT: u32 = _

Provided Methods§

source

fn n_cells_max() -> T

source

fn n_cells(depth: u8) -> T

source

fn delta_depth_max_from_n_bits(n_bits: u8) -> u8

Upper bound on the maximum number of depths that can be coded using n_bitsof a MOC index. I.e., maximum possible hierarchy depth on a len = [0, 2^(delta_depth)^dim] => (log(len) / log(2)) / dim = delta_depth

source

fn delta_depth_max_from_n_bits_unchecked(n_bits: u8) -> u8

Same as delta_depth_max_from_n_bits without checking that the result is smaller than depth_max.

source

fn delta_with_depth_max(depth: u8) -> u8

source

fn shift_from_depth_max(depth: u8) -> u8

source

fn get_msb(x: T) -> u32

source

fn get_lsb(x: T) -> u32

source

fn compute_min_depth(x: T) -> u8

source

fn from_uniq_gen(uniq: T) -> (u8, T)

From generic uniq notation (using a sentinel bit)

source

fn to_uniq_gen(depth: u8, idx: T) -> T

To generic uniq notation (using a sentinel bit)

source

fn sentinel_bit(depth: u8) -> T

source

fn uniq_gen_to_range(uniq: T) -> Range<T>

Range from the genric uniq notation (using a sentinel bit)

source

fn to_zuniq(depth: u8, idx: T) -> T

zuniq is similar to the uniq notation (i.e. it encodes both the depth and the cell index at this depth), but the natural ordering of the type T preserves the global ordering of the cells, independently of the cells depth. It is similar to the cdshealpix BMOC notation (without the extra bit coding a boolean) and to multi-order-map, but also coding the depth.

source

fn from_zuniq(zuniq: T) -> (u8, T)

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> MocQty<T> for Frequency<T>
where T: Idx,

source§

impl<T> MocQty<T> for Hpx<T>
where T: Idx,

source§

impl<T> MocQty<T> for Time<T>
where T: Idx,