Registered Member
|
Dear all,
I am doing the most "trivial" thing but cannot get it to work. I am solving a A*x=b type system of 3 equations of 3 unknowns. The matrix is of rank 1, so IIRC a solution must exist. I am comparing
compiled against eigen 3.1.4 shipped with fc19. For
Eigen gives me:
If I do the same thing with octave (version 3.6.4), I get a different result (that is not even linearly dependent on the eigen result given above):
I'd appreciate any hint on what could cause this severe difference. Best - |
Registered Member
|
Your system of equations has no solutions. If the matrix A is singular, as is the case here, then the equation A*x=0 has nonzero solutions, but the system A*x=b usually has no solutions. Generally, solving systems of equations with singular matrices numerically is not the most trivial thing; non-singular matrices are much easier to handle.
In Octave, the command b\A solves the system x*A=b and indeed the result is a row vector. To solve the system A*x=b you have to compute A\b. |
Registered Member
|
Indeed, using a different matrix:
0.32158 0.08359 0.03690 0.00000 0.47783 0.19056 0.00000 0.00000 0.58779 The solution coincide as they should be. I had the feeling in the first place, that I oversaw something obvious. Many thanks for you reply, eigen is a great tool - keep it up. Peter |
Registered Member
|
Now the question rises, how is b\A mimicked in eigen? I am asking since this is what I actually need.
I know that solving x*A = b can be expressed as A.transpose()*z = b.transpose(). However, the solvers in eigen tend to take column vectors as arguments, not row vectors. Any hints! Peter |
Registered Member
|
Addendum to the above: x*A = b is equivalent to solving A.transpose()*z = b.transpose() with x = z.transpose()
|
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]