CompressedArray1D class
Usage of this class: Invoke the static function compress. The compression
result is either cArray, or cArrayPos and cArrayNeg, depending
on the argument separate
of compress.
See README.md
of this package about when this class should be employed.
Constructors
-
CompressedArray1D(Float64List cArray, List<
int> uIndices, int cpdIndexIncrement) -
CompressedArray1D.sep(Float64List cArrayPos, Float64List cArrayNeg, List<
int> uIndices, int cpdIndexIncrement)
Properties
- cArray ↔ Float64List
-
The compressed array: if positive and negative array values not to be separated
read / write
- cArrayNeg ↔ Float64List
-
The compressed array: if positive and negative array values to be separated
read / write
- cArrayPos ↔ Float64List
-
The compressed array: if positive and negative array values to be separated
read / write
- cpdIndexIncrement ↔ int
-
The index difference between 2 adjacent values in uIndices.
read / write
-
uIndices
↔ List<
int> -
Indices in the original uncompressed array (same length as cValues).
Can be used to find out from which orginal index range a value in the compressed
array originated.
read / write
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator ==(
dynamic other) → bool -
The equality operator. [...]
inherited
Static Methods
-
compress(
Float64List array, int ixFirst_, int ixLast_, bool separate, [ int newLength ]) → CompressedArray1D -
Compresses a desired section of an
array
to a smallernewLength
, defaulting to 1024.ixFirst_
,ixLast_
are the left and right section limits (indices). Returns a CompressedArray1D object with cArray being the compressed values ifseparate
is false. If true, the compressed values are instead stored in 2 arrays, cArrayPos and cArrayNeg, with only positive and negative values. The algorithm fragments the considered section into intervals with a size computed fromnewLength
. In each interval, it discards all but 2 values, the minimum and maximum. NOTE: IfnewLength
is not a divisor of thearray
length, the last compressed values are sampled from a wider index interval than the other compressed values! -
getCompressionIntervals(
Float64List array, int nIntervals, int ixFirst) → List< int> -
array
= array (e.g. to be compressed)nIntervals
= size of compressed arrayixFirst
= first index inarray to be considered
Returns the computed interval indices with respect toarray
. The size of the result isnIntervals
.