327 Commits

Author SHA1 Message Date
Matthias Grob
b0b7d7229a Multiplication test: fix division resulting in NAN 2019-09-18 09:59:50 +02:00
Matthias Grob
3747232724 LeastSquaresSolver: Fix nasty GCC compile optimization error
The original implementation with no wrapping on size_t is more readable
but the compiler errors with:
internal compiler error: in trunc_int_for_mode, at explow.c:55
I read up and it's apparently a loop optimization problem.
Inspired by https://stackoverflow.com/a/27224697/6326048
I used a far less readable implementation that works fine and
wrote a comment to explain it.
2019-09-18 09:59:50 +02:00
Matthias Grob
5844b0e46e Implement one float equality check and use it everywhere 2019-09-18 09:59:50 +02:00
Matthias Grob
1e80807e8e test: Add uncovered equality checks with NAN and INFINITE 2019-09-18 09:59:50 +02:00
Matthias Grob
a374f37a54 Include helper_functions like all other library components 2019-09-18 09:59:50 +02:00
James Goppert
60c9c99dcc Fix type for division. 2019-09-17 11:08:00 -04:00
Julian Kent
b4714e2ed2 Don't lose array sizes in copyTo 2019-09-17 15:09:12 +02:00
Julian Kent
51d2f9f0dc Remove direct access to internal data 2019-09-16 21:58:32 -04:00
Julian Kent
18218c8f9c
Test non-square matrix multiplication (#91)
* Test non-square matrix multiplication
2019-09-16 17:40:25 +02:00
Julian Kent
b817e8677d Add helpers based on Slice: row(), col(), xy() 2019-09-16 16:11:08 +02:00
Julian Kent
82d565f4d9 Add support for Slice to Matrix, SquareMatrix, Vector 2019-09-16 16:11:08 +02:00
Julian Kent
af1378cc55 Add Slice class 2019-09-16 16:11:08 +02:00
Julian Kent
15865b741c Help compiler with name resolution to avoid overload mixups 2019-09-09 11:18:57 -07:00
Julian Kent
03ffd696a6 Replace pow with sqrt 2019-09-09 02:18:10 -07:00
Julian Kent
22bf63cb71 A smaller codesize wrap, since it gets inlined in many places 2019-09-05 22:31:13 +02:00
Matthias Grob
74ace7d1d5 helper test: cover wrap close to limits cases (#84) 2019-09-05 18:02:33 +02:00
Tanja Baumann
26fd962cbe fix bug in matrix wrap function (#83) 2019-09-05 11:21:41 +02:00
Julian Kent
4a4309327a better API comment
Co-Authored-By: Julian Oes <julian@oes.ch>
2019-09-05 10:19:47 +02:00
Matthias Grob
31450c407c Matrix: use existing print() if isEqual test fails 2019-09-05 10:19:47 +02:00
Matthias Grob
938274fce5 helper test: add extensive wrap tests 2019-09-05 10:19:47 +02:00
Matthias Grob
315010bae1 helper_functions: generalize wrap function to any range 2019-09-05 10:19:47 +02:00
Matthias Grob
007c7c58c4 fix math defines to have M_PI and M_TWOPI 2019-09-05 10:19:47 +02:00
Martina Rivizzigno
cc084e0791 matrix: add method to check all values are nan (#82) 2019-08-26 19:27:58 +02:00
kritz
84b3da227c Canonical Quaternion with tests (#81) 2019-08-22 15:05:14 +02:00
Matthias Grob
56b069956d slice test: fix trailing whitespace style 2019-03-08 20:20:08 +01:00
Oskar Weigl
5ccfa74c72 Fix const error 2019-03-08 19:17:40 +00:00
Oskar Weigl
eea6b59973 Implement slice as copy loop 2019-03-08 19:17:40 +00:00
Oskar Weigl
93375fbd3c Fix copy-paste error 2019-03-08 19:17:40 +00:00
Oskar Weigl
5872bbc28c Add slicing tests that are not pure row slicing
I had a look at the implementation of `slice`, and I found it odd that it doesn't have a copy loop. The current implementation does a raw memcpy of the underlying contiguous row-major data. As far as I can tell, this could only slice along rows. Interestingly, I found that the tests only tested for slicing along rows, so this bug would go unnoticed.

I added some tests that checks slicing along columns also. I have a feeling this would break, and we need to fix the implementation of `slice`. However I could be wrong, and hence I'm submitting these tests first to verify.
2019-03-08 19:17:40 +00:00
TSC21
ec436d5aee define FLT_EPSILON; be descriptive about upper_right_triangle() method 2019-02-24 17:14:05 +00:00
TSC21
7355a29a2a tests: use __FLT_EPSILON__ in comparisons 2019-02-24 17:14:05 +00:00
TSC21
7ab2b24e65 tests: urt: refactor 2019-02-24 17:14:05 +00:00
TSC21
4aab44fe01 Travis CI: update MacOS version to use 2019-02-24 17:14:05 +00:00
TSC21
707967d117 add test to .urt() 2019-02-24 17:14:05 +00:00
TSC21
210c76c04b add test to setNaN() 2019-02-24 17:14:05 +00:00
TSC21
96cb9ab146 add NaN value set for Matrix; add return of URT of a matrix 2019-02-24 17:14:05 +00:00
Daniel Agar
6b0777d815
stdlib_imports cinttypes currently unavailable in NuttX toolchain (#79) 2019-01-21 09:12:36 -05:00
Matthias Grob
18fba8221c quaternion: improve comments 2018-12-16 20:16:38 +01:00
Matthias Grob
a4f39c0f89 quaternion: reuse existing dot product 2018-12-16 20:16:38 +01:00
Matthias Grob
9c0acfba36 Matrix: remove unsafe copyToRaw method
It used a pointer and could therefore not do correct type checking
for index out of bound or struct memebr order.
Has to be considered unsafe and bad practise.
We should switch to arrays as representation for vectors
inside the messages instead of foo_x, foo_y, foo_z fields.
2018-11-20 16:39:44 +00:00
Beat Küng
0d3bff5e00 Vector2: add explicit constructor for Vector3
Initialize from the first 2 elements.
2018-10-01 10:17:16 +02:00
Beat Küng
807472bfd7 README: document how to run tests 2018-10-01 10:17:16 +02:00
Bart Slinger
30d5a79432 testing float/double with Type template 2018-09-18 09:39:17 +02:00
Bart Slinger
707e288019 explicit casting 2018-09-18 09:39:17 +02:00
Bart Slinger
480c5f1f8e static assert M>=N. floats to Type, arguments as const reference 2018-09-18 09:39:17 +02:00
Bart Slinger
7495794386 test zero divisions 2018-09-18 09:39:17 +02:00
Bart Slinger
3f2d3cf58d fix a div/0 condition 2018-09-18 09:39:17 +02:00
Bart Slinger
983a3f0212 use Matrix and Vector class for A and tau 2018-09-18 09:39:17 +02:00
Bart Slinger
98b8e2d43b formatting 2018-09-18 09:39:17 +02:00
Bart Slinger
0009328257 least squares solver for MxN matrices using QR householder algorithm 2018-09-18 09:39:17 +02:00