public class MutablePositionVector extends AbstractMutableDoubleVectorAbs<PositionUnit,LengthUnit,PositionVector,LengthVector,MutablePositionVector,Position>
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
$LastChangedDate: 2015-09-29 14:14:28 +0200 (Tue, 29 Sep 2015) $, @version $Revision: 73 $, by $Author: pknoppers $, initial
version Sep 5, 2015
AbstractDoubleVectorAbs.Itr
data
Constructor and Description |
---|
MutablePositionVector(double[] values,
PositionUnit unit,
StorageType storageType)
Construct a new Absolute Mutable Double PositionVector.
|
MutablePositionVector(DoubleVectorData data,
PositionUnit unit)
Construct a new Absolute Mutable Double PositionVector.
|
MutablePositionVector(List<Double> values,
PositionUnit unit,
StorageType storageType)
Construct a new Absolute Mutable Double PositionVector.
|
MutablePositionVector(List<Position> values,
StorageType storageType)
Construct a new Absolute Mutable Double PositionVector.
|
MutablePositionVector(Position[] values,
StorageType storageType)
Construct a new Absolute Mutable Double PositionVector.
|
MutablePositionVector(SortedMap<Integer,Double> values,
PositionUnit unit,
int length,
StorageType storageType)
Construct a new Absolute Mutable Double PositionVector.
|
MutablePositionVector(SortedMap<Integer,Position> values,
int length,
StorageType storageType)
Construct a new Absolute Mutable Double PositionVector.
|
Modifier and Type | Method and Description |
---|---|
protected MutablePositionVector |
instantiateMutableType(DoubleVectorData dvd,
PositionUnit unit)
Construct a new Absolute Mutable DoubleVector of the right type.
|
protected Position |
instantiateScalar(double value,
PositionUnit unit)
Construct a new Absolute Immutable DoubleScalar of the right type.
|
protected PositionVector |
instantiateTypeAbs(DoubleVectorData dvd,
PositionUnit unit)
Construct a new Absolute Immutable DoubleVector of the right type.
|
protected LengthVector |
instantiateTypeRel(DoubleVectorData dvd,
LengthUnit unit)
Construct a new Relative Immutable DoubleVector of the right type.
|
Position[] |
toArray()
Return an array of Position Scalars from this vector.
|
MutablePositionVector |
toDense()
return a dense version of this vector.
|
MutablePositionVector |
toSparse()
return a sparse version of this vector.
|
assign, ceil, checkCopyOnWrite, copy, decrementBy, decrementBy, decrementBy, divideBy, floor, immutable, incrementBy, incrementBy, incrementBy, multiplyBy, multiplyBy, mutable, normalize, rint, round, set, setCopyOnWrite, setInUnit, setSI
checkUnit, checkUnit, checkUnit, get, iterator, minus, minus, plus
cardinality, checkIndex, checkSize, checkSize, equals, getData, getInUnit, getInUnit, getSI, getStorageType, getValuesInUnit, getValuesInUnit, getValuesSI, hashCode, size, toString, toString, toString, toString, zSum
expressAsSIUnit, expressAsSpecifiedUnit, getUnit, isAbsolute, isRelative, setDisplayUnit
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
DIV, MULT, POW
cardinality, get, getInUnit, getInUnit, getSI, getValuesInUnit, getValuesInUnit, getValuesSI, size, toString, toString, toString, toString, zSum
forEach, spliterator
public MutablePositionVector(double[] values, PositionUnit unit, StorageType storageType) throws ValueException
values
- double[]; the values of the entries in the new Absolute Mutable Double PositionVectorunit
- PositionUnit; the unit of the new Absolute Mutable Double PositionVectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullpublic MutablePositionVector(List<Double> values, PositionUnit unit, StorageType storageType) throws ValueException
values
- List<Double>; the values of the entries in the new Absolute Mutable Double PositionVectorunit
- PositionUnit; the unit of the new Absolute Mutable Double PositionVectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullpublic MutablePositionVector(Position[] values, StorageType storageType) throws ValueException
values
- Position[]; the values of the entries in the new Absolute Mutable Double PositionVectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriespublic MutablePositionVector(List<Position> values, StorageType storageType) throws ValueException
values
- List<Position>; the values of the entries in the new Absolute Mutable Double PositionVectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriespublic MutablePositionVector(SortedMap<Integer,Position> values, int length, StorageType storageType) throws ValueException
values
- SortedMap<Integer, Position>; the values of the entries in the new Absolute Sparse Mutable Double
PositionVectorlength
- int; the size of the vectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriespublic MutablePositionVector(SortedMap<Integer,Double> values, PositionUnit unit, int length, StorageType storageType) throws ValueException
values
- SortedMap<Integer, Double>; the map of indexes to values of the Absolute Sparse Mutable Double
PositionVectorunit
- PositionUnit; the unit of the new Absolute Sparse Mutable Double PositionVectorlength
- int; the size of the vectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullMutablePositionVector(DoubleVectorData data, PositionUnit unit)
data
- DoubleVectorData; an internal data objectunit
- PositionUnit; the unitprotected final PositionVector instantiateTypeAbs(DoubleVectorData dvd, PositionUnit unit)
instantiateTypeAbs
in class AbstractDoubleVectorAbs<PositionUnit,LengthUnit,PositionVector,LengthVector,MutablePositionVector,Position>
dvd
- DoubleVectorData; an internal data objectunit
- AU; the unitprotected final LengthVector instantiateTypeRel(DoubleVectorData dvd, LengthUnit unit)
instantiateTypeRel
in class AbstractDoubleVectorAbs<PositionUnit,LengthUnit,PositionVector,LengthVector,MutablePositionVector,Position>
dvd
- DoubleVectorData; an internal data objectunit
- RU; the unitprotected final MutablePositionVector instantiateMutableType(DoubleVectorData dvd, PositionUnit unit)
instantiateMutableType
in class AbstractDoubleVectorAbs<PositionUnit,LengthUnit,PositionVector,LengthVector,MutablePositionVector,Position>
dvd
- DoubleVectorData; an internal data objectunit
- AU; the unitprotected final Position instantiateScalar(double value, PositionUnit unit)
instantiateScalar
in class AbstractDoubleVectorAbs<PositionUnit,LengthUnit,PositionVector,LengthVector,MutablePositionVector,Position>
value
- double; the valueunit
- AU; the unitpublic final MutablePositionVector toDense()
public final MutablePositionVector toSparse()
public Position[] toArray()
RuntimeException
- wrapping a ValueException on error getting one of the valuesCopyright © 2015–2019 Delft University of Technology. All rights reserved.