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