U - the unitR - the vector typeMR - the mutable vector typeS - the scalar typeabstract class AbstractMutableFloatVectorRel<U extends Unit<U>,R extends AbstractFloatVectorRel<U,R,MR,S>,MR extends AbstractMutableFloatVectorRel<U,R,MR,S>,S extends AbstractFloatScalarRel<U,S>> extends AbstractFloatVectorRel<U,R,MR,S> implements MathFunctionsRel<MR>, FloatMathFunctions<MR>, MutableFloatVectorInterface<U>
Copyright (c) 2013-2018 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
AbstractFloatVectorRel.Itrdata| Constructor and Description |
|---|
AbstractMutableFloatVectorRel(float[] values,
U unit,
StorageType storageType)
Construct a new Relative Mutable FloatVector.
|
AbstractMutableFloatVectorRel(FloatVectorData data,
U unit)
Construct a new Relative Mutable FloatVector.
|
AbstractMutableFloatVectorRel(List<Float> values,
U unit,
StorageType storageType)
Construct a new Relative Mutable FloatVector.
|
AbstractMutableFloatVectorRel(List<S> values,
StorageType storageType)
Construct a new Relative Mutable FloatVector.
|
AbstractMutableFloatVectorRel(S[] values,
StorageType storageType)
Construct a new Relative Mutable FloatVector.
|
AbstractMutableFloatVectorRel(SortedMap<Integer,Float> values,
U unit,
int length,
StorageType storageType)
Construct a new Relative Mutable FloatVector.
|
AbstractMutableFloatVectorRel(SortedMap<Integer,S> values,
int length,
StorageType storageType)
Construct a new Relative Mutable FloatVector.
|
| Modifier and Type | Method and Description |
|---|---|
MR |
abs()
Set the value(s) to their absolute value.
|
void |
assign(FloatFunction floatFunction)
Execute a function on a cell by cell basis.
|
MR |
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.
|
MR |
copy()
Create a deep copy of this MutableFloatVector.
|
MR |
decrementBy(float decrement)
Decrement the value by the supplied constant and return the changed vector.
|
MR |
decrementBy(R decrement)
Decrement the value by the supplied value and return the changed vector.
|
MR |
decrementBy(S decrement)
Decrement the value by the supplied value and return the changed vector.
|
MR |
divideBy(float factor)
Scale the value(s) by the inverse of a factor; i.e.
|
MR |
divideBy(R factors)
Divide the values in the vector by the supplied values and return the changed vector.
|
MR |
divideBy(S factor)
Divide the values in the vector by the supplied value and return the changed vector.
|
MR |
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.
|
R |
immutable()
Create a immutable version of this MutableFloatVector.
|
MR |
incrementBy(float increment)
Increment the value by the supplied constant and return the changed vector.
|
MR |
incrementBy(R increment)
Increment the value by the supplied value and return the changed vector.
|
MR |
incrementBy(S increment)
Increment the value by the supplied value and return the changed vector.
|
MR |
multiplyBy(float factor)
Scale the value(s) by a factor.
|
MR |
multiplyBy(R factors)
Multiply the values in the vector by the supplied values and return the changed vector.
|
MR |
multiplyBy(S factor)
Multiply the values in the vector by the supplied value and return the changed vector.
|
MR |
mutable()
Create a mutable version of this FloatVector.
|
MR |
neg()
Set the value(s) to the minus value.
|
void |
normalize()
Normalize the vector, i.e.
|
MR |
rint()
Set the value(s) to the value(s) that are closest in value to the argument and equal to a mathematical integer.
|
MR |
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,
U 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, divide, get, instantiateMutableType, instantiateScalar, instantiateType, iterator, minus, plus, timescardinality, checkIndex, checkSize, checkSize, equals, getData, getInUnit, getInUnit, getSI, getStorageType, getValuesInUnit, getValuesInUnit, getValuesSI, hashCode, size, toString, toString, toString, toString, zSumexpressAsSIUnit, expressAsSpecifiedUnit, getUnit, isAbsolute, isRelative, setDisplayUnitclone, finalize, getClass, notify, notifyAll, wait, wait, waitDIV, MULT, POWcardinality, getInUnit, getInUnit, getSI, getValuesInUnit, getValuesInUnit, getValuesSI, size, toDense, toSparse, toString, toString, toString, toString, zSumforEach, spliteratorAbstractMutableFloatVectorRel(float[] values,
U unit,
StorageType storageType)
throws ValueException
values - float[]; the values of the entries in the new Relative Mutable FloatVectorunit - U; the unit of the new Relative Mutable FloatVectorstorageType - the data type to use (e.g., DENSE or SPARSE)ValueException - when values is nullAbstractMutableFloatVectorRel(List<Float> values, U unit, StorageType storageType) throws ValueException
values - List; the values of the entries in the new Relative Mutable FloatVectorunit - U; the unit of the new Relative Mutable FloatVectorstorageType - the data type to use (e.g., DENSE or SPARSE)ValueException - when values is nullAbstractMutableFloatVectorRel(S[] values, StorageType storageType) throws ValueException
values - FloatScalar.Rel<U>[]; the values of the entries in the new Relative Mutable FloatVectorstorageType - the data type to use (e.g., DENSE or SPARSE)ValueException - when values has zero entriesAbstractMutableFloatVectorRel(List<S> values, StorageType storageType) throws ValueException
values - List; the values of the entries in the new Relative Mutable FloatVectorstorageType - the data type to use (e.g., DENSE or SPARSE)ValueException - when values has zero entriesAbstractMutableFloatVectorRel(SortedMap<Integer,S> values, int length, StorageType storageType) throws ValueException
values - FloatScalar.Rel<U>[]; the values of the entries in the new Relative Sparse Mutable FloatVectorlength - the size of the vectorstorageType - the data type to use (e.g., DENSE or SPARSE)ValueException - when values has zero entriesAbstractMutableFloatVectorRel(SortedMap<Integer,Float> values, U unit, int length, StorageType storageType) throws ValueException
values - Map; the map of indexes to values of the Relative Sparse Mutable FloatVectorunit - U; the unit of the new Relative Sparse Mutable FloatVectorlength - the size of the vectorstorageType - the data type to use (e.g., DENSE or SPARSE)ValueException - when values is nullAbstractMutableFloatVectorRel(FloatVectorData data, U unit)
data - an internal data objectunit - the unitfinal void setCopyOnWrite(boolean copyOnWrite)
copyOnWrite - boolean; the new value for the copyOnWrite flagpublic final MR mutable()
mutable in interface FloatVectorInterface<U extends Unit<U>>mutable in class AbstractFloatVectorRel<U extends Unit<U>,R extends AbstractFloatVectorRel<U,R,MR,S>,MR extends AbstractMutableFloatVectorRel<U,R,MR,S>,S extends AbstractFloatScalarRel<U,S>>public R immutable()
immutable in interface MutableFloatVectorInterface<U extends Unit<U>>public final MR copy()
public final MR incrementBy(R increment) throws ValueException
increment - FloatVector.Rel<U>; amount by which the value is incrementedValueException - when the size of increment is not identical to the size of thispublic final MR incrementBy(S increment)
increment - FloatScalar.Rel<U>; amount by which the value is incrementedpublic final MR incrementBy(float increment)
increment - amount by which the value is incrementedpublic final MR decrementBy(R decrement) throws ValueException
decrement - FloatVector.Rel<U>; amount by which the value is decrementedValueException - when the size of increment is not identical to the size of thispublic final MR decrementBy(S decrement)
decrement - FloatScalar.Rel<U>; amount by which the value is decrementedpublic final MR decrementBy(float decrement)
decrement - amount by which the value is decrementedpublic final MR multiplyBy(R factors) throws ValueException
factors - FloatVector.Rel<U>; amounts by which the value is multipliedValueException - when the size of the factors is not identical to the size of thispublic final MR multiplyBy(S factor)
factor - FloatScalar.Rel<U>; amount by which the values in the vector are multipliedpublic final MR multiplyBy(float factor)
multiplyBy in interface FloatMathFunctions<MR extends AbstractMutableFloatVectorRel<U,R,MR,S>>factor - float; the multiplierpublic final MR divideBy(R factors) throws ValueException
factors - FloatVector.Rel<U>; amounts by which the value is dividedValueException - when the size of the factors is not identical to the size of thispublic MR divideBy(float factor)
divideBy in interface FloatMathFunctions<MR extends AbstractMutableFloatVectorRel<U,R,MR,S>>factor - float; the divisorpublic final MR divideBy(S factor)
factor - FloatScalar.Rel<U>; amount by which the values in the vector are dividedpublic final void assign(FloatFunction floatFunction)
floatFunction - the function to applypublic final MR abs()
abs in interface MathFunctionsRel<MR extends AbstractMutableFloatVectorRel<U,R,MR,S>>public final MR ceil()
ceil in interface MathFunctionsAbs<MR extends AbstractMutableFloatVectorRel<U,R,MR,S>>public final MR floor()
floor in interface MathFunctionsAbs<MR extends AbstractMutableFloatVectorRel<U,R,MR,S>>public final MR neg()
neg in interface MathFunctionsRel<MR extends AbstractMutableFloatVectorRel<U,R,MR,S>>public final MR rint()
rint in interface MathFunctionsAbs<MR extends AbstractMutableFloatVectorRel<U,R,MR,S>>public final MR round()
round in interface MathFunctionsAbs<MR extends AbstractMutableFloatVectorRel<U,R,MR,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 - FloatScalar<U>; the strongly typed value to storeValueException - when index out of range (index < 0 or index >= size())public final void setInUnit(int index,
float value,
U valueUnit)
throws ValueException
index - int; index of the value to replacevalue - float; the value to store (which is expressed in valueUnit)valueUnit - U; 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–2018 Delft University of Technology. All rights reserved.