Package org.ojalgo.array
Class OffHeapArray
- All Implemented Interfaces:
Access1D<Double>
,Access1D.Aggregatable<Double>
,Access1D.Collectable<Double,
,Mutate1D> Access1D.Visitable<Double>
,Factory1D.Builder<DenseArray<Double>>
,Mutate1D
,Mutate1D.Fillable<Double>
,Mutate1D.Modifiable<Double>
,Structure1D
- Direct Known Subclasses:
OffHeapR032
,OffHeapR064
,OffHeapZ008
,OffHeapZ016
,OffHeapZ032
,OffHeapZ064
Off heap memory array.
When just instantiated these array classes contain uninitialized memory – memory is allocated but not
initialized. To initialize call Mutate1D.reset()
. Explicit initialization is only necessary if your code
depends on having zeros as the default/initial value.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.ojalgo.structure.Access1D
Access1D.Aggregatable<N extends Comparable<N>>, Access1D.Collectable<N extends Comparable<N>,
R extends Mutate1D>, Access1D.ElementView<N extends Comparable<N>>, Access1D.SelectionView<N extends Comparable<N>>, Access1D.Sliceable<N extends Comparable<N>>, Access1D.Visitable<N extends Comparable<N>> Nested classes/interfaces inherited from interface org.ojalgo.structure.Mutate1D
Mutate1D.Fillable<N extends Comparable<N>>, Mutate1D.Mixable<N extends Comparable<N>>, Mutate1D.Modifiable<N extends Comparable<N>>, Mutate1D.ModifiableReceiver<N extends Comparable<N>>, Mutate1D.Receiver<N extends Comparable<N>>, Mutate1D.Sortable
Nested classes/interfaces inherited from interface org.ojalgo.structure.Structure1D
Structure1D.BasicMapper<T>, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.Logical<S extends Structure1D,
B extends Structure1D.Logical<S, B>>, Structure1D.LongIndex, Structure1D.LoopCallback -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final long
static final DenseArray.Factory
<Double> static final DenseArray.Factory
<Double> static final DenseArray.Factory
<Double> static final DenseArray.Factory
<Double> static final DenseArray.Factory
<Double> static final DenseArray.Factory
<Double> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
add
(long index, byte addend) final void
add
(long index, double addend) final void
add
(long index, float addend) final void
add
(long index, int addend) final void
add
(long index, long addend) final void
add
(long index, short addend) final long
count()
The total number of elements in this structure.protected void
exchange
(long firstA, long firstB, long step, long count) void
get
(long index) (package private) void
modify
(long extIndex, int intIndex, BinaryFunction<Double> function, Access1D<Double> right) (package private) void
modify
(long extIndex, int intIndex, UnaryFunction<Double> function) (package private) void
modify
(long extIndex, int intIndex, Access1D<Double> left, BinaryFunction<Double> function) void
modifyOne
(long index, UnaryFunction<Double> modifier) final int
size()
The total number of elements in this structure.void
visitOne
(long index, VoidFunction<Double> visitor) Methods inherited from class org.ojalgo.array.DenseArray
build
Methods inherited from class org.ojalgo.array.BasicArray
aggregateRange, equals, factory, fill, fill, getMathType, hashCode, indexOfLargest, indexOfLargest, isPrimitive, modify, modify, modify, modifyAll, modifyMatching, modifyMatching, modifyRange, supplyTo, toString, visit, visitAll, visitRange, wrapInArray1D, wrapInArray2D, wrapInArrayAnyD
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.ojalgo.structure.Access1D
asCollectable1D, asKeyed1D, axpy, byteValue, byteValue, dot, doubleValue, doubleValue, elements, floatValue, floatValue, intValue, intValue, longValue, longValue, nonzeros, select, shortValue, shortValue, supplyTo, toRawCopy1D
Methods inherited from interface org.ojalgo.structure.Access1D.Aggregatable
aggregateAll
Methods inherited from interface org.ojalgo.structure.Access1D.Collectable
collect
Methods inherited from interface org.ojalgo.structure.Mutate1D
reset, set, set, set, set, set, set, set, set, set, set, set, set, set
Methods inherited from interface org.ojalgo.structure.Mutate1D.Fillable
fillAll, fillCompatible, fillMatching, fillMatching, fillMatching, fillRange, fillRange
Methods inherited from interface org.ojalgo.structure.Mutate1D.Modifiable
add
-
Field Details
-
R032
-
R064
-
Z008
-
Z016
-
Z032
-
Z064
-
myCount
private final long myCount
-
-
Constructor Details
-
OffHeapArray
OffHeapArray(DenseArray.Factory<Double> factory, long count)
-
-
Method Details
-
add
public final void add(long index, byte addend) -
add
public final void add(long index, double addend) -
add
public final void add(long index, float addend) -
add
public final void add(long index, int addend) -
add
public final void add(long index, long addend) -
add
public final void add(long index, short addend) -
count
public final long count()Description copied from interface:Structure1D
The total number of elements in this structure.You only need to implement this method if the structure can contain more than Integer.MAX_VALUE elements.
-
fillAll
-
get
-
modifyOne
-
size
public final int size()Description copied from interface:Structure1D
The total number of elements in this structure. -
visitOne
-
exchange
protected void exchange(long firstA, long firstB, long step, long count) - Overrides:
exchange
in classBasicArray<Double>
-
modify
- Specified by:
modify
in classDenseArray<Double>
-
modify
- Specified by:
modify
in classDenseArray<Double>
-
modify
- Specified by:
modify
in classDenseArray<Double>
-