Example usage for org.apache.mahout.math DenseMatrix numCols

List of usage examples for org.apache.mahout.math DenseMatrix numCols

Introduction

In this page you can find the example usage for org.apache.mahout.math DenseMatrix numCols.

Prototype

@Override
    public int numCols() 

Source Link

Usage

From source file:org.qcri.pca.CompositeJobTest.java

License:Apache License

private void verifyXtX(DenseMatrix xtxMatrix) {
    Assert.assertEquals("The computed xtx must have " + xsize + " rows!", xsize, xtxMatrix.numRows());
    Assert.assertEquals("The computed xtx must have " + xsize + " cols!", xsize, xtxMatrix.numCols());
    for (int r = 0; r < xsize; r++)
        for (int c = 0; c < xsize; c++)
            Assert.assertEquals("The xtx[" + r + "][" + c + "] is incorrect: ", xtx[r][c], xtxMatrix.get(r, c),
                    EPSILON);/*from  w ww.  j  a va2s  .c  o m*/
}