Example usage for org.apache.mahout.math Matrix like

List of usage examples for org.apache.mahout.math Matrix like

Introduction

In this page you can find the example usage for org.apache.mahout.math Matrix like.

Prototype

Matrix like(int rows, int columns);

Source Link

Document

Returns an empty matrix of the same underlying class as the receiver and of the specified size.

Usage

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

static Matrix sample(Matrix bigMatrix) {
    setSampleRate(bigMatrix.numRows(), bigMatrix.numCols());
    Matrix sampleMatrix = bigMatrix.like((int) (bigMatrix.numRows() * SAMPLE_RATE), bigMatrix.numCols());
    sample(bigMatrix, sampleMatrix);/* w  w w.  ja  v a 2  s.com*/
    return sampleMatrix;
}