pub struct DenseVector<S> { /* private fields */ }Expand description
A dynamically sized, heap-backed dense vector.
Implementations§
Source§impl<S: BaseScalar> DenseVector<S>
impl<S: BaseScalar> DenseVector<S>
Sourcepub fn from_vec(data: Vec<S>) -> Result<Self, SolverError>
pub fn from_vec(data: Vec<S>) -> Result<Self, SolverError>
Build from an owned Vec<S> (no memory limit).
Sourcepub fn from_vec_with_options(
data: Vec<S>,
options: DenseIngestOptions,
) -> Result<Self, SolverError>
pub fn from_vec_with_options( data: Vec<S>, options: DenseIngestOptions, ) -> Result<Self, SolverError>
Build from an owned Vec<S>, rejecting payloads over max_elements
with SolverError::InvalidInput.
Source§impl<S: FiniteScalar> DenseVector<S>
impl<S: FiniteScalar> DenseVector<S>
Sourcepub fn validate_finite(&self) -> Result<(), SolverError>
pub fn validate_finite(&self) -> Result<(), SolverError>
Scan for non-finite elements, returning NonFiniteInput on the first
one. Validation state is RFC 012-owned; this is a plain check helper.
Trait Implementations§
Source§impl<S: Clone> Clone for DenseVector<S>
impl<S: Clone> Clone for DenseVector<S>
Source§fn clone(&self) -> DenseVector<S>
fn clone(&self) -> DenseVector<S>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<S: BaseScalar> ContiguousVectorAccess for DenseVector<S>
impl<S: BaseScalar> ContiguousVectorAccess for DenseVector<S>
Source§fn as_contiguous(&self) -> Option<&[S]>
fn as_contiguous(&self) -> Option<&[S]>
The contiguous backing slice, or
None if storage is not contiguous.Source§impl<S: BaseScalar> ContiguousVectorAccessMut for DenseVector<S>
impl<S: BaseScalar> ContiguousVectorAccessMut for DenseVector<S>
Source§fn as_contiguous_mut(&mut self) -> Option<&mut [S]>
fn as_contiguous_mut(&mut self) -> Option<&mut [S]>
The contiguous mutable backing slice, or
None if not contiguous.Source§impl<S: Debug> Debug for DenseVector<S>
impl<S: Debug> Debug for DenseVector<S>
Source§impl<S: BaseScalar> VectorAccess for DenseVector<S>
impl<S: BaseScalar> VectorAccess for DenseVector<S>
Source§fn dimension_kind(&self) -> DimensionKind
fn dimension_kind(&self) -> DimensionKind
Whether the length is known at compile time or at run time.
Source§fn get(&self, index: usize) -> Result<S, SolverError>
fn get(&self, index: usize) -> Result<S, SolverError>
The element at
index, or SolverError::DimensionMismatch if index
is out of bounds (payload: the requested index and the valid length).Source§impl<S: BaseScalar> VectorAccessMut for DenseVector<S>
impl<S: BaseScalar> VectorAccessMut for DenseVector<S>
Auto Trait Implementations§
impl<S> Freeze for DenseVector<S>
impl<S> RefUnwindSafe for DenseVector<S>where
S: RefUnwindSafe,
impl<S> Send for DenseVector<S>where
S: Send,
impl<S> Sync for DenseVector<S>where
S: Sync,
impl<S> Unpin for DenseVector<S>where
S: Unpin,
impl<S> UnsafeUnpin for DenseVector<S>
impl<S> UnwindSafe for DenseVector<S>where
S: UnwindSafe,
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
Mutably borrows from an owned value. Read more