Click here to Skip to main content
15,905,563 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my application I am using a few complex-values matrices. Working in Linux I am using the armadillo library for the matrix operations.

The operations are basically simple, just matrix - matrix additions and multiplications and some matrix-vector multiplications.
The real complex operation, only once per activation of the module, is taking the inverse of a complex-valued matrix (order app 60).

In armadillo there is a simple function to do that, as far as I can see
inverting a matrix with complex elements is far more complex that
inverting a real-values matrix
There is a reference to computing the inverse with real-valued
matrices, (A + jB)^-1 = (A + B * A^-1 * B)^-1 - j (B + A * B ^-1 * A)^-1),
but for whatever reason, the results I get in my application are less than
when using armadillo and do not give the right results

While armadillo is - more or less - a standard package in common Linux distros, there does not seem to be a useable 32 bit dll for use with windows.

My application - something to do with software defined radio - runs obviously under Linux and is cross compiled for Windows (mingw64-32), (I do not develop
under Windows). I distribute the software (it is free, GPL-V2), for Linux the
source code, for Windows an installer. The installer would contain the
required dll's.

The multiplication and addition, transposition etc are straightforward, so I do not need a library for that, only for the inversion.

So, the question is

a. is there a precompiled library with a dll for use under 32 bits windows that provides some Linear Algebra functions, such as matrix inversion, but for
matrices with complex elements. The order of the matrices is depending on
input and configuration, around 60 to 70.
b. otherwise is there functioning C or C++ code to do such operation?

Any pointers, links, code to solve the problem is appreciated

Thanks in advance

What I have tried:

As said, under Linux I am using armadillo, For windows I need either (a link to) sources for an inverter for complex-valued matrices, or a link to a dll that implements an inverter for complex-valued matrices
Updated 28-Nov-21 23:12pm

Look at Eigen[^].

It works with both dense and sparse matrices. While I haven't used it for complex algebra, it supports std::complex as underlining data type.
Share this answer
Share this answer
well, I tried to use "eigen", I am no sure I want to carry Matlab as required library in the distribution of my application.
Eigen did not solve the problem. For an optimal result I have to (pseudo) invert a non-square matrix (using A^T x A) ^-1 x A^T)
When feeding it random data it gives good results (tested by computing A^-1 x A),
however when feeding the data in my application the results arer just wrong.
(Eigen gives the same values as my own - straight forward - implementation, while armadillo gives the right results when using it in my application)
Anyway, the second best solution is to use square matrices, while there is a slight
loss in accuracy for the output of my application, results are acceptable.
In this set up I can use my own implementation and I do not have to carry a foreign library in the distribution

Anyway thanks for the link.
Just out of curiosity I'll give using matlab-based libs a try

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900