public class DoubleMatrixDataSparse extends Object
Copyright (c) 2013-2015 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
| Modifier and Type | Field and Description |
|---|---|
protected int |
cols
the number of columns of the vector.
|
protected double[] |
matrixSI
the internal storage of the Matrix; can be sparse or dense.
|
protected int |
rows
the number of rows of the vector.
|
| Constructor and Description |
|---|
DoubleMatrixDataSparse(double[][] matrixSI)
Create a vector with sparse data.
|
DoubleMatrixDataSparse(double[] matrixSI,
long[] indices,
int length,
int rows,
int cols)
Create a vector with sparse data.
|
| Modifier and Type | Method and Description |
|---|---|
int |
cardinality() |
int |
cols() |
DoubleMatrixDataSparse |
copy() |
boolean |
equals(Object obj) |
double[][] |
getDenseMatrixSI() |
double[] |
getDenseVectorSI() |
double |
getSI(int row,
int col) |
int |
hashCode() |
int |
rows() |
void |
setSI(int row,
int col,
double valueSI)
Sets a value at the [row, col] point in the vector.
|
DoubleMatrixDataDense |
toDense() |
double |
zSum() |
protected double[] matrixSI
protected int rows
protected int cols
public DoubleMatrixDataSparse(double[] matrixSI,
long[] indices,
int length,
int rows,
int cols)
matrixSI - the data to storeindices - the index values of the Vector, with index = row * cols + collength - the length of the vector (padded with 0 after highest index in indices)rows - the number of rowscols - the number of columnspublic DoubleMatrixDataSparse(double[][] matrixSI)
throws ValueException
matrixSI - the data to storeValueException - in case matrix is raggedpublic final DoubleMatrixDataDense toDense()
public final double getSI(int row,
int col)
row - the row number to get the value forcol - the column number to get the value forpublic final void setSI(int row,
int col,
double valueSI)
row - the row number to set the value forcol - the column number to set the value forvalueSI - the value at the indexpublic final double[] getDenseVectorSI()
public final double[][] getDenseMatrixSI()
public final DoubleMatrixDataSparse copy()
public int hashCode()
public boolean equals(Object obj)
public int rows()
public int cols()
public final int cardinality()
public final double zSum()
Copyright © 2015 Delft University of Technology. All rights reserved.