Linear algebra on Teensy 3.0

Status
Not open for further replies.

christoph

Well-known member
Hi all,

I need some linear algebra for a project. In a setup stage, I want to take measurements from a set of accelerometers and magnetometers and then calculate a rotation matrix that gives the closest match between the measurements and a known orientation. I've tried to include Armadillo and MTL4, but both use exceptions, streams and/or functions only found on a PC. Is there any lightweight linear algebra library, preferably in C++, that provides the following:
  • scale vector by scalar
  • vector length
  • scalar product of two vectors
  • matrix*vector product
  • solve A*x=b for A, preferably even a best fit for multiple sets of x and b
I only need speed for matrix*vector after the matrix involved has been calculated from a number of samples.

Regards

Christoph
 
I think I'd do this on a PC with MATLAB and a data acquisition product with MATLAB support, from National Instruments.
 
Thanks for the suggestion steve, but I can't do that for several reasons. The device must be mobile and operate from a battery for several hours. I also don't want to get Matlab for personal use.

The project is head-up display for an astronomical telescope, similar to the Telrad, but with a 128*128 OLED display instead of the fixed rings. I could also add a raspberry Pi to the whole thing to do the heavy maths and object lookup, but I'd like to keep everything on a Teensy 3.0 or (yay!) a Teensy 3.1.
 
Ah thanks for that suggestion, I'll give it a try.

In the meantime, I found libfixmatrix which is a matrix library for fixed-point math. It's written in C, and actually doing computations with multiple values is quite painful. It uses libfixmath to handle the fixed point values and adds vectors and matrices on top.

If eigen fits on my K20 and allows for a more relaxed syntax, that would be great!
 
The ARM CMSIS DSP functions are all available on Teensy3. I believe all the vector manipulation functions are there, but probably not anything like "solve A*x=b for A, preferably even a best fit for multiple sets of x and b".

Generally, these functions work on 3 data types, single precision float, "q15" and "q31", which are 16 and 32 bit integers representing -1 to +1.

Here's a site with documentation:

http://www.keil.com/pack/doc/cmsis/DSP/html/modules.html
 
Status
Not open for further replies.
Back
Top