public class DoubleMatrixDataDense 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 |
|---|
DoubleMatrixDataDense(double[][] matrixSI)
Create a vector with dense data.
|
DoubleMatrixDataDense(double[] matrixSI,
int rows,
int cols)
Create a vector with dense data.
|
| Modifier and Type | Method and Description |
|---|---|
void |
assign(DoubleFunction doubleFunction) |
int |
cardinality() |
int |
cols() |
DoubleMatrixDataDense |
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.
|
DoubleMatrixDataSparse |
toSparse() |
double |
zSum() |
protected double[] matrixSI
protected int rows
protected int cols
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()
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 DoubleMatrixDataDense copy()
public int rows()
public int cols()
public final int cardinality()
public final double zSum()
Copyright © 2015 Delft University of Technology. All rights reserved.