use crate::buffers::types::*;
use crate::matrix::{MatrixData, MatrixDataArray, MatrixDataBoxed};
pub struct BufferBuilder;
impl BufferBuilder {
pub fn state_vector_x<const STATES: usize>() -> StateVectorBufferBuilder<STATES> {
StateVectorBufferBuilder
}
#[allow(non_snake_case)]
#[doc(alias = "system_state_transition_A")]
pub fn system_matrix_A<const STATES: usize>() -> StateTransitionMatrixBufferBuilder<STATES> {
StateTransitionMatrixBufferBuilder
}
#[allow(non_snake_case)]
#[doc(alias = "system_covariance_P")]
pub fn estimate_covariance_P<const STATES: usize>(
) -> EstimateCovarianceMatrixBufferBuilder<STATES> {
EstimateCovarianceMatrixBufferBuilder
}
#[allow(non_snake_case)]
#[doc(alias = "process_noise_covariance_Q")]
pub fn direct_process_noise_covariance_Q<const STATES: usize>(
) -> DirectProcessNoiseCovarianceMatrixBufferBuilder<STATES> {
DirectProcessNoiseCovarianceMatrixBufferBuilder
}
pub fn control_vector_u<const CONTROLS: usize>() -> ControlVectorBufferBuilder<CONTROLS> {
ControlVectorBufferBuilder
}
#[allow(non_snake_case)]
pub fn control_matrix_B<const STATES: usize, const CONTROLS: usize>(
) -> ControlTransitionMatrixBufferBuilder<STATES, CONTROLS> {
ControlTransitionMatrixBufferBuilder
}
#[allow(non_snake_case)]
#[doc(alias = "control_covariance_Q")]
pub fn control_process_noise_covariance_Q<const CONTROLS: usize>(
) -> ControlProcessNoiseCovarianceMatrixBufferBuilder<CONTROLS> {
ControlProcessNoiseCovarianceMatrixBufferBuilder
}
#[doc(alias = "observation_vector_z")]
pub fn measurement_vector_z<const OBSERVATIONS: usize>(
) -> ObservationVectorBufferBuilder<OBSERVATIONS> {
ObservationVectorBufferBuilder
}
#[allow(non_snake_case)]
#[doc(alias = "measurement_transformation_H")]
pub fn observation_matrix_H<const OBSERVATIONS: usize, const STATES: usize>(
) -> ObservationMatrixBufferBuilder<OBSERVATIONS, STATES> {
ObservationMatrixBufferBuilder
}
#[allow(non_snake_case)]
pub fn observation_covariance_R<const OBSERVATIONS: usize>(
) -> MeasurementNoiseCovarianceMatrixBufferBuilder<OBSERVATIONS> {
MeasurementNoiseCovarianceMatrixBufferBuilder
}
pub fn innovation_vector_y<const OBSERVATIONS: usize>(
) -> InnovationVectorBufferBuilder<OBSERVATIONS> {
InnovationVectorBufferBuilder
}
#[allow(non_snake_case)]
pub fn innovation_covariance_S<const OBSERVATIONS: usize>(
) -> InnovationResidualCovarianceMatrixBufferBuilder<OBSERVATIONS> {
InnovationResidualCovarianceMatrixBufferBuilder
}
#[allow(non_snake_case)]
pub fn kalman_gain_K<const STATES: usize, const OBSERVATIONS: usize>(
) -> KalmanGainMatrixBufferBuilder<STATES, OBSERVATIONS> {
KalmanGainMatrixBufferBuilder
}
pub fn state_prediction_temp_x<const STATES: usize>(
) -> StatePredictionVectorBufferBuilder<STATES> {
StatePredictionVectorBufferBuilder
}
#[allow(non_snake_case)]
pub fn temp_system_covariance_P<const STATES: usize>(
) -> TemporarySystemCovarianceMatrixBufferBuilder<STATES> {
TemporarySystemCovarianceMatrixBufferBuilder
}
#[allow(non_snake_case)]
pub fn temp_BQ<const STATES: usize, const CONTROLS: usize>(
) -> TemporaryBQMatrixBufferBuilder<STATES, CONTROLS> {
TemporaryBQMatrixBufferBuilder
}
#[allow(non_snake_case)]
pub fn temp_S_inv<const OBSERVATIONS: usize>() -> TemporarySInvMatrixBufferBuilder<OBSERVATIONS>
{
TemporarySInvMatrixBufferBuilder
}
#[allow(non_snake_case)]
pub fn temp_HP<const OBSERVATIONS: usize, const STATES: usize>(
) -> TemporaryHPMatrixBufferBuilder<OBSERVATIONS, STATES> {
TemporaryHPMatrixBufferBuilder
}
#[allow(non_snake_case)]
pub fn temp_PHt<const STATES: usize, const OBSERVATIONS: usize>(
) -> TemporaryPHtMatrixBufferBuilder<STATES, OBSERVATIONS> {
TemporaryPHtMatrixBufferBuilder
}
#[allow(non_snake_case)]
pub fn temp_KHP<const STATES: usize>() -> TemporaryKHPMatrixBufferBuilder<STATES> {
TemporaryKHPMatrixBufferBuilder
}
#[allow(non_snake_case)]
pub fn sigma_point_matrix<const STATES: usize, const NUM_SIGMA: usize>(
) -> SigmaPointMatrixBufferBuilder<STATES, NUM_SIGMA> {
SigmaPointMatrixBufferBuilder
}
#[allow(non_snake_case)]
pub fn sigma_weights_vector<const NUM_SIGMA: usize>(
) -> SigmaWeightsVectorBufferBuilder<NUM_SIGMA> {
SigmaWeightsVectorBufferBuilder
}
#[allow(non_snake_case)]
pub fn sigma_propagated_matrix<const STATES: usize, const NUM_SIGMA: usize>(
) -> SigmaPropagatedMatrixBufferBuilder<STATES, NUM_SIGMA> {
SigmaPropagatedMatrixBufferBuilder
}
#[allow(non_snake_case)]
pub fn sigma_observed_matrix<const OBSERVATIONS: usize, const NUM_SIGMA: usize>(
) -> SigmaObservedMatrixBufferBuilder<OBSERVATIONS, NUM_SIGMA> {
SigmaObservedMatrixBufferBuilder
}
#[allow(non_snake_case)]
pub fn cross_covariance_matrix<const STATES: usize, const OBSERVATIONS: usize>(
) -> CrossCovarianceMatrixBufferBuilder<STATES, OBSERVATIONS> {
CrossCovarianceMatrixBufferBuilder
}
#[allow(non_snake_case)]
pub fn temp_sigma_P<const STATES: usize>() -> TempSigmaPMatrixBufferBuilder<STATES> {
TempSigmaPMatrixBufferBuilder
}
}
pub struct StateVectorBufferBuilder<const STATES: usize>;
pub struct StateTransitionMatrixBufferBuilder<const STATES: usize>;
#[doc(alias = "SystemCovarianceMatrixBufferBuilder")]
pub struct EstimateCovarianceMatrixBufferBuilder<const STATES: usize>;
pub struct DirectProcessNoiseCovarianceMatrixBufferBuilder<const STATES: usize>;
pub struct ControlVectorBufferBuilder<const CONTROLS: usize>;
pub struct ControlTransitionMatrixBufferBuilder<const STATES: usize, const CONTROLS: usize>;
#[doc(alias = "ControlCovarianceMatrixBufferBuilder")]
pub struct ControlProcessNoiseCovarianceMatrixBufferBuilder<const CONTROLS: usize>;
pub struct ObservationVectorBufferBuilder<const OBSERVATIONS: usize>;
pub struct ObservationMatrixBufferBuilder<const OBSERVATION: usize, const STATES: usize>;
pub struct InnovationVectorBufferBuilder<const OBSERVATIONS: usize>;
pub struct MeasurementNoiseCovarianceMatrixBufferBuilder<const OBSERVATIONS: usize>;
pub struct InnovationResidualCovarianceMatrixBufferBuilder<const OBSERVATIONS: usize>;
pub struct KalmanGainMatrixBufferBuilder<const STATES: usize, const OBSERVATIONS: usize>;
pub struct StatePredictionVectorBufferBuilder<const STATES: usize>;
pub struct TemporarySystemCovarianceMatrixBufferBuilder<const STATES: usize>;
pub struct TemporaryBQMatrixBufferBuilder<const STATES: usize, const CONTROLS: usize>;
pub struct TemporarySInvMatrixBufferBuilder<const OBSERVATIONS: usize>;
pub struct TemporaryHPMatrixBufferBuilder<const OBSERVATION: usize, const STATES: usize>;
pub struct TemporaryPHtMatrixBufferBuilder<const STATES: usize, const OBSERVATIONS: usize>;
pub struct TemporaryKHPMatrixBufferBuilder<const STATES: usize>;
pub struct SigmaPointMatrixBufferBuilder<const STATES: usize, const NUM_SIGMA: usize>;
pub struct SigmaWeightsVectorBufferBuilder<const NUM_SIGMA: usize>;
pub struct SigmaPropagatedMatrixBufferBuilder<const STATES: usize, const NUM_SIGMA: usize>;
pub struct SigmaObservedMatrixBufferBuilder<const OBSERVATIONS: usize, const NUM_SIGMA: usize>;
pub struct CrossCovarianceMatrixBufferBuilder<const STATES: usize, const OBSERVATIONS: usize>;
pub struct TempSigmaPMatrixBufferBuilder<const STATES: usize>;
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type StateVectorBufferOwnedType<const STATES: usize, T> =
StateVectorBuffer<STATES, T, MatrixDataArray<STATES, 1, STATES, T>>;
impl<const STATES: usize> StateVectorBufferBuilder<STATES> {
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(&self) -> StateVectorBufferOwnedType<STATES, T>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(&self, init: T) -> StateVectorBufferOwnedType<STATES, T>
where
T: Copy,
{
StateVectorBuffer::<STATES, T, MatrixDataArray<STATES, 1, STATES, T>>::new(
MatrixData::new_array::<STATES, 1, STATES, T>([init; STATES]),
)
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type SystemMatrixMutBufferOwnedType<const STATES: usize, T> =
StateTransitionMatrixMutBuffer<STATES, T, MatrixDataBoxed<STATES, STATES, T>>;
impl<const STATES: usize> StateTransitionMatrixBufferBuilder<STATES> {
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(&self) -> SystemMatrixMutBufferOwnedType<STATES, T>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(&self, init: T) -> SystemMatrixMutBufferOwnedType<STATES, T>
where
T: Copy,
{
StateTransitionMatrixMutBuffer::<STATES, T, MatrixDataBoxed<STATES, STATES, T>>::new(
MatrixData::new_boxed::<STATES, STATES, T, _>(alloc::vec![init; STATES * STATES]),
)
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[doc(alias = "SystemCovarianceMatrixBufferOwnedType")]
pub type EstimateCovarianceMatrixBufferOwnedType<const STATES: usize, T> =
EstimateCovarianceMatrixBuffer<STATES, T, MatrixDataBoxed<STATES, STATES, T>>;
impl<const STATES: usize> EstimateCovarianceMatrixBufferBuilder<STATES> {
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(&self) -> EstimateCovarianceMatrixBufferOwnedType<STATES, T>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(&self, init: T) -> EstimateCovarianceMatrixBufferOwnedType<STATES, T>
where
T: Copy,
{
EstimateCovarianceMatrixBuffer::<STATES, T, MatrixDataBoxed<STATES, STATES, T>>::new(
MatrixData::new_boxed::<STATES, STATES, T, _>(alloc::vec![init; STATES * STATES]),
)
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type ControlVectorBufferOwnedType<const STATES: usize, T> =
ControlVectorBuffer<STATES, T, MatrixDataArray<STATES, 1, STATES, T>>;
impl<const CONTROLS: usize> ControlVectorBufferBuilder<CONTROLS> {
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(
&self,
) -> ControlVectorBuffer<CONTROLS, T, MatrixDataArray<CONTROLS, 1, CONTROLS, T>>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(
&self,
init: T,
) -> ControlVectorBuffer<CONTROLS, T, MatrixDataArray<CONTROLS, 1, CONTROLS, T>>
where
T: Copy,
{
ControlVectorBuffer::<CONTROLS, T, MatrixDataArray<CONTROLS, 1, CONTROLS, T>>::new(
MatrixData::new_array::<CONTROLS, 1, CONTROLS, T>([init; CONTROLS]),
)
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type ControlMatrixBufferOwnedType<const STATES: usize, const CONTROLS: usize, T> =
ControlMatrixMutBuffer<STATES, CONTROLS, T, MatrixDataBoxed<STATES, CONTROLS, T>>;
impl<const STATES: usize, const CONTROLS: usize>
ControlTransitionMatrixBufferBuilder<STATES, CONTROLS>
{
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(
&self,
) -> ControlMatrixMutBuffer<STATES, CONTROLS, T, MatrixDataBoxed<STATES, CONTROLS, T>>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(
&self,
init: T,
) -> ControlMatrixMutBuffer<STATES, CONTROLS, T, MatrixDataBoxed<STATES, CONTROLS, T>>
where
T: Copy,
{
ControlMatrixMutBuffer::<STATES, CONTROLS, T, MatrixDataBoxed<STATES, CONTROLS, T>>::new(
MatrixData::new_boxed::<STATES, CONTROLS, T, _>(alloc::vec![init; STATES * CONTROLS]),
)
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type DirectProcessNoiseCovarianceMatrixBufferOwnedType<const STATES: usize, T> =
DirectProcessNoiseCovarianceMatrixMutBuffer<STATES, T, MatrixDataBoxed<STATES, STATES, T>>;
impl<const CONTROLS: usize> DirectProcessNoiseCovarianceMatrixBufferBuilder<CONTROLS> {
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(
&self,
) -> DirectProcessNoiseCovarianceMatrixMutBuffer<
CONTROLS,
T,
MatrixDataBoxed<CONTROLS, CONTROLS, T>,
>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(
&self,
init: T,
) -> DirectProcessNoiseCovarianceMatrixMutBuffer<
CONTROLS,
T,
MatrixDataBoxed<CONTROLS, CONTROLS, T>,
>
where
T: Copy,
{
DirectProcessNoiseCovarianceMatrixMutBuffer::<
CONTROLS,
T,
MatrixDataBoxed<CONTROLS, CONTROLS, T>,
>::new(MatrixData::new_boxed::<CONTROLS, CONTROLS, T, _>(
alloc::vec![init; CONTROLS * CONTROLS],
))
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type ControlProcessNoiseCovarianceMatrixBufferOwnedType<const CONTROLS: usize, T> =
ControlProcessNoiseCovarianceMatrixMutBuffer<
CONTROLS,
T,
MatrixDataBoxed<CONTROLS, CONTROLS, T>,
>;
impl<const CONTROLS: usize> ControlProcessNoiseCovarianceMatrixBufferBuilder<CONTROLS> {
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(
&self,
) -> ControlProcessNoiseCovarianceMatrixMutBuffer<
CONTROLS,
T,
MatrixDataBoxed<CONTROLS, CONTROLS, T>,
>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(
&self,
init: T,
) -> ControlProcessNoiseCovarianceMatrixMutBuffer<
CONTROLS,
T,
MatrixDataBoxed<CONTROLS, CONTROLS, T>,
>
where
T: Copy,
{
ControlProcessNoiseCovarianceMatrixMutBuffer::<
CONTROLS,
T,
MatrixDataBoxed<CONTROLS, CONTROLS, T>,
>::new(MatrixData::new_boxed::<CONTROLS, CONTROLS, T, _>(
alloc::vec![init; CONTROLS * CONTROLS],
))
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type ObservationVectorBufferOwnedType<const OBSERVATIONS: usize, T> =
MeasurementVectorBuffer<OBSERVATIONS, T, MatrixDataArray<OBSERVATIONS, 1, OBSERVATIONS, T>>;
impl<const OBSERVATIONS: usize> ObservationVectorBufferBuilder<OBSERVATIONS> {
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(&self) -> ObservationVectorBufferOwnedType<OBSERVATIONS, T>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(&self, init: T) -> ObservationVectorBufferOwnedType<OBSERVATIONS, T>
where
T: Copy,
{
MeasurementVectorBuffer::<OBSERVATIONS, T, MatrixDataArray<OBSERVATIONS, 1, OBSERVATIONS, T>>::new(
MatrixData::new_array::<OBSERVATIONS, 1, OBSERVATIONS, T>([init; OBSERVATIONS]),
)
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type ObservationMatrixBufferOwnedType<const OBSERVATIONS: usize, const STATES: usize, T> =
ObservationMatrixMutBuffer<OBSERVATIONS, STATES, T, MatrixDataBoxed<OBSERVATIONS, STATES, T>>;
impl<const OBSERVATIONS: usize, const STATES: usize>
ObservationMatrixBufferBuilder<OBSERVATIONS, STATES>
{
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(&self) -> ObservationMatrixBufferOwnedType<OBSERVATIONS, STATES, T>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(&self, init: T) -> ObservationMatrixBufferOwnedType<OBSERVATIONS, STATES, T>
where
T: Copy,
{
ObservationMatrixMutBuffer::<
OBSERVATIONS,
STATES,
T,
MatrixDataBoxed<OBSERVATIONS, STATES, T>,
>::new(MatrixData::new_boxed::<OBSERVATIONS, STATES, T, _>(
alloc::vec![init; OBSERVATIONS * STATES],
))
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type MeasurementNoiseCovarianceBufferOwnedType<const OBSERVATIONS: usize, T> =
MeasurementNoiseCovarianceMatrixBuffer<
OBSERVATIONS,
T,
MatrixDataBoxed<OBSERVATIONS, OBSERVATIONS, T>,
>;
impl<const OBSERVATIONS: usize> MeasurementNoiseCovarianceMatrixBufferBuilder<OBSERVATIONS> {
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(&self) -> MeasurementNoiseCovarianceBufferOwnedType<OBSERVATIONS, T>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(&self, init: T) -> MeasurementNoiseCovarianceBufferOwnedType<OBSERVATIONS, T>
where
T: Copy,
{
MeasurementNoiseCovarianceMatrixBuffer::<
OBSERVATIONS,
T,
MatrixDataBoxed<OBSERVATIONS, OBSERVATIONS, T>,
>::new(MatrixData::new_boxed::<OBSERVATIONS, OBSERVATIONS, T, _>(
alloc::vec![init; OBSERVATIONS * OBSERVATIONS],
))
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type InnovationVectorBufferOwnedType<const OBSERVATIONS: usize, T> =
InnovationVectorBuffer<OBSERVATIONS, T, MatrixDataArray<OBSERVATIONS, 1, OBSERVATIONS, T>>;
impl<const OBSERVATIONS: usize> InnovationVectorBufferBuilder<OBSERVATIONS> {
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(&self) -> InnovationVectorBufferOwnedType<OBSERVATIONS, T>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(&self, init: T) -> InnovationVectorBufferOwnedType<OBSERVATIONS, T>
where
T: Copy,
{
InnovationVectorBuffer::<OBSERVATIONS, T, MatrixDataArray<OBSERVATIONS, 1, OBSERVATIONS, T>>::new(
MatrixData::new_array::<OBSERVATIONS, 1, OBSERVATIONS, T>([init; OBSERVATIONS]),
)
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type InnovationResidualCovarianceMatrixBufferOwnedType<const OBSERVATIONS: usize, T> =
InnovationCovarianceMatrixBuffer<
OBSERVATIONS,
T,
MatrixDataBoxed<OBSERVATIONS, OBSERVATIONS, T>,
>;
impl<const OBSERVATIONS: usize> InnovationResidualCovarianceMatrixBufferBuilder<OBSERVATIONS> {
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(&self) -> InnovationResidualCovarianceMatrixBufferOwnedType<OBSERVATIONS, T>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(
&self,
init: T,
) -> InnovationResidualCovarianceMatrixBufferOwnedType<OBSERVATIONS, T>
where
T: Copy,
{
InnovationCovarianceMatrixBuffer::<
OBSERVATIONS,
T,
MatrixDataBoxed<OBSERVATIONS, OBSERVATIONS, T>,
>::new(MatrixData::new_boxed::<OBSERVATIONS, OBSERVATIONS, T, _>(
alloc::vec![init; OBSERVATIONS * OBSERVATIONS],
))
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type KalmanGainMatrixBufferOwnedType<const STATES: usize, const OBSERVATIONS: usize, T> =
KalmanGainMatrixBuffer<STATES, OBSERVATIONS, T, MatrixDataBoxed<STATES, OBSERVATIONS, T>>;
impl<const STATES: usize, const OBSERVATIONS: usize>
KalmanGainMatrixBufferBuilder<STATES, OBSERVATIONS>
{
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(&self) -> KalmanGainMatrixBufferOwnedType<STATES, OBSERVATIONS, T>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(&self, init: T) -> KalmanGainMatrixBufferOwnedType<STATES, OBSERVATIONS, T>
where
T: Copy,
{
KalmanGainMatrixBuffer::<
STATES,
OBSERVATIONS,
T,
MatrixDataBoxed<STATES, OBSERVATIONS, T>,
>::new(MatrixData::new_boxed::<STATES, OBSERVATIONS, T, _>(
alloc::vec![init; STATES * OBSERVATIONS],
))
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type TemporaryStatePredictionVectorBufferOwnedType<const STATES: usize, T> =
PredictedStateEstimateVectorBuffer<STATES, T, MatrixDataArray<STATES, 1, STATES, T>>;
impl<const STATES: usize> StatePredictionVectorBufferBuilder<STATES> {
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(&self) -> TemporaryStatePredictionVectorBufferOwnedType<STATES, T>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(&self, init: T) -> TemporaryStatePredictionVectorBufferOwnedType<STATES, T>
where
T: Copy,
{
PredictedStateEstimateVectorBuffer::<STATES, T, MatrixDataArray<STATES, 1, STATES, T>>::new(
MatrixData::new_array::<STATES, 1, STATES, T>([init; STATES]),
)
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type TemporaryStateMatrixBufferOwnedType<const STATES: usize, T> =
TemporaryStateMatrixBuffer<STATES, T, MatrixDataBoxed<STATES, STATES, T>>;
impl<const STATES: usize> TemporarySystemCovarianceMatrixBufferBuilder<STATES> {
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(&self) -> TemporaryStateMatrixBufferOwnedType<STATES, T>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(&self, init: T) -> TemporaryStateMatrixBufferOwnedType<STATES, T>
where
T: Copy,
{
TemporaryStateMatrixBuffer::<STATES, T, MatrixDataBoxed<STATES, STATES, T>>::new(
MatrixData::new_boxed::<STATES, STATES, T, _>(alloc::vec![init; STATES * STATES]),
)
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type TemporaryBQMatrixBufferOwnedType<const STATES: usize, const CONTROLS: usize, T> =
TemporaryBQMatrixBuffer<STATES, CONTROLS, T, MatrixDataBoxed<STATES, CONTROLS, T>>;
impl<const STATES: usize, const CONTROLS: usize> TemporaryBQMatrixBufferBuilder<STATES, CONTROLS> {
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(&self) -> TemporaryBQMatrixBufferOwnedType<STATES, CONTROLS, T>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(&self, init: T) -> TemporaryBQMatrixBufferOwnedType<STATES, CONTROLS, T>
where
T: Copy,
{
TemporaryBQMatrixBuffer::<STATES, CONTROLS, T, MatrixDataBoxed<STATES, CONTROLS, T>>::new(
MatrixData::new_boxed::<STATES, CONTROLS, T, _>(alloc::vec![init; STATES * CONTROLS]),
)
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type TemporarySInvertedMatrixBufferOwnedType<const OBSERVATIONS: usize, T> =
TemporaryResidualCovarianceInvertedMatrixBuffer<
OBSERVATIONS,
T,
MatrixDataBoxed<OBSERVATIONS, OBSERVATIONS, T>,
>;
impl<const OBSERVATIONS: usize> TemporarySInvMatrixBufferBuilder<OBSERVATIONS> {
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(&self) -> TemporarySInvertedMatrixBufferOwnedType<OBSERVATIONS, T>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(&self, init: T) -> TemporarySInvertedMatrixBufferOwnedType<OBSERVATIONS, T>
where
T: Copy,
{
TemporaryResidualCovarianceInvertedMatrixBuffer::<
OBSERVATIONS,
T,
MatrixDataBoxed<OBSERVATIONS, OBSERVATIONS, T>,
>::new(MatrixData::new_boxed::<OBSERVATIONS, OBSERVATIONS, T, _>(
alloc::vec![init; OBSERVATIONS * OBSERVATIONS],
))
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type TemporaryHPMatrixBufferOwnedType<const OBSERVATIONS: usize, const STATES: usize, T> =
TemporaryHPMatrixBuffer<OBSERVATIONS, STATES, T, MatrixDataBoxed<OBSERVATIONS, STATES, T>>;
impl<const OBSERVATIONS: usize, const STATES: usize>
TemporaryHPMatrixBufferBuilder<OBSERVATIONS, STATES>
{
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(&self) -> TemporaryHPMatrixBufferOwnedType<OBSERVATIONS, STATES, T>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(&self, init: T) -> TemporaryHPMatrixBufferOwnedType<OBSERVATIONS, STATES, T>
where
T: Copy,
{
TemporaryHPMatrixBuffer::<
OBSERVATIONS,
STATES,
T,
MatrixDataBoxed<OBSERVATIONS, STATES, T>,
>::new(MatrixData::new_boxed::<OBSERVATIONS, STATES, T, _>(
alloc::vec![init; OBSERVATIONS * STATES],
))
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type TemporaryPHtMatrixBufferOwnedType<const STATES: usize, const OBSERVATIONS: usize, T> =
TemporaryPHTMatrixBuffer<STATES, OBSERVATIONS, T, MatrixDataBoxed<STATES, OBSERVATIONS, T>>;
impl<const STATES: usize, const OBSERVATIONS: usize>
TemporaryPHtMatrixBufferBuilder<STATES, OBSERVATIONS>
{
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(&self) -> TemporaryPHtMatrixBufferOwnedType<STATES, OBSERVATIONS, T>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(&self, init: T) -> TemporaryPHtMatrixBufferOwnedType<STATES, OBSERVATIONS, T>
where
T: Copy,
{
TemporaryPHTMatrixBuffer::<
STATES,
OBSERVATIONS,
T,
MatrixDataBoxed<STATES, OBSERVATIONS, T>,
>::new(MatrixData::new_boxed::<STATES, OBSERVATIONS, T, _>(
alloc::vec![init; STATES * OBSERVATIONS],
))
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type TemporaryKHPMatrixBufferOwnedType<const STATES: usize, T> =
TemporaryKHPMatrixBuffer<STATES, T, MatrixDataBoxed<STATES, STATES, T>>;
impl<const STATES: usize> TemporaryKHPMatrixBufferBuilder<STATES> {
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(&self) -> TemporaryKHPMatrixBufferOwnedType<STATES, T>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(&self, init: T) -> TemporaryKHPMatrixBufferOwnedType<STATES, T>
where
T: Copy,
{
TemporaryKHPMatrixBuffer::<STATES, T, MatrixDataBoxed<STATES, STATES, T>>::new(
MatrixData::new_boxed::<STATES, STATES, T, _>(alloc::vec![init; STATES * STATES]),
)
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type SigmaPointMatrixBufferOwnedType<const STATES: usize, const NUM_SIGMA: usize, T> =
SigmaPointMatrixBuffer<STATES, NUM_SIGMA, T, MatrixDataBoxed<STATES, NUM_SIGMA, T>>;
impl<const STATES: usize, const NUM_SIGMA: usize> SigmaPointMatrixBufferBuilder<STATES, NUM_SIGMA> {
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(&self) -> SigmaPointMatrixBufferOwnedType<STATES, NUM_SIGMA, T>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(&self, init: T) -> SigmaPointMatrixBufferOwnedType<STATES, NUM_SIGMA, T>
where
T: Copy,
{
SigmaPointMatrixBuffer::<STATES, NUM_SIGMA, T, MatrixDataBoxed<STATES, NUM_SIGMA, T>>::new(
MatrixData::new_boxed::<STATES, NUM_SIGMA, T, _>(alloc::vec![init; STATES * NUM_SIGMA]),
)
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type SigmaWeightsVectorBufferOwnedType<const NUM_SIGMA: usize, T> =
SigmaWeightsVectorBuffer<NUM_SIGMA, T, MatrixDataArray<NUM_SIGMA, 1, NUM_SIGMA, T>>;
impl<const NUM_SIGMA: usize> SigmaWeightsVectorBufferBuilder<NUM_SIGMA> {
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(&self) -> SigmaWeightsVectorBufferOwnedType<NUM_SIGMA, T>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(&self, init: T) -> SigmaWeightsVectorBufferOwnedType<NUM_SIGMA, T>
where
T: Copy,
{
SigmaWeightsVectorBuffer::<NUM_SIGMA, T, MatrixDataArray<NUM_SIGMA, 1, NUM_SIGMA, T>>::new(
MatrixData::new_array::<NUM_SIGMA, 1, NUM_SIGMA, T>([init; NUM_SIGMA]),
)
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type SigmaPropagatedMatrixBufferOwnedType<const STATES: usize, const NUM_SIGMA: usize, T> =
SigmaPropagatedMatrixBuffer<STATES, NUM_SIGMA, T, MatrixDataBoxed<STATES, NUM_SIGMA, T>>;
impl<const STATES: usize, const NUM_SIGMA: usize>
SigmaPropagatedMatrixBufferBuilder<STATES, NUM_SIGMA>
{
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(&self) -> SigmaPropagatedMatrixBufferOwnedType<STATES, NUM_SIGMA, T>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(&self, init: T) -> SigmaPropagatedMatrixBufferOwnedType<STATES, NUM_SIGMA, T>
where
T: Copy,
{
SigmaPropagatedMatrixBuffer::<
STATES,
NUM_SIGMA,
T,
MatrixDataBoxed<STATES, NUM_SIGMA, T>,
>::new(MatrixData::new_boxed::<STATES, NUM_SIGMA, T, _>(
alloc::vec![init; STATES * NUM_SIGMA],
))
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type SigmaObservedMatrixBufferOwnedType<const OBSERVATIONS: usize, const NUM_SIGMA: usize, T> =
SigmaObservedMatrixBuffer<
OBSERVATIONS,
NUM_SIGMA,
T,
MatrixDataBoxed<OBSERVATIONS, NUM_SIGMA, T>,
>;
impl<const OBSERVATIONS: usize, const NUM_SIGMA: usize>
SigmaObservedMatrixBufferBuilder<OBSERVATIONS, NUM_SIGMA>
{
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(&self) -> SigmaObservedMatrixBufferOwnedType<OBSERVATIONS, NUM_SIGMA, T>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(
&self,
init: T,
) -> SigmaObservedMatrixBufferOwnedType<OBSERVATIONS, NUM_SIGMA, T>
where
T: Copy,
{
SigmaObservedMatrixBuffer::<
OBSERVATIONS,
NUM_SIGMA,
T,
MatrixDataBoxed<OBSERVATIONS, NUM_SIGMA, T>,
>::new(MatrixData::new_boxed::<OBSERVATIONS, NUM_SIGMA, T, _>(
alloc::vec![init; OBSERVATIONS * NUM_SIGMA],
))
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type CrossCovarianceMatrixBufferOwnedType<const STATES: usize, const OBSERVATIONS: usize, T> =
CrossCovarianceMatrixBuffer<STATES, OBSERVATIONS, T, MatrixDataBoxed<STATES, OBSERVATIONS, T>>;
impl<const STATES: usize, const OBSERVATIONS: usize>
CrossCovarianceMatrixBufferBuilder<STATES, OBSERVATIONS>
{
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(&self) -> CrossCovarianceMatrixBufferOwnedType<STATES, OBSERVATIONS, T>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(
&self,
init: T,
) -> CrossCovarianceMatrixBufferOwnedType<STATES, OBSERVATIONS, T>
where
T: Copy,
{
CrossCovarianceMatrixBuffer::<
STATES,
OBSERVATIONS,
T,
MatrixDataBoxed<STATES, OBSERVATIONS, T>,
>::new(MatrixData::new_boxed::<STATES, OBSERVATIONS, T, _>(
alloc::vec![init; STATES * OBSERVATIONS],
))
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub type TempSigmaPMatrixBufferOwnedType<const STATES: usize, T> =
TempSigmaPMatrixBuffer<STATES, T, MatrixDataBoxed<STATES, STATES, T>>;
impl<const STATES: usize> TempSigmaPMatrixBufferBuilder<STATES> {
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new<T>(&self) -> TempSigmaPMatrixBufferOwnedType<STATES, T>
where
T: Copy + Default,
{
self.new_with(T::default())
}
#[allow(clippy::new_ret_no_self, clippy::wrong_self_convention)]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
#[cfg(feature = "alloc")]
pub fn new_with<T>(&self, init: T) -> TempSigmaPMatrixBufferOwnedType<STATES, T>
where
T: Copy,
{
TempSigmaPMatrixBuffer::<STATES, T, MatrixDataBoxed<STATES, STATES, T>>::new(
MatrixData::new_boxed::<STATES, STATES, T, _>(alloc::vec![init; STATES * STATES]),
)
}
}