163 Commits

Author SHA1 Message Date
kritz
e81483a808 Catch quaternion canonical corner cases (#116) 2019-12-18 14:12:47 +01:00
kritz
2f6398168d Add several functions that are useful for coavriance matrices: (#114)
* uncorrelateCovariance
	* uncorrelateCovarianceSetVariance
	* makeBlockSymmetric
	* makeRowColSymmetric
	* isBlockSymmetric
	* isRowColSymmetric
2019-12-06 12:03:26 +01:00
kritz
5cbcf6035a Set Matrix's col amd row to single value (#113) 2019-12-05 18:16:14 +01:00
kritz
ef442fab92 Getter function for the diag elements of slice (#112) 2019-12-05 11:39:21 +01:00
kritz
de6a2d31ff Slice assign value (#111)
* Assign value to slice

* Readme for formatting
2019-12-04 14:33:33 +01:00
Julien Lecoeur
a172c3cdac Add implementation of pseudo-inverse (#102)
* Fix compilation error

* Add implementation of pseudo-inverse

The implementation is based on this publication:
Courrieu, P. (2008). Fast Computation of Moore-Penrose Inverse Matrices, 8(2), 25–29. http://arxiv.org/abs/0804.4809
It is a fully templated implementation to guaranty type correctness.

* Add tests for pseudoinverse

* Apply suggestions from code review

Co-Authored-By: Mathieu Bresciani <brescianimathieu@gmail.com>

* Adapt fullRankCholesky tolerance to type

* Add pseudoinverse test with effectiveness matrix

* Fix coverage

* Fix rebase issue

* Fix SquareMatrix test, add null Matrix test
2019-11-18 14:36:30 -08:00
kritz
38e966cea1 Add min, max, constrain function for Matrix (#105)
* Add min, max, constrain function for Matrix

* Set individual elements to nan in constrain

* Deal with NANs
2019-11-12 18:57:12 +01:00
kritz
93d42947b6 Add test for setting Quaternion to Identity (#104) 2019-11-08 17:27:33 +01:00
Julian Kent
445f58d484
Fix weird C preprocessor conflicts (#101) 2019-11-01 14:23:35 +01:00
Julian Kent
215203fc6f
Automatic Differentiation 'Dual' Type (#100)
* Dual numbers initial implementation

* Add test coverage, with partial derivative example

* Add Jacobian test, fix small issues

* Improve test to demonstrate non-square jacobian

* Better naming for collectReals/Derivatives

* Improve comments

* Potential GCC 4.8 bug workaround

* Add fallback workaround for non-IEEE float platforms
2019-10-23 12:07:51 +02:00
Julian Kent
92d1c8761e
More features: longerThan, norm, copyTo and slice on a Slice (#97)
* Allow slices of slices, add longerThan to Vector/Slice
2019-10-03 13:47:36 +02:00
Matthias Grob
740324cf1e Make all array constructors explicit (#99)
* Make all array constructors explicit

to avoid accidental implicit casts like e.g.
Vector3f v = 0;
assigning nullpointer content.
2019-10-03 13:38:51 +02:00
Julian Kent
7b34c1c51d Enable branch coverage 2019-10-03 08:32:05 +02:00
Matthias Grob
c34e8dc98f helper: consider matrices with the same NANs and INFINITYs equal
to simplify bulk checks when these values are expected
2019-09-18 09:59:50 +02:00
Matthias Grob
bbaa93880b helper: consider NAN equal to NAN such that vectors can be compared exactly 2019-09-18 09:59:50 +02:00
Matthias Grob
33a629105c Matrix: add proper print function testing
Before the print function was just implicitly called somewhere
and that's why we had 100% line coverage. With this we have actual
testing of the functions.
2019-09-18 09:59:50 +02:00
Matthias Grob
b0b7d7229a Multiplication test: fix division resulting in NAN 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
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
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
Matthias Grob
938274fce5 helper test: add extensive wrap tests 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
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
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
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
Bart Slinger
30d5a79432 testing float/double with Type template 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
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
Daniel Agar
f1bee775a0 use default constructors and skip unnecessary initialization 2018-08-31 08:11:02 +02:00
Daniel Agar
03a3e3ad46 helper_functions add wrap_2pi 2018-06-10 10:56:45 +02:00
James Goppert
e7c95fa027 Fix README/cmake format. 2018-03-28 00:11:03 -04:00
James Goppert
d142ac234c Fix coverage and bug in matrix equal test. 2018-03-28 00:09:01 -04:00