openIndy lib (linear algebra) - OpenIndy/OpenIndy GitHub Wiki
"openIndyLib" is a seperate Qt-project where classes for linear algebra are implemented. In OpenIndy and in all plugins the "openIndyLib" is linked against as a dynamic library. In the following diagram you can see the structure of that library.
virtual OiVec addIn(OiVec v1, OiVec v2) = 0;
virtual OiMat addIn(OiMat m1, OiMat m2) = 0;
virtual OiVec substract(OiVec v1, OiVec v2) = 0;
virtual OiMat substract(OiMat m1, OiMat m2) = 0;
virtual OiMat multiply(OiMat m1, OiMat m2) = 0;
virtual OiVec multiply(OiMat m, OiVec v) = 0;
virtual OiMat multiply(double s, OiMat m) = 0;
virtual OiVec multiply(double s, OiVec v) = 0;
virtual OiMat invert(OiMat m) = 0;
virtual OiMat transpose(OiMat m) = 0;
virtual void svd(OiMat &u, OiVec &d, OiMat &v, OiMat x) = 0;
virtual OiVec cross(OiVec a, OiVec b) = 0;
virtual double dot(OiVec a, OiVec b) = 0;
};
This interface may be realized by many different implementations. The great advantage of this is that OpenIndy is not dependent on one special linear algebra library. There is always the possibility to switch the used linear algebra implementation. To switch the current implementation there is the static class [ChooseLALib](https://github.com/OpenIndy/OpenIndy/blob/master/lib/openIndyLib/include/chooselalib.h). Via the method `setLinearAlgebra` the current linear algebra library can be changed. Currently there is only one implementation `LAArmadillo` which uses the open source library [Armadillo](http://arma.sourceforge.net/).