Class AnyTensor<N extends Comparable<N>>
- All Implemented Interfaces:
Consumer<AccessAnyD<?>>, Group, Group.Additive<AnyTensor<N>>, NormedVectorSpace<AnyTensor<N>, N>, Operation, Operation.Addition<AnyTensor<N>>, ScalarOperation, ScalarOperation.Multiplication<AnyTensor<N>, N>, VectorSpace<AnyTensor<N>, N>, Access1D<N>, AccessAnyD<N>, Mutate1D, Mutate1D.Fillable<N>, MutateAnyD, MutateAnyD.Fillable<N>, MutateAnyD.Receiver<N>, Structure1D, StructureAnyD, Tensor<N, AnyTensor<N>>
public final class AnyTensor<N extends Comparable<N>>
extends ArrayBasedTensor<N, AnyTensor<N>>
implements AccessAnyD<N>, MutateAnyD.Receiver<N>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classAnyTensor.Factory<N extends Comparable<N>>Nested classes/interfaces inherited from interface AccessAnyD
AccessAnyD.Aggregatable<N>, AccessAnyD.Collectable<N,R>, AccessAnyD.ElementView<N>, AccessAnyD.MatrixView<N>, AccessAnyD.SelectionView<N>, AccessAnyD.Sliceable<N>, AccessAnyD.VectorView<N>, AccessAnyD.Visitable<N> Nested classes/interfaces inherited from interface Group
Group.Additive<T>, Group.Multiplicative<T>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 MutateAnyD
MutateAnyD.Fillable<N>, MutateAnyD.Mixable<N>, MutateAnyD.Modifiable<N>, MutateAnyD.ModifiableReceiver<N>, MutateAnyD.Receiver<N>Nested classes/interfaces inherited from interface Operation
Operation.Addition<T>, Operation.Division<T>, Operation.Multiplication<T>, Operation.Subtraction<T>Nested classes/interfaces inherited from interface ScalarOperation
ScalarOperation.Addition<T,N>, ScalarOperation.Division<T, N>, ScalarOperation.Multiplication<T, N>, ScalarOperation.Subtraction<T, N> Nested classes/interfaces inherited from interface Structure1D
Structure1D.BasicMapper<T>, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.Logical<S,B>, Structure1D.LongIndex, Structure1D.LoopCallback Nested classes/interfaces inherited from interface StructureAnyD
StructureAnyD.IntReference, StructureAnyD.Logical<S,B>, StructureAnyD.LongReference, StructureAnyD.ReducibleTo1D<R>, StructureAnyD.ReducibleTo2D<R>, StructureAnyD.ReferenceCallback, StructureAnyD.ReferenceMapper, StructureAnyD.Reshapable -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbytebyteValue(long... ref) This method will (most likely) be moved to some other interface in the future! Just have to figure out where it fits...longcount(int dimension) count() == count(0) * count(1) * count(2) * count(3) * ...doubledoubleValue(int index) doubledoubleValue(long... ref) booleanstatic <N extends Comparable<N>>
TensorFactoryAnyD<N, AnyTensor<N>> factory(DenseArray.Factory<N, ?> arrayFactory) voidvoidfillSet(int dimension, long dimensionalIndex, NullaryFunction<?> supplier) voidvoidfillSet(long[] initial, int dimension, NullaryFunction<?> supplier) floatfloatValue(long... ref) get(long index) get(long... ref) getArray()inthashCode()intintValue(long... ref) longlongValue(long... ref) multiply(double scalarMultiplicand) negate()The additive inverse of this.doublenorm()this == this.signum().multiply(this.norm())voidset(int index, double 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, Comparable<?> value) voidset(long index, Comparable<?> value) long[]shape()shortshortValue(long... ref) intsize()The total number of elements in this structure.intsize(int dimension) toString()Methods inherited from class ArrayBasedTensor
add, dimensions, multiply, multiply, negate, norm, rank, signumMethods inherited from interface Access1D
asCollectable1D, asKeyed1D, asList, axpy, byteValue, byteValue, dot, doubleValue, floatValue, floatValue, intValue, intValue, longValue, longValue, nonzeros, select, shortValue, shortValue, supplyTo, toList, toRawCopy1DMethods inherited from interface AccessAnyD
asCollectableAnyD, byteValue, doubleValue, elements, floatValue, get, intValue, longValue, matrices, select, shortValue, vectorsMethods inherited from interface Mutate1D
reset, 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 MutateAnyD.Fillable
fillCompatibleMethods inherited from interface MutateAnyD.Receiver
accept, isAcceptableMethods inherited from interface NormedVectorSpace
isSmallMethods inherited from interface ScalarOperation.Multiplication
multiplyMethods inherited from interface Structure1D
countMethods inherited from interface StructureAnyD
loop, loop, loopAllReferences, loopReferences, rankMethods inherited from interface Tensor
components, isSameShape
-
Field Details
-
myArray
-
myFactory
-
-
Constructor Details
-
AnyTensor
AnyTensor(ArrayAnyD.Factory<N> factory, int rank, int dimensions)
-
-
Method Details
-
factory
public static <N extends Comparable<N>> TensorFactoryAnyD<N, AnyTensor<N>> factory(DenseArray.Factory<N, ?> arrayFactory) -
add
- Specified by:
addin interfaceOperation.Addition<N extends Comparable<N>>- Parameters:
addend- What to add- Returns:
this + addend
-
byteValue
public byte byteValue(long... ref) - Specified by:
byteValuein interfaceAccessAnyD<N extends Comparable<N>>
-
conjugate
Description copied from interface:VectorSpaceThis method will (most likely) be moved to some other interface in the future! Just have to figure out where it fits...
The conjugate transpose of a matrix and/or the conjugate of a scalar/field like ComplexNumber or Quaternion.
The conjugate transpose of a real matrix is simply its transpose.
- Specified by:
conjugatein interfaceVectorSpace<AnyTensor<N extends Comparable<N>>, N extends Comparable<N>>
-
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 Comparable<N>>
-
doubleValue
public double doubleValue(long... ref) - Specified by:
doubleValuein interfaceAccessAnyD<N extends Comparable<N>>
-
equals
- Overrides:
equalsin classArrayBasedTensor<N extends Comparable<N>, AnyTensor<N extends Comparable<N>>>
-
fillSet
- Specified by:
fillSetin interfaceMutateAnyD.Fillable<N extends Comparable<N>>
-
fillSet
- Specified by:
fillSetin interfaceMutateAnyD.Fillable<N extends Comparable<N>>
-
fillSet
- Specified by:
fillSetin interfaceMutateAnyD.Fillable<N extends Comparable<N>>
-
fillSet
- Specified by:
fillSetin interfaceMutateAnyD.Fillable<N extends Comparable<N>>
-
floatValue
public float floatValue(long... ref) - Specified by:
floatValuein interfaceAccessAnyD<N extends Comparable<N>>
-
get
- Specified by:
getin interfaceAccessAnyD<N extends Comparable<N>>
-
get
-
hashCode
public int hashCode()- Overrides:
hashCodein classArrayBasedTensor<N extends Comparable<N>, AnyTensor<N extends Comparable<N>>>
-
intValue
public int intValue(long... ref) - Specified by:
intValuein interfaceAccessAnyD<N extends Comparable<N>>
-
longValue
public long longValue(long... ref) - Specified by:
longValuein interfaceAccessAnyD<N extends Comparable<N>>
-
multiply
- Specified by:
multiplyin interfaceScalarOperation.Multiplication<AnyTensor<N extends Comparable<N>>, N extends Comparable<N>>- Returns:
this * scalarMultiplicand.
-
multiply
- Specified by:
multiplyin interfaceScalarOperation.Multiplication<AnyTensor<N extends Comparable<N>>, N extends Comparable<N>>- Returns:
this * multiplicand.
-
negate
Description copied from interface:Group.AdditiveThe additive inverse of this.- Specified by:
negatein interfaceGroup.Additive<N extends Comparable<N>>- Returns:
-this.
-
norm
public double norm()Description copied from interface:NormedVectorSpacethis == this.signum().multiply(this.norm())- Specified by:
normin interfaceNormedVectorSpace<AnyTensor<N extends Comparable<N>>, N extends Comparable<N>>- Returns:
- The norm
-
set
-
set
-
set
public void set(long[] reference, byte value) - Specified by:
setin interfaceMutateAnyD
-
set
- 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(long... ref) - Specified by:
shortValuein interfaceAccessAnyD<N extends 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
-
toString
-
getArray
-
newSameShape
- Specified by:
newSameShapein classArrayBasedTensor<N extends Comparable<N>, AnyTensor<N extends Comparable<N>>>
-