Package org.ojalgo.tensor
Class VectorTensor<N extends Comparable<N>>
java.lang.Object
org.ojalgo.tensor.ArrayBasedTensor<N,VectorTensor<N>>
org.ojalgo.tensor.VectorTensor<N>
- All Implemented Interfaces:
Consumer<Access1D<?>>
,Group
,Group.Additive<VectorTensor<N>>
,NormedVectorSpace<VectorTensor<N>,
,N> Operation
,Operation.Addition<VectorTensor<N>>
,ScalarOperation
,ScalarOperation.Multiplication<VectorTensor<N>,
,N> VectorSpace<VectorTensor<N>,
,N> Access1D<N>
,Mutate1D
,Mutate1D.Fillable<N>
,Mutate1D.Receiver<N>
,Structure1D
,Tensor<N,
VectorTensor<N>>
public final class VectorTensor<N extends Comparable<N>>
extends ArrayBasedTensor<N,VectorTensor<N>>
implements Access1D<N>, Mutate1D.Receiver<N>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class
VectorTensor.Factory<N extends Comparable<N>>
Nested classes/interfaces inherited from interface org.ojalgo.structure.Access1D
Access1D.Aggregatable<N extends Comparable<N>>, Access1D.Collectable<N extends Comparable<N>,
R extends Mutate1D>, Access1D.ElementView<N extends Comparable<N>>, Access1D.SelectionView<N extends Comparable<N>>, Access1D.Sliceable<N extends Comparable<N>>, Access1D.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.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 -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd
(VectorTensor<N> addend) byte
byteValue
(int index) byte
byteValue
(long index) This method will (most likely) be moved to some other interface in the future! Just have to figure out where it fits...long
count()
The total number of elements in this structure.double
doubleValue
(int index) double
doubleValue
(long index) boolean
static <N extends Comparable<N>>
TensorFactory1D<N, VectorTensor<N>> factory
(DenseArray.Factory<N> arrayFactory) float
floatValue
(int index) float
floatValue
(long index) get
(long index) getArray()
int
hashCode()
int
intValue
(int index) int
intValue
(long index) long
longValue
(int index) long
longValue
(long index) multiply
(double scalarMultiplicand) negate()
The additive inverse of this.(package private) VectorTensor
<N> double
norm()
this == this.signum().multiply(this.norm())
void
set
(int index, byte value) void
set
(int index, double value) void
set
(int index, float value) void
set
(int index, int value) void
set
(int index, long value) void
set
(int index, short value) void
set
(long index, byte value) void
set
(long index, double value) void
set
(long index, float value) void
set
(long index, int value) void
set
(long index, long value) void
set
(long index, short value) void
set
(long index, Comparable<?> value) short
shortValue
(int index) short
shortValue
(long index) int
size()
The total number of elements in this structure.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, dot, elements, nonzeros, select, supplyTo, toRawCopy1D
Methods inherited from interface org.ojalgo.structure.Mutate1D.Fillable
fillAll, fillAll, fillCompatible, fillMatching, fillMatching, fillMatching, fillRange, fillRange
Methods inherited from interface org.ojalgo.structure.Mutate1D.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.tensor.Tensor
components, isSameShape
-
Field Details
-
myArray
-
myFactory
-
-
Constructor Details
-
VectorTensor
VectorTensor(Array1D.Factory<N> factory, int dimensions)
-
-
Method Details
-
factory
public static <N extends Comparable<N>> TensorFactory1D<N,VectorTensor<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(int index) - Specified by:
byteValue
in interfaceAccess1D<N extends Comparable<N>>
-
byteValue
public byte byteValue(long index) - Specified by:
byteValue
in interfaceAccess1D<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<VectorTensor<N extends Comparable<N>>,
N extends Comparable<N>>
-
count
public long count()Description copied from interface:Structure1D
The 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:
count
in interfaceStructure1D
-
doubleValue
public double doubleValue(int index) - Specified by:
doubleValue
in interfaceAccess1D<N extends Comparable<N>>
-
doubleValue
public double doubleValue(long index) - Specified by:
doubleValue
in interfaceAccess1D<N extends Comparable<N>>
-
equals
- Overrides:
equals
in classArrayBasedTensor<N extends Comparable<N>,
VectorTensor<N extends Comparable<N>>>
-
floatValue
public float floatValue(int index) - Specified by:
floatValue
in interfaceAccess1D<N extends Comparable<N>>
-
floatValue
public float floatValue(long index) - Specified by:
floatValue
in interfaceAccess1D<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>,
VectorTensor<N extends Comparable<N>>>
-
intValue
public int intValue(int index) - Specified by:
intValue
in interfaceAccess1D<N extends Comparable<N>>
-
intValue
public int intValue(long index) - Specified by:
intValue
in interfaceAccess1D<N extends Comparable<N>>
-
longValue
public long longValue(int index) - Specified by:
longValue
in interfaceAccess1D<N extends Comparable<N>>
-
longValue
public long longValue(long index) - Specified by:
longValue
in interfaceAccess1D<N extends Comparable<N>>
-
multiply
- Specified by:
multiply
in interfaceScalarOperation.Multiplication<VectorTensor<N extends Comparable<N>>,
N extends Comparable<N>> - Returns:
this * scalarMultiplicand
.
-
multiply
- Specified by:
multiply
in interfaceScalarOperation.Multiplication<VectorTensor<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<VectorTensor<N extends Comparable<N>>,
N extends Comparable<N>> - Returns:
- The norm
-
set
public void set(int index, byte value) -
set
public void set(int index, double value) -
set
public void set(int index, float value) -
set
public void set(int index, int value) -
set
public void set(int index, long value) -
set
public void set(int index, short value) -
set
public void set(long index, byte value) -
set
-
set
public void set(long index, double value) -
set
public void set(long index, float value) -
set
public void set(long index, int value) -
set
public void set(long index, long value) -
set
public void set(long index, short value) -
shortValue
public short shortValue(int index) - Specified by:
shortValue
in interfaceAccess1D<N extends Comparable<N>>
-
shortValue
public short shortValue(long index) - Specified by:
shortValue
in interfaceAccess1D<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
-
toString
-
getArray
-
newSameShape
VectorTensor<N> newSameShape()- Specified by:
newSameShape
in classArrayBasedTensor<N extends Comparable<N>,
VectorTensor<N extends Comparable<N>>>
-