public class IntSparseMatrix extends Object
Constructor and Description |
---|
IntSparseMatrix(int numRows)
Create a new matrix with the given number of rows.
|
Modifier and Type | Method and Description |
---|---|
int |
get(int i,
int j)
Get a specific entry of the matrix.
|
int |
getNumRows()
Get the number of rows in the matrix.
|
IntSparseVector |
getRow(int i)
Get a specific row of the matrix.
|
void |
initialize()
Create a empty matrix with all values set to 0.0
|
void |
set(int i,
int j,
int v)
Set a specific entry of the matrix.
|
void |
setRow(int i,
IntSparseVector vec)
Set the int vector as the row specified.
|
public IntSparseMatrix(int numRows)
numRows
- the number of rows.public void initialize()
public int getNumRows()
public int get(int i, int j)
i
- the rowj
- the columnpublic void set(int i, int j, int v)
i
- the rowj
- the columnv
- the value of the entrypublic IntSparseVector getRow(int i)
i
- the row numberpublic void setRow(int i, IntSparseVector vec)
i
- the rowvec
- the vector to set as the rowCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.