- java.lang.Object
-
- org.ojalgo.array.ArrayAnyD<N>
-
- All Implemented Interfaces:
java.util.function.Consumer<AccessAnyD<?>>,Access1D<N>,Access1D.Aggregatable<N>,Access1D.Sliceable<N>,Access1D.Visitable<N>,AccessAnyD<N>,AccessAnyD.Aggregatable<N>,AccessAnyD.Collectable<N,MutateAnyD>,AccessAnyD.Sliceable<N>,AccessAnyD.Visitable<N>,FactoryAnyD.Builder<ArrayAnyD<N>>,Mutate1D,Mutate1D.Fillable<N>,Mutate1D.Mixable<N>,Mutate1D.Modifiable<N>,MutateAnyD,MutateAnyD.Fillable<N>,MutateAnyD.Mixable<N>,MutateAnyD.Modifiable<N>,MutateAnyD.ModifiableReceiver<N>,MutateAnyD.Receiver<N>,Structure1D,StructureAnyD,StructureAnyD.ReducibleTo1D<Array1D<N>>,StructureAnyD.ReducibleTo2D<Array2D<N>>,StructureAnyD.Reshapable
public final class ArrayAnyD<N extends java.lang.Comparable<N>> extends java.lang.Object implements AccessAnyD.Visitable<N>, AccessAnyD.Aggregatable<N>, AccessAnyD.Sliceable<N>, StructureAnyD.ReducibleTo1D<Array1D<N>>, StructureAnyD.ReducibleTo2D<Array2D<N>>, AccessAnyD.Collectable<N,MutateAnyD>, MutateAnyD.ModifiableReceiver<N>, MutateAnyD.Mixable<N>, StructureAnyD.Reshapable, FactoryAnyD.Builder<ArrayAnyD<N>>
ArrayAnyD
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classArrayAnyD.Factory<N extends java.lang.Comparable<N>>-
Nested classes/interfaces inherited from interface org.ojalgo.structure.AccessAnyD
AccessAnyD.Aggregatable<N extends java.lang.Comparable<N>>, AccessAnyD.Collectable<N extends java.lang.Comparable<N>,R extends MutateAnyD>, AccessAnyD.ElementView<N extends java.lang.Comparable<N>>, AccessAnyD.MatrixView<N extends java.lang.Comparable<N>>, AccessAnyD.SelectionView<N extends java.lang.Comparable<N>>, AccessAnyD.Sliceable<N extends java.lang.Comparable<N>>, AccessAnyD.VectorView<N extends java.lang.Comparable<N>>, AccessAnyD.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.MutateAnyD
MutateAnyD.Fillable<N extends java.lang.Comparable<N>>, MutateAnyD.Mixable<N extends java.lang.Comparable<N>>, MutateAnyD.Modifiable<N extends java.lang.Comparable<N>>, MutateAnyD.ModifiableReceiver<N extends java.lang.Comparable<N>>, MutateAnyD.Receiver<N extends java.lang.Comparable<N>>
-
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
-
Nested classes/interfaces inherited from interface org.ojalgo.structure.StructureAnyD
StructureAnyD.IntReference, StructureAnyD.Logical<S extends StructureAnyD,B extends StructureAnyD.Logical<S,B>>, StructureAnyD.LongReference, StructureAnyD.ReducibleTo1D<R extends Structure1D>, StructureAnyD.ReducibleTo2D<R extends Structure2D>, StructureAnyD.ReferenceCallback, StructureAnyD.ReferenceMapper, StructureAnyD.Reshapable
-
-
Field Summary
Fields Modifier and Type Field Description static ArrayAnyD.Factory<ComplexNumber>C128static ArrayAnyD.Factory<Quaternion>H256private BasicArray<N>myDelegateprivate long[]myStructurestatic ArrayAnyD.Factory<RationalNumber>Q128static ArrayAnyD.Factory<java.lang.Double>R032static ArrayAnyD.Factory<java.lang.Double>R064static ArrayAnyD.Factory<Quadruple>R128static ArrayAnyD.Factory<java.math.BigDecimal>R256static ArrayAnyD.Factory<java.lang.Double>Z008static ArrayAnyD.Factory<java.lang.Double>Z016static ArrayAnyD.Factory<java.lang.Double>Z032static ArrayAnyD.Factory<java.lang.Double>Z064
-
Constructor Summary
Constructors Modifier Constructor Description privateArrayAnyD()(package private)ArrayAnyD(BasicArray<N> delegate, long[] structure)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, double addend)voidadd(long[] reference, byte addend)voidadd(long[] reference, double addend)voidadd(long[] reference, float addend)voidadd(long[] reference, int addend)voidadd(long[] reference, long addend)voidadd(long[] reference, short addend)voidadd(long[] reference, java.lang.Comparable<?> addend)voidadd(long index, byte addend)voidadd(long index, double addend)voidadd(long index, float addend)voidadd(long index, int addend)voidadd(long index, long addend)voidadd(long index, short addend)voidadd(long index, java.lang.Comparable<?> addend)NaggregateRange(long first, long limit, Aggregator aggregator)NaggregateSet(int dimension, long dimensionalIndex, Aggregator aggregator)NaggregateSet(long[] initial, int dimension, Aggregator aggregator)ArrayAnyD<N>build()bytebyteValue(int index)bytebyteValue(long index)bytebyteValue(long... ref)longcount()The total number of elements in this structure.longcount(int dimension)count() == count(0) * count(1) * count(2) * count(3) * ...doubledoubleValue(int index)doubledoubleValue(long index)doubledoubleValue(long... ref)booleanequals(java.lang.Object obj)ArrayAnyD<N>expand(int rank)If necessary increase the rank to the specified number (without changing the total number of components)(package private) FactoryAnyD<ArrayAnyD<N>>factory()static <N extends java.lang.Comparable<N>>
ArrayAnyD.Factory<N>factory(DenseArray.Factory<N,?> denseArray)voidfillAll(N value)voidfillAll(NullaryFunction<?> supplier)voidfillRange(long first, long limit, N value)voidfillRange(long first, long limit, NullaryFunction<?> supplier)voidfillSet(int dimension, long dimensionalIndex, N value)voidfillSet(int dimension, long dimensionalIndex, NullaryFunction<?> supplier)voidfillSet(long[] initial, int dimension, N value)voidfillSet(long[] initial, int dimension, NullaryFunction<?> supplier)Array1D<N>flatten()Flattens this abitrary dimensional array to a one dimensional array.floatfloatValue(int index)floatfloatValue(long index)floatfloatValue(long... ref)Nget(long index)Nget(long... ref)(package private) BasicArray<N>getDelegate()inthashCode()longindexOfLargest()intintValue(int index)intintValue(long index)intintValue(long... ref)longlongValue(int index)longlongValue(long index)longlongValue(long... ref)doublemix(long[] reference, BinaryFunction<N> mixer, double addend)Nmix(long[] reference, BinaryFunction<N> mixer, N addend)voidmodifyAll(UnaryFunction<N> modifier)voidmodifyAny(TransformationAnyD<N> modifier)voidmodifyMatching(BinaryFunction<N> function, Access1D<N> right)voidmodifyMatching(Access1D<N> left, BinaryFunction<N> function)voidmodifyOne(long[] reference, UnaryFunction<N> modifier)voidmodifyOne(long index, UnaryFunction<N> modifier)voidmodifyRange(long first, long limit, UnaryFunction<N> modifier)voidmodifySet(int dimension, long dimensionalIndex, UnaryFunction<N> modifier)voidmodifySet(long[] initial, int dimension, UnaryFunction<N> modifier)intrank()Array2D<N>reduce(int rowDim, int colDim, Aggregator aggregator)Array1D<N>reduce(int dimension, Aggregator aggregator)voidreset()Reset this mutable structure to some standard (all zeros) initial state.ArrayAnyD<N>reshape(long... shape)The same array viewed/accessed with a different shapevoidset(int index, byte value)voidset(int index, double value)voidset(int index, float value)voidset(int index, int value)voidset(int index, long value)voidset(int index, short value)voidset(long[] reference, byte value)voidset(long[] reference, double value)voidset(long[] reference, float value)voidset(long[] reference, int value)voidset(long[] reference, long value)voidset(long[] reference, short value)voidset(long[] reference, java.lang.Comparable<?> value)voidset(long index, byte value)voidset(long index, double value)voidset(long index, float value)voidset(long index, int value)voidset(long index, long value)voidset(long index, short value)voidset(long index, java.lang.Comparable<?> value)long[]shape()shortshortValue(int index)shortshortValue(long index)shortshortValue(long... ref)intsize()The total number of elements in this structure.intsize(int dimension)Array1D<N>sliceRange(long first, long limit)Array1D<N>sliceSet(long[] initial, int dimension)If the intial reference is {0, 2, 3} and the slice dimension is 1 then the sliced 1D view will map to the following elements in the AnyD data structure:ArrayAnyD<N>squeeze()Squeezing removes the dimensions or axes that have a length of one.voidsupplyTo(MutateAnyD receiver)java.lang.StringtoString()voidvisitAll(VoidFunction<N> visitor)voidvisitOne(long[] reference, VoidFunction<N> visitor)voidvisitOne(long index, VoidFunction<N> visitor)voidvisitRange(long first, long limit, VoidFunction<N> visitor)voidvisitSet(int dimension, long dimensionalIndex, VoidFunction<N> visitor)voidvisitSet(long[] initial, int dimension, VoidFunction<N> visitor)-
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, asList, axpy, dot, nonzeros, select, supplyTo, toList, toRawCopy1D
-
Methods inherited from interface org.ojalgo.structure.Access1D.Aggregatable
aggregateAll
-
Methods inherited from interface org.ojalgo.structure.AccessAnyD
asCollectableAnyD, byteValue, doubleValue, elements, floatValue, get, intValue, longValue, matrices, select, shortValue, vectors
-
Methods inherited from interface org.ojalgo.structure.AccessAnyD.Aggregatable
reduce
-
Methods inherited from interface org.ojalgo.structure.AccessAnyD.Collectable
collect
-
Methods inherited from interface org.ojalgo.structure.Mutate1D.Fillable
fillCompatible, fillMatching, fillMatching, fillMatching
-
Methods inherited from interface org.ojalgo.structure.MutateAnyD.Fillable
fillCompatible
-
Methods inherited from interface org.ojalgo.structure.MutateAnyD.Mixable
mix, mix
-
Methods inherited from interface org.ojalgo.structure.MutateAnyD.ModifiableReceiver
modifyCompatible, modifyCompatible
-
Methods inherited from interface org.ojalgo.structure.MutateAnyD.Receiver
accept, isAcceptable
-
Methods inherited from interface org.ojalgo.structure.StructureAnyD
loop, loop, loopAllReferences, loopReferences
-
-
-
-
Field Detail
-
C128
public static final ArrayAnyD.Factory<ComplexNumber> C128
-
H256
public static final ArrayAnyD.Factory<Quaternion> H256
-
Q128
public static final ArrayAnyD.Factory<RationalNumber> Q128
-
R032
public static final ArrayAnyD.Factory<java.lang.Double> R032
-
R064
public static final ArrayAnyD.Factory<java.lang.Double> R064
-
R128
public static final ArrayAnyD.Factory<Quadruple> R128
-
R256
public static final ArrayAnyD.Factory<java.math.BigDecimal> R256
-
Z008
public static final ArrayAnyD.Factory<java.lang.Double> Z008
-
Z016
public static final ArrayAnyD.Factory<java.lang.Double> Z016
-
Z032
public static final ArrayAnyD.Factory<java.lang.Double> Z032
-
Z064
public static final ArrayAnyD.Factory<java.lang.Double> Z064
-
myDelegate
private final BasicArray<N extends java.lang.Comparable<N>> myDelegate
-
myStructure
private final long[] myStructure
-
-
Constructor Detail
-
ArrayAnyD
private ArrayAnyD()
-
ArrayAnyD
ArrayAnyD(BasicArray<N> delegate, long[] structure)
-
-
Method Detail
-
factory
public static <N extends java.lang.Comparable<N>> ArrayAnyD.Factory<N> factory(DenseArray.Factory<N,?> denseArray)
-
add
public void add(int index, double addend)- Specified by:
addin interfaceMutate1D.Modifiable<N extends java.lang.Comparable<N>>- Specified by:
addin interfaceMutateAnyD.Modifiable<N extends java.lang.Comparable<N>>
-
add
public void add(long index, byte addend)- Specified by:
addin interfaceMutate1D.Modifiable<N extends java.lang.Comparable<N>>- Specified by:
addin interfaceMutateAnyD.Modifiable<N extends java.lang.Comparable<N>>
-
add
public void add(long index, java.lang.Comparable<?> addend)- Specified by:
addin interfaceMutate1D.Modifiable<N extends java.lang.Comparable<N>>- Specified by:
addin interfaceMutateAnyD.Modifiable<N extends java.lang.Comparable<N>>
-
add
public void add(long index, double addend)- Specified by:
addin interfaceMutate1D.Modifiable<N extends java.lang.Comparable<N>>- Specified by:
addin interfaceMutateAnyD.Modifiable<N extends java.lang.Comparable<N>>
-
add
public void add(long index, float addend)- Specified by:
addin interfaceMutate1D.Modifiable<N extends java.lang.Comparable<N>>- Specified by:
addin interfaceMutateAnyD.Modifiable<N extends java.lang.Comparable<N>>
-
add
public void add(long index, int addend)- Specified by:
addin interfaceMutate1D.Modifiable<N extends java.lang.Comparable<N>>- Specified by:
addin interfaceMutateAnyD.Modifiable<N extends java.lang.Comparable<N>>
-
add
public void add(long index, long addend)- Specified by:
addin interfaceMutate1D.Modifiable<N extends java.lang.Comparable<N>>- Specified by:
addin interfaceMutateAnyD.Modifiable<N extends java.lang.Comparable<N>>
-
add
public void add(long index, short addend)- Specified by:
addin interfaceMutate1D.Modifiable<N extends java.lang.Comparable<N>>- Specified by:
addin interfaceMutateAnyD.Modifiable<N extends java.lang.Comparable<N>>
-
add
public void add(long[] reference, byte addend)- Specified by:
addin interfaceMutateAnyD.Modifiable<N extends java.lang.Comparable<N>>
-
add
public void add(long[] reference, java.lang.Comparable<?> addend)- Specified by:
addin interfaceMutateAnyD.Modifiable<N extends java.lang.Comparable<N>>
-
add
public void add(long[] reference, double addend)- Specified by:
addin interfaceMutateAnyD.Modifiable<N extends java.lang.Comparable<N>>
-
add
public void add(long[] reference, float addend)- Specified by:
addin interfaceMutateAnyD.Modifiable<N extends java.lang.Comparable<N>>
-
add
public void add(long[] reference, int addend)- Specified by:
addin interfaceMutateAnyD.Modifiable<N extends java.lang.Comparable<N>>
-
add
public void add(long[] reference, long addend)- Specified by:
addin interfaceMutateAnyD.Modifiable<N extends java.lang.Comparable<N>>
-
add
public void add(long[] reference, short addend)- Specified by:
addin interfaceMutateAnyD.Modifiable<N extends java.lang.Comparable<N>>
-
aggregateRange
public N aggregateRange(long first, long limit, Aggregator aggregator)
- Specified by:
aggregateRangein interfaceAccess1D.Aggregatable<N extends java.lang.Comparable<N>>
-
aggregateSet
public N aggregateSet(int dimension, long dimensionalIndex, Aggregator aggregator)
- Specified by:
aggregateSetin interfaceAccessAnyD.Aggregatable<N extends java.lang.Comparable<N>>
-
aggregateSet
public N aggregateSet(long[] initial, int dimension, Aggregator aggregator)
- Specified by:
aggregateSetin interfaceAccessAnyD.Aggregatable<N extends java.lang.Comparable<N>>
-
build
public ArrayAnyD<N> build()
- Specified by:
buildin interfaceFactoryAnyD.Builder<N extends java.lang.Comparable<N>>
-
byteValue
public byte byteValue(int index)
-
byteValue
public byte byteValue(long index)
-
byteValue
public byte byteValue(long... ref)
- Specified by:
byteValuein interfaceAccessAnyD<N extends java.lang.Comparable<N>>
-
count
public long count()
Description copied from interface:Structure1DThe 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.
- Specified by:
countin interfaceStructure1D
-
count
public long count(int dimension)
Description copied from interface:StructureAnyDcount() == count(0) * count(1) * count(2) * count(3) * ...- Specified by:
countin interfaceStructureAnyD
-
doubleValue
public double doubleValue(int index)
- Specified by:
doubleValuein interfaceAccess1D<N extends java.lang.Comparable<N>>
-
doubleValue
public double doubleValue(long index)
- Specified by:
doubleValuein interfaceAccess1D<N extends java.lang.Comparable<N>>
-
doubleValue
public double doubleValue(long... ref)
- Specified by:
doubleValuein interfaceAccessAnyD<N extends java.lang.Comparable<N>>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
expand
public ArrayAnyD<N> expand(int rank)
Description copied from interface:StructureAnyD.ReshapableIf necessary increase the rank to the specified number (without changing the total number of components)- Specified by:
expandin interfaceStructureAnyD.Reshapable
-
fillAll
public void fillAll(N value)
- Specified by:
fillAllin interfaceMutate1D.Fillable<N extends java.lang.Comparable<N>>
-
fillAll
public void fillAll(NullaryFunction<?> supplier)
- Specified by:
fillAllin interfaceMutate1D.Fillable<N extends java.lang.Comparable<N>>
-
fillRange
public void fillRange(long first, long limit, N value)- Specified by:
fillRangein interfaceMutate1D.Fillable<N extends java.lang.Comparable<N>>
-
fillRange
public void fillRange(long first, long limit, NullaryFunction<?> supplier)- Specified by:
fillRangein interfaceMutate1D.Fillable<N extends java.lang.Comparable<N>>
-
fillSet
public void fillSet(int dimension, long dimensionalIndex, N value)- Specified by:
fillSetin interfaceMutateAnyD.Fillable<N extends java.lang.Comparable<N>>
-
fillSet
public void fillSet(int dimension, long dimensionalIndex, NullaryFunction<?> supplier)- Specified by:
fillSetin interfaceMutateAnyD.Fillable<N extends java.lang.Comparable<N>>
-
fillSet
public void fillSet(long[] initial, int dimension, N value)- Specified by:
fillSetin interfaceMutateAnyD.Fillable<N extends java.lang.Comparable<N>>
-
fillSet
public void fillSet(long[] initial, int dimension, NullaryFunction<?> supplier)- Specified by:
fillSetin interfaceMutateAnyD.Fillable<N extends java.lang.Comparable<N>>
-
flatten
public Array1D<N> flatten()
Flattens this abitrary dimensional array to a one dimensional array. The (internal/actual) array is not copied, it is just accessed through a different adaptor.- Specified by:
flattenin interfaceStructureAnyD.Reshapable- See Also:
StructureAnyD.Reshapable.flatten()
-
floatValue
public float floatValue(int index)
- Specified by:
floatValuein interfaceAccess1D<N extends java.lang.Comparable<N>>
-
floatValue
public float floatValue(long index)
- Specified by:
floatValuein interfaceAccess1D<N extends java.lang.Comparable<N>>
-
floatValue
public float floatValue(long... ref)
- Specified by:
floatValuein interfaceAccessAnyD<N extends java.lang.Comparable<N>>
-
get
public N get(long index)
-
get
public N get(long... ref)
- Specified by:
getin interfaceAccessAnyD<N extends java.lang.Comparable<N>>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
indexOfLargest
public long indexOfLargest()
- Specified by:
indexOfLargestin interfaceAccess1D.Aggregatable<N extends java.lang.Comparable<N>>
-
intValue
public int intValue(int index)
-
intValue
public int intValue(long index)
-
intValue
public int intValue(long... ref)
- Specified by:
intValuein interfaceAccessAnyD<N extends java.lang.Comparable<N>>
-
longValue
public long longValue(int index)
-
longValue
public long longValue(long index)
-
longValue
public long longValue(long... ref)
- Specified by:
longValuein interfaceAccessAnyD<N extends java.lang.Comparable<N>>
-
mix
public double mix(long[] reference, BinaryFunction<N> mixer, double addend)- Specified by:
mixin interfaceMutateAnyD.Mixable<N extends java.lang.Comparable<N>>
-
mix
public N mix(long[] reference, BinaryFunction<N> mixer, N addend)
- Specified by:
mixin interfaceMutateAnyD.Mixable<N extends java.lang.Comparable<N>>
-
modifyAll
public void modifyAll(UnaryFunction<N> modifier)
- Specified by:
modifyAllin interfaceMutate1D.Modifiable<N extends java.lang.Comparable<N>>
-
modifyAny
public void modifyAny(TransformationAnyD<N> modifier)
- Specified by:
modifyAnyin interfaceMutateAnyD.ModifiableReceiver<N extends java.lang.Comparable<N>>
-
modifyMatching
public void modifyMatching(Access1D<N> left, BinaryFunction<N> function)
- Specified by:
modifyMatchingin interfaceMutate1D.Modifiable<N extends java.lang.Comparable<N>>
-
modifyMatching
public void modifyMatching(BinaryFunction<N> function, Access1D<N> right)
- Specified by:
modifyMatchingin interfaceMutate1D.Modifiable<N extends java.lang.Comparable<N>>
-
modifyOne
public void modifyOne(long index, UnaryFunction<N> modifier)- Specified by:
modifyOnein interfaceMutate1D.Modifiable<N extends java.lang.Comparable<N>>
-
modifyOne
public void modifyOne(long[] reference, UnaryFunction<N> modifier)- Specified by:
modifyOnein interfaceMutateAnyD.Modifiable<N extends java.lang.Comparable<N>>
-
modifyRange
public void modifyRange(long first, long limit, UnaryFunction<N> modifier)- Specified by:
modifyRangein interfaceMutate1D.Modifiable<N extends java.lang.Comparable<N>>
-
modifySet
public void modifySet(int dimension, long dimensionalIndex, UnaryFunction<N> modifier)- Specified by:
modifySetin interfaceMutateAnyD.Modifiable<N extends java.lang.Comparable<N>>
-
modifySet
public void modifySet(long[] initial, int dimension, UnaryFunction<N> modifier)- Specified by:
modifySetin interfaceMutateAnyD.Modifiable<N extends java.lang.Comparable<N>>
-
rank
public int rank()
- Specified by:
rankin interfaceStructureAnyD- Returns:
- The number of dimensions (the number of indices used to reference one element)
-
reduce
public Array1D<N> reduce(int dimension, Aggregator aggregator)
- Specified by:
reducein interfaceStructureAnyD.ReducibleTo1D<N extends java.lang.Comparable<N>>- Parameters:
dimension- Which of the AnyD-dimensions should be mapped to the resulting 1D structure.aggregator- How to aggregate the values of the reduction- Returns:
- A 1D data structure with aggregated values
-
reduce
public Array2D<N> reduce(int rowDim, int colDim, Aggregator aggregator)
- Specified by:
reducein interfaceStructureAnyD.ReducibleTo2D<N extends java.lang.Comparable<N>>- Parameters:
rowDim- Which of the AnyD-dimensions should be mapped to the rows of the resulting 2D structure.colDim- Which of the AnyD-dimensions should be mapped to the columns of the resulting 2D structure.aggregator- How to aggregate the values of the reduction- Returns:
- A 2D data structure with aggregated values
-
reset
public void reset()
Description copied from interface:Mutate1DReset 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.
-
reshape
public ArrayAnyD<N> reshape(long... shape)
Description copied from interface:StructureAnyD.ReshapableThe same array viewed/accessed with a different shape- Specified by:
reshapein interfaceStructureAnyD.Reshapable
-
set
public void set(long index, java.lang.Comparable<?> value)
-
set
public void set(long[] reference, byte value)- Specified by:
setin interfaceMutateAnyD
-
set
public void set(long[] reference, java.lang.Comparable<?> value)- Specified by:
setin interfaceMutateAnyD
-
set
public void set(long[] reference, double value)- Specified by:
setin interfaceMutateAnyD
-
set
public void set(long[] reference, float value)- Specified by:
setin interfaceMutateAnyD
-
set
public void set(long[] reference, int value)- Specified by:
setin interfaceMutateAnyD
-
set
public void set(long[] reference, long value)- Specified by:
setin interfaceMutateAnyD
-
set
public void set(long[] reference, short value)- Specified by:
setin interfaceMutateAnyD
-
shape
public long[] shape()
- Specified by:
shapein interfaceStructureAnyD
-
shortValue
public short shortValue(int index)
- Specified by:
shortValuein interfaceAccess1D<N extends java.lang.Comparable<N>>
-
shortValue
public short shortValue(long index)
- Specified by:
shortValuein interfaceAccess1D<N extends java.lang.Comparable<N>>
-
shortValue
public short shortValue(long... ref)
- Specified by:
shortValuein interfaceAccessAnyD<N extends java.lang.Comparable<N>>
-
size
public int size()
Description copied from interface:Structure1DThe total number of elements in this structure.- Specified by:
sizein interfaceStructure1D
-
size
public int size(int dimension)
- Specified by:
sizein interfaceStructureAnyD
-
sliceRange
public Array1D<N> sliceRange(long first, long limit)
- Specified by:
sliceRangein interfaceAccess1D.Sliceable<N extends java.lang.Comparable<N>>
-
sliceSet
public Array1D<N> sliceSet(long[] initial, int dimension)
Description copied from interface:AccessAnyD.SliceableIf the intial reference is {0, 2, 3} and the slice dimension is 1 then the sliced 1D view will map to the following elements in the AnyD data structure:0 => {0, 2, 3} 1 => {0, 3, 3} 2 => {0, 4, 3} 3 => {0, 5, 3} 4 => {0, 6, 3} 5 => {0, 7, 3} 6 => ...Meaning the row index is always '0', and the plane/matrix/area index is always '3', but the column index starts at '2' and then increments.If you have a data structure defined as 3 x 3 x n (that is n 3x3 matrices) and you want to access the second element of the first column of each of the matrices, then the intial refrence is {1, 0, 0} and the slice dimension is 2.
- Specified by:
sliceSetin interfaceAccessAnyD.Sliceable<N extends java.lang.Comparable<N>>- Parameters:
initial- Indices pointing to what will be the first element of the slicedAccess1Ddimension- Which indices that make out an element reference should be incremented- Returns:
- A sliced 1D view of the underlying AnyD data structure
-
squeeze
public ArrayAnyD<N> squeeze()
Description copied from interface:StructureAnyD.ReshapableSqueezing removes the dimensions or axes that have a length of one. (This does not change the total number of components.)- Specified by:
squeezein interfaceStructureAnyD.Reshapable
-
supplyTo
public void supplyTo(MutateAnyD receiver)
- Specified by:
supplyToin interfaceAccessAnyD.Collectable<N extends java.lang.Comparable<N>,MutateAnyD>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
visitAll
public void visitAll(VoidFunction<N> visitor)
- Specified by:
visitAllin interfaceAccess1D.Visitable<N extends java.lang.Comparable<N>>
-
visitOne
public void visitOne(long index, VoidFunction<N> visitor)- Specified by:
visitOnein interfaceAccess1D.Visitable<N extends java.lang.Comparable<N>>
-
visitOne
public void visitOne(long[] reference, VoidFunction<N> visitor)- Specified by:
visitOnein interfaceAccessAnyD.Visitable<N extends java.lang.Comparable<N>>
-
visitRange
public void visitRange(long first, long limit, VoidFunction<N> visitor)- Specified by:
visitRangein interfaceAccess1D.Visitable<N extends java.lang.Comparable<N>>
-
visitSet
public void visitSet(int dimension, long dimensionalIndex, VoidFunction<N> visitor)- Specified by:
visitSetin interfaceAccessAnyD.Visitable<N extends java.lang.Comparable<N>>
-
visitSet
public void visitSet(long[] initial, int dimension, VoidFunction<N> visitor)- Specified by:
visitSetin interfaceAccessAnyD.Visitable<N extends java.lang.Comparable<N>>
-
factory
FactoryAnyD<ArrayAnyD<N>> factory()
-
getDelegate
BasicArray<N> getDelegate()
-
-