public class MutableTimeMatrix extends AbstractMutableDoubleMatrixAbs<TimeUnit,DurationUnit,TimeMatrix,DurationMatrix,MutableTimeMatrix,Time>
Note that when the offset of a stored absolute Time becomes large, precision of a double might not be enough for the required resolution of a Time. A double has around 16 significant digits (52 bit mantissa). This means that when we need to have a double Time with TimeUnit.BASE as its unit, the largest value where the ms precision is reached is 2^51 = 2.3E15, which is around 71000 years. This is sufficient to store a date in the 21st Century with a BASE or an Epoch offset precise to a microsecond.
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
data
Constructor and Description |
---|
MutableTimeMatrix(double[][] values,
TimeUnit unit,
StorageType storageType)
Construct a new Absolute Mutable Double TimeMatrix.
|
MutableTimeMatrix(DoubleMatrixData data,
TimeUnit unit)
Construct a new Absolute Mutable Double TimeMatrix.
|
MutableTimeMatrix(Time[][] values,
StorageType storageType)
Construct a new Absolute Mutable Double TimeMatrix.
|
Modifier and Type | Method and Description |
---|---|
protected MutableTimeMatrix |
instantiateMutableType(DoubleMatrixData dmd,
TimeUnit unit)
Construct a new Absolute Mutable DoubleMatrix of the right type.
|
protected Time |
instantiateScalar(double value,
TimeUnit unit)
Construct a new Absolute Immutable DoubleScalar of the right type.
|
protected TimeMatrix |
instantiateTypeAbs(DoubleMatrixData dmd,
TimeUnit unit)
Construct a new Absolute Immutable DoubleMatrix of the right type.
|
protected DurationMatrix |
instantiateTypeRel(DoubleMatrixData dmd,
DurationUnit unit)
Construct a new Relative Immutable DoubleMatrix of the right type.
|
MutableTimeMatrix |
toDense()
Create a dense version of this DoubleMatrix.
|
MutableTimeMatrix |
toSparse()
Create a sparse version of this DoubleMatrix.
|
assign, ceil, checkCopyOnWrite, copy, decrementBy, decrementBy, decrementBy, divideBy, floor, immutable, incrementBy, incrementBy, incrementBy, multiplyBy, multiplyBy, mutable, normalize, rint, round, set, setCopyOnWrite, setInUnit, setSI
checkUnit, ensureRectangularAndNonEmpty, get, minus, minus, plus
cardinality, checkIndex, checkSize, checkSize, columns, determinant, ensureRectangularAndNonEmpty, equals, getData, getInUnit, getInUnit, getSI, getStorageType, getValuesInUnit, getValuesInUnit, getValuesSI, hashCode, rows, toString, toString, toString, toString, zSum
expressAsSIUnit, expressAsSpecifiedUnit, getUnit, isAbsolute, isRelative, setDisplayUnit
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
DIV, MULT, POW
public MutableTimeMatrix(double[][] values, TimeUnit unit, StorageType storageType) throws ValueException
values
- double[][]; the values of the entries in the new Absolute Mutable Double TimeMatrixunit
- U; the unit of the new Absolute Mutable Double TimeMatrixstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullpublic MutableTimeMatrix(Time[][] values, StorageType storageType) throws ValueException
values
- DoubleScalar.Rel<U>[][]; the values of the entries in the new Absolute Mutable Double TimeMatrixstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriesMutableTimeMatrix(DoubleMatrixData data, TimeUnit unit)
data
- an internal data objectunit
- the unitpublic final MutableTimeMatrix toDense()
public final MutableTimeMatrix toSparse()
protected final TimeMatrix instantiateTypeAbs(DoubleMatrixData dmd, TimeUnit unit)
instantiateTypeAbs
in class AbstractDoubleMatrixAbs<TimeUnit,DurationUnit,TimeMatrix,DurationMatrix,MutableTimeMatrix,Time>
dmd
- an internal data objectunit
- the unitprotected final DurationMatrix instantiateTypeRel(DoubleMatrixData dmd, DurationUnit unit)
instantiateTypeRel
in class AbstractDoubleMatrixAbs<TimeUnit,DurationUnit,TimeMatrix,DurationMatrix,MutableTimeMatrix,Time>
dmd
- an internal data objectunit
- the unitprotected final MutableTimeMatrix instantiateMutableType(DoubleMatrixData dmd, TimeUnit unit)
instantiateMutableType
in class AbstractDoubleMatrixAbs<TimeUnit,DurationUnit,TimeMatrix,DurationMatrix,MutableTimeMatrix,Time>
dmd
- an internal data objectunit
- the unitprotected final Time instantiateScalar(double value, TimeUnit unit)
instantiateScalar
in class AbstractDoubleMatrixAbs<TimeUnit,DurationUnit,TimeMatrix,DurationMatrix,MutableTimeMatrix,Time>
value
- the valueunit
- the unitCopyright © 2015–2018 Delft University of Technology. All rights reserved.