pub struct GraphIndex {
pub topology: Arc<Topology>,
pub ids: Arc<IdMap>,
/* private fields */
}Expand description
A built graph: its topology, and the map from dense node indexes back to the edges’ ids.
A graph with a vertex table has the vertex table’s keys as its nodes, in
the table’s order, and only the edges whose endpoints are both keys (see
ursa_core::EdgeInterner): its edge ids number the edges kept, and
Self::edge_row maps them back to rows of the edge table.
Fields§
§topology: Arc<Topology>§ids: Arc<IdMap>Implementations§
Source§impl GraphIndex
impl GraphIndex
pub fn new(topology: Arc<Topology>, ids: Arc<IdMap>) -> Self
Sourcepub fn with_dropped(self, n_dropped: u64, kept: Option<BooleanBuffer>) -> Self
pub fn with_dropped(self, n_dropped: u64, kept: Option<BooleanBuffer>) -> Self
This index, built from edge rows of which kept says which were kept
(None: all of them), n_dropped having been dropped.
Sourcepub fn n_dropped(&self) -> u64
pub fn n_dropped(&self) -> u64
Edge rows dropped because an endpoint is not a node of the graph’s vertex table.
Sourcepub fn kept_rows(&self) -> Option<&BooleanBuffer>
pub fn kept_rows(&self) -> Option<&BooleanBuffer>
Which rows of the edge plan were kept, one bit per row, if any was dropped.
Sourcepub fn edge_row(&self, edge: u32) -> u64
pub fn edge_row(&self, edge: u32) -> u64
The row of the edge plan edge edge was read from: the edge id itself
when no row was dropped.
Sourcepub fn with_stored_weights(
self,
keys: Vec<String>,
read: Box<dyn Fn(&str) -> Option<Vec<Vec<f64>>> + Send + Sync>,
) -> Self
pub fn with_stored_weights( self, keys: Vec<String>, read: Box<dyn Fn(&str) -> Option<Vec<Vec<f64>>> + Send + Sync>, ) -> Self
This index, with the weight sets stored on disk under keys, which
read reads when one is first asked for.
Sourcepub fn weights(&self, key: &str) -> Option<Weights>
pub fn weights(&self, key: &str) -> Option<Weights>
The weight columns stored under key in memory, if they are.
Sourcepub fn has_stored_weights(&self, key: &str) -> bool
pub fn has_stored_weights(&self, key: &str) -> bool
Whether weights are stored under key on disk.
Sourcepub fn stored_weights(&self, key: &str, n_columns: usize) -> Option<Weights>
pub fn stored_weights(&self, key: &str, n_columns: usize) -> Option<Weights>
The weight columns stored under key, in memory or else on disk, if
they are and have n_columns columns of one value per edge row. Read
from disk, they are kept in memory too. Blocking: it may read a file.
Sourcepub fn weight_sets(&self) -> Vec<(String, Weights)>
pub fn weight_sets(&self) -> Vec<(String, Weights)>
Every set of weight columns held in memory, with its key.
Sourcepub fn store_weights(&self, key: String, weights: Weights)
pub fn store_weights(&self, key: String, weights: Weights)
Store weight columns under key. They must be one per edge row of this
index, in its edge-row order.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for GraphIndex
impl !RefUnwindSafe for GraphIndex
impl !UnwindSafe for GraphIndex
impl Forget for GraphIndex
impl Send for GraphIndex
impl Sync for GraphIndex
impl Unpin for GraphIndex
impl UnsafeUnpin for GraphIndex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more