1

I'm having trouble with a linear-algebra problem.

I've got 2 Matrices K (1034*1037) and T (1034*2) and I want to compute the solution W (1037*2) of KW=T.

But k.solve(t) returns the following error:

Exception in thread "main" java.lang.RuntimeException: Matrix is rank deficient.
    at Jama.QRDecomposition.solve(QRDecomposition.java:185)
    at Jama.Matrix.solve(Matrix.java:815)
    at Main.main(Main.java:59)

What could it mean? I've tried to compute the rank of K to check if it is 1034, but the computation seems to last forever...

What should I do? Any hints would be appreciated.


Here are what the matrices look like (with m = 1024):

// Matrix k
 0  u12 u13   ...   u1m  1  sx1 sy1
u12  0  u23   ...   u2m  1  sx2 sy2
u13 u23  0    ...   u3m  1  sx3 sy3
 .          .        .   .   .   .
 .             .     .   .   .   .
 .                .  .   .   .   .
u1m u2m u3m   ...    0   1  sxm sym

// Matrix t
tx1 ty1
tx2 ty2
 .   .
 .   .
 .   .
txm tym

If you ask, this is for a Thin-Plate-Splines implementation (Image treatment) :)

AdrienW
  • 3,092
  • 6
  • 29
  • 59
  • Rank deficient means (among other things) that it has linearly dependent columns and basically is non-invertible, hence your error. – ilanman Nov 27 '16 at 14:35
  • How could this be possible? If you look at the structure of the matrix, there isn't any way that this has lineary dependent columns, is there? – AdrienW Nov 28 '16 at 14:36
  • I face same problem while trying to multiply a matrix with another one. What did you do to solve the problem? – Encipher Sep 08 '18 at 19:54
  • Sorry I don't remember :/ maybe I simply used another method or found out it was another mistake somewhere else... Good luck ! – AdrienW Sep 09 '18 at 12:33

0 Answers0