Struct nalgebra::core::MatrixVec [] [src]

#[repr(C)]
pub struct MatrixVec<N, R: Dim, C: Dim> { /* fields omitted */ }

A Vec-based matrix data storage. It may be dynamically-sized.

Methods

impl<N, R: Dim, C: Dim> MatrixVec<N, R, C>
[src]

[src]

Creates a new dynamic matrix data storage from the given vector and shape.

[src]

The underlying data storage.

[src]

The underlying mutable data storage.

This is unsafe because this may cause UB if the vector is modified by the user.

[src]

Resizes the undelying mutable data storage and unrwaps it.

If sz is larger than the current size, additional elements are uninitialized. If sz is smaller than the current size, additional elements are trucated.

Methods from Deref<Target = Vec<N>>

1.0.0
[src]

Returns the number of elements the vector can hold without reallocating.

Examples

let vec: Vec<i32> = Vec::with_capacity(10);
assert_eq!(vec.capacity(), 10);

1.0.0
[src]

Converts the vector into Box<[T]>.

Note that this will drop any excess capacity. Calling this and converting back to a vector with into_vec is equivalent to calling shrink_to_fit.

Examples

let v = vec![1, 2, 3];

let slice = v.into_boxed_slice();

Any excess capacity is removed:

let mut vec = Vec::with_capacity(10);
vec.extend([1, 2, 3].iter().cloned());

assert_eq!(vec.capacity(), 10);
let slice = vec.into_boxed_slice();
assert_eq!(slice.into_vec().capacity(), 3);

1.7.0
[src]

Extracts a slice containing the entire vector.

Equivalent to &s[..].

Examples

use std::io::{self, Write};
let buffer = vec![1, 2, 3, 5, 8];
io::sink().write(buffer.as_slice()).unwrap();

1.0.0
[src]

Returns the number of elements in the vector, also referred to as its 'length'.

Examples

let a = vec![1, 2, 3];
assert_eq!(a.len(), 3);

1.0.0
[src]

Returns true if the vector contains no elements.

Examples

let mut v = Vec::new();
assert!(v.is_empty());

v.push(1);
assert!(!v.is_empty());

Trait Implementations

impl<N: Eq, R: Eq + Dim, C: Eq + Dim> Eq for MatrixVec<N, R, C>
[src]

impl<N: Debug, R: Debug + Dim, C: Debug + Dim> Debug for MatrixVec<N, R, C>
[src]

[src]

Formats the value using the given formatter.

impl<N: Clone, R: Clone + Dim, C: Clone + Dim> Clone for MatrixVec<N, R, C>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<N: PartialEq, R: PartialEq + Dim, C: PartialEq + Dim> PartialEq for MatrixVec<N, R, C>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<N, R: Dim, C: Dim> Deref for MatrixVec<N, R, C>
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.

impl<N: Scalar, C: Dim> Storage<N, Dynamic, C> for MatrixVec<N, Dynamic, C> where
    DefaultAllocator: Allocator<N, Dynamic, C, Buffer = Self>, 
[src]

The static stride of this storage's rows.

The static stride of this storage's columns.

[src]

The matrix data pointer.

[src]

The dimension of the matrix at run-time. Arr length of zero indicates the additive identity element of any dimension. Must be equal to Self::dimension() if it is not None. Read more

[src]

The spacing between concecutive row elements and consecutive column elements. Read more

[src]

Indicates whether this data buffer stores its elements contiguously.

[src]

Builds a matrix data storage that does not contain any reference.

[src]

Clones this data storage to one that does not contain any reference.

[src]

Retrieves the data buffer as a contiguous slice. Read more

[src]

Compute the index corresponding to the irow-th row and icol-th column of this matrix. The index must be such that the following holds: Read more

[src]

Gets the address of the i-th matrix component without performing bound-checking.

[src]

Gets the address of the i-th matrix component without performing bound-checking.

[src]

Retrieves a reference to the i-th element without bound-checking.

[src]

Retrieves a reference to the i-th element without bound-checking.

impl<N: Scalar, R: DimName> Storage<N, R, Dynamic> for MatrixVec<N, R, Dynamic> where
    DefaultAllocator: Allocator<N, R, Dynamic, Buffer = Self>, 
[src]

The static stride of this storage's rows.

The static stride of this storage's columns.

[src]

The matrix data pointer.

[src]

The dimension of the matrix at run-time. Arr length of zero indicates the additive identity element of any dimension. Must be equal to Self::dimension() if it is not None. Read more

[src]

The spacing between concecutive row elements and consecutive column elements. Read more

[src]

Indicates whether this data buffer stores its elements contiguously.

[src]

Builds a matrix data storage that does not contain any reference.

[src]

Clones this data storage to one that does not contain any reference.

[src]

Retrieves the data buffer as a contiguous slice. Read more

[src]

Compute the index corresponding to the irow-th row and icol-th column of this matrix. The index must be such that the following holds: Read more

[src]

Gets the address of the i-th matrix component without performing bound-checking.

[src]

Gets the address of the i-th matrix component without performing bound-checking.

[src]

Retrieves a reference to the i-th element without bound-checking.

[src]

Retrieves a reference to the i-th element without bound-checking.

impl<N: Scalar, C: Dim> StorageMut<N, Dynamic, C> for MatrixVec<N, Dynamic, C> where
    DefaultAllocator: Allocator<N, Dynamic, C, Buffer = Self>, 
[src]

[src]

The matrix mutable data pointer.

[src]

Retrieves the mutable data buffer as a contiguous slice. Read more

[src]

Gets the mutable address of the i-th matrix component without performing bound-checking.

[src]

Gets the mutable address of the i-th matrix component without performing bound-checking.

[src]

Retrieves a mutable reference to the i-th element without bound-checking.

[src]

Retrieves a mutable reference to the element at (irow, icol) without bound-checking.

[src]

Swaps two elements using their linear index without bound-checking.

[src]

Swaps two elements without bound-checking.

impl<N: Scalar, C: Dim> ContiguousStorage<N, Dynamic, C> for MatrixVec<N, Dynamic, C> where
    DefaultAllocator: Allocator<N, Dynamic, C, Buffer = Self>, 
[src]

impl<N: Scalar, C: Dim> ContiguousStorageMut<N, Dynamic, C> for MatrixVec<N, Dynamic, C> where
    DefaultAllocator: Allocator<N, Dynamic, C, Buffer = Self>, 
[src]

impl<N: Scalar, R: DimName> StorageMut<N, R, Dynamic> for MatrixVec<N, R, Dynamic> where
    DefaultAllocator: Allocator<N, R, Dynamic, Buffer = Self>, 
[src]

[src]

The matrix mutable data pointer.

[src]

Retrieves the mutable data buffer as a contiguous slice. Read more

[src]

Gets the mutable address of the i-th matrix component without performing bound-checking.

[src]

Gets the mutable address of the i-th matrix component without performing bound-checking.

[src]

Retrieves a mutable reference to the i-th element without bound-checking.

[src]

Retrieves a mutable reference to the element at (irow, icol) without bound-checking.

[src]

Swaps two elements using their linear index without bound-checking.

[src]

Swaps two elements without bound-checking.

impl<N: Scalar, R: DimName> ContiguousStorage<N, R, Dynamic> for MatrixVec<N, R, Dynamic> where
    DefaultAllocator: Allocator<N, R, Dynamic, Buffer = Self>, 
[src]

impl<N: Scalar, R: DimName> ContiguousStorageMut<N, R, Dynamic> for MatrixVec<N, R, Dynamic> where
    DefaultAllocator: Allocator<N, R, Dynamic, Buffer = Self>, 
[src]