AU
- the absolute unitRU
- the relative unitA
- the absolute vector typeR
- the relative vector typeMA
- the mutable absolute vector typeS
- the absolute scalar typeabstract class AbstractMutableFloatVectorAbs<AU extends AbsoluteLinearUnit<AU,RU>,RU extends Unit<RU>,A extends AbstractFloatVectorAbs<AU,RU,A,R,MA,S>,R extends AbstractFloatVectorRel<RU,R,?,?>,MA extends AbstractMutableFloatVectorAbs<AU,RU,A,R,MA,S>,S extends AbstractFloatScalarAbs<AU,S,RU,?>> extends AbstractFloatVectorAbs<AU,RU,A,R,MA,S> implements Mutable, MathFunctionsAbs<MA>, FloatMathFunctions<MA>, MutableFloatVectorInterface<AU>
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
AbstractFloatVectorAbs.Itr
data
Constructor and Description |
---|
AbstractMutableFloatVectorAbs(float[] values,
AU unit,
StorageType storageType)
Construct a new Absolute Mutable FloatVector.
|
AbstractMutableFloatVectorAbs(FloatVectorData data,
AU unit)
Construct a new Absolute Mutable FloatVector.
|
AbstractMutableFloatVectorAbs(List<Float> values,
AU unit,
StorageType storageType)
Construct a new Absolute Mutable FloatVector.
|
AbstractMutableFloatVectorAbs(List<S> values,
StorageType storageType)
Construct a new Absolute Mutable FloatVector.
|
AbstractMutableFloatVectorAbs(S[] values,
StorageType storageType)
Construct a new Absolute Mutable FloatVector.
|
AbstractMutableFloatVectorAbs(SortedMap<Integer,Float> values,
AU unit,
int length,
StorageType storageType)
Construct a new Absolute Mutable FloatVector.
|
AbstractMutableFloatVectorAbs(SortedMap<Integer,S> values,
int length,
StorageType storageType)
Construct a new Absolute Mutable FloatVector.
|
Modifier and Type | Method and Description |
---|---|
void |
assign(FloatFunction floatFunction)
Execute a function on a cell by cell basis.
|
MA |
ceil()
Set the value(s) to the smallest (closest to negative infinity) value(s) that are greater than or equal to the argument
and equal to a mathematical integer.
|
protected void |
checkCopyOnWrite()
Check the copyOnWrite flag and, if it is set, make a deep copy of the data and clear the flag.
|
MA |
copy()
Create a deep copy of this MutableFloatVector.
|
MA |
decrementBy(float decrement)
Decrement the value by the supplied constant and return the changed vector.
|
MA |
decrementBy(R decrement)
Decrement the value by the supplied value and return the changed vector.
|
MA |
decrementBy(S decrement)
Decrement the value by the supplied value and return the changed vector.
|
MA |
divideBy(float factor)
Scale the value(s) by the inverse of a factor; i.e.
|
MA |
floor()
Set the value(s) to the largest (closest to positive infinity) value(s) that are less than or equal to the argument and
equal to a mathematical integer.
|
A |
immutable()
Create a immutable version of this MutableFloatVector.
|
MA |
incrementBy(float increment)
Increment the value by the supplied constant and return the changed vector.
|
MA |
incrementBy(R increment)
Increment the value by the supplied value and return the changed vector.
|
MA |
incrementBy(S increment)
Increment the value by the supplied value and return the changed vector.
|
MA |
multiplyBy(float factor)
Scale the value(s) by a factor.
|
MA |
multiplyBy(R factors)
Multiply the values in the vector by the supplied values and return the changed vector.
|
MA |
mutable()
Create a mutable version of this FloatVector.
|
void |
normalize()
Normalize the vector, i.e.
|
MA |
rint()
Set the value(s) to the value(s) that are closest in value to the argument and equal to a mathematical integer.
|
MA |
round()
Set the value(s) to the closest long to the argument with ties rounding up.
|
void |
set(int index,
S value)
Replace the value at index by the supplied value which is in a compatible unit.
|
(package private) void |
setCopyOnWrite(boolean copyOnWrite)
Change the copyOnWrite flag.
|
void |
setInUnit(int index,
float value,
AU valueUnit)
Replace the value at index by the supplied value which is expressed in a supplied (compatible) unit.
|
void |
setSI(int index,
float valueSI)
Replace the value at index by the supplied value which is expressed in the standard SI unit.
|
checkUnit, checkUnit, checkUnit, get, instantiateMutableType, instantiateScalar, instantiateTypeAbs, instantiateTypeRel, 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, getInUnit, getInUnit, getSI, getValuesInUnit, getValuesInUnit, getValuesSI, size, toDense, toSparse, toString, toString, toString, toString, zSum
forEach, spliterator
AbstractMutableFloatVectorAbs(float[] values, AU unit, StorageType storageType) throws ValueException
values
- float[]; the values of the entries in the new Absolute Mutable FloatVectorunit
- AU; the unit of the new Absolute Mutable FloatVectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullAbstractMutableFloatVectorAbs(List<Float> values, AU unit, StorageType storageType) throws ValueException
values
- List<Float>; the values of the entries in the new Absolute Mutable FloatVectorunit
- AU; the unit of the new Absolute Mutable FloatVectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullAbstractMutableFloatVectorAbs(S[] values, StorageType storageType) throws ValueException
values
- S[]; the values of the entries in the new Absolute Mutable FloatVectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriesAbstractMutableFloatVectorAbs(List<S> values, StorageType storageType) throws ValueException
values
- List<S>; the values of the entries in the new Absolute Mutable FloatVectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriesAbstractMutableFloatVectorAbs(SortedMap<Integer,S> values, int length, StorageType storageType) throws ValueException
values
- SortedMap<Integer, S>; the values of the entries in the new Absolute Sparse Mutable FloatVectorlength
- int; the size of the vectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriesAbstractMutableFloatVectorAbs(SortedMap<Integer,Float> values, AU unit, int length, StorageType storageType) throws ValueException
values
- SortedMap<Integer, Float>; the map of indexes to values of the Absolute Sparse Mutable FloatVectorunit
- AU; the unit of the new Absolute Sparse Mutable FloatVectorlength
- int; the size of the vectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullAbstractMutableFloatVectorAbs(FloatVectorData data, AU unit)
data
- FloatVectorData; an internal data objectunit
- AU; the unitfinal void setCopyOnWrite(boolean copyOnWrite)
copyOnWrite
- boolean; the new value for the copyOnWrite flagpublic final MA mutable()
mutable
in interface FloatVectorInterface<AU extends AbsoluteLinearUnit<AU,RU>>
mutable
in class AbstractFloatVectorAbs<AU extends AbsoluteLinearUnit<AU,RU>,RU extends Unit<RU>,A extends AbstractFloatVectorAbs<AU,RU,A,R,MA,S>,R extends AbstractFloatVectorRel<RU,R,?,?>,MA extends AbstractMutableFloatVectorAbs<AU,RU,A,R,MA,S>,S extends AbstractFloatScalarAbs<AU,S,RU,?>>
public A immutable()
immutable
in interface MutableFloatVectorInterface<AU extends AbsoluteLinearUnit<AU,RU>>
public final MA copy()
public final MA incrementBy(R increment) throws ValueException
increment
- R; amount by which the value is incrementedValueException
- when the size of increment is not identical to the size of thispublic final MA incrementBy(S increment)
increment
- S; amount by which the value is incrementedpublic final MA incrementBy(float increment)
increment
- float; amount by which the value is incrementedpublic final MA decrementBy(R decrement) throws ValueException
decrement
- R; amount by which the value is decrementedValueException
- when the size of increment is not identical to the size of thispublic final MA decrementBy(S decrement)
decrement
- S; amount by which the value is decrementedpublic final MA decrementBy(float decrement)
decrement
- float; amount by which the value is decrementedpublic final MA multiplyBy(float factor)
multiplyBy
in interface FloatMathFunctions<MA extends AbstractMutableFloatVectorAbs<AU,RU,A,R,MA,S>>
factor
- float; the multiplierpublic MA divideBy(float factor)
divideBy
in interface FloatMathFunctions<MA extends AbstractMutableFloatVectorAbs<AU,RU,A,R,MA,S>>
factor
- float; the divisorpublic final MA multiplyBy(R factors) throws ValueException
factors
- R; amounts by which the value is multipliedValueException
- when the size of the factors is not identical to the size of thispublic final void assign(FloatFunction floatFunction)
floatFunction
- FloatFunction; the function to applypublic final MA ceil()
ceil
in interface MathFunctionsAbs<MA extends AbstractMutableFloatVectorAbs<AU,RU,A,R,MA,S>>
public final MA floor()
floor
in interface MathFunctionsAbs<MA extends AbstractMutableFloatVectorAbs<AU,RU,A,R,MA,S>>
public final MA rint()
rint
in interface MathFunctionsAbs<MA extends AbstractMutableFloatVectorAbs<AU,RU,A,R,MA,S>>
public final MA round()
round
in interface MathFunctionsAbs<MA extends AbstractMutableFloatVectorAbs<AU,RU,A,R,MA,S>>
protected final void checkCopyOnWrite()
public final void setSI(int index, float valueSI) throws ValueException
index
- int; index of the value to replacevalueSI
- float; the value to store (expressed in the standard SI unit)ValueException
- when index out of range (index < 0 or index >= size())public final void set(int index, S value) throws ValueException
index
- int; index of the value to replacevalue
- S; the strongly typed value to storeValueException
- when index out of range (index < 0 or index >= size())public final void setInUnit(int index, float value, AU valueUnit) throws ValueException
index
- int; index of the value to replacevalue
- float; the value to store (which is expressed in valueUnit)valueUnit
- AU; unit of the supplied valueValueException
- when index out of range (index < 0 or index >= size())public final void normalize() throws ValueException
ValueException
- when the sum of the values is zero and normalization is not possibleCopyright © 2015–2019 Delft University of Technology. All rights reserved.