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 ClassesModifier and TypeClassDescription(package private) static classBasicArray.BaseFactory<N extends Comparable<N>, A extends BasicArray<N>>static final classBasicArray.Factory<N extends Comparable<N>>Nested classes/interfaces inherited from interface Access1D
Access1D.Aggregatable<N>, Access1D.Collectable<N,R>, Access1D.ElementView<N>, Access1D.SelectionView<N>, Access1D.Sliceable<N>, Access1D.Visitable<N> Nested classes/interfaces inherited from interface Mutate1D
Mutate1D.Fillable<N>, Mutate1D.Mixable<N>, Mutate1D.Modifiable<N>, Mutate1D.ModifiableReceiver<N>, Mutate1D.Receiver<N>, Mutate1D.SortableNested classes/interfaces inherited from interface Structure1D
Structure1D.BasicMapper<T>, Structure1D.IndexMapper<T>, Structure1D.IntIndex, 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) booleanprotected voidexchange(long firstA, long firstB, long step, long count) (package private) final BasicArray.BaseFactory<N, ?> factory()protected voidprotected voidfill(long first, long limit, long step, NullaryFunction<?> supplier) final MathTypeinthashCode()longprotected longindexOfLargest(long first, long limit, long step) final booleanprotected voidmodify(long first, long limit, long step, BinaryFunction<N> function, Access1D<N> right) protected voidmodify(long first, long limit, long step, UnaryFunction<N> function) protected voidmodify(long first, long limit, long step, Access1D<N> left, BinaryFunction<N> function) voidmodifyAll(UnaryFunction<N> modifier) voidmodifyMatching(BinaryFunction<N> function, Access1D<N> right) voidmodifyMatching(Access1D<N> left, BinaryFunction<N> function) voidmodifyRange(long first, long limit, UnaryFunction<N> modifier) voidtoString()protected voidvisit(long first, long limit, long step, VoidFunction<N> visitor) voidvisitAll(VoidFunction<N> visitor) voidvisitRange(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 interface Access1D
asCollectable1D, asKeyed1D, asList, axpy, byteValue, byteValue, dot, doubleValue, doubleValue, elements, floatValue, floatValue, get, intValue, intValue, longValue, longValue, nonzeros, select, shortValue, shortValue, supplyTo, toList, toRawCopy1DMethods inherited from interface Access1D.Aggregatable
aggregateAllMethods inherited from interface Access1D.Collectable
collectMethods inherited from interface Access1D.Visitable
visitOneMethods inherited from interface Mutate1D
reset, set, set, set, set, set, set, set, set, set, set, set, set, setMethods inherited from interface Mutate1D.Fillable
fillAll, fillAll, fillCompatible, fillMatching, fillMatching, fillMatching, fillMatching, fillRange, fillRangeMethods inherited from interface Mutate1D.Modifiable
add, add, add, add, add, add, add, add, add, add, add, add, add, modifyOneMethods inherited from interface Structure1D
count, size
-
Field Details
-
myFactory
-
-
Constructor Details
-
BasicArray
private BasicArray() -
BasicArray
-
-
Method Details
-
aggregateRange
- Specified by:
aggregateRangein interfaceAccess1D.Aggregatable<N extends Comparable<N>>
-
equals
-
getMathType
-
hashCode
-
indexOfLargest
public long indexOfLargest()- Specified by:
indexOfLargestin interfaceAccess1D.Aggregatable<N extends Comparable<N>>
-
isPrimitive
public final boolean isPrimitive() -
modifyAll
- Specified by:
modifyAllin interfaceMutate1D.Modifiable<N extends Comparable<N>>
-
modifyMatching
- Specified by:
modifyMatchingin interfaceMutate1D.Modifiable<N extends Comparable<N>>
-
modifyMatching
- Specified by:
modifyMatchingin interfaceMutate1D.Modifiable<N extends Comparable<N>>
-
modifyRange
- Specified by:
modifyRangein interfaceMutate1D.Modifiable<N extends Comparable<N>>
-
supplyTo
- Specified by:
supplyToin interfaceAccess1D.Collectable<N extends Comparable<N>, Mutate1D>
-
toString
-
visitAll
- Specified by:
visitAllin interfaceAccess1D.Visitable<N extends Comparable<N>>
-
visitRange
- Specified by:
visitRangein 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
-