All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.wikibrain.matrix.Matrix Maven / Gradle / Ivy

There is a newer version: 0.9.1
Show newest version
package org.wikibrain.matrix;

import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.util.Iterator;

/**
 * Base class for dense / sparse matrices
 * @author Shilad Sen
 */
public interface Matrix extends Iterable, Closeable {
    /**
     * Gets a particular matrix row.
     * @param rowId
     * @return The row, or null if it does not exist.
     * @throws IOException
     */
    T getRow(int rowId) throws IOException;

    /**
     * Gets all row ids.
     * @return
     */
    int[] getRowIds();

    /**
     * Returns the number of rows.
     * @return
     */
    int getNumRows();

    /**
     * Returns the path to the file that backs the matrix.
     * @return
     */
    File getPath();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy