pub struct Q42TensorVolume<'a> { /* private fields */ }Expand description
Zero-heap tensor volume backed by caller-owned storage.
Implementations§
Source§impl<'a> Q42TensorVolume<'a>
impl<'a> Q42TensorVolume<'a>
Sourcepub fn new(
nquins: &'a mut [NQuin],
tensor_metadata: &'a mut [TensorMetadata],
) -> Result<Self, TensorVolumeError>
pub fn new( nquins: &'a mut [NQuin], tensor_metadata: &'a mut [TensorMetadata], ) -> Result<Self, TensorVolumeError>
Create a new tensor volume over caller-supplied storage.
Sourcepub fn with_config(
nquins: &'a mut [NQuin],
tensor_metadata: &'a mut [TensorMetadata],
config: TensorVolumeConfig,
) -> Result<Self, TensorVolumeError>
pub fn with_config( nquins: &'a mut [NQuin], tensor_metadata: &'a mut [TensorMetadata], config: TensorVolumeConfig, ) -> Result<Self, TensorVolumeError>
Create a new tensor volume with specific configuration.
Sourcepub fn as_view(&self) -> Q42TensorView<'_>
pub fn as_view(&self) -> Q42TensorView<'_>
Borrow this volume as a zero-heap query view.
Sourcepub fn add_nquin_with_tensor(
&mut self,
nquin: NQuin,
tensor: Tensor10D,
) -> Result<usize, TensorVolumeError>
pub fn add_nquin_with_tensor( &mut self, nquin: NQuin, tensor: Tensor10D, ) -> Result<usize, TensorVolumeError>
Add an NQuin to the volume with tensor coordinates.
Sourcepub fn add_nquin(&mut self, nquin: NQuin) -> Result<usize, TensorVolumeError>
pub fn add_nquin(&mut self, nquin: NQuin) -> Result<usize, TensorVolumeError>
Add an NQuin to the volume without tensor coordinates.
Sourcepub fn get_tensor_metadata(&self, index: usize) -> Option<&TensorMetadata>
pub fn get_tensor_metadata(&self, index: usize) -> Option<&TensorMetadata>
Get tensor metadata for an NQuin by index.
Sourcepub fn config(&self) -> &TensorVolumeConfig
pub fn config(&self) -> &TensorVolumeConfig
The volume’s tensor configuration.
Sourcepub fn update_config(&mut self, config: TensorVolumeConfig)
pub fn update_config(&mut self, config: TensorVolumeConfig)
Replace the volume configuration.
Sourcepub fn tensor_count(&self) -> usize
pub fn tensor_count(&self) -> usize
Entries whose metadata carries tensor coordinates.
Sourcepub fn get_tensorized_nquins_into<'b>(
&'b self,
out: &mut [TensorizedEntry<'b>],
) -> Result<usize, TensorVolumeError>
pub fn get_tensorized_nquins_into<'b>( &'b self, out: &mut [TensorizedEntry<'b>], ) -> Result<usize, TensorVolumeError>
Copy every tensorized (NQuin, metadata) pair into out;
OutputBufferFull when out can’t hold all of them.
Delegates to the view.
Sourcepub fn collapse_empirically_anchored_into<'b>(
&'b self,
out: &mut [TensorizedEntry<'b>],
) -> Result<usize, TensorVolumeError>
pub fn collapse_empirically_anchored_into<'b>( &'b self, out: &mut [TensorizedEntry<'b>], ) -> Result<usize, TensorVolumeError>
Copy only empirically anchored / collapsible entries ($q < 1.0$) into out,
leaving counterfactual or narrative realm entries ($q \ge 1.0$) uncollapsed (Packet OCS-13).
Sourcepub fn visit_tensorized_nquins<F>(
&self,
on_entry: F,
) -> Result<(), TensorVolumeError>
pub fn visit_tensorized_nquins<F>( &self, on_entry: F, ) -> Result<(), TensorVolumeError>
Zero-allocation variant of get_tensorized_nquins_into —
on_entry per tensorized pair, Break to stop early.
Sourcepub fn tensor_search_into(
&self,
query: &Tensor10D,
max_distance: f32,
out: &mut [usize],
) -> Result<usize, TensorVolumeError>
pub fn tensor_search_into( &self, query: &Tensor10D, max_distance: f32, out: &mut [usize], ) -> Result<usize, TensorVolumeError>
Indices of entries within max_distance of query in 10D
(full-distance metric) written to out. Delegates to the view.
Sourcepub fn visit_tensor_search<F>(
&self,
query: &Tensor10D,
max_distance: f32,
on_match: F,
) -> Result<(), TensorVolumeError>
pub fn visit_tensor_search<F>( &self, query: &Tensor10D, max_distance: f32, on_match: F, ) -> Result<(), TensorVolumeError>
Zero-allocation variant of tensor_search_into — on_match
per index, Break to stop early.
Sourcepub fn temporal_query_into(
&self,
target_t: f32,
tolerance: f32,
out: &mut [usize],
) -> Result<usize, TensorVolumeError>
pub fn temporal_query_into( &self, target_t: f32, tolerance: f32, out: &mut [usize], ) -> Result<usize, TensorVolumeError>
Indices whose tensor t coordinate is within tolerance of
target_t written to out. Delegates to the view.
Sourcepub fn visit_temporal_query<F>(
&self,
target_t: f32,
tolerance: f32,
on_match: F,
) -> Result<(), TensorVolumeError>
pub fn visit_temporal_query<F>( &self, target_t: f32, tolerance: f32, on_match: F, ) -> Result<(), TensorVolumeError>
Zero-allocation variant of temporal_query_into — on_match
per index, Break to stop early.
Sourcepub fn manifold_query_into(
&self,
target_w: f32,
max_distance: f32,
out: &mut [usize],
) -> Result<usize, TensorVolumeError>
pub fn manifold_query_into( &self, target_w: f32, max_distance: f32, out: &mut [usize], ) -> Result<usize, TensorVolumeError>
Indices matching manifold coordinate target_w within
max_distance (see manifold_matches) written to out.
Delegates to the view.
Sourcepub fn visit_manifold_query<F>(
&self,
target_w: f32,
max_distance: f32,
on_match: F,
) -> Result<(), TensorVolumeError>
pub fn visit_manifold_query<F>( &self, target_w: f32, max_distance: f32, on_match: F, ) -> Result<(), TensorVolumeError>
Zero-allocation variant of manifold_query_into — on_match
per index, Break to stop early.
Auto Trait Implementations§
impl<'a> !UnwindSafe for Q42TensorVolume<'a>
impl<'a> Freeze for Q42TensorVolume<'a>
impl<'a> RefUnwindSafe for Q42TensorVolume<'a>
impl<'a> Send for Q42TensorVolume<'a>
impl<'a> Sync for Q42TensorVolume<'a>
impl<'a> Unpin for Q42TensorVolume<'a>
impl<'a> UnsafeUnpin for Q42TensorVolume<'a>
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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