Package org.ojalgo.array
Class BufferArray
- All Implemented Interfaces:
AutoCloseable
,RandomAccess
,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:
BufferR032
,BufferR064
,BufferZ008
,BufferZ016
,BufferZ032
,BufferZ064
The odd member among the array implementations. It allows to create arrays based on memory mapped files or direct buffers.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interface
static final class
static final class
Nested 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 Buffer
private final AutoCloseable
static final BufferArray.Factory
static final BufferArray.Factory
static final BufferArray.Factory
static final BufferArray.Factory
static final BufferArray.Factory
static final BufferArray.Factory
Fields inherited from class org.ojalgo.array.PlainArray
CHARACTERISTICS, MAX_SIZE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
add
(int index, byte addend) protected final void
add
(int index, double addend) protected final void
add
(int index, float addend) protected final void
add
(int index, int addend) protected final void
add
(int index, long addend) protected final void
add
(int index, short addend) void
close()
protected void
exchange
(int firstA, int firstB, int step, int count) protected void
protected void
fill
(int first, int limit, int step, NullaryFunction<?> supplier) protected void
protected void
get
(int index) protected int
indexOfLargest
(int first, int limit, int step) protected boolean
isAbsolute
(int index) protected boolean
isSmall
(int index, double comparedTo) protected void
modify
(int first, int limit, int step, BinaryFunction<Double> function, Access1D<Double> right) protected void
modify
(int first, int limit, int step, UnaryFunction<Double> function) protected void
modify
(int first, int limit, int step, Access1D<Double> left, BinaryFunction<Double> function) (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) protected void
modifyOne
(int index, UnaryFunction<Double> modifier) void
reset()
Reset this mutable structure to some standard (all zeros) initial state.protected int
searchAscending
(Double number) protected void
set
(int index, Comparable<?> value) protected void
protected void
protected void
visit
(int first, int limit, int step, VoidFunction<Double> visitor) protected void
visitOne
(int index, VoidFunction<Double> visitor) Methods inherited from class org.ojalgo.array.PlainArray
add, add, add, add, add, add, add, add, byteValue, byteValue, count, doubleValue, doubleValue, exchange, fill, fill, fillAll, fillAll, fillOne, fillRange, fillRange, floatValue, floatValue, get, indexOfLargest, intValue, intValue, longValue, longValue, modify, modify, modify, modifyOne, set, set, set, set, set, set, set, set, set, set, set, set, set, shortValue, shortValue, size, visit, visitOne
Methods inherited from class org.ojalgo.array.DenseArray
build
Methods inherited from class org.ojalgo.array.BasicArray
aggregateRange, equals, factory, getMathType, hashCode, indexOfLargest, isPrimitive, modifyAll, modifyMatching, modifyMatching, modifyRange, supplyTo, toString, 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, dot, elements, nonzeros, select, 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.Fillable
fillCompatible, fillMatching, fillMatching, fillMatching
-
Field Details
-
R032
-
R064
-
Z008
-
Z016
-
Z032
-
Z064
-
myBuffer
-
myFile
-
-
Constructor Details
-
BufferArray
BufferArray(BufferArray.Factory factory, Buffer buffer, AutoCloseable file)
-
-
Method Details
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
get
- Specified by:
get
in classPlainArray<Double>
-
reset
public void reset()Description copied from interface:Mutate1D
Reset this mutable structure to some standard (all zeros) initial state. It must still be usuable after this call, and the structure/size/shape must not change. -
add
protected final void add(int index, byte addend) - Overrides:
add
in classPlainArray<Double>
-
add
protected final void add(int index, double addend) - Specified by:
add
in classPlainArray<Double>
-
add
protected final void add(int index, float addend) - Overrides:
add
in classPlainArray<Double>
-
add
protected final void add(int index, int addend) - Overrides:
add
in classPlainArray<Double>
-
add
protected final void add(int index, long addend) - Overrides:
add
in classPlainArray<Double>
-
add
protected final void add(int index, short addend) - Overrides:
add
in classPlainArray<Double>
-
exchange
protected void exchange(int firstA, int firstB, int step, int count) - Specified by:
exchange
in classPlainArray<Double>
-
fill
- Specified by:
fill
in classPlainArray<Double>
-
fill
- Specified by:
fill
in classPlainArray<Double>
-
fillOne
- Specified by:
fillOne
in classPlainArray<Double>
-
fillOne
- Specified by:
fillOne
in classPlainArray<Double>
-
indexOfLargest
protected int indexOfLargest(int first, int limit, int step) - Specified by:
indexOfLargest
in classPlainArray<Double>
-
isAbsolute
protected boolean isAbsolute(int index) - Specified by:
isAbsolute
in classPlainArray<Double>
- See Also:
-
isSmall
protected boolean isSmall(int index, double comparedTo) - Specified by:
isSmall
in classPlainArray<Double>
- See Also:
-
modify
protected void modify(int first, int limit, int step, Access1D<Double> left, BinaryFunction<Double> function) - Specified by:
modify
in classPlainArray<Double>
-
modify
protected void modify(int first, int limit, int step, BinaryFunction<Double> function, Access1D<Double> right) - Specified by:
modify
in classPlainArray<Double>
-
modify
- Specified by:
modify
in classPlainArray<Double>
-
modifyOne
- Specified by:
modifyOne
in classPlainArray<Double>
-
searchAscending
- Specified by:
searchAscending
in classPlainArray<Double>
-
set
- Specified by:
set
in classPlainArray<Double>
-
sortAscending
protected void sortAscending()- Specified by:
sortAscending
in classPlainArray<Double>
-
sortDescending
protected void sortDescending()- Specified by:
sortDescending
in classPlainArray<Double>
-
visit
- Specified by:
visit
in classPlainArray<Double>
-
visitOne
- Specified by:
visitOne
in classPlainArray<Double>
-
modify
- Specified by:
modify
in classDenseArray<Double>
-
modify
- Specified by:
modify
in classDenseArray<Double>
-
modify
- Specified by:
modify
in classDenseArray<Double>
-