public class SymmMatrix
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int |
dim |
Constructor and Description |
---|
SymmMatrix(int dim)
Construct a symmetric matrix
|
SymmMatrix(SymmMatrix mat)
Construct a symmetric matrix by deeply copying data from a given matrix
|
Modifier and Type | Method and Description |
---|---|
void |
add(int row,
int col,
double val)
add a value to entry (row, col)
|
SymmMatrix |
clone()
Make a deep copy of current matrix
|
boolean |
contains(int row,
int col)
Get a value at entry (row, col)
|
double |
get(int row,
int col)
Get a value at entry (row, col)
|
com.google.common.collect.Table<java.lang.Integer,java.lang.Integer,java.lang.Double> |
getData() |
int |
getDim() |
SparseVector |
row(int row)
Retrieve a complete row of similar items
|
void |
set(int row,
int col,
double val)
set a value to entry (row, col)
|
java.lang.String |
toString() |
public SymmMatrix(int dim)
dim
- matrix dimensionpublic SymmMatrix(SymmMatrix mat)
mat
- a given matrixpublic SymmMatrix clone()
clone
in class java.lang.Object
public double get(int row, int col)
row
- row indexcol
- column indexpublic boolean contains(int row, int col)
row
- row indexcol
- column indexpublic void set(int row, int col, double val)
row
- row indexcol
- column indexval
- value to setpublic void add(int row, int col, double val)
row
- row indexcol
- column indexval
- value to addpublic SparseVector row(int row)
row
- row indexpublic int getDim()
public com.google.common.collect.Table<java.lang.Integer,java.lang.Integer,java.lang.Double> getData()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2017. All Rights Reserved.