[Fwd: Problems w/ LUDecomposition]


Sender: Monty Hall <kungfu_disciple@sbcglobal.net>
Subject: Problems w/ LUDecomposition


Hello,

I keep getting an exception with the following simple test code.  I've 
also tried using MTL's LU decomposition on the same matrix and got 4x4, 
4x4 LU matrices when I should be getting 4x4 4x5.  What am I doing 
wrong?  If anybody can shed some light on what I'm doing wrong, I'd 
greatly appreciate it.

Regards,

Monty


   static public void main(String[] args) {
       double test [][] = {
           { 2,  4, -1,  5, -2},
           {-4, -5,  3, -8,  1},
           { 2, -5, -4,  1,  8},
           {-6,  0,  7, -3,  1}
       };
       
       Matrix A = new Matrix(test);
       A.print(3,0);
       System.out.println();
       
       LUDecomposition lu = new LUDecomposition(A);

       lu.getL().print(3,0);
       System.out.println();
}

=================================================
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4
       at Jama.LUDecomposition.<init>(LUDecomposition.java:107)
       at zzzz.Test.main(Test.java:109)






Date Index | Thread Index | Problems or questions? Contact list-master@nist.gov