Package org.ojalgo.array
Class OffHeapArray
- java.lang.Object
-
- org.ojalgo.array.BasicArray<N>
-
- org.ojalgo.array.DenseArray<java.lang.Double>
-
- org.ojalgo.array.OffHeapArray
-
- All Implemented Interfaces:
Access1D<java.lang.Double>
,Access1D.Aggregatable<java.lang.Double>
,Access1D.Collectable<java.lang.Double,Mutate1D>
,Access1D.Visitable<java.lang.Double>
,Factory1D.Builder<DenseArray<java.lang.Double>>
,Mutate1D
,Mutate1D.Fillable<java.lang.Double>
,Mutate1D.Modifiable<java.lang.Double>
,Structure1D
- Direct Known Subclasses:
OffHeapR032
,OffHeapR064
,OffHeapZ008
,OffHeapZ016
,OffHeapZ032
,OffHeapZ064
public abstract class OffHeapArray extends DenseArray<java.lang.Double>
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 Classes Modifier and Type Class Description (package private) static class
OffHeapArray.Factory
-
Nested classes/interfaces inherited from interface org.ojalgo.structure.Access1D
Access1D.Aggregatable<N extends java.lang.Comparable<N>>, Access1D.Collectable<N extends java.lang.Comparable<N>,R extends Mutate1D>, Access1D.ElementView<N extends java.lang.Comparable<N>>, Access1D.SelectionView<N extends java.lang.Comparable<N>>, Access1D.Sliceable<N extends java.lang.Comparable<N>>, Access1D.Visitable<N extends java.lang.Comparable<N>>
-
Nested classes/interfaces inherited from interface org.ojalgo.structure.Mutate1D
Mutate1D.Fillable<N extends java.lang.Comparable<N>>, Mutate1D.Mixable<N extends java.lang.Comparable<N>>, Mutate1D.Modifiable<N extends java.lang.Comparable<N>>, Mutate1D.ModifiableReceiver<N extends java.lang.Comparable<N>>, Mutate1D.Receiver<N extends java.lang.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
Fields Modifier and Type Field Description private long
myCount
static DenseArray.Factory<java.lang.Double>
R032
static DenseArray.Factory<java.lang.Double>
R064
static DenseArray.Factory<java.lang.Double>
Z008
static DenseArray.Factory<java.lang.Double>
Z016
static DenseArray.Factory<java.lang.Double>
Z032
static DenseArray.Factory<java.lang.Double>
Z064
-
Constructor Summary
Constructors Constructor Description OffHeapArray(DenseArray.Factory<java.lang.Double> factory, long count)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(long index, byte addend)
void
add(long index, double addend)
void
add(long index, float addend)
void
add(long index, int addend)
void
add(long index, long addend)
void
add(long index, short addend)
long
count()
The total number of elements in this structure.protected void
exchange(long firstA, long firstB, long step, long count)
void
fillAll(java.lang.Double value)
java.lang.Double
get(long index)
(package private) void
modify(long extIndex, int intIndex, BinaryFunction<java.lang.Double> function, Access1D<java.lang.Double> right)
(package private) void
modify(long extIndex, int intIndex, UnaryFunction<java.lang.Double> function)
(package private) void
modify(long extIndex, int intIndex, Access1D<java.lang.Double> left, BinaryFunction<java.lang.Double> function)
void
modifyOne(long index, UnaryFunction<java.lang.Double> modifier)
int
size()
The total number of elements in this structure.void
visitOne(long index, VoidFunction<java.lang.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 Detail
-
R032
public static final DenseArray.Factory<java.lang.Double> R032
-
R064
public static final DenseArray.Factory<java.lang.Double> R064
-
Z008
public static final DenseArray.Factory<java.lang.Double> Z008
-
Z016
public static final DenseArray.Factory<java.lang.Double> Z016
-
Z032
public static final DenseArray.Factory<java.lang.Double> Z032
-
Z064
public static final DenseArray.Factory<java.lang.Double> Z064
-
myCount
private final long myCount
-
-
Constructor Detail
-
OffHeapArray
OffHeapArray(DenseArray.Factory<java.lang.Double> factory, long count)
-
-
Method Detail
-
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
public void fillAll(java.lang.Double value)
-
get
public java.lang.Double get(long index)
-
modifyOne
public void modifyOne(long index, UnaryFunction<java.lang.Double> modifier)
-
size
public final int size()
Description copied from interface:Structure1D
The total number of elements in this structure.
-
visitOne
public void visitOne(long index, VoidFunction<java.lang.Double> visitor)
-
exchange
protected void exchange(long firstA, long firstB, long step, long count)
- Overrides:
exchange
in classBasicArray<java.lang.Double>
-
modify
void modify(long extIndex, int intIndex, Access1D<java.lang.Double> left, BinaryFunction<java.lang.Double> function)
- Specified by:
modify
in classDenseArray<java.lang.Double>
-
modify
void modify(long extIndex, int intIndex, BinaryFunction<java.lang.Double> function, Access1D<java.lang.Double> right)
- Specified by:
modify
in classDenseArray<java.lang.Double>
-
modify
void modify(long extIndex, int intIndex, UnaryFunction<java.lang.Double> function)
- Specified by:
modify
in classDenseArray<java.lang.Double>
-
-