Package ch.akuhn.hapax.linalg

Examples of ch.akuhn.hapax.linalg.SymetricMatrix


        }
        return ranking.sort();
    }

    public Matrix documentCorrelation() {
        Matrix correlation = new SymetricMatrix(documents.size());
        for (int row: range(documents.size())) {
            for (int column: range(documents.size())) {
                correlation.put(row, column, svd.similarityVV(row, column));
            }
        }
        //Appendable file = Files.openWrite("document-correlation.json");
        //correlation.storeOn(file);
        //Files.close(file);
View Full Code Here


        //Files.close(file);
        return correlation;
    }
   
    public Matrix euclidianDistance() {
        Matrix dist = new SymetricMatrix(documents.size());
        for (int row: range(documents.size())) {
            for (int column: range(documents.size())) {
                dist.put(row, column, svd.euclidianVV(row, column));
            }
        }
        return dist;
    }
View Full Code Here

public class SymetricMatrixTest {

    @Test
    public void testPutGetIsSymetric() {
        Matrix m = new SymetricMatrix(5);
        m.put(4, 2, PI);
        assertEquals(PI, m.get(4, 2), Double.MIN_VALUE);
        assertEquals(PI, m.get(2, 4), Double.MIN_VALUE);
        m.put(3, 3, PI);
        assertEquals(PI, m.get(3, 3), Double.MIN_VALUE);
    }
View Full Code Here

TOP

Related Classes of ch.akuhn.hapax.linalg.SymetricMatrix

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.