I've written the following program for what we discussed and I get a
Exception in thread "main" javax.vecmath.MismatchedSizeException:
GMatrix.SVD: d
imension mismatch with V matrix
at javax.vecmath.GMatrix.SVD(GMatrix.java:1521)
at SVDTest.main(SVDTest.java:41)
Can't see why myself? Any ideas?
import javax.vecmath.* ;
public class SVDTest {
public static void main (String[] args) {
GMatrix u,v,w ;
double[] aInput = { 0,1,0,1,0,0,0,0,0,-58,0,
0,0,0,0,0,1,0,1,0,-201,0,
0,1,1,1,0,0,0,0,0,-53,-53,
0,0,0,0,0,1,1,1,0,-52,-52,
0,0,0,1,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,1,0,0,0,
0,0,1,1,0,0,0,0,0,0,-156,
0,0,0,0,0,0,1,1,0,0,-44,
1,0,0,1,0,0,0,0,-263,0,0,
0,0,0,0,1,0,0,1,-193,0,0,
1,0,1,1,0,0,0,0,-259,0,-259,
0,0,0,0,1,0,1,1,-45,0,-45,
} ;
GMatrix a = new GMatrix(12,11, aInput) ;
u = new GMatrix(12,12) ;
v = new GMatrix(11,11) ;
w = new GMatrix(12,11) ;
a.SVD(u,v,w) ;
GVector alpha = new GVector(11) ;
double[] bInput = {58.,201.,53.,52.,159.,181.,156.,44.,263.,193.,259 .,45.} ;
GVector b = new GVector(bInput) ;
alpha.SVDBackSolve(u,v,w,b) ;
}
}