This fixes the warning appearing with GCC 10.2:
../../src/lib/matrix/matrix/Matrix.hpp:481:34: error: logical ‘and’ of equal expressions [-Werror=logical-op]
481 | for (size_t i = 0; i < M && i < N; i++) {
|
I would prefered something with if constexpr but we don't have that yet
in because we're using C++14.
* Add SparseVector
temp
* Add gtest
* Some reworking of the sparse concept
* Change type of M from int to size_t
* Add const modifier
* Add needed declaration for accessing elements of _indices
* Add norm_squared, norm, longerThan
* Add test for all sparse vector functions
* Add missing const to slice's norm_squared, norm and longerThan
* Construction from Vector<M> and carray[N]
* try to fix ci
Co-authored-by: Julian Kent <julian@auterion.com>
GCC 10 gives a warning
"comparison of unsigned expression in ‘>= 0’ is always true"
for these asserts since checking if an unsigned integer cannot
be negative and hence the statement gets droped.
Most often the multiplication in convention descriptions and papers is
described in matrix multiplication style like this:
q · p := Q(q)p
Q(q) :=
[q0 −q1 −q2 −q3]
[q1 q0 −q3 q2]
[q2 q3 q0 −q1]
[q3 −q2 q1 q0]
I'm just rearanging the terms such that it's easily comparable with
these definitions additional to it being clearly described by
documenting we use the hamilton convention.
I want to switch the print() function back to use printf()
such that it's fully compatible with all (embedded) platforms.
To still test the print function I'm capturing stdout into a file
such that the print() function can stay unchanged and the result of
the printf()s can be evaluated.
This is important depending on the platform because norm()
calls matrix::squrt() which dispatches correctly to the implementation
for the used type. Otherwise float squrt()s can get calculated as
double.