Package org.ojalgo.tensor
Class AnyTensor<N extends Comparable<N>>
java.lang.Object
org.ojalgo.tensor.ArrayBasedTensor<N,AnyTensor<N>>
org.ojalgo.tensor.AnyTensor<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 class
AnyTensor.Factory<N extends Comparable<N>>
Nested classes/interfaces inherited from interface org.ojalgo.structure.AccessAnyD
AccessAnyD.Aggregatable<N extends Comparable<N>>, AccessAnyD.Collectable<N extends Comparable<N>,
R extends MutateAnyD>, AccessAnyD.ElementView<N extends Comparable<N>>, AccessAnyD.MatrixView<N extends Comparable<N>>, AccessAnyD.SelectionView<N extends Comparable<N>>, AccessAnyD.Sliceable<N extends Comparable<N>>, AccessAnyD.VectorView<N extends Comparable<N>>, AccessAnyD.Visitable<N extends Comparable<N>> Nested classes/interfaces inherited from interface org.ojalgo.algebra.Group
Group.Additive<T>, Group.Multiplicative<T>
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.MutateAnyD
MutateAnyD.Fillable<N extends Comparable<N>>, MutateAnyD.Mixable<N extends Comparable<N>>, MutateAnyD.Modifiable<N extends Comparable<N>>, MutateAnyD.ModifiableReceiver<N extends Comparable<N>>, MutateAnyD.Receiver<N extends Comparable<N>>
Nested classes/interfaces inherited from interface org.ojalgo.algebra.Operation
Operation.Addition<T>, Operation.Division<T>, Operation.Multiplication<T>, Operation.Subtraction<T>
Nested classes/interfaces inherited from interface org.ojalgo.algebra.ScalarOperation
ScalarOperation.Addition<T,
N extends Comparable<N>>, ScalarOperation.Division<T, N extends Comparable<N>>, ScalarOperation.Multiplication<T, N extends Comparable<N>>, ScalarOperation.Subtraction<T, N extends 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte
byteValue
(long... ref) This method will (most likely) be moved to some other interface in the future! Just have to figure out where it fits...long
count
(int dimension) count() == count(0) * count(1) * count(2) * count(3) * ...double
doubleValue
(int index) double
doubleValue
(long... ref) boolean
static <N extends Comparable<N>>
TensorFactoryAnyD<N, AnyTensor<N>> factory
(DenseArray.Factory<N> arrayFactory) void
void
fillSet
(int dimension, long dimensionalIndex, NullaryFunction<?> supplier) void
void
fillSet
(long[] initial, int dimension, NullaryFunction<?> supplier) float
floatValue
(long... ref) get
(long index) get
(long... ref) getArray()
int
hashCode()
int
intValue
(long... ref) long
longValue
(long... ref) multiply
(double scalarMultiplicand) negate()
The additive inverse of this.double
norm()
this == this.signum().multiply(this.norm())
void
set
(int index, double value) void
set
(long[] reference, byte value) void
set
(long[] reference, double value) void
set
(long[] reference, float value) void
set
(long[] reference, int value) void
set
(long[] reference, long value) void
set
(long[] reference, short value) void
set
(long[] reference, Comparable<?> value) void
set
(long index, Comparable<?> value) long[]
shape()
short
shortValue
(long... ref) int
size()
The total number of elements in this structure.int
size
(int dimension) toString()
Methods inherited from class org.ojalgo.tensor.ArrayBasedTensor
add, dimensions, multiply, multiply, negate, norm, rank, signum
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, floatValue, floatValue, intValue, intValue, longValue, longValue, nonzeros, select, shortValue, shortValue, supplyTo, toRawCopy1D
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.Mutate1D
reset, 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.MutateAnyD.Fillable
fillCompatible
Methods inherited from interface org.ojalgo.structure.MutateAnyD.Receiver
accept, isAcceptable
Methods inherited from interface org.ojalgo.algebra.NormedVectorSpace
isSmall
Methods inherited from interface org.ojalgo.algebra.ScalarOperation.Multiplication
multiply
Methods inherited from interface org.ojalgo.structure.Structure1D
count
Methods inherited from interface org.ojalgo.structure.StructureAnyD
loop, loop, loopAllReferences, loopReferences, rank
Methods inherited from interface org.ojalgo.tensor.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:
add
in interfaceOperation.Addition<N extends Comparable<N>>
- Parameters:
addend
- What to add- Returns:
this + addend
-
byteValue
public byte byteValue(long... ref) - Specified by:
byteValue
in interfaceAccessAnyD<N extends Comparable<N>>
-
conjugate
Description copied from interface:VectorSpace
This 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:
conjugate
in interfaceVectorSpace<AnyTensor<N extends Comparable<N>>,
N extends Comparable<N>>
-
count
public long count(int dimension) Description copied from interface:StructureAnyD
count() == count(0) * count(1) * count(2) * count(3) * ...- Specified by:
count
in interfaceStructureAnyD
-
doubleValue
public double doubleValue(int index) - Specified by:
doubleValue
in interfaceAccess1D<N extends Comparable<N>>
-
doubleValue
public double doubleValue(long... ref) - Specified by:
doubleValue
in interfaceAccessAnyD<N extends Comparable<N>>
-
equals
- Overrides:
equals
in classArrayBasedTensor<N extends Comparable<N>,
AnyTensor<N extends Comparable<N>>>
-
fillSet
- Specified by:
fillSet
in interfaceMutateAnyD.Fillable<N extends Comparable<N>>
-
fillSet
- Specified by:
fillSet
in interfaceMutateAnyD.Fillable<N extends Comparable<N>>
-
fillSet
- Specified by:
fillSet
in interfaceMutateAnyD.Fillable<N extends Comparable<N>>
-
fillSet
- Specified by:
fillSet
in interfaceMutateAnyD.Fillable<N extends Comparable<N>>
-
floatValue
public float floatValue(long... ref) - Specified by:
floatValue
in interfaceAccessAnyD<N extends Comparable<N>>
-
get
- Specified by:
get
in interfaceAccessAnyD<N extends Comparable<N>>
-
get
- Specified by:
get
in interfaceAccess1D<N extends Comparable<N>>
-
hashCode
public int hashCode()- Overrides:
hashCode
in classArrayBasedTensor<N extends Comparable<N>,
AnyTensor<N extends Comparable<N>>>
-
intValue
public int intValue(long... ref) - Specified by:
intValue
in interfaceAccessAnyD<N extends Comparable<N>>
-
longValue
public long longValue(long... ref) - Specified by:
longValue
in interfaceAccessAnyD<N extends Comparable<N>>
-
multiply
- Specified by:
multiply
in interfaceScalarOperation.Multiplication<AnyTensor<N extends Comparable<N>>,
N extends Comparable<N>> - Returns:
this * scalarMultiplicand
.
-
multiply
- Specified by:
multiply
in interfaceScalarOperation.Multiplication<AnyTensor<N extends Comparable<N>>,
N extends Comparable<N>> - Returns:
this * multiplicand
.
-
negate
Description copied from interface:Group.Additive
The additive inverse of this.- Specified by:
negate
in interfaceGroup.Additive<N extends Comparable<N>>
- Returns:
-this
.
-
norm
public double norm()Description copied from interface:NormedVectorSpace
this == this.signum().multiply(this.norm())
- Specified by:
norm
in interfaceNormedVectorSpace<AnyTensor<N extends Comparable<N>>,
N extends Comparable<N>> - Returns:
- The norm
-
set
public void set(int index, double value) -
set
-
set
public void set(long[] reference, byte value) - Specified by:
set
in interfaceMutateAnyD
-
set
- Specified by:
set
in interfaceMutateAnyD
-
set
public void set(long[] reference, double value) - Specified by:
set
in interfaceMutateAnyD
-
set
public void set(long[] reference, float value) - Specified by:
set
in interfaceMutateAnyD
-
set
public void set(long[] reference, int value) - Specified by:
set
in interfaceMutateAnyD
-
set
public void set(long[] reference, long value) - Specified by:
set
in interfaceMutateAnyD
-
set
public void set(long[] reference, short value) - Specified by:
set
in interfaceMutateAnyD
-
shape
public long[] shape()- Specified by:
shape
in interfaceStructureAnyD
-
shortValue
public short shortValue(long... ref) - Specified by:
shortValue
in interfaceAccessAnyD<N extends Comparable<N>>
-
size
public int size()Description copied from interface:Structure1D
The total number of elements in this structure.- Specified by:
size
in interfaceStructure1D
-
size
public int size(int dimension) - Specified by:
size
in interfaceStructureAnyD
-
toString
-
getArray
-
newSameShape
- Specified by:
newSameShape
in classArrayBasedTensor<N extends Comparable<N>,
AnyTensor<N extends Comparable<N>>>
-