use crate::matrix::{AsMatrix, Matrix, MatrixMut};
use crate::prelude::{AsMatrixMut, RowMajorSequentialData, RowMajorSequentialDataMut};
use core::ops::{Index, IndexMut};
#[doc(alias = "Zustandsvektor")]
pub trait StateVector<const STATES: usize, T = f32>:
RowMajorSequentialData<STATES, 1, T> + Index<usize, Output = T> + AsMatrix<STATES, 1, T>
{
}
#[doc(alias = "Zustandsvektor")]
pub trait StateVectorMut<const STATES: usize, T = f32>:
StateVector<STATES, T>
+ RowMajorSequentialDataMut<STATES, 1, T>
+ IndexMut<usize, Output = T>
+ AsMatrixMut<STATES, 1, T>
{
}
#[doc(alias = "Übergangsmatrix")]
pub trait StateTransitionMatrix<const STATES: usize, T = f32>:
RowMajorSequentialData<STATES, STATES, T> + Index<usize, Output = T>
{
type Target: Matrix<STATES, STATES, T>;
fn as_matrix(&self) -> &Self::Target;
}
#[doc(alias = "Übergangsmatrix")]
pub trait StateTransitionMatrixMut<const STATES: usize, T = f32>:
StateTransitionMatrix<STATES, T>
+ RowMajorSequentialDataMut<STATES, STATES, T>
+ IndexMut<usize, Output = T>
{
type TargetMut: MatrixMut<STATES, STATES, T>;
fn as_matrix_mut(&mut self) -> &mut Self::TargetMut;
}
#[doc(alias = "SystemCovarianceMatrix")]
#[doc(alias = "Schätzkovarianzmatrix")]
pub trait EstimateCovarianceMatrix<const STATES: usize, T = f32>:
RowMajorSequentialData<STATES, STATES, T>
+ RowMajorSequentialDataMut<STATES, STATES, T>
+ Index<usize, Output = T>
+ IndexMut<usize, Output = T>
{
type Target: Matrix<STATES, STATES, T>;
type TargetMut: MatrixMut<STATES, STATES, T>;
fn as_matrix(&self) -> &Self::Target;
fn as_matrix_mut(&mut self) -> &mut Self::TargetMut;
}
#[doc(alias = "InputVector")]
#[doc(alias = "Steuervektor")]
pub trait ControlVector<const CONTROLS: usize, T = f32>:
RowMajorSequentialData<CONTROLS, 1, T> + Index<usize, Output = T> + AsMatrix<CONTROLS, 1, T>
{
}
#[doc(alias = "InputVectorMut")]
#[doc(alias = "Steuervektor")]
pub trait ControlVectorMut<const CONTROLS: usize, T = f32>:
ControlVector<CONTROLS, T>
+ RowMajorSequentialDataMut<CONTROLS, 1, T>
+ IndexMut<usize, Output = T>
+ AsMatrixMut<CONTROLS, 1, T>
{
}
#[doc(alias = "InputTransitionMatrix")]
#[doc(alias = "Steuermatrix")]
pub trait ControlMatrix<const STATES: usize, const CONTROLS: usize, T = f32>:
RowMajorSequentialData<STATES, CONTROLS, T> + Index<usize, Output = T>
{
type Target: Matrix<STATES, CONTROLS, T>;
fn as_matrix(&self) -> &Self::Target;
}
#[doc(alias = "InputTransitionMatrix")]
#[doc(alias = "Steuermatrix")]
pub trait ControlMatrixMut<const STATES: usize, const CONTROLS: usize, T = f32>:
ControlMatrix<STATES, CONTROLS, T>
+ RowMajorSequentialDataMut<STATES, CONTROLS, T>
+ IndexMut<usize, Output = T>
{
type TargetMut: MatrixMut<STATES, CONTROLS, T>;
fn as_matrix_mut(&mut self) -> &mut Self::TargetMut;
}
#[doc(alias = "ControlCovarianceMatrix")]
#[doc(alias = "Prozessrauschkovarianzmatrix")]
pub trait DirectProcessNoiseCovarianceMatrix<const STATES: usize, T = f32>:
RowMajorSequentialData<STATES, STATES, T> + Index<usize, Output = T>
{
type Target: Matrix<STATES, STATES, T>;
fn as_matrix(&self) -> &Self::Target;
}
#[doc(alias = "ControlCovarianceMatrixMut")]
#[doc(alias = "Prozessrauschkovarianzmatrix")]
pub trait DirectProcessNoiseCovarianceMatrixMut<const STATES: usize, T = f32>:
DirectProcessNoiseCovarianceMatrix<STATES, T>
+ RowMajorSequentialDataMut<STATES, STATES, T>
+ IndexMut<usize, Output = T>
{
type TargetMut: MatrixMut<STATES, STATES, T>;
fn as_matrix_mut(&mut self) -> &mut Self::TargetMut;
}
#[doc(alias = "ControlCovarianceMatrix")]
#[doc(alias = "Prozessrauschkovarianzmatrix")]
pub trait ControlProcessNoiseCovarianceMatrix<const CONTROLS: usize, T = f32>:
RowMajorSequentialData<CONTROLS, CONTROLS, T> + Index<usize, Output = T>
{
type Target: Matrix<CONTROLS, CONTROLS, T>;
fn as_matrix(&self) -> &Self::Target;
}
#[doc(alias = "ControlCovarianceMatrixMut")]
#[doc(alias = "Prozessrauschkovarianzmatrix")]
pub trait ControlProcessNoiseCovarianceMatrixMut<const CONTROLS: usize, T = f32>:
ControlProcessNoiseCovarianceMatrix<CONTROLS, T>
+ RowMajorSequentialDataMut<CONTROLS, CONTROLS, T>
+ IndexMut<usize, Output = T>
{
type TargetMut: MatrixMut<CONTROLS, CONTROLS, T>;
fn as_matrix_mut(&mut self) -> &mut Self::TargetMut;
}
pub trait PredictedStateEstimateVector<const STATES: usize, T = f32>:
RowMajorSequentialData<STATES, 1, T>
+ RowMajorSequentialDataMut<STATES, 1, T>
+ Index<usize, Output = T>
+ IndexMut<usize, Output = T>
+ AsMatrixMut<STATES, 1, T>
{
}
pub trait TemporaryStateMatrix<const STATES: usize, T = f32>:
RowMajorSequentialData<STATES, STATES, T>
+ RowMajorSequentialDataMut<STATES, STATES, T>
+ Index<usize, Output = T>
+ IndexMut<usize, Output = T>
{
type Target: Matrix<STATES, STATES, T>;
type TargetMut: MatrixMut<STATES, STATES, T>;
fn as_matrix(&self) -> &Self::Target;
fn as_matrix_mut(&mut self) -> &mut Self::TargetMut;
}
pub trait TemporaryBQMatrix<const STATES: usize, const CONTROLS: usize, T = f32>:
RowMajorSequentialData<STATES, CONTROLS, T>
+ RowMajorSequentialDataMut<STATES, CONTROLS, T>
+ Index<usize, Output = T>
+ IndexMut<usize, Output = T>
{
type Target: Matrix<STATES, CONTROLS, T>;
type TargetMut: MatrixMut<STATES, CONTROLS, T>;
fn as_matrix(&self) -> &Self::Target;
fn as_matrix_mut(&mut self) -> &mut Self::TargetMut;
}
#[doc(alias = "ObservationVector")]
#[doc(alias = "Messvektor")]
pub trait MeasurementVector<const OBSERVATIONS: usize, T = f32>:
RowMajorSequentialData<OBSERVATIONS, 1, T> + Index<usize, Output = T> + AsMatrix<OBSERVATIONS, 1, T>
{
}
#[doc(alias = "ObservationVectorMut")]
#[doc(alias = "Messvektor")]
pub trait MeasurementVectorMut<const OBSERVATIONS: usize, T = f32>:
MeasurementVector<OBSERVATIONS, T>
+ RowMajorSequentialDataMut<OBSERVATIONS, 1, T>
+ IndexMut<usize, Output = T>
+ AsMatrixMut<OBSERVATIONS, 1, T>
{
}
#[doc(alias = "Beobachtungsmatrix")]
pub trait ObservationMatrix<const OBSERVATIONS: usize, const STATES: usize, T = f32>:
RowMajorSequentialData<OBSERVATIONS, STATES, T> + Index<usize, Output = T>
{
type Target: Matrix<OBSERVATIONS, STATES, T>;
fn as_matrix(&self) -> &Self::Target;
}
#[doc(alias = "Beobachtungsmatrix")]
pub trait ObservationMatrixMut<const OBSERVATIONS: usize, const STATES: usize, T = f32>:
ObservationMatrix<OBSERVATIONS, STATES, T>
+ RowMajorSequentialDataMut<OBSERVATIONS, STATES, T>
+ IndexMut<usize, Output = T>
{
type TargetMut: MatrixMut<OBSERVATIONS, STATES, T>;
fn as_matrix_mut(&mut self) -> &mut Self::TargetMut;
}
#[doc(alias = "Messrauschkovarianzmatrix")]
pub trait MeasurementNoiseCovarianceMatrix<const OBSERVATIONS: usize, T = f32>:
RowMajorSequentialData<OBSERVATIONS, OBSERVATIONS, T>
+ RowMajorSequentialDataMut<OBSERVATIONS, OBSERVATIONS, T>
+ Index<usize, Output = T>
+ IndexMut<usize, Output = T>
{
type Target: Matrix<OBSERVATIONS, OBSERVATIONS, T>;
type TargetMut: MatrixMut<OBSERVATIONS, OBSERVATIONS, T>;
fn as_matrix(&self) -> &Self::Target;
fn as_matrix_mut(&mut self) -> &mut Self::TargetMut;
}
#[doc(alias = "Innovationsvektor")]
#[doc(alias = "Messabweichung")]
pub trait InnovationVector<const OBSERVATIONS: usize, T = f32>:
RowMajorSequentialData<OBSERVATIONS, 1, T>
+ RowMajorSequentialDataMut<OBSERVATIONS, 1, T>
+ Index<usize, Output = T>
+ IndexMut<usize, Output = T>
+ AsMatrix<OBSERVATIONS, 1, T>
+ AsMatrixMut<OBSERVATIONS, 1, T>
{
}
#[doc(alias = "ResidualCovarianceMatrix")]
#[doc(alias = "Innovationskovarianz")]
#[doc(alias = "Residualkovarianz")]
pub trait InnovationCovarianceMatrix<const OBSERVATIONS: usize, T = f32>:
RowMajorSequentialData<OBSERVATIONS, OBSERVATIONS, T>
+ RowMajorSequentialDataMut<OBSERVATIONS, OBSERVATIONS, T>
+ Index<usize, Output = T>
+ IndexMut<usize, Output = T>
{
type Target: Matrix<OBSERVATIONS, OBSERVATIONS, T>;
type TargetMut: MatrixMut<OBSERVATIONS, OBSERVATIONS, T>;
fn as_matrix(&self) -> &Self::Target;
fn as_matrix_mut(&mut self) -> &mut Self::TargetMut;
}
pub trait KalmanGainMatrix<const STATES: usize, const OBSERVATIONS: usize, T = f32>:
RowMajorSequentialData<STATES, OBSERVATIONS, T>
+ RowMajorSequentialDataMut<STATES, OBSERVATIONS, T>
+ Index<usize, Output = T>
+ IndexMut<usize, Output = T>
{
type Target: Matrix<STATES, OBSERVATIONS, T>;
type TargetMut: MatrixMut<STATES, OBSERVATIONS, T>;
fn as_matrix(&self) -> &Self::Target;
fn as_matrix_mut(&mut self) -> &mut Self::TargetMut;
}
pub trait TemporaryResidualCovarianceInvertedMatrix<const OBSERVATIONS: usize, T = f32>:
RowMajorSequentialData<OBSERVATIONS, OBSERVATIONS, T>
+ RowMajorSequentialDataMut<OBSERVATIONS, OBSERVATIONS, T>
+ Index<usize, Output = T>
+ IndexMut<usize, Output = T>
{
type Target: Matrix<OBSERVATIONS, OBSERVATIONS, T>;
type TargetMut: MatrixMut<OBSERVATIONS, OBSERVATIONS, T>;
fn as_matrix(&self) -> &Self::Target;
fn as_matrix_mut(&mut self) -> &mut Self::TargetMut;
}
pub trait TemporaryHPMatrix<const OBSERVATIONS: usize, const STATES: usize, T = f32>:
RowMajorSequentialData<OBSERVATIONS, STATES, T>
+ RowMajorSequentialDataMut<OBSERVATIONS, STATES, T>
+ Index<usize, Output = T>
+ IndexMut<usize, Output = T>
{
type Target: Matrix<OBSERVATIONS, STATES, T>;
type TargetMut: MatrixMut<OBSERVATIONS, STATES, T>;
fn as_matrix(&self) -> &Self::Target;
fn as_matrix_mut(&mut self) -> &mut Self::TargetMut;
}
pub trait TemporaryKHPMatrix<const STATES: usize, T = f32>:
RowMajorSequentialData<STATES, STATES, T>
+ RowMajorSequentialDataMut<STATES, STATES, T>
+ Index<usize, Output = T>
+ IndexMut<usize, Output = T>
{
type Target: Matrix<STATES, STATES, T>;
type TargetMut: MatrixMut<STATES, STATES, T>;
fn as_matrix(&self) -> &Self::Target;
fn as_matrix_mut(&mut self) -> &mut Self::TargetMut;
}
pub trait TemporaryPHTMatrix<const STATES: usize, const OBSERVATIONS: usize, T = f32>:
RowMajorSequentialData<STATES, OBSERVATIONS, T>
+ RowMajorSequentialDataMut<STATES, OBSERVATIONS, T>
+ Index<usize, Output = T>
+ IndexMut<usize, Output = T>
{
type Target: Matrix<STATES, OBSERVATIONS, T>;
type TargetMut: MatrixMut<STATES, OBSERVATIONS, T>;
fn as_matrix(&self) -> &Self::Target;
fn as_matrix_mut(&mut self) -> &mut Self::TargetMut;
}
pub trait SigmaPointMatrix<const STATES: usize, const NUM_SIGMA: usize, T = f32>:
RowMajorSequentialData<STATES, NUM_SIGMA, T>
+ RowMajorSequentialDataMut<STATES, NUM_SIGMA, T>
+ Index<usize, Output = T>
+ IndexMut<usize, Output = T>
{
type Target: Matrix<STATES, NUM_SIGMA, T>;
type TargetMut: MatrixMut<STATES, NUM_SIGMA, T>;
fn as_matrix(&self) -> &Self::Target;
fn as_matrix_mut(&mut self) -> &mut Self::TargetMut;
}
pub trait SigmaWeightsVector<const NUM_SIGMA: usize, T = f32>:
RowMajorSequentialData<NUM_SIGMA, 1, T> + Index<usize, Output = T> + AsMatrix<NUM_SIGMA, 1, T>
{
}
pub trait SigmaWeightsVectorMut<const NUM_SIGMA: usize, T = f32>:
SigmaWeightsVector<NUM_SIGMA, T>
+ RowMajorSequentialDataMut<NUM_SIGMA, 1, T>
+ IndexMut<usize, Output = T>
+ AsMatrixMut<NUM_SIGMA, 1, T>
{
}
pub trait SigmaPropagatedMatrix<const STATES: usize, const NUM_SIGMA: usize, T = f32>:
RowMajorSequentialData<STATES, NUM_SIGMA, T>
+ RowMajorSequentialDataMut<STATES, NUM_SIGMA, T>
+ Index<usize, Output = T>
+ IndexMut<usize, Output = T>
{
type Target: Matrix<STATES, NUM_SIGMA, T>;
type TargetMut: MatrixMut<STATES, NUM_SIGMA, T>;
fn as_matrix(&self) -> &Self::Target;
fn as_matrix_mut(&mut self) -> &mut Self::TargetMut;
}
pub trait SigmaObservedMatrix<const OBSERVATIONS: usize, const NUM_SIGMA: usize, T = f32>:
RowMajorSequentialData<OBSERVATIONS, NUM_SIGMA, T>
+ RowMajorSequentialDataMut<OBSERVATIONS, NUM_SIGMA, T>
+ Index<usize, Output = T>
+ IndexMut<usize, Output = T>
{
type Target: Matrix<OBSERVATIONS, NUM_SIGMA, T>;
type TargetMut: MatrixMut<OBSERVATIONS, NUM_SIGMA, T>;
fn as_matrix(&self) -> &Self::Target;
fn as_matrix_mut(&mut self) -> &mut Self::TargetMut;
}
pub trait CrossCovarianceMatrix<const STATES: usize, const OBSERVATIONS: usize, T = f32>:
RowMajorSequentialData<STATES, OBSERVATIONS, T>
+ RowMajorSequentialDataMut<STATES, OBSERVATIONS, T>
+ Index<usize, Output = T>
+ IndexMut<usize, Output = T>
{
type Target: Matrix<STATES, OBSERVATIONS, T>;
type TargetMut: MatrixMut<STATES, OBSERVATIONS, T>;
fn as_matrix(&self) -> &Self::Target;
fn as_matrix_mut(&mut self) -> &mut Self::TargetMut;
}
pub trait TempSigmaPMatrix<const STATES: usize, T = f32>:
RowMajorSequentialData<STATES, STATES, T>
+ RowMajorSequentialDataMut<STATES, STATES, T>
+ Index<usize, Output = T>
+ IndexMut<usize, Output = T>
{
type Target: Matrix<STATES, STATES, T>;
type TargetMut: MatrixMut<STATES, STATES, T>;
fn as_matrix(&self) -> &Self::Target;
fn as_matrix_mut(&mut self) -> &mut Self::TargetMut;
}