In C / C++ there are two kinds of undefined behaviour. One is where there is written in standard what UB is. Another one is everthing else that is not in standard.
Spending few weeks trying to understand Kalman filterm, I figured out that I need to understand all if the following:
1. Model of system
2. Internal state
3. How is optimal estimation defined
4. Covariance (statistics)
Kalman filter is optimal estimation of internal state and covariance of system based on measurements so far.
Kalman process/filter is mathematical solution to this problem as the system is evolving based on input and observable measurements. Turns out that internal state that includes both estimated value and covariance is all that is needed to fully capture internal state for such model.
It is important to undrstand, that having different model for what is optimum, uncertenty or system model, compared to what Rudolf Kalman presented, gives just different mathematical solution for this problem. Examples of different optimal solutions for different estimation models are nonlinear Kalman filters and Wiener filter.
---
I think that book on this topic from author Alex Becker is great and possibly best introduction into this topic. It has lot of examples and builds requred intuition really well. All I was missing is little more emphasis into mathematical rigor and chapter about LQG regulator, but you can find both of this in original paper by Rudolf Kalman.
Thanks for your feedback. I am thinking of writing a second volume with more advanced and less introductory topics, but I haven't decided yet. It is a serious commitment and it will take years to complete.
If I take this decision, I will consider a chapter on LQG.
Small clarification: nonlinear Kalman filters are suboptimal. EKF relies on linear approximations, and UKF uses heuristic approximations.
It improves immune system and geneal wellbeing. It is pain that you can get used to and I kind of enyoj it now in some weird way. It is hard, requires some dedication and brings some benefits, but does not requre extra time or planning. Great morale booster.
What are protental issues with compiler, by just disabling borrow checker? If I recall correctly some compiler optimisations for rust can not be done in C/C++ because of restrictions implied by borrow checker.
The crazy part about this is that (auto) vectorization in Rust looks something like this: iter.chunks(32).map(vectorized)
Where the vectorized function checks if the chunk has length 32, if yes run the algorithm, else run the algorithm.
The compiler knows that the chunk has a fixed size at compile time in the first block, which means it can now attempt to vectorize the algorithm with a SIMD size of 32. The else block handles the scalar case, where the chunk is smaller than 32.
The borrow checker does not deal with ownership, which is what rust’s memory management leverages. The borrow checker validates that borrows (references) are valid aka that they don’t outlive their sources and that exclusive borrows don’t overlap.
The borrow checker does not influence codegen at all.
It would be the same as in any language with manual memory management, you'd simply get a dangling pointer access. The 'move-by-default' semantics of Rust just makes this a lot trickier than in a 'copy-by-default' language though.
It's actually interesting to me that the Rust borrow checker can 'simply' be disabled (e.g. no language- or stdlib-features really depending on the borrow checker pass) - not that it's very useful in practice though.
"Math nerd explains how to spend 3 days proving 1+1=2" -> Original
"From Zero to QED: An informal introduction to formality with Lean 4"
https://news.ycombinator.com/item?id=46259343
Years ago I wrote c++ library for stream compostion. Something like C++20 ranges.
It turns out that as long as you compose everything with lambdas, compiled code is same as it would be with naive loops. Everything gets optimised.
For example, you can write sum of numbers less than n as:
reply