public class DoubleMatrixDataDense extends DoubleMatrixData
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 |
---|
DoubleMatrixDataDense(double[][] matrixSI)
Create a matrix with dense data.
|
DoubleMatrixDataDense(double[] matrixSI,
int rows,
int cols)
Create a matrix with dense data.
|
Modifier and Type | Method and Description |
---|---|
void |
assign(DoubleFunction doubleFunction) |
DoubleMatrixDataDense |
copy() |
void |
decrementBy(DoubleMatrixData right)
Subtract a matrix from this matrix on a cell-by-cell basis.
|
void |
divideBy(DoubleMatrixData right)
Divide the values of a matrix by the values of another matrix on a cell-by-cell basis.
|
double[][] |
getDenseMatrixSI() |
double |
getSI(int row,
int col) |
void |
incrementBy(DoubleMatrixData right)
Add a matrix to this matrix on a cell-by-cell basis.
|
void |
multiplyBy(DoubleMatrixData right)
Multiply a matrix with the values of another matrix on a cell-by-cell basis.
|
void |
setSI(int row,
int col,
double valueSI)
Sets a value at the [row, col] point in the matrix.
|
DoubleMatrixDataSparse |
toSparse() |
cardinality, cols, decrementBy, divide, divideBy, equals, getStorageType, hashCode, incrementBy, instantiate, instantiate, isDense, isSparse, minus, multiplyBy, plus, rows, times, toDense, toString, zSum
public DoubleMatrixDataDense(double[] 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 DoubleMatrixDataDense(double[][] matrixSI) throws ValueException
matrixSI
- the data to storeValueException
- in case matrix is raggedpublic final void assign(DoubleFunction doubleFunction)
doubleFunction
- the function to apply on the (mutable) data elementspublic final DoubleMatrixDataSparse toSparse()
toSparse
in class DoubleMatrixData
public final double getSI(int row, int col)
getSI
in class DoubleMatrixData
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)
setSI
in class DoubleMatrixData
row
- the row number to set the value forcol
- the column number to set the value forvalueSI
- the value at the indexpublic final double[][] getDenseMatrixSI()
getDenseMatrixSI
in class DoubleMatrixData
public final DoubleMatrixDataDense copy()
copy
in class DoubleMatrixData
public final void incrementBy(DoubleMatrixData right) throws ValueException
incrementBy
in class DoubleMatrixData
right
- the other data object to addValueException
- if matrices have different lengthspublic final void decrementBy(DoubleMatrixData right) throws ValueException
decrementBy
in class DoubleMatrixData
right
- the other data object to subtractValueException
- if matrices have different lengthspublic final void multiplyBy(DoubleMatrixData right) throws ValueException
multiplyBy
in class DoubleMatrixData
right
- the other data object to multiply withValueException
- if matrices have different lengthspublic final void divideBy(DoubleMatrixData right) throws ValueException
divideBy
in class DoubleMatrixData
right
- the other data object to divide byValueException
- if matrices have different lengthsCopyright © 2015–2018 Delft University of Technology. All rights reserved.