Package org.ojalgo.array
Class BasicArray<N extends Comparable<N>>
java.lang.Object
org.ojalgo.array.BasicArray<N>
- All Implemented Interfaces:
Access1D<N>
,Access1D.Aggregatable<N>
,Access1D.Collectable<N,
,Mutate1D> Access1D.Visitable<N>
,Mutate1D
,Mutate1D.Fillable<N>
,Mutate1D.Modifiable<N>
,Structure1D
- Direct Known Subclasses:
DenseArray
,SegmentedArray
,SparseArray
public abstract class BasicArray<N extends Comparable<N>>
extends Object
implements Access1D<N>, Access1D.Aggregatable<N>, Access1D.Visitable<N>, Mutate1D, Mutate1D.Fillable<N>, Mutate1D.Modifiable<N>, Access1D.Collectable<N,Mutate1D>
A BasicArray is 1-dimensional, but designed to easily be extended or encapsulated, and then treated as arbitrary-dimensional. It stores/handles (any subclass of) Comparable elements depending on the subclass/implementation.
This abstract class defines a set of methods to access and modify array elements. It does not "know" anything about linear algebra or similar.
-
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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaggregateRange
(long first, long limit, Aggregator aggregator) boolean
protected void
exchange
(long firstA, long firstB, long step, long count) (package private) final ArrayFactory
<N, ?> factory()
protected void
protected void
fill
(long first, long limit, long step, NullaryFunction<?> supplier) final MathType
int
hashCode()
long
protected long
indexOfLargest
(long first, long limit, long step) final boolean
protected void
modify
(long first, long limit, long step, BinaryFunction<N> function, Access1D<N> right) protected void
modify
(long first, long limit, long step, UnaryFunction<N> function) protected void
modify
(long first, long limit, long step, Access1D<N> left, BinaryFunction<N> function) void
modifyAll
(UnaryFunction<N> modifier) void
modifyMatching
(BinaryFunction<N> function, Access1D<N> right) void
modifyMatching
(Access1D<N> left, BinaryFunction<N> function) void
modifyRange
(long first, long limit, UnaryFunction<N> modifier) void
toString()
protected void
visit
(long first, long limit, long step, VoidFunction<N> visitor) void
visitAll
(VoidFunction<N> visitor) void
visitRange
(long first, long limit, VoidFunction<N> visitor) A utility facade that conveniently/consistently presents the BasicArray as a one-dimensional array.wrapInArray2D
(long structure) A utility facade that conveniently/consistently presents the BasicArray as a two-dimensional array.wrapInArrayAnyD
(long[] structure) A utility facade that conveniently/consistently presents the BasicArray as a multi-dimensional array.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, get, 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.Access1D.Visitable
visitOne
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, fillAll, fillCompatible, fillMatching, fillMatching, fillMatching, fillRange, fillRange
Methods inherited from interface org.ojalgo.structure.Mutate1D.Modifiable
add, add, add, add, add, add, add, modifyOne
Methods inherited from interface org.ojalgo.structure.Structure1D
count, size
-
Field Details
-
myFactory
-
-
Constructor Details
-
BasicArray
private BasicArray() -
BasicArray
-
-
Method Details
-
aggregateRange
- Specified by:
aggregateRange
in interfaceAccess1D.Aggregatable<N extends Comparable<N>>
-
equals
-
getMathType
-
hashCode
public int hashCode() -
indexOfLargest
public long indexOfLargest()- Specified by:
indexOfLargest
in interfaceAccess1D.Aggregatable<N extends Comparable<N>>
-
isPrimitive
public final boolean isPrimitive() -
modifyAll
- Specified by:
modifyAll
in interfaceMutate1D.Modifiable<N extends Comparable<N>>
-
modifyMatching
- Specified by:
modifyMatching
in interfaceMutate1D.Modifiable<N extends Comparable<N>>
-
modifyMatching
- Specified by:
modifyMatching
in interfaceMutate1D.Modifiable<N extends Comparable<N>>
-
modifyRange
- Specified by:
modifyRange
in interfaceMutate1D.Modifiable<N extends Comparable<N>>
-
supplyTo
- Specified by:
supplyTo
in interfaceAccess1D.Collectable<N extends Comparable<N>,
Mutate1D>
-
toString
-
visitAll
- Specified by:
visitAll
in interfaceAccess1D.Visitable<N extends Comparable<N>>
-
visitRange
- Specified by:
visitRange
in interfaceAccess1D.Visitable<N extends Comparable<N>>
-
exchange
protected void exchange(long firstA, long firstB, long step, long count) -
fill
-
fill
-
indexOfLargest
protected long indexOfLargest(long first, long limit, long step) -
modify
protected void modify(long first, long limit, long step, Access1D<N> left, BinaryFunction<N> function) -
modify
protected void modify(long first, long limit, long step, BinaryFunction<N> function, Access1D<N> right) -
modify
-
visit
-
wrapInArray1D
A utility facade that conveniently/consistently presents the BasicArray as a one-dimensional array. Note that you will modify the actual array by accessing it through this facade. -
wrapInArray2D
A utility facade that conveniently/consistently presents the BasicArray as a two-dimensional array. Note that you will modify the actual array by accessing it through this facade. -
wrapInArrayAnyD
A utility facade that conveniently/consistently presents the BasicArray as a multi-dimensional array. Note that you will modify the actual array by accessing it through this facade. -
factory
-