sunsided / minikalman-rs

Fixed- and floating-point Kalman filters for resource-constrained environments, written in Rust.
https://crates.io/crates/minikalman
MIT License
7 stars 1 forks source link

Use const generics. #1

Closed ahmedcharles closed 11 months ago

ahmedcharles commented 11 months ago

This doesn't remove the fields, it uses them to verify that all of the values are right through debug_asserts. I have more PRs that take this approach further.

The only issue with this is that it doesn't work with the trait, because Self::Target isn't the same time for each of the various functions.

Anyways, is this a direction that you're open to? Thanks.

sunsided commented 11 months ago

Absolutely, yes. The reason I didn't go for it yet is because of the limited compile-time arithmetic support for const generics.

ahmedcharles commented 11 months ago

Are you ok with the PR as is, or would you prefer some changes? Thanks.

ahmedcharles commented 11 months ago

ping?

sunsided commented 11 months ago

Heya, apologies for the delay. Didn't have the time to get into it in depth yet.

sunsided commented 11 months ago

@ahmedcharles Thanks for the implementation! I adjusted it a bit to get rid of the redundant row/column counts. Will merge in a bit.

ahmedcharles commented 11 months ago

I should've mentioned that I had a commit to remove those parameters, I didn't submit it because I wanted it to be obvious that the asserts were correct. :)

ahmedcharles commented 11 months ago

Thanks.