aksaraaa006 / airhead-research

Automatically exported from code.google.com/p/airhead-research
0 stars 0 forks source link

transpose method does not work properly #84

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create an input matrix with these values:
2 5
0.89453775 0.27084422 0.20789784 1.3732798 1.5811776 
-1.4221323 -0.8210684 -0.52053654 0.8210684 0.3005319 

2. Read the matrix with MatrixIO and then transpose it calling 
Matrices.transpose(...) method.
3. Write the matrix to a new file.

What is the expected output? What do you see instead?
The expected output is:
5 2
0.89453775 -1.4221323 
0.27084422 -0.8210684 
0.20789784 -0.52053654 
1.3732798 0.8210684 
1.5811776 0.3005319 

But the output obatined is:
2 2
0.89453775 -1.4221323 
0.27084422 -0.8210684 

What version of the product are you using? On what operating system?
svd.jar (May 2010) on Ubuntu 10.04

Please provide any additional information below.
I think the problem could be in TransposedMatrix class.

Original issue reported on code.google.com by alpgar...@gmail.com on 18 Feb 2011 at 3:34

GoogleCodeExporter commented 8 years ago
Great!  We'll take a look at this right away.

Original comment by David.Ju...@gmail.com on 18 Feb 2011 at 6:54

GoogleCodeExporter commented 8 years ago
So I created a simple test script based on your input, but I'm not able to 
reproduce the error.  Here's what I'm trying:

        Matrix m = MatrixIO.readMatrix(new File(args[0]), MatrixIO.Format.CLUTO_DENSE, Matrix.Type.DENSE_IN_MEMORY, false);
        m = Matrices.transpose(m);
        MatrixIO.writeMatrix(m, new File(args[1]), MatrixIO.Format.CLUTO_DENSE);

When I check the output, it appears as the transposed version of the input.

I checked this using both svd.jar and the latest version of the trunk.  Is 
there another step that you might be running in addition to those three?

Original comment by David.Ju...@gmail.com on 21 Feb 2011 at 9:14

GoogleCodeExporter commented 8 years ago
I am doing SVD before trasposing, but resulting matrix is correct, the problem 
comes after trasposing. I have uploaded the code which produces this bug. Hope 
it helps!

If you check c.cluto and c2.cluto, you should get the wrong result.

Original comment by alpgar...@gmail.com on 22 Feb 2011 at 9:18

Attachments:

GoogleCodeExporter commented 8 years ago
I just checked this against the latest snapshot of the trunk and it looks like 
this problem has been fixed.  So i've just uploaded a new version of svd.jar.  
can you try downloading it and let me know if it solves your problem?

Thanks!

Original comment by FozzietheBeat@gmail.com on 24 Feb 2011 at 7:36

GoogleCodeExporter commented 8 years ago
I tried with the new version of svd.jar and the problem is solved!

Thank you very much for your effort!

Original comment by alpgar...@gmail.com on 25 Feb 2011 at 11:49

GoogleCodeExporter commented 8 years ago

Original comment by FozzietheBeat@gmail.com on 26 Feb 2011 at 3:32