943,865 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Marked Solved
  • Views: 4360
  • C++ RSS
Dec 19th, 2008
0

Library to solve matrix determinant c++

Expand Post »
Hi, i'm looking for some library that provides solving matrix determinant. My matrix contains complex numbers (complex.h).
Please write me some hints
Reputation Points: 10
Solved Threads: 0
Newbie Poster
35nando is offline Offline
10 posts
since Dec 2008
Dec 19th, 2008
0

Re: Library to solve matrix determinant c++

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.
Reputation Points: 718
Solved Threads: 373
Nearly a Posting Maven
Lerner is offline Offline
2,253 posts
since Jul 2005
Dec 19th, 2008
0

Re: Library to solve matrix determinant c++

see...Cramers rule...then u can create your own library...
Reputation Points: 47
Solved Threads: 69
Posting Whiz
cikara21 is offline Offline
340 posts
since Jul 2008
Dec 19th, 2008
0

Re: Library to solve matrix determinant c++

For example, download free Matrix TCL Lite 1.13 by Techsoft:
http://www.techsoftpl.com/matrix/download.htm
(it's not a recommendation, I never use this library but it's compact and simple ).
Comment 5 lines of abs definitions in downloaded matrix.h:
c++ Syntax (Toggle Plain Text)
  1. /* Do that, you can't compile it with VC++ when <complex> included
  2. #if ( defined(__BORLANDC__) || _MSC_VER ) && !defined( __GNUG__ )
  3. inline float abs (float v) { return (float)fabs( v); }
  4. inline double abs (double v) { return fabs( v); }
  5. inline long double abs (long double v) { return fabsl( v); }
  6. #endif
  7. */
Now
c++ Syntax (Toggle Plain Text)
  1. #include <complex>
  2. using namespace std;
  3. #include "matrix.h"
  4.  
  5. typedef complex<double> Complex;
  6. typedef math::matrix<Complex> CMat;
  7.  
  8. int main()
  9. {
  10. CMat m(2,2);
  11. m(0,0) = Complex(0,1);
  12. m(0,1) = m(1,0) = 0.0;
  13. m(1,1) = Complex(0,1);
  14.  
  15. cout << m.Det() << endl;
  16.  
  17. return 0;
  18. }
  19. // prints (-1,0)
Read package manual in pro_doc directory...
Last edited by ArkM; Dec 19th, 2008 at 1:43 pm.
Reputation Points: 1234
Solved Threads: 347
Postaholic
ArkM is offline Offline
2,001 posts
since Jul 2008
Jan 5th, 2009
0

Re: Library to solve matrix determinant c++

Click to Expand / Collapse  Quote originally posted by cikara21 ...
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.

Click to Expand / Collapse  Quote originally posted by ArkM ...
For example, download free Matrix TCL Lite 1.13 by Techsoft:
http://www.techsoftpl.com/matrix/download.htm ...
Thanks, that library is simple and solves determinants quickly
Reputation Points: 10
Solved Threads: 0
Newbie Poster
35nando is offline Offline
10 posts
since Dec 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: matrix addition
Next Thread in C++ Forum Timeline: Change button background





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC