public class FloatMatrixDataDense 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 |
|---|
FloatMatrixDataDense(float[][] matrixSI)
Create a vector with dense data.
|
FloatMatrixDataDense(float[] matrixSI,
int rows,
int cols)
Create a vector with dense data.
|
| Modifier and Type | Method and Description |
|---|---|
void |
assign(FloatFunction floatFunction) |
int |
cardinality() |
int |
cols() |
FloatMatrixDataDense |
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.
|
FloatMatrixDataSparse |
toSparse() |
float |
zSum() |
protected float[] matrixSI
protected int rows
protected int cols
public FloatMatrixDataDense(float[] matrixSI,
int rows,
int cols)
throws ValueException
matrixSI - the data to storerows - the number of rowscols - the number of columnsValueException - in case rows * cols != matrixSI.lengthpublic FloatMatrixDataDense(float[][] matrixSI)
throws ValueException
matrixSI - the data to storeValueException - in case matrix is raggedpublic final void assign(FloatFunction floatFunction)
floatFunction - the function to apply on the (mutable) data elementspublic final FloatMatrixDataSparse toSparse()
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 FloatMatrixDataDense copy()
public int rows()
public int cols()
public final int cardinality()
public final float zSum()
Copyright © 2015 Delft University of Technology. All rights reserved.