public class FloatMatrixDataSparse 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 float[] |
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 |
|---|
FloatMatrixDataSparse(float[][] matrixSI)
Create a vector with sparse data.
|
FloatMatrixDataSparse(float[] 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() |
FloatMatrixDataSparse |
copy() |
boolean |
equals(Object obj) |
double[][] |
getDenseDoubleMatrixSI() |
float[][] |
getDenseMatrixSI() |
float[] |
getDenseVectorSI() |
float |
getSI(int row,
int col) |
int |
hashCode() |
int |
rows() |
void |
setSI(int row,
int col,
float valueSI)
Sets a value at the [row, col] point in the vector.
|
FloatMatrixDataDense |
toDense() |
float |
zSum() |
protected float[] matrixSI
protected int rows
protected int cols
public FloatMatrixDataSparse(float[] 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 FloatMatrixDataSparse(float[][] matrixSI)
throws ValueException
matrixSI - the data to storeValueException - in case matrix is raggedpublic final FloatMatrixDataDense toDense()
public final float 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,
float valueSI)
row - the row number to set the value forcol - the column number to set the value forvalueSI - the value at the indexpublic final float[] getDenseVectorSI()
public final float[][] getDenseMatrixSI()
public final double[][] getDenseDoubleMatrixSI()
public final FloatMatrixDataSparse copy()
public int hashCode()
public boolean equals(Object obj)
public int rows()
public int cols()
public final int cardinality()
public final float zSum()
Copyright © 2015 Delft University of Technology. All rights reserved.