pathfinder-for-autonomous-navigation / psim

Six DOF flight simulator and related GNC implementations.
MIT License
4 stars 6 forks source link

Updates to the lin Submodule #173

Closed kylekrol closed 4 years ago

kylekrol commented 4 years ago

Updates to the lin Submodule

Summary of changes

Without writing a ton, there are a whole new set of element wise operation functions that include: lin::add, lin::divide, lin::multiply, lin::negate, lin::sign, lin::multiply, etc which will always perform an element wise operation.

For example, the following code is equivalent to using .* in MATLAB:

lin::Matrix2x2f A { ... }, B { ... };
lin::Matrix2x2f C = lin::multiply(A, B);

These functions can also take a scalar in as any argument to, as an example, add 5.0 to every element of a matrix/vector:

lin::Matrix2x2d A = { ... };
A = lin::add(5.0, A);

Most of the above operations can be expressed using operator overloads as well; for example, lin::add(5.0, A) is equivalent to 5.0 + A. There is, however, the notable exception regarding lin::multiply. A * B from the example above would perform matrix multiplication; lin::multiply must be used explicitly for element wise multiplication.

Ptest Effects

NA

Testing

Unit tests continue to pass

Constants

NA

Documentation Evidence

Still need to find some time to create some tutorials or something along those lines.