eldouha / addi

Automatically exported from code.google.com/p/addi
0 stars 0 forks source link

matrix inversion doesn't work for complex entreis #25

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Enter a matrix with complex entries, e.g. A=[1 i;i 1];
2. call the inv() function on A, i.e. inv(A);
3. the answer is
1.0000 -0.0000
-0.000 1.0000

What is the expected output?
0.50000 -0.50000i
--0.50000i 0.50000

What do you see instead?
1.0000 -0.0000
-0.000 1.0000

What version of the product are you using?
1.71
On what operating system?
Android 2.2.1

Please provide any additional information below.
Huawei U8160

Original issue reported on code.google.com by gbo...@gmail.com on 29 Aug 2011 at 7:28

GoogleCodeExporter commented 8 years ago
yes, it looks like it is det and adjoint that don't support complex numbers 
properly, which are both used by inv.  work has started on a fix.

Original comment by corbi...@gmail.com on 31 Aug 2011 at 5:02

GoogleCodeExporter commented 8 years ago
I would like to suggest using an LU decomposition instead of det and adjoint to 
get the inverse of a matrix. I have never programmed an android app, neither 
I've programmed in Java, but I have experience in using C++ for numerical 
computations. So, I can help you with the LU decomposition.

Original comment by gbo...@gmail.com on 31 Aug 2011 at 10:46

GoogleCodeExporter commented 8 years ago
this is a good suggestion, initially i will fix the bug and then work on 
performance later.  i didn't write the code i am starting from and it has many 
issues, but i have to address those that are most important first.  ie making 
it so inv handles complex numbers is more important than making it so inv runs 
quickly.  

that being said, learning java after already having a background in programming 
is not difficult and the math side of addi (as opposed to the UI side) doesn't 
really know it is in android for most purposes, so it is just standard java 
(with some exceptions-which I can help with if you bump into them).  if you are 
interested, you could help out and improve the functionality and performance.  
just a thought...

i am going to go down a diversion into improving the gui for a while starting 
soon.

Original comment by corbi...@gmail.com on 2 Sep 2011 at 10:20

GoogleCodeExporter commented 8 years ago
Should be fixed in the next release.  More optimum solutions may follow.

Original comment by corbi...@gmail.com on 7 Sep 2011 at 5:15

GoogleCodeExporter commented 8 years ago
Hi, thanks for the fix and sorry for the delay in answering your proposal. I 
looked at jmathlib source, as you wrote this code has many issue. Next week 
I've a conference, but once I'm back I can start trying to contribute to the 
improvement of the math functions in addi. How can I get the source code? The 
svn checkout doesn't work for me. 

Original comment by gbo...@gmail.com on 7 Sep 2011 at 9:51