ObservationMatrixMutBuffer

Struct ObservationMatrixMutBuffer 

Source
pub struct ObservationMatrixMutBuffer<const OBSERVATIONS: usize, const STATES: usize, T, M>(/* private fields */)
where
    M: MatrixMut<OBSERVATIONS, STATES, T>;
Expand description

Mutable buffer for the observation matrix (num_controls × num_states), typically denoted “H”.

§Regular Kalman Filters

This matrix represents the observation model. It defines the relationship between the state and the measurements obtained from the system. The matrix ( H ) is used to map the predicted state into the measurement space, allowing the Kalman filter to compare the predicted measurements with the actual measurements for updating the state estimate.

§Extended Kalman Filters

This matrix represents the observation model in the context of the Extended Kalman Filter (EKF). It defines the relationship between the state and the measurements obtained from the system. In the EKF, the matrix ( H ) is the Jacobian of the measurement function with respect to the state, evaluated at the current state estimate. This Jacobian matrix linearizes the non-linear measurement function around the current estimate, allowing the EKF to map the predicted state into the measurement space for comparison with the actual measurements during the update step.

§Example

use minikalman::buffers::types::ObservationMatrixMutBuffer;
use minikalman::prelude::*;

// From owned data
let buffer = ObservationMatrixMutBuffer::new(MatrixData::new_array::<2, 2, 4, f32>([0.0; 4]));

// From a reference
let mut data = [0.0; 4];
let buffer = ObservationMatrixMutBuffer::<2, 2, f32, _>::from(data.as_mut_slice());

Implementations§

Source§

impl<const OBSERVATIONS: usize, const STATES: usize, T, M> ObservationMatrixMutBuffer<OBSERVATIONS, STATES, T, M>
where M: MatrixMut<OBSERVATIONS, STATES, T>,

Source

pub const fn new(matrix: M) -> Self

Source

pub const fn len(&self) -> usize

Source

pub const fn is_empty(&self) -> bool

Source

pub fn is_valid(&self) -> bool

Ensures the underlying buffer has enough space for the expected number of values.

Trait Implementations§

Source§

impl<'a, const OBSERVATIONS: usize, const STATES: usize, T> From<&'a mut [T]> for ObservationMatrixMutBuffer<OBSERVATIONS, STATES, T, MatrixDataMut<'a, OBSERVATIONS, STATES, T>>

Source§

fn from(value: &'a mut [T]) -> Self

Converts to this type from the input type.
Source§

impl<const OBSERVATIONS: usize, const STATES: usize, const TOTAL: usize, T> From<[T; TOTAL]> for ObservationMatrixMutBuffer<OBSERVATIONS, STATES, T, MatrixDataArray<OBSERVATIONS, STATES, TOTAL, T>>

Source§

fn from(value: [T; TOTAL]) -> Self

Converts to this type from the input type.
Source§

impl<const OBSERVATIONS: usize, const STATES: usize, T, M> Index<usize> for ObservationMatrixMutBuffer<OBSERVATIONS, STATES, T, M>
where M: MatrixMut<OBSERVATIONS, STATES, T>,

Source§

type Output = T

The returned type after indexing.
Source§

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

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

impl<const OBSERVATIONS: usize, const STATES: usize, T, M> IndexMut<usize> for ObservationMatrixMutBuffer<OBSERVATIONS, STATES, T, M>
where M: MatrixMut<OBSERVATIONS, STATES, T>,

Source§

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

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

impl<const OBSERVATIONS: usize, const STATES: usize, T, M> IntoInnerData for ObservationMatrixMutBuffer<OBSERVATIONS, STATES, T, M>
where M: MatrixMut<OBSERVATIONS, STATES, T> + IntoInnerData,

Source§

impl<const OBSERVATIONS: usize, const STATES: usize, T, M> Matrix<OBSERVATIONS, STATES, T> for ObservationMatrixMutBuffer<OBSERVATIONS, STATES, T, M>
where M: MatrixMut<OBSERVATIONS, STATES, T>,

Source§

fn rows(&self) -> usize

Returns the number of rows of this matrix.
Source§

fn cols(&self) -> usize

Returns the number of columns of this matrix.
Source§

fn inspect<F, O>(&self, f: F) -> O
where F: FnMut(&Self) -> O,

Applies a function to this matrix.
Source§

fn get(&self, row: usize, column: usize) -> T
where T: Copy,

Gets a matrix element Read more
Source§

fn get_column_copy(&self, column: usize, col_data: &mut [T])
where T: Copy,

Gets a copy of a matrix column Read more
Source§

fn get_row_copy(&self, row: usize, row_data: &mut [T])
where T: Copy,

Gets a copy of a matrix row Read more
Source§

fn copy<Target>(&self, target: &mut Target)
where Target: MatrixMut<ROWS, COLS, T>, T: Copy,

Copies the matrix from mat to target. Read more
Source§

fn mult_buffered<const U: usize, B, C>(&self, b: &B, c: &mut C, baux: &mut [T])
where B: Matrix<COLS, U, T>, C: MatrixMut<ROWS, U, T>, T: MatrixDataType,

Performs a matrix multiplication such that C = A * B. This method uses an auxiliary buffer for keeping one row of B cached. This might improve performance on very wide matrices but is generally slower than Matrix::mult. Read more
Source§

fn mult<const U: usize, B, C>(&self, b: &B, c: &mut C)
where B: Matrix<COLS, U, T>, C: MatrixMut<ROWS, U, T>, T: MatrixDataType,

Performs a matrix multiplication such that C = A * B. Read more
Source§

fn mult_rowvector<X, C>(&self, x: &X, c: &mut C)
where X: Matrix<COLS, 1, T>, C: MatrixMut<ROWS, 1, T>, T: MatrixDataType,

Performs a matrix multiplication such that C = A * x. Read more
Source§

fn multadd_rowvector<X, C>(&self, x: &X, c: &mut C)
where X: Matrix<COLS, 1, T>, C: MatrixMut<ROWS, 1, T>, T: MatrixDataType,

Performs a matrix-vector multiplication and addition such that C = C + A * x. Read more
Source§

fn mult_transb<const U: usize, B, C>(&self, b: &B, c: &mut C)
where B: Matrix<U, COLS, T>, C: MatrixMut<ROWS, U, T>, T: MatrixDataType,

Performs a matrix multiplication with transposed B such that C = A * B'. Read more
Source§

fn multadd_transb<const U: usize, B, C>(&self, b: &B, c: &mut C)
where B: Matrix<U, COLS, T>, C: MatrixMut<ROWS, U, T>, T: MatrixDataType,

Performs a matrix multiplication with transposed B and adds the result to C such that C = C + A * B'. Read more
Source§

fn multscale_transb<const U: usize, B, C>(&self, b: &B, scale: T, c: &mut C)
where B: Matrix<U, COLS, T>, C: MatrixMut<ROWS, U, T>, T: MatrixDataType,

Performs a matrix multiplication with transposed B and scales the result such that C = A * B' * scale. Read more
Source§

fn sub<B, C>(&self, b: &B, c: &mut C)
where B: Matrix<ROWS, COLS, T>, C: MatrixMut<ROWS, COLS, T>, T: MatrixDataType,

Subtracts two matrices, using C = A - B. Read more
Source§

fn add_inplace_b<B>(&self, b: &mut B)
where B: MatrixMut<ROWS, COLS, T>, T: MatrixDataType,

Adds two matrices in place, using B = A + B Read more
Source§

fn sub_inplace_b<B>(&self, b: &mut B)
where B: MatrixMut<ROWS, COLS, T>, T: MatrixDataType,

Subtracts two matrices in place, using B = A - B. Read more
Source§

impl<const OBSERVATIONS: usize, const STATES: usize, T, M> MatrixMut<OBSERVATIONS, STATES, T> for ObservationMatrixMutBuffer<OBSERVATIONS, STATES, T, M>
where M: MatrixMut<OBSERVATIONS, STATES, T>,

Source§

fn apply<F, O>(&mut self, f: F) -> O
where F: FnMut(&mut Self) -> O,

Applies a function to this matrix.
Source§

fn clear(&mut self)
where T: Copy + Zero,

Sets all elements of the matrix to the zero.
Source§

fn set(&mut self, row: usize, column: usize, value: T)

Sets a matrix element Read more
Source§

fn set_all(&mut self, value: T)
where T: Copy,

Sets all elements of the matrix to the provided value. Read more
Source§

fn set_zero(&mut self)
where T: Copy + Zero,

Sets all elements of the matrix to the provided value. Read more
Source§

fn set_symmetric(&mut self, row: usize, column: usize, value: T)
where T: Copy,

Sets matrix elements in a symmetric matrix Read more
Source§

fn add_inplace_a<B>(&mut self, b: &B)
where B: Matrix<ROWS, COLS, T>, T: MatrixDataType,

Adds two matrices in place, using A = A + B Read more
Source§

fn sub_inplace_a<B>(&mut self, b: &B)
where B: Matrix<ROWS, COLS, T>, T: MatrixDataType,

Subtracts two matrices in place, using A = A - B. Read more
Source§

fn cholesky_decompose_lower(&mut self) -> bool
where T: MatrixDataType,

Decomposes a matrix into lower triangular form using Cholesky decomposition. Read more
Source§

impl<const OBSERVATIONS: usize, const STATES: usize, T, M> ObservationMatrix<OBSERVATIONS, STATES, T> for ObservationMatrixMutBuffer<OBSERVATIONS, STATES, T, M>
where M: MatrixMut<OBSERVATIONS, STATES, T>,

Source§

type Target = M

Source§

fn as_matrix(&self) -> &Self::Target

Source§

impl<const OBSERVATIONS: usize, const STATES: usize, T, M> ObservationMatrixMut<OBSERVATIONS, STATES, T> for ObservationMatrixMutBuffer<OBSERVATIONS, STATES, T, M>
where M: MatrixMut<OBSERVATIONS, STATES, T>,

Source§

type TargetMut = M

Source§

fn as_matrix_mut(&mut self) -> &mut Self::TargetMut

Source§

impl<const OBSERVATIONS: usize, const STATES: usize, T, M> RowMajorSequentialData<OBSERVATIONS, STATES, T> for ObservationMatrixMutBuffer<OBSERVATIONS, STATES, T, M>
where M: MatrixMut<OBSERVATIONS, STATES, T>,

Source§

fn as_slice(&self) -> &[T]

Gets the data as a slice. Read more
Source§

fn len(&self) -> usize

Gets the length of the data.
Source§

fn buffer_len(&self) -> usize

Gets the length of the underlying data buffer.
Source§

fn is_empty(&self) -> bool

Determines if this data is empty.
Source§

fn is_valid(&self) -> bool

Ensures the underlying buffer has enough space for the expected number of values.
Source§

fn get_at(&self, row: usize, column: usize) -> T
where T: Copy,

Gets a matrix element Read more
Source§

impl<const OBSERVATIONS: usize, const STATES: usize, T, M> RowMajorSequentialDataMut<OBSERVATIONS, STATES, T> for ObservationMatrixMutBuffer<OBSERVATIONS, STATES, T, M>
where M: MatrixMut<OBSERVATIONS, STATES, T>,

Source§

fn as_mut_slice(&mut self) -> &mut [T]

Source§

fn set_at(&mut self, row: usize, column: usize, value: T)

Gets a matrix element Read more

Auto Trait Implementations§

§

impl<const OBSERVATIONS: usize, const STATES: usize, T, M> Freeze for ObservationMatrixMutBuffer<OBSERVATIONS, STATES, T, M>
where M: Freeze,

§

impl<const OBSERVATIONS: usize, const STATES: usize, T, M> RefUnwindSafe for ObservationMatrixMutBuffer<OBSERVATIONS, STATES, T, M>

§

impl<const OBSERVATIONS: usize, const STATES: usize, T, M> Send for ObservationMatrixMutBuffer<OBSERVATIONS, STATES, T, M>
where M: Send, T: Send,

§

impl<const OBSERVATIONS: usize, const STATES: usize, T, M> Sync for ObservationMatrixMutBuffer<OBSERVATIONS, STATES, T, M>
where M: Sync, T: Sync,

§

impl<const OBSERVATIONS: usize, const STATES: usize, T, M> Unpin for ObservationMatrixMutBuffer<OBSERVATIONS, STATES, T, M>
where M: Unpin, T: Unpin,

§

impl<const OBSERVATIONS: usize, const STATES: usize, T, M> UnwindSafe for ObservationMatrixMutBuffer<OBSERVATIONS, STATES, T, M>
where M: UnwindSafe, T: 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> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
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<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<const N: usize, T, M> ColumnVector<N, T> for M
where M: Matrix<1, N, T>,

Source§

fn get_col(&self, column: usize) -> T
where T: Copy,

Gets the value of the n-th column of a matrix of size 1×N.
Source§

impl<const N: usize, T, M> ColumnVectorMut<N, T> for M
where M: MatrixMut<1, N, T>,

Source§

fn set_col(&mut self, column: usize, value: T)

Sets the value of the n-th column of a matrix of size 1×N.
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<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

Source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
Source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

Source§

fn lossy_into(self) -> Dst

Performs the conversion.
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<const N: usize, T, M> RowVector<N, T> for M
where M: Matrix<N, 1, T>,

Source§

fn get_row(&self, row: usize) -> T
where T: Copy,

Gets the value of the n-th row of a matrix of size N×1.
Source§

impl<const N: usize, T, M> RowVectorMut<N, T> for M
where M: MatrixMut<N, 1, T>,

Source§

fn set_row(&mut self, row: usize, value: T)

Sets the value of the n-th row of a matrix of size N×1.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T, M> Scalar<T> for M
where M: Matrix<1, 1, T>,

Source§

fn get_value(&self) -> T
where T: Copy,

Gets the value of a matrix of size 1×1.
Source§

impl<T, M> ScalarMut<T> for M
where M: MatrixMut<1, 1, T>,

Source§

fn set_value(&mut self, value: T)

Sets the value of a matrix of size 1×1.
Source§

impl<const N: usize, T, M> SquareMatrix<N, T> for M
where M: Matrix<N, N, T>,

Source§

fn invert_l_cholesky<I>(&self, inverse: &mut I)
where I: SquareMatrixMut<N, T>, T: MatrixDataType,

Inverts a square lower triangular matrix. Meant to be used with MatrixDataMut::cholesky_decompose_lower. Read more
Source§

impl<const N: usize, T, M> SquareMatrixMut<N, T> for M
where M: MatrixMut<N, N, T>,

Source§

fn make_identity(&mut self)
where T: One + Zero + Copy,

Sets this matrix to the identity matrix, i.e. all off-diagonal entries are set to zero, diagonal entries are set to 1.0.
Source§

fn make_scalar(&mut self, diagonal: T)
where T: Zero + Copy,

Sets this matrix to a scalar matrix, i.e. all off-diagonal entries are set to zero, diagonal entries are set to the provided value. Read more
Source§

fn set_diagonal_to_scalar(&mut self, value: T)
where T: Copy,

Sets the diagonal elements of the matrix to the provided value. Read more
Source§

fn make_comatrix(&mut self, diagonal: T, off_diagonal: T)
where T: Copy,

Sets this matrix to a comatrix, or constant diagonal matrix, i.e. a matrix where all off-diagonal entries are identical and all diagonal entries are identical. Read more
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.