pub trait MocQty<T>: MocableQtywhere
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§
Provided Methods§
fn n_cells_max() -> T
fn n_cells(depth: u8) -> T
sourcefn delta_depth_max_from_n_bits(n_bits: u8) -> u8
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_bits
of a MOC index.
I.e., maximum possible hierarchy depth on a
len = [0, 2^(delta_depth)^dim]
=> (log(len) / log(2)) / dim = delta_depth
sourcefn delta_depth_max_from_n_bits_unchecked(n_bits: u8) -> u8
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.
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
sourcefn from_uniq_gen(uniq: T) -> (u8, T)
fn from_uniq_gen(uniq: T) -> (u8, T)
From generic uniq notation (using a sentinel bit)
sourcefn to_uniq_gen(depth: u8, idx: T) -> T
fn to_uniq_gen(depth: u8, idx: T) -> T
To generic uniq notation (using a sentinel bit)
fn sentinel_bit(depth: u8) -> T
sourcefn uniq_gen_to_range(uniq: T) -> Range<T>
fn uniq_gen_to_range(uniq: T) -> Range<T>
Range from the genric uniq notation (using a sentinel bit)
sourcefn to_zuniq(depth: u8, idx: T) -> T
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.