public class DoubleVectorDataSparse 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 double[] |
vectorSI
the internal storage of the Vector; can be sparse or dense.
|
| Constructor and Description |
|---|
DoubleVectorDataSparse(double[] vectorSI,
int[] indices,
int length)
Create a vector with sparse data.
|
| Modifier and Type | Method and Description |
|---|---|
int |
cardinality() |
DoubleVectorDataSparse |
copy() |
org.djunits.value.vdouble.vector.DoubleVectorData |
divide(org.djunits.value.vdouble.vector.DoubleVectorData right)
Divide two vectors on a cell-by-cell basis.
|
boolean |
equals(Object obj) |
double[] |
getDenseVectorSI() |
double |
getSI(int index) |
int |
hashCode() |
org.djunits.value.vdouble.vector.DoubleVectorData |
minus(org.djunits.value.vdouble.vector.DoubleVectorData right)
Subtract two vectors on a cell-by-cell basis.
|
org.djunits.value.vdouble.vector.DoubleVectorData |
plus(org.djunits.value.vdouble.vector.DoubleVectorData right)
Add two vectors on a cell-by-cell basis.
|
void |
setSI(int index,
double valueSI)
Sets a value at the index in the vector.
|
int |
size() |
org.djunits.value.vdouble.vector.DoubleVectorData |
times(org.djunits.value.vdouble.vector.DoubleVectorData right)
Multiply two vector on a cell-by-cell basis.
|
DoubleVectorDataDense |
toDense() |
double |
zSum() |
protected double[] vectorSI
public DoubleVectorDataSparse(double[] vectorSI,
int[] indices,
int length)
vectorSI - the data to storeindices - the index values of the Vectorlength - the length of the vector (padded with 0 after highest index in indices)public final DoubleVectorDataDense toDense()
public final int size()
public final double getSI(int index)
index - the index to get the value forpublic final void setSI(int index,
double valueSI)
index - the index to set the value forvalueSI - the value at the indexpublic final double[] getDenseVectorSI()
public final DoubleVectorDataSparse copy()
public int hashCode()
public boolean equals(Object obj)
public final int cardinality()
public final double zSum()
public org.djunits.value.vdouble.vector.DoubleVectorData plus(org.djunits.value.vdouble.vector.DoubleVectorData right)
throws ValueException
right - the other data object to addValueException - if vectors have different lengthspublic org.djunits.value.vdouble.vector.DoubleVectorData minus(org.djunits.value.vdouble.vector.DoubleVectorData right)
throws ValueException
right - the other data object to subtractValueException - if vectors have different lengthspublic org.djunits.value.vdouble.vector.DoubleVectorData times(org.djunits.value.vdouble.vector.DoubleVectorData right)
throws ValueException
right - the other data object to multiply withValueException - if vectors have different lengthspublic org.djunits.value.vdouble.vector.DoubleVectorData divide(org.djunits.value.vdouble.vector.DoubleVectorData right)
throws ValueException
right - the other data object to divide byValueException - if vectors have different lengthsCopyright © 2015 Delft University of Technology. All rights reserved.