Package org.ojalgo.tensor
Class AnyTensor<N extends java.lang.Comparable<N>>
- java.lang.Object
-
- org.ojalgo.tensor.ArrayBasedTensor<N,AnyTensor<N>>
-
- org.ojalgo.tensor.AnyTensor<N>
-
- All Implemented Interfaces:
java.util.function.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 java.lang.Comparable<N>> extends ArrayBasedTensor<N,AnyTensor<N>> implements AccessAnyD<N>, MutateAnyD.Receiver<N>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
AnyTensor.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.algebra.Group
Group.Additive<T>, Group.Multiplicative<T>
-
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.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 java.lang.Comparable<N>>, ScalarOperation.Division<T,N extends java.lang.Comparable<N>>, ScalarOperation.Multiplication<T,N extends java.lang.Comparable<N>>, ScalarOperation.Subtraction<T,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
-
-
Constructor Summary
Constructors Constructor Description AnyTensor(ArrayAnyD.Factory<N> factory, int rank, int dimensions)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AnyTensor<N>
add(AnyTensor<N> addend)
byte
byteValue(long... ref)
AnyTensor<N>
conjugate()
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
equals(java.lang.Object obj)
static <N extends java.lang.Comparable<N>>
TensorFactoryAnyD<N,AnyTensor<N>>factory(DenseArray.Factory<N> arrayFactory)
void
fillSet(int dimension, long dimensionalIndex, N value)
void
fillSet(int dimension, long dimensionalIndex, NullaryFunction<?> supplier)
void
fillSet(long[] initial, int dimension, N value)
void
fillSet(long[] initial, int dimension, NullaryFunction<?> supplier)
float
floatValue(long... ref)
N
get(long index)
N
get(long... ref)
(package private) ArrayAnyD<N>
getArray()
int
hashCode()
int
intValue(long... ref)
long
longValue(long... ref)
AnyTensor<N>
multiply(double scalarMultiplicand)
AnyTensor<N>
multiply(N scalarMultiplicand)
AnyTensor<N>
negate()
The additive inverse of this.(package private) AnyTensor<N>
newSameShape()
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, java.lang.Comparable<?> value)
void
set(long index, java.lang.Comparable<?> value)
long[]
shape()
short
shortValue(long... ref)
int
size()
The total number of elements in this structure.int
size(int dimension)
java.lang.String
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
-
-
-
-
Constructor Detail
-
AnyTensor
AnyTensor(ArrayAnyD.Factory<N> factory, int rank, int dimensions)
-
-
Method Detail
-
factory
public static <N extends java.lang.Comparable<N>> TensorFactoryAnyD<N,AnyTensor<N>> factory(DenseArray.Factory<N> arrayFactory)
-
add
public AnyTensor<N> add(AnyTensor<N> addend)
- Specified by:
add
in interfaceOperation.Addition<N extends java.lang.Comparable<N>>
- Parameters:
addend
- What to add- Returns:
this + addend
-
byteValue
public byte byteValue(long... ref)
- Specified by:
byteValue
in interfaceAccessAnyD<N extends java.lang.Comparable<N>>
-
conjugate
public AnyTensor<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.
-
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 java.lang.Comparable<N>>
-
doubleValue
public double doubleValue(long... ref)
- Specified by:
doubleValue
in interfaceAccessAnyD<N extends java.lang.Comparable<N>>
-
equals
public boolean equals(java.lang.Object obj)
-
fillSet
public void fillSet(int dimension, long dimensionalIndex, N value)
- Specified by:
fillSet
in interfaceMutateAnyD.Fillable<N extends java.lang.Comparable<N>>
-
fillSet
public void fillSet(int dimension, long dimensionalIndex, NullaryFunction<?> supplier)
- Specified by:
fillSet
in interfaceMutateAnyD.Fillable<N extends java.lang.Comparable<N>>
-
fillSet
public void fillSet(long[] initial, int dimension, N value)
- Specified by:
fillSet
in interfaceMutateAnyD.Fillable<N extends java.lang.Comparable<N>>
-
fillSet
public void fillSet(long[] initial, int dimension, NullaryFunction<?> supplier)
- Specified by:
fillSet
in interfaceMutateAnyD.Fillable<N extends java.lang.Comparable<N>>
-
floatValue
public float floatValue(long... ref)
- Specified by:
floatValue
in interfaceAccessAnyD<N extends java.lang.Comparable<N>>
-
get
public N get(long... ref)
- Specified by:
get
in interfaceAccessAnyD<N extends java.lang.Comparable<N>>
-
get
public N get(long index)
-
hashCode
public int hashCode()
-
intValue
public int intValue(long... ref)
- Specified by:
intValue
in interfaceAccessAnyD<N extends java.lang.Comparable<N>>
-
longValue
public long longValue(long... ref)
- Specified by:
longValue
in interfaceAccessAnyD<N extends java.lang.Comparable<N>>
-
negate
public AnyTensor<N> negate()
Description copied from interface:Group.Additive
The additive inverse of this.- Specified by:
negate
in interfaceGroup.Additive<N extends java.lang.Comparable<N>>
- Returns:
-this
.
-
norm
public double norm()
Description copied from interface:NormedVectorSpace
this == this.signum().multiply(this.norm())
-
set
public void set(long index, java.lang.Comparable<?> value)
-
set
public void set(long[] reference, byte value)
- Specified by:
set
in interfaceMutateAnyD
-
set
public void set(long[] reference, java.lang.Comparable<?> value)
- 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 java.lang.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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
newSameShape
AnyTensor<N> newSameShape()
- Specified by:
newSameShape
in classArrayBasedTensor<N extends java.lang.Comparable<N>,AnyTensor<N extends java.lang.Comparable<N>>>
-
-