Struct faer_core::RowMut

source ·
pub struct RowMut<'a, T> { /* private fields */ }
Expand description

Mutable row vector view with general column stride.

For usage examples, see MatRef.

Implementations§

source§

impl<'a, T> RowMut<'a, T>

source

pub unsafe fn from_raw_parts( ptr: *mut T, ncols: usize, col_stride: isize ) -> Self

Returns a mutable row vector slice from the given arguments.
ptr: pointer to the first element of the row vector.
ncols: number of columns of the row vector.
col_stride: offset between the first elements of two successive columns in the row vector.

Safety

ptr must be non null and properly aligned for type T.
For each j < ncols,
ptr.offset(j as isize * col_stride) must point to a valid initialized object of type T, unless memory pointing to that address is never read.
Additionally, when j != 0, this pointer is never equal to ptr (no self aliasing).
The referenced memory must not be accessed by another pointer which was not derived from the return value, during the lifetime 'a.

source

pub fn as_ptr(self) -> *mut T

Returns a mutable pointer to the first (left) element of the row vector.

source

pub fn nrows(&self) -> usize

Returns the number of rows of the row vector. Always returns 1.

source

pub fn ncols(&self) -> usize

Returns the number of columns of the row vector.

source

pub fn col_stride(&self) -> isize

Returns the offset between the first elements of two successive columns in the row vector.

source

pub fn ptr_at(self, j: usize) -> *mut T

Returns a mutable pointer to the element at position (0, j) in the row vector.

source

pub unsafe fn ptr_in_bounds_at_unchecked(self, j: usize) -> *mut T

Returns a mutable pointer to the element at position (0, j) in the row vector, assuming it falls within its bounds with no bound checks.

Safety

Requires that

  • j < self.ncols().

Otherwise, the behavior is undefined.

source

pub fn ptr_in_bounds_at(self, j: usize) -> *mut T

Returns a mutable pointer to the element at position (0, j) in the row vector, while asserting that it falls within its bounds.

Panics

Requires that

  • j < self.ncols().

Otherwise, it panics.

source

pub unsafe fn write_at_unchecked(&mut self, j: usize, value: T)

Writes the given value to the matrix at position (0, j) in the row vector, assuming it falls within its bounds with no bound checks.

Safety

Requires that

  • j < self.ncols().

Otherwise, the behavior is undefined.

source

pub fn write_at(&mut self, j: usize, value: T)

Writes the given value to the matrix at position (0, j) in the row vector, or panics if the index is out of bounds.

Panics

Requires that

  • j < self.ncols().

Otherwise, it panics.

source

pub unsafe fn split_at_unchecked(self, j: usize) -> (Self, Self)

Splits the row vector into two parts in the following order: left, right.

Safety

Requires that

  • j <= self.ncols().

Otherwise, the behavior is undefined.

source

pub fn split_at(self, j: usize) -> (Self, Self)

Splits the row vector into two parts in the following order: left, right.

Panics

Requires that

  • j <= self.ncols().

Otherwise, it panics.

source

pub unsafe fn get_unchecked(self, j: usize) -> &'a mut T

Returns a mutable reference to the element at position (0, j), with no bound checks.

Safety

Requires j < self.ncols().

Otherwise, the behavior is undefined.

source

pub fn get(self, j: usize) -> &'a mut T

Returns a mutable reference to the element at position (0, j), or panics if the index is out of bounds.

source

pub fn as_2d(self) -> MatMut<'a, T>

Returns an equivalent matrix view over the same data.

source

pub fn transpose(self) -> ColMut<'a, T>

Returns the transpose of self.

source

pub unsafe fn subcols_unchecked(self, j: usize, ncols: usize) -> Self

Returns a view over subcolumns of self, starting at position j with a column count of ncols.

Safety

Requires that

  • j <= self.ncols(),
  • ncols <= self.ncols() - j.

Otherwise, the behavior is undefined.

source

pub fn subcols(self, j: usize, ncols: usize) -> Self

Returns a view over subcolumnss of self, starting at position j with a col count of ncols.

Panics

Requires that

  • j <= self.ncols(),
  • ncols <= self.ncols() - j.

Otherwise, it panics.

source

pub fn cwise(self) -> ZipRow<(Self,)>

Returns a thin wrapper that can be used to execute coefficientwise operations on matrices.

source§

impl<'a, T> RowMut<'a, Complex<T>>

source

pub fn into_real_imag(self) -> (RowMut<'a, T>, RowMut<'a, T>)

Trait Implementations§

source§

impl<'a, T: 'static, U: 'static> Coerce<RowMut<'a, U>> for RowMut<'a, T>

source§

fn coerce(self) -> RowMut<'a, U>

source§

impl<'short, 'a, T> CwiseRow<'short, &'short RowMut<'a, T>> for RowMut<'a, T>

§

type Item = &'short mut T

source§

fn ncols(&self) -> usize

source§

fn is_contiguous(&self) -> bool

source§

unsafe fn get_unchecked(&'short mut self, i: usize) -> Self::Item

source§

unsafe fn get_contiguous_unchecked(&'short mut self, i: usize) -> Self::Item

source§

impl<'a, T: Debug + 'static> Debug for RowMut<'a, T>

source§

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

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

impl<'a, T> Index<usize> for RowMut<'a, T>

§

type Output = T

The returned type after indexing.
source§

fn index(&self, j: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<'a, T> IndexMut<usize> for RowMut<'a, T>

source§

fn index_mut(&mut self, j: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<'a, T> IntoConst for RowMut<'a, T>

§

type Target = RowRef<'a, T>

source§

fn into_const(self) -> Self::Target

source§

impl<'a, T> IntoIterator for RowMut<'a, T>

§

type Item = &'a mut T

The type of the elements being iterated over.
§

type IntoIter = ElemIterMut<'a, T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<'b, 'a, T> Reborrow<'b, &'b RowMut<'a, T>> for RowMut<'a, T>

§

type Target = RowRef<'b, T>

source§

fn rb(&'b self) -> Self::Target

source§

impl<'b, 'a, T> ReborrowMut<'b, &'b RowMut<'a, T>> for RowMut<'a, T>

§

type Target = RowMut<'b, T>

source§

fn rb_mut(&'b mut self) -> Self::Target

source§

impl<'a, T: Send> Send for RowMut<'a, T>

source§

impl<'a, T: Sync> Sync for RowMut<'a, T>

Auto Trait Implementations§

§

impl<'a, T> RefUnwindSafe for RowMut<'a, T>where T: RefUnwindSafe,

§

impl<'a, T> Unpin for RowMut<'a, T>

§

impl<'a, T> !UnwindSafe for RowMut<'a, T>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> SameLayoutAs<T> for T