Skip to main content

StaticTopTreeDataBuilder

Struct StaticTopTreeDataBuilder 

Source
struct StaticTopTreeDataBuilder<C>
where C: Cluster,
{ compressed: Vec<MaybeUninit<InnerValue<<C as Cluster>::Path>>>, raked: Vec<MaybeUninit<InnerValue<<C as Cluster>::Point>>>, light_points: Vec<<C as Cluster>::Point>, }

Fields§

§compressed: Vec<MaybeUninit<InnerValue<<C as Cluster>::Path>>>§raked: Vec<MaybeUninit<InnerValue<<C as Cluster>::Point>>>§light_points: Vec<<C as Cluster>::Point>

Implementations§

Source§

impl<C> StaticTopTreeDataBuilder<C>
where C: Cluster,

Source

fn new(tree: &StaticTopTree) -> Self

Examples found in repository?
crates/competitive/src/tree/static_top_tree.rs (line 465)
457    pub fn new(
458        tree: &'a StaticTopTree,
459        vertices: Vec<<C as Cluster>::Vertex>,
460        edges: Vec<<C as Cluster>::Edge>,
461    ) -> Self {
462        assert_eq!(vertices.len(), tree.vertices_size());
463        assert_eq!(edges.len(), tree.edges_size());
464
465        let mut data: StaticTopTreeDataBuilder<C> = StaticTopTreeDataBuilder::new(tree);
466        let path = tree.init_compress(
467            &mut data,
468            &vertices,
469            &edges,
470            tree.compress_roots[tree.root].expect("root compress tree must exist"),
471        );
472        let all_point = C::add_edge(&path);
473        Self {
474            tree,
475            vertices,
476            edges,
477            compressed: unsafe { assume_init_vec(data.compressed) },
478            raked: unsafe { assume_init_vec(data.raked) },
479            light_points: data.light_points,
480            all_point,
481        }
482    }

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToArrayVecScalar for T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.