public class FloatMatrixDataDense extends FloatMatrixData
Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
cols, matrixSI, rows
Constructor and Description |
---|
FloatMatrixDataDense(float[][] matrixSI)
Create a matrix with dense data.
|
FloatMatrixDataDense(float[] matrixSI,
int rows,
int cols)
Create a matrix with dense data.
|
Modifier and Type | Method and Description |
---|---|
void |
assign(FloatFunction floatFunction) |
FloatMatrixDataDense |
copy() |
void |
decrementBy(FloatMatrixData right)
Subtract a matrix from this matrix on a cell-by-cell basis.
|
void |
divideBy(FloatMatrixData right)
Divide the values of a matrix by the values of another matrix on a cell-by-cell basis.
|
float[][] |
getDenseMatrixSI() |
double[][] |
getDoubleDenseMatrixSI() |
float |
getSI(int row,
int col) |
void |
incrementBy(FloatMatrixData right)
Add a matrix to this matrix on a cell-by-cell basis.
|
void |
multiplyBy(FloatMatrixData right)
Multiply a matrix with the values of another matrix on a cell-by-cell basis.
|
void |
setSI(int row,
int col,
float valueSI)
Sets a value at the [row, col] point in the matrix.
|
FloatMatrixDataSparse |
toSparse() |
cardinality, cols, decrementBy, divide, divideBy, equals, getStorageType, hashCode, incrementBy, instantiate, instantiate, isDense, isSparse, minus, multiplyBy, plus, rows, times, toDense, toString, zSum
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()
toSparse
in class FloatMatrixData
public final float getSI(int row, int col)
getSI
in class FloatMatrixData
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)
setSI
in class FloatMatrixData
row
- the row number to set the value forcol
- the column number to set the value forvalueSI
- the value at the indexpublic final float[][] getDenseMatrixSI()
getDenseMatrixSI
in class FloatMatrixData
public final double[][] getDoubleDenseMatrixSI()
getDoubleDenseMatrixSI
in class FloatMatrixData
public final FloatMatrixDataDense copy()
copy
in class FloatMatrixData
public final void incrementBy(FloatMatrixData right) throws ValueException
incrementBy
in class FloatMatrixData
right
- the other data object to addValueException
- if matrices have different lengthspublic final void decrementBy(FloatMatrixData right) throws ValueException
decrementBy
in class FloatMatrixData
right
- the other data object to subtractValueException
- if matrices have different lengthspublic final void multiplyBy(FloatMatrixData right) throws ValueException
multiplyBy
in class FloatMatrixData
right
- the other data object to multiply withValueException
- if matrices have different lengthspublic final void divideBy(FloatMatrixData right) throws ValueException
divideBy
in class FloatMatrixData
right
- the other data object to divide byValueException
- if matrices have different lengthsCopyright © 2015–2018 Delft University of Technology. All rights reserved.