Hi, i'm looking for some library that provides solving matrix determinant. My matrix contains complex numbers (complex.h).

## All 4 Replies

Hint: google search using C++ matrix determinant. It provided 12,000 hits. One of them, probably early on in the list, probably/may have something to help.

(it's not a recommendation, I never use this library but it's compact and simple;) ).

``````/* Do that, you can't compile it with VC++ when <complex> included
#if ( defined(__BORLANDC__) || _MSC_VER ) && !defined( __GNUG__ )
inline float abs (float v) { return (float)fabs( v); }
inline double abs (double v) { return fabs( v); }
inline long double abs (long double v) { return fabsl( v); }
#endif
*/``````

Now

``````#include <complex>
using namespace std;
#include "matrix.h"

typedef complex<double> Complex;
typedef math::matrix<Complex>  CMat;

int main()
{
CMat m(2,2);
m(0,0) = Complex(0,1);
m(0,1) = m(1,0) = 0.0;
m(1,1) = Complex(0,1);

cout << m.Det() << endl;

return 0;
}
// prints (-1,0)``````

Read package manual in pro_doc directory...

see...Cramers rule...then u can create your own library...

Cramer's rule is useful to fing solution of a system of linear equations, not solving determinant.