public abstract class BasicArray<N extends Number> extends Object implements Access1D<N>, Access1D.Elements, Access1D.IndexOf, Access1D.Visitable<N>, Mutate1D, Mutate1D.Fillable<N>, Mutate1D.Modifiable<N>, Serializable
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) Number 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.
| Modifier and Type | Class and Description |
|---|---|
static class |
BasicArray.Factory<N extends Number> |
Access1D.Aggregatable<N extends Number>, Access1D.Collectable<N extends Number,R extends Mutate1D.Receiver<N>>, Access1D.Elements, Access1D.ElementView<N extends Number>, Access1D.IndexOf, Access1D.Sliceable<N extends Number>, Access1D.Visitable<N extends Number>Mutate1D.BiModifiable<N extends Number>, Mutate1D.Fillable<N extends Number>, Mutate1D.Mixable<N extends Number>, Mutate1D.Modifiable<N extends Number>, Mutate1D.Receiver<N extends Number>, Mutate1D.SortableStructure1D.BasicMapper<T>, Structure1D.IndexCallback, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.LongIndex, Structure1D.LoopCallback| Modifier | Constructor and Description |
|---|---|
protected |
BasicArray(org.ojalgo.array.ArrayFactory<N,?> factory) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
exchange(long firstA,
long firstB,
long step,
long count) |
static <N extends Number> |
factory(DenseArray.Factory<N> denseFactory) |
protected abstract void |
fill(long first,
long limit,
long step,
N value) |
protected abstract void |
fill(long first,
long limit,
long step,
NullaryFunction<N> supplier) |
long |
indexOfLargest() |
protected long |
indexOfLargest(long first,
long limit,
long step) |
long |
indexOfLargestInRange(long first,
long limit) |
protected abstract boolean |
isSmall(long first,
long limit,
long step,
double comparedTo) |
static int[] |
makeDecreasingRange(int first,
int count) |
static long[] |
makeDecreasingRange(long first,
int count) |
static int[] |
makeIncreasingRange(int first,
int count) |
static long[] |
makeIncreasingRange(long first,
int count) |
protected abstract void |
modify(long first,
long limit,
long step,
Access1D<N> left,
BinaryFunction<N> function) |
protected abstract void |
modify(long first,
long limit,
long step,
BinaryFunction<N> function,
Access1D<N> right) |
protected abstract void |
modify(long first,
long limit,
long step,
UnaryFunction<N> function) |
void |
modifyAll(UnaryFunction<N> modifier) |
void |
modifyRange(long first,
long limit,
UnaryFunction<N> modifier) |
String |
toString() |
protected abstract 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) |
protected Array1D<N> |
wrapInArray1D()
A utility facade that conveniently/consistently presents the BasicArray
as a one-dimensional array.
|
protected Array2D<N> |
wrapInArray2D(long structure)
A utility facade that conveniently/consistently presents the BasicArray
as a two-dimensional array.
|
protected ArrayAnyD<N> |
wrapInArrayAnyD(long[] structure)
A utility facade that conveniently/consistently presents the BasicArray
as a multi-dimensional array.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitasCollectable1D, asPrimitive1D, axpy, dot, doubleValue, elements, equals, get, hashCode, iterator, nonzeros, stream, supplyTo, toRawCopy1D, wrap, wrap, wrap, wrapAccess1D, wrapAccess1D, wrapAccess1DforEach, spliteratorisAbsolute, isAllSmall, isSmallvisitOnefillAll, fillAll, fillMatching, fillMatching, fillMatching, fillOne, fillOne, fillOne, fillRange, fillRangemodifyOnecount, loopAll, loopMatching, loopRange, mapperprotected BasicArray(org.ojalgo.array.ArrayFactory<N,?> factory)
public static <N extends Number> BasicArray.Factory<N> factory(DenseArray.Factory<N> denseFactory)
public static int[] makeDecreasingRange(int first,
int count)
public static long[] makeDecreasingRange(long first,
int count)
public static int[] makeIncreasingRange(int first,
int count)
public static long[] makeIncreasingRange(long first,
int count)
public long indexOfLargest()
indexOfLargest in interface Access1D.IndexOfpublic long indexOfLargestInRange(long first,
long limit)
indexOfLargestInRange in interface Access1D.IndexOfpublic void modifyAll(UnaryFunction<N> modifier)
modifyAll in interface Mutate1D.Modifiable<N extends Number>public void modifyRange(long first,
long limit,
UnaryFunction<N> modifier)
modifyRange in interface Mutate1D.Modifiable<N extends Number>public void visitAll(VoidFunction<N> visitor)
visitAll in interface Access1D.Visitable<N extends Number>public void visitRange(long first,
long limit,
VoidFunction<N> visitor)
visitRange in interface Access1D.Visitable<N extends Number>protected abstract void exchange(long firstA,
long firstB,
long step,
long count)
protected abstract void fill(long first,
long limit,
long step,
N value)
protected abstract void fill(long first,
long limit,
long step,
NullaryFunction<N> supplier)
protected long indexOfLargest(long first,
long limit,
long step)
protected abstract boolean isSmall(long first,
long limit,
long step,
double comparedTo)
protected abstract void modify(long first,
long limit,
long step,
Access1D<N> left,
BinaryFunction<N> function)
protected abstract void modify(long first,
long limit,
long step,
BinaryFunction<N> function,
Access1D<N> right)
protected abstract void modify(long first,
long limit,
long step,
UnaryFunction<N> function)
protected abstract void visit(long first,
long limit,
long step,
VoidFunction<N> visitor)
protected final Array1D<N> wrapInArray1D()
protected final Array2D<N> wrapInArray2D(long structure)
protected final ArrayAnyD<N> wrapInArrayAnyD(long[] structure)
Copyright © 2018 Optimatika. All rights reserved.