Hi Neil,
Bug 4348562 is updated concerning problems in GMatrix SVD()
method.
Thanks for your bug report.
- Kelvin
-----------
Java 3D Team
Sun Microsystems Inc.
>X-Unix-From: [EMAIL PROTECTED] Mon Aug 28 00:38:04 2000
>X-Accept-Language: en
>MIME-Version: 1.0
>Date: Mon, 28 Aug 2000 03:21:33 -0400
>From: Neil Bomberger <[EMAIL PROTECTED]>
>Subject: [JAVA3D] unexpected behavior of GMatrix.SVD() in javax.vecmath
>To: [EMAIL PROTECTED]
>
>The behavior of the SVD() method of GMatrix seems to conflict with that
> specified
> in the javax.vecmath section of the Java3D API:
>
>http://java.sun.com/products/java-media/3D/forDevelopers/J3D_1_2_API/j3dapi/ind
ex.html
>
> TestSVD3x3.java (see below) shows that GMatrix.SVD(U, W, V) does not
> overwrite W as the API says it should; U and V are overwritten and
>contain the
> correct values (I checked with matlab), except U is the transpose of
>what I think it
> should be based on the API.
>
>I have also include short programs for a 2x2 matrix and a 4x4 matrix.
>The 2x2 matrix produces a java.lang.ArrayIndexOutOfBoundsException when
>GMatrix.SVD is called, and the 4x4 matrix produces results for U and V
>that aren't the same as what I get from Matlab.
>
>Am I using this method incorrectly?
>
>
>> //: TestSVD3x3.java
>> import javax.vecmath.*;
>>
>> public class TestSVD3x3 {
>> public static void main(String[] args)
>> {
>> double[] arrayMat = { 1, 2, 0,
>> 3, 4, 0,
>> 0, 0, 0 };
>>
>> GMatrix mat = new GMatrix(3, 3, arrayMat);
>>
>> System.out.println("The matrix is \n" + mat);
>>
>> GMatrix U = new GMatrix(3,3), W = new GMatrix(3, 3),
>> V = new GMatrix(3, 3);
>>
>> int rank = mat.SVD(U, W, V);
>>
>> System.out.println("The rank of the matrix is " + rank + "\n");
>>
>> System.out.println("\nAfter SVD, U = \n" + U);
>>
>> System.out.println("\nAfter SVD, W = \n" + W);
>> System.out.println("\nAfter SVD, V = \n" + V);
>> }
>> }
>>
>> //: TestSVD2x2.java
>> import javax.vecmath.*;
>>
>> public class TestSVD2x2 {
>> public static void main(String[] args)
>> {
>> double[] arrayMat = { 1, 2,
>> 3, 4 };
>>
>> GMatrix mat = new GMatrix(2, 2, arrayMat);
>>
>> System.out.println("The matrix is \n" + mat);
>>
>> GMatrix U = new GMatrix(2,2), W = new GMatrix(2, 2),
>> V = new GMatrix(2, 2);
>>
>> int rank = mat.SVD(U, W, V);
>>
>> System.out.println("The rank of the matrix is " + rank + "\n");
>>
>> System.out.println("\nAfter SVD, U = \n" + U);
>>
>> System.out.println("\nAfter SVD, W = \n" + W);
>> System.out.println("\nAfter SVD, V = \n" + V);
>> }
>> }
>>
>
>
>
>> //: TestSVD4x4.java
>> import javax.vecmath.*;
>>
>> public class TestSVD4x4 {
>> public static void main(String[] args)
>> {
>> double[] arrayMat = { 1, 2, 3, 4,
>> 5, 6, 7, 8,
>> 9, 10, 11, 12,
>> 13, 14, 15, 16 };
>>
>> GMatrix mat = new GMatrix(4, 4, arrayMat);
>>
>> System.out.println("The matrix is \n" + mat);
>>
>> GMatrix U = new GMatrix(4,4), W = new GMatrix(4, 4),
>> V = new GMatrix(4, 4);
>>
>> int rank = mat.SVD(U, W, V);
>>
>> System.out.println("The rank of the matrix is " + rank + "\n");
>>
>> System.out.println("\nAfter SVD, U = \n" + U);
>>
>> System.out.println("\nAfter SVD, W = \n" + W);
>> System.out.println("\nAfter SVD, V = \n" + V);
>> }
>> }
>>
>
>
>
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".