Skip to main content

DenseVector

Struct DenseVector 

Source
pub struct DenseVector<S> { /* private fields */ }
Expand description

A dynamically sized, heap-backed dense vector.

Implementations§

Source§

impl<S: BaseScalar> DenseVector<S>

Source

pub fn from_vec(data: Vec<S>) -> Result<Self, SolverError>

Build from an owned Vec<S> (no memory limit).

Source

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. An empty vector is rejected with SolverError::InvalidDimension (zero length), checked before the limit.

Source

pub fn len(&self) -> usize

The element count.

Source

pub fn is_empty(&self) -> bool

Whether the vector is empty.

Source§

impl<S: FiniteScalar> DenseVector<S>

Source

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>

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl<S: BaseScalar> ContiguousVectorAccess for DenseVector<S>

Source§

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>

Source§

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>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<S: BaseScalar> VectorAccess for DenseVector<S>

Source§

type Scalar = S

The element type, constrained to the base scalar capability tier.
Source§

fn len(&self) -> usize

The number of elements.
Source§

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>

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>

Source§

fn set(&mut self, index: usize, value: S) -> Result<(), SolverError>

Write value at index, or return SolverError::DimensionMismatch if index is out of bounds.

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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.