Struct sprs::CsVecBase [−][src]
A sparse vector, storing the indices of its non-zero data.
A CsVec
represents a sparse vector by storing a sorted indices()
array
containing the locations of the non-zero values and a data()
array
containing the corresponding values. The format is compatible with CsMat
,
ie a CsVec
can represent the row of a CSR matrix without any copying.
Similar to CsMat
and TriMat
, the CsVecBase
type is parameterized
over the indexing storage backend IStorage
and the data storage backend
DStorage
. Type aliases are provided for common cases: CsVec
represents
a sparse vector owning its data, with Vec
s as storage backends;
CsVecView
represents a sparse vector borrowing its data, using slices
as storage backends; and CsVecViewMut
represents a sparse vector that
mutably borrows its data (but immutably borrows its indices).
Additionaly, the type aliases CsVecI
, CsVecViewI
, and
CsVecViewMutI
can be used to choose an index type different from the
default usize
.
Implementations
impl<N, I: SpIndex, DStorage, IStorage> CsVecBase<IStorage, DStorage, N, I> where
DStorage: Deref<Target = [N]>,
IStorage: Deref<Target = [I]>,
[src]
DStorage: Deref<Target = [N]>,
IStorage: Deref<Target = [I]>,
pub fn new(n: usize, indices: IStorage, data: DStorage) -> Self
[src]
Create a sparse vector
Panics
- if
indices
anddata
lengths differ - if the vector contains out of bounds indices
- if indices are out of order
Examples
// Creating a sparse owned vector let owned = CsVec::new(10, vec![0, 4], vec![-4, 2]); // Creating a sparse borrowing vector with `I = u16` let borrow = CsVecViewI::new(10, &[0_u16, 4], &[-4, 2]); // Creating a general sparse vector with different storage types let mixed = CsVecBase::new(10, &[0_u64, 4] as &[_], vec![-4, 2]);
pub fn try_new(
n: usize,
indices: IStorage,
data: DStorage
) -> Result<Self, (IStorage, DStorage, StructureError)>
[src]
n: usize,
indices: IStorage,
data: DStorage
) -> Result<Self, (IStorage, DStorage, StructureError)>
Try create a sparse vector from the given buffers
Will return the buffers along with the error if conversion is illegal
pub unsafe fn new_uncheked(n: usize, indices: IStorage, data: DStorage) -> Self
[src]
Create a CsVec
without checking the structure
Safety
This is unsafe because algorithms are free to assume
that properties guaranteed by check_structure
are enforced.
For instance, non out-of-bounds indices can be relied upon to
perform unchecked slice access.
impl<N, I: SpIndex, DStorage, IStorage> CsVecBase<IStorage, DStorage, N, I> where
DStorage: DerefMut<Target = [N]>,
IStorage: DerefMut<Target = [I]>,
[src]
DStorage: DerefMut<Target = [N]>,
IStorage: DerefMut<Target = [I]>,
pub fn new_from_unsorted(
n: usize,
indices: IStorage,
data: DStorage
) -> Result<Self, (IStorage, DStorage, StructureError)> where
N: Clone,
[src]
n: usize,
indices: IStorage,
data: DStorage
) -> Result<Self, (IStorage, DStorage, StructureError)> where
N: Clone,
Creates a sparse vector
Will sort indices and data if necessary
impl<N, I: SpIndex> CsVecBase<Vec<I, Global>, Vec<N, Global>, N, I>
[src]
pub fn empty(dim: usize) -> Self
[src]
Create an empty CsVec
, which can be used for incremental construction
pub fn append(&mut self, ind: usize, val: N)
[src]
Append an element to the sparse vector. Used for incremental
building of the CsVec
. The append should preserve the structure
of the vector, ie the newly added index should be strictly greater
than the last element of indices.
Panics
- Panics if
ind
is lower or equal to the last element ofself.indices()
- Panics if
ind
is greater thanself.dim()
pub fn reserve(&mut self, size: usize)
[src]
Reserve size
additional non-zero values.
pub fn reserve_exact(&mut self, exact_size: usize)
[src]
Reserve exactly exact_size
non-zero values.
pub fn clear(&mut self)
[src]
Clear the underlying storage
impl<N, I, IStorage, DStorage> CsVecBase<IStorage, DStorage, N, I> where
I: SpIndex,
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
[src]
I: SpIndex,
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
pub fn view(&self) -> CsVecViewI<'_, N, I>
[src]
Get a view of this vector.
pub fn to_dense(&self) -> Array<N, Ix1> where
N: Clone + Zero,
[src]
N: Clone + Zero,
Convert the sparse vector to a dense one
pub fn iter(&self) -> VectorIterator<'_, N, I>ⓘNotable traits for VectorIterator<'a, N, I>
impl<'a, N: 'a, I: 'a + SpIndex> Iterator for VectorIterator<'a, N, I> type Item = (usize, &'a N);
[src]
Notable traits for VectorIterator<'a, N, I>
impl<'a, N: 'a, I: 'a + SpIndex> Iterator for VectorIterator<'a, N, I> type Item = (usize, &'a N);
Iterate over the non zero values.
Example
use sprs::CsVec; let v = CsVec::new(5, vec![0, 2, 4], vec![1., 2., 3.]); let mut iter = v.iter(); assert_eq!(iter.next(), Some((0, &1.))); assert_eq!(iter.next(), Some((2, &2.))); assert_eq!(iter.next(), Some((4, &3.))); assert_eq!(iter.next(), None);
pub fn indices(&self) -> &[I]ⓘ
[src]
The underlying indices.
pub fn data(&self) -> &[N]ⓘ
[src]
The underlying non zero values.
pub fn into_raw_storage(self) -> (IStorage, DStorage)
[src]
Destruct the vector object and recycle its storage containers.
pub fn dim(&self) -> usize
[src]
The dimension of this vector.
pub fn nnz(&self) -> usize
[src]
The non zero count of this vector.
pub fn check_structure(&self) -> Result<(), StructureError>
[src]
Check the sparse structure, namely that:
- indices are sorted
- all indices are less than dims()
pub fn to_owned(&self) -> CsVecI<N, I> where
N: Clone,
[src]
N: Clone,
Allocate a new vector equal to this one.
pub fn to_other_types<I2>(&self) -> CsVecI<N, I2> where
N: Clone,
I2: SpIndex,
[src]
N: Clone,
I2: SpIndex,
Clone the vector with another integer type for its indices
Panics
If the indices cannot be represented by the requested integer type.
pub fn row_view<Iptr: SpIndex>(
&self
) -> CsMatBase<N, I, Array2<Iptr>, &'_ [I], &'_ [N], Iptr>
[src]
&self
) -> CsMatBase<N, I, Array2<Iptr>, &'_ [I], &'_ [N], Iptr>
View this vector as a matrix with only one row.
pub fn col_view<Iptr: SpIndex>(
&self
) -> CsMatBase<N, I, Array2<Iptr>, &'_ [I], &'_ [N], Iptr>
[src]
&self
) -> CsMatBase<N, I, Array2<Iptr>, &'_ [I], &'_ [N], Iptr>
View this vector as a matrix with only one column.
pub fn get<'a>(&'a self, index: usize) -> Option<&'a N> where
I: 'a,
[src]
I: 'a,
Access element at given index, with logarithmic complexity
pub fn nnz_index(&self, index: usize) -> Option<NnzIndex>
[src]
Find the non-zero index of the requested dimension index, returning None if no non-zero is present at the requested location.
Looking for the NnzIndex
is done with logarithmic complexity, but
once it is available, the NnzIndex
enables retrieving the data with
O(1) complexity.
pub fn dot<'b, T: IntoSparseVecIter<'b, N>>(&'b self, rhs: T) -> N where
N: 'b + MulAcc + Zero,
I: 'b,
<T as IntoSparseVecIter<'b, N>>::IterType: Iterator<Item = (usize, &'b N)>,
T: Copy,
[src]
N: 'b + MulAcc + Zero,
I: 'b,
<T as IntoSparseVecIter<'b, N>>::IterType: Iterator<Item = (usize, &'b N)>,
T: Copy,
Sparse vector dot product. The right-hand-side can be any type that can be interpreted as a sparse vector (hence sparse vectors, std vectors and slices, and ndarray’s dense vectors work).
However, even if dense vectors work, it is more performant to use
the dot_dense
.
Panics
If the dimension of the vectors do not match.
Example
use sprs::CsVec; let v1 = CsVec::new(8, vec![1, 2, 4, 6], vec![1.; 4]); let v2 = CsVec::new(8, vec![1, 3, 5, 7], vec![2.; 4]); assert_eq!(2., v1.dot(&v2)); assert_eq!(4., v1.dot(&v1)); assert_eq!(16., v2.dot(&v2));
pub fn dot_dense<V>(&self, rhs: V) -> N where
V: DenseVector<Scalar = N>,
N: Sum,
&'r N: Mul<&'r N, Output = N>,
[src]
V: DenseVector<Scalar = N>,
N: Sum,
&'r N: Mul<&'r N, Output = N>,
Sparse-dense vector dot product. The right-hand-side can be any type that can be interpreted as a dense vector (hence std vectors and slices, and ndarray’s dense vectors work).
Since the dot
method can work with the same performance on
dot vectors, the main interest of this method is to enforce at
compile time that the rhs is dense.
Panics
If the dimension of the vectors do not match.
pub fn squared_l2_norm(&self) -> N where
N: Sum,
&'r N: Mul<&'r N, Output = N>,
[src]
N: Sum,
&'r N: Mul<&'r N, Output = N>,
Compute the squared L2-norm.
pub fn l2_norm(&self) -> N where
N: Float + Sum,
&'r N: Mul<&'r N, Output = N>,
[src]
N: Float + Sum,
&'r N: Mul<&'r N, Output = N>,
Compute the L2-norm.
pub fn l1_norm(&self) -> N where
N: Signed + Sum,
[src]
N: Signed + Sum,
Compute the L1-norm.
pub fn norm(&self, p: N) -> N where
N: Float + Sum,
[src]
N: Float + Sum,
Compute the vector norm for the given order p.
The norm for vector v is defined as:
- If p = ∞: maxᵢ |vᵢ|
- If p = -∞: minᵢ |vᵢ|
- If p = 0: ∑ᵢ[vᵢ≠0]
- Otherwise: ᵖ√(∑ᵢ|vᵢ|ᵖ)
pub fn scatter<V: ?Sized>(&self, out: &mut V) where
N: Clone,
V: DenseVectorMut<Scalar = N>,
[src]
N: Clone,
V: DenseVectorMut<Scalar = N>,
Fill a dense vector with our values
pub fn to_set(&self) -> HashSet<(usize, N)> where
N: Hash + Eq + Clone,
[src]
N: Hash + Eq + Clone,
Transform this vector into a set of (index, value) tuples
pub fn map<F>(&self, f: F) -> CsVecI<N, I> where
F: FnMut(&N) -> N,
N: Clone,
[src]
F: FnMut(&N) -> N,
N: Clone,
Apply a function to each non-zero element, yielding a new matrix with the same sparsity structure.
impl<'a, N, I, IStorage, DStorage> CsVecBase<IStorage, DStorage, N, I> where
N: 'a,
I: 'a + SpIndex,
IStorage: 'a + Deref<Target = [I]>,
DStorage: DerefMut<Target = [N]>,
[src]
N: 'a,
I: 'a + SpIndex,
IStorage: 'a + Deref<Target = [I]>,
DStorage: DerefMut<Target = [N]>,
pub fn view_mut(&mut self) -> CsVecViewMutI<'_, N, I>
[src]
pub fn get_mut(&mut self, index: usize) -> Option<&mut N>
[src]
Access element at given index, with logarithmic complexity
pub fn map_inplace<F>(&mut self, f: F) where
F: FnMut(&N) -> N,
[src]
F: FnMut(&N) -> N,
Apply a function to each non-zero element, mutating it
pub fn iter_mut(&mut self) -> VectorIteratorMut<'_, N, I>ⓘNotable traits for VectorIteratorMut<'a, N, I>
impl<'a, N: 'a, I: 'a + SpIndex> Iterator for VectorIteratorMut<'a, N, I> type Item = (usize, &'a mut N);
[src]
Notable traits for VectorIteratorMut<'a, N, I>
impl<'a, N: 'a, I: 'a + SpIndex> Iterator for VectorIteratorMut<'a, N, I> type Item = (usize, &'a mut N);
Mutable iteration over the non-zero values of a sparse vector
Only the values can be changed, the sparse structure is kept.
pub fn unit_normalize(&mut self) where
N: Float + Sum,
&'r N: Mul<&'r N, Output = N>,
[src]
N: Float + Sum,
&'r N: Mul<&'r N, Output = N>,
Divides the vector by its own L2-norm.
Zero vector is left unchanged.
impl<'a, N: 'a, I: 'a + SpIndex> CsVecBase<&'a [I], &'a [N], N, I>
[src]
pub fn get_rbr(&self, index: usize) -> Option<&'a N>
[src]
Access element at given index, with logarithmic complexity
Re-borrowing version of at()
.
Trait Implementations
impl<N, I, IS1, DS1, IS2, DS2> AbsDiffEq<CsVecBase<IS2, DS2, N, I>> for CsVecBase<IS1, DS1, N, I> where
I: SpIndex,
CsVecBase<IS1, DS1, N, I>: PartialEq<CsVecBase<IS2, DS2, N, I>>,
IS1: Deref<Target = [I]>,
IS2: Deref<Target = [I]>,
DS1: Deref<Target = [N]>,
DS2: Deref<Target = [N]>,
N: AbsDiffEq,
N::Epsilon: Clone,
N: Zero,
[src]
I: SpIndex,
CsVecBase<IS1, DS1, N, I>: PartialEq<CsVecBase<IS2, DS2, N, I>>,
IS1: Deref<Target = [I]>,
IS2: Deref<Target = [I]>,
DS1: Deref<Target = [N]>,
DS2: Deref<Target = [N]>,
N: AbsDiffEq,
N::Epsilon: Clone,
N: Zero,
type Epsilon = N::Epsilon
Used for specifying relative comparisons.
fn default_epsilon() -> N::Epsilon
[src]
fn abs_diff_eq(
&self,
other: &CsVecBase<IS2, DS2, N, I>,
epsilon: N::Epsilon
) -> bool
[src]
&self,
other: &CsVecBase<IS2, DS2, N, I>,
epsilon: N::Epsilon
) -> bool
pub fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
[src]
impl<'a, N, I, IS1, DS1, IS2, DS2> Add<&'a CsVecBase<IS2, DS2, N, I>> for CsVecBase<IS1, DS1, N, I> where
N: Num + Clone + for<'r> AddAssign<&'r N>,
I: SpIndex,
IS1: Deref<Target = [I]>,
DS1: Deref<Target = [N]>,
IS2: Deref<Target = [I]>,
DS2: Deref<Target = [N]>,
[src]
N: Num + Clone + for<'r> AddAssign<&'r N>,
I: SpIndex,
IS1: Deref<Target = [I]>,
DS1: Deref<Target = [N]>,
IS2: Deref<Target = [I]>,
DS2: Deref<Target = [N]>,
type Output = CsVecI<N, I>
The resulting type after applying the +
operator.
fn add(self, rhs: &CsVecBase<IS2, DS2, N, I>) -> CsVecI<N, I>
[src]
impl<'a, 'b, N, I, IS1, DS1, IS2, DS2> Add<&'b CsVecBase<IS2, DS2, N, I>> for &'a CsVecBase<IS1, DS1, N, I> where
N: Num + Clone + for<'r> AddAssign<&'r N>,
I: SpIndex,
IS1: Deref<Target = [I]>,
DS1: Deref<Target = [N]>,
IS2: Deref<Target = [I]>,
DS2: Deref<Target = [N]>,
[src]
N: Num + Clone + for<'r> AddAssign<&'r N>,
I: SpIndex,
IS1: Deref<Target = [I]>,
DS1: Deref<Target = [N]>,
IS2: Deref<Target = [I]>,
DS2: Deref<Target = [N]>,
type Output = CsVecI<N, I>
The resulting type after applying the +
operator.
fn add(self, rhs: &CsVecBase<IS2, DS2, N, I>) -> CsVecI<N, I>
[src]
impl<N, I, IS1, DS1, IS2, DS2> Add<CsVecBase<IS2, DS2, N, I>> for CsVecBase<IS1, DS1, N, I> where
N: Num + Clone + for<'r> AddAssign<&'r N>,
I: SpIndex,
IS1: Deref<Target = [I]>,
DS1: Deref<Target = [N]>,
IS2: Deref<Target = [I]>,
DS2: Deref<Target = [N]>,
[src]
N: Num + Clone + for<'r> AddAssign<&'r N>,
I: SpIndex,
IS1: Deref<Target = [I]>,
DS1: Deref<Target = [N]>,
IS2: Deref<Target = [I]>,
DS2: Deref<Target = [N]>,
type Output = CsVecI<N, I>
The resulting type after applying the +
operator.
fn add(self, rhs: CsVecBase<IS2, DS2, N, I>) -> CsVecI<N, I>
[src]
impl<'a, N, I, IS1, DS1, IS2, DS2> Add<CsVecBase<IS2, DS2, N, I>> for &'a CsVecBase<IS1, DS1, N, I> where
N: Num + Clone + for<'r> AddAssign<&'r N>,
I: SpIndex,
IS1: Deref<Target = [I]>,
DS1: Deref<Target = [N]>,
IS2: Deref<Target = [I]>,
DS2: Deref<Target = [N]>,
[src]
N: Num + Clone + for<'r> AddAssign<&'r N>,
I: SpIndex,
IS1: Deref<Target = [I]>,
DS1: Deref<Target = [N]>,
IS2: Deref<Target = [I]>,
DS2: Deref<Target = [N]>,
type Output = CsVecI<N, I>
The resulting type after applying the +
operator.
fn add(self, rhs: CsVecBase<IS2, DS2, N, I>) -> CsVecI<N, I>
[src]
impl<IStorage: Clone, DStorage: Clone, N: Clone, I: Clone + SpIndex> Clone for CsVecBase<IStorage, DStorage, N, I> where
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
[src]
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
fn clone(&self) -> CsVecBase<IStorage, DStorage, N, I>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<IStorage: Copy, DStorage: Copy, N: Copy, I: Copy + SpIndex> Copy for CsVecBase<IStorage, DStorage, N, I> where
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
[src]
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
impl<IStorage: Debug, DStorage: Debug, N: Debug, I: Debug + SpIndex> Debug for CsVecBase<IStorage, DStorage, N, I> where
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
[src]
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
impl<'de, IStorage, DStorage, N, I: SpIndex> Deserialize<'de> for CsVecBase<IStorage, DStorage, N, I> where
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
IStorage: Deserialize<'de>,
DStorage: Deserialize<'de>,
[src]
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
IStorage: Deserialize<'de>,
DStorage: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<N, I, IStorage, DStorage> DivAssign<N> for CsVecBase<IStorage, DStorage, N, I> where
N: Clone + DivAssign<N>,
I: SpIndex,
IStorage: Deref<Target = [I]>,
DStorage: DerefMut<Target = [N]>,
[src]
N: Clone + DivAssign<N>,
I: SpIndex,
IStorage: Deref<Target = [I]>,
DStorage: DerefMut<Target = [N]>,
fn div_assign(&mut self, rhs: N)
[src]
impl<IStorage: Eq, DStorage: Eq, N: Eq, I: Eq + SpIndex> Eq for CsVecBase<IStorage, DStorage, N, I> where
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
[src]
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
impl<IStorage: Hash, DStorage: Hash, N: Hash, I: Hash + SpIndex> Hash for CsVecBase<IStorage, DStorage, N, I> where
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
[src]
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<N, IS, DS> Index<NnzIndex> for CsVecBase<IS, DS, N> where
IS: Deref<Target = [usize]>,
DS: Deref<Target = [N]>,
[src]
IS: Deref<Target = [usize]>,
DS: Deref<Target = [N]>,
impl<N, IS, DS> Index<usize> for CsVecBase<IS, DS, N> where
IS: Deref<Target = [usize]>,
DS: Deref<Target = [N]>,
[src]
IS: Deref<Target = [usize]>,
DS: Deref<Target = [N]>,
impl<N, IS, DS> IndexMut<NnzIndex> for CsVecBase<IS, DS, N> where
IS: Deref<Target = [usize]>,
DS: DerefMut<Target = [N]>,
[src]
IS: Deref<Target = [usize]>,
DS: DerefMut<Target = [N]>,
impl<N, IS, DS> IndexMut<usize> for CsVecBase<IS, DS, N> where
IS: Deref<Target = [usize]>,
DS: DerefMut<Target = [N]>,
[src]
IS: Deref<Target = [usize]>,
DS: DerefMut<Target = [N]>,
impl<'a, N: 'a, I: 'a, IS, DS> IntoSparseVecIter<'a, N> for &'a CsVecBase<IS, DS, N, I> where
I: SpIndex,
IS: Deref<Target = [I]>,
DS: Deref<Target = [N]>,
[src]
I: SpIndex,
IS: Deref<Target = [I]>,
DS: Deref<Target = [N]>,
type IterType = VectorIterator<'a, N, I>
fn dim(&self) -> usize
[src]
fn into_sparse_vec_iter(self) -> VectorIterator<'a, N, I>ⓘNotable traits for VectorIterator<'a, N, I>
impl<'a, N: 'a, I: 'a + SpIndex> Iterator for VectorIterator<'a, N, I> type Item = (usize, &'a N);
[src]
Notable traits for VectorIterator<'a, N, I>
impl<'a, N: 'a, I: 'a + SpIndex> Iterator for VectorIterator<'a, N, I> type Item = (usize, &'a N);
fn is_dense(&self) -> bool
[src]
fn index(self, idx: usize) -> &'a N where
Self: Sized,
[src]
Self: Sized,
impl<'a, 'b, N, I, Iptr, IS1, DS1, IpS2, IS2, DS2> Mul<&'b CsMatBase<N, I, IpS2, IS2, DS2, Iptr>> for &'a CsVecBase<IS1, DS1, N, I> where
N: 'a + Clone + MulAcc + Zero + Default + Send + Sync,
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IS1: 'a + Deref<Target = [I]>,
DS1: 'a + Deref<Target = [N]>,
IpS2: 'b + Deref<Target = [Iptr]>,
IS2: 'b + Deref<Target = [I]>,
DS2: 'b + Deref<Target = [N]>,
[src]
N: 'a + Clone + MulAcc + Zero + Default + Send + Sync,
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IS1: 'a + Deref<Target = [I]>,
DS1: 'a + Deref<Target = [N]>,
IpS2: 'b + Deref<Target = [Iptr]>,
IS2: 'b + Deref<Target = [I]>,
DS2: 'b + Deref<Target = [N]>,
type Output = CsVecI<N, I>
The resulting type after applying the *
operator.
fn mul(self, rhs: &CsMatBase<N, I, IpS2, IS2, DS2, Iptr>) -> CsVecI<N, I>
[src]
impl<'a, 'b, N, I, Iptr, IpS1, IS1, DS1, IS2, DS2> Mul<&'b CsVecBase<IS2, DS2, N, I>> for &'a CsMatBase<N, I, IpS1, IS1, DS1, Iptr> where
N: Clone + MulAcc + Zero + PartialEq + Default + Send + Sync,
I: SpIndex,
Iptr: SpIndex,
IpS1: Deref<Target = [Iptr]>,
IS1: Deref<Target = [I]>,
DS1: Deref<Target = [N]>,
IS2: Deref<Target = [I]>,
DS2: Deref<Target = [N]>,
[src]
N: Clone + MulAcc + Zero + PartialEq + Default + Send + Sync,
I: SpIndex,
Iptr: SpIndex,
IpS1: Deref<Target = [Iptr]>,
IS1: Deref<Target = [I]>,
DS1: Deref<Target = [N]>,
IS2: Deref<Target = [I]>,
DS2: Deref<Target = [N]>,
type Output = CsVecI<N, I>
The resulting type after applying the *
operator.
fn mul(self, rhs: &CsVecBase<IS2, DS2, N, I>) -> CsVecI<N, I>
[src]
impl<N, I, IStorage, DStorage> MulAssign<N> for CsVecBase<IStorage, DStorage, N, I> where
N: Clone + MulAssign<N>,
I: SpIndex,
IStorage: Deref<Target = [I]>,
DStorage: DerefMut<Target = [N]>,
[src]
N: Clone + MulAssign<N>,
I: SpIndex,
IStorage: Deref<Target = [I]>,
DStorage: DerefMut<Target = [N]>,
fn mul_assign(&mut self, rhs: N)
[src]
impl<IStorage: PartialEq, DStorage: PartialEq, N: PartialEq, I: PartialEq + SpIndex> PartialEq<CsVecBase<IStorage, DStorage, N, I>> for CsVecBase<IStorage, DStorage, N, I> where
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
[src]
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
fn eq(&self, other: &CsVecBase<IStorage, DStorage, N, I>) -> bool
[src]
fn ne(&self, other: &CsVecBase<IStorage, DStorage, N, I>) -> bool
[src]
impl<N, I, IS1, DS1, IS2, DS2> RelativeEq<CsVecBase<IS2, DS2, N, I>> for CsVecBase<IS1, DS1, N, I> where
I: SpIndex,
CsVecBase<IS1, DS1, N, I>: PartialEq<CsVecBase<IS2, DS2, N, I>>,
IS1: Deref<Target = [I]>,
IS2: Deref<Target = [I]>,
DS1: Deref<Target = [N]>,
DS2: Deref<Target = [N]>,
N: RelativeEq,
N::Epsilon: Clone,
N: Zero,
[src]
I: SpIndex,
CsVecBase<IS1, DS1, N, I>: PartialEq<CsVecBase<IS2, DS2, N, I>>,
IS1: Deref<Target = [I]>,
IS2: Deref<Target = [I]>,
DS1: Deref<Target = [N]>,
DS2: Deref<Target = [N]>,
N: RelativeEq,
N::Epsilon: Clone,
N: Zero,
fn default_max_relative() -> N::Epsilon
[src]
fn relative_eq(
&self,
other: &CsVecBase<IS2, DS2, N, I>,
epsilon: N::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
&self,
other: &CsVecBase<IS2, DS2, N, I>,
epsilon: N::Epsilon,
max_relative: Self::Epsilon
) -> bool
pub fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
impl<IStorage, DStorage, N, I: SpIndex> Serialize for CsVecBase<IStorage, DStorage, N, I> where
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
IStorage: Serialize,
DStorage: Serialize,
[src]
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
IStorage: Serialize,
DStorage: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<IStorage, DStorage, N, I: SpIndex> StructuralEq for CsVecBase<IStorage, DStorage, N, I> where
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
[src]
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
impl<IStorage, DStorage, N, I: SpIndex> StructuralPartialEq for CsVecBase<IStorage, DStorage, N, I> where
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
[src]
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
impl<'a, 'b, N, I, IS1, DS1, IS2, DS2> Sub<&'b CsVecBase<IS2, DS2, N, I>> for &'a CsVecBase<IS1, DS1, N, I> where
N: Num + Clone + for<'r> SubAssign<&'r N>,
I: SpIndex,
IS1: Deref<Target = [I]>,
DS1: Deref<Target = [N]>,
IS2: Deref<Target = [I]>,
DS2: Deref<Target = [N]>,
[src]
N: Num + Clone + for<'r> SubAssign<&'r N>,
I: SpIndex,
IS1: Deref<Target = [I]>,
DS1: Deref<Target = [N]>,
IS2: Deref<Target = [I]>,
DS2: Deref<Target = [N]>,
type Output = CsVecI<N, I>
The resulting type after applying the -
operator.
fn sub(self, rhs: &CsVecBase<IS2, DS2, N, I>) -> CsVecI<N, I>
[src]
impl<N, I, IS1, DS1, IS2, DS2> UlpsEq<CsVecBase<IS2, DS2, N, I>> for CsVecBase<IS1, DS1, N, I> where
I: SpIndex,
CsVecBase<IS1, DS1, N, I>: PartialEq<CsVecBase<IS2, DS2, N, I>>,
IS1: Deref<Target = [I]>,
IS2: Deref<Target = [I]>,
DS1: Deref<Target = [N]>,
DS2: Deref<Target = [N]>,
N: UlpsEq,
N::Epsilon: Clone,
N: Zero,
[src]
I: SpIndex,
CsVecBase<IS1, DS1, N, I>: PartialEq<CsVecBase<IS2, DS2, N, I>>,
IS1: Deref<Target = [I]>,
IS2: Deref<Target = [I]>,
DS1: Deref<Target = [N]>,
DS2: Deref<Target = [N]>,
N: UlpsEq,
N::Epsilon: Clone,
N: Zero,
fn default_max_ulps() -> u32
[src]
fn ulps_eq(
&self,
other: &CsVecBase<IS2, DS2, N, I>,
epsilon: N::Epsilon,
max_ulps: u32
) -> bool
[src]
&self,
other: &CsVecBase<IS2, DS2, N, I>,
epsilon: N::Epsilon,
max_ulps: u32
) -> bool
pub fn ulps_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_ulps: u32
) -> bool
[src]
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_ulps: u32
) -> bool
impl<N, I: SpIndex, IS: Deref<Target = [I]>, DS: Deref<Target = [N]>> VecDim<N> for CsVecBase<IS, DS, N, I>
[src]
Auto Trait Implementations
impl<IStorage, DStorage, N, I> RefUnwindSafe for CsVecBase<IStorage, DStorage, N, I> where
DStorage: RefUnwindSafe,
IStorage: RefUnwindSafe,
DStorage: RefUnwindSafe,
IStorage: RefUnwindSafe,
impl<IStorage, DStorage, N, I> Send for CsVecBase<IStorage, DStorage, N, I> where
DStorage: Send,
IStorage: Send,
DStorage: Send,
IStorage: Send,
impl<IStorage, DStorage, N, I> Sync for CsVecBase<IStorage, DStorage, N, I> where
DStorage: Sync,
IStorage: Sync,
DStorage: Sync,
IStorage: Sync,
impl<IStorage, DStorage, N, I> Unpin for CsVecBase<IStorage, DStorage, N, I> where
DStorage: Unpin,
IStorage: Unpin,
DStorage: Unpin,
IStorage: Unpin,
impl<IStorage, DStorage, N, I> UnwindSafe for CsVecBase<IStorage, DStorage, N, I> where
DStorage: UnwindSafe,
IStorage: UnwindSafe,
DStorage: UnwindSafe,
IStorage: UnwindSafe,
Blanket Implementations
impl<T> AdditiveMagma for T where
T: AbstractMagma<Additive>,
[src]
T: AbstractMagma<Additive>,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> ClosedNeg for T where
T: Neg<Output = T>,
[src]
T: Neg<Output = T>,
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub unsafe fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,