Package org.ojalgo.tensor
Class VectorTensor<N extends java.lang.Comparable<N>>
- java.lang.Object
-
- org.ojalgo.tensor.ArrayBasedTensor<N,VectorTensor<N>>
-
- org.ojalgo.tensor.VectorTensor<N>
-
- All Implemented Interfaces:
java.util.function.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 java.lang.Comparable<N>> extends ArrayBasedTensor<N,VectorTensor<N>> implements Access1D<N>, Mutate1D.Receiver<N>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
VectorTensor.Factory<N extends java.lang.Comparable<N>>
-
Nested classes/interfaces inherited from interface org.ojalgo.structure.Access1D
Access1D.Aggregatable<N extends java.lang.Comparable<N>>, Access1D.Collectable<N extends java.lang.Comparable<N>,R extends Mutate1D>, Access1D.ElementView<N extends java.lang.Comparable<N>>, Access1D.SelectionView<N extends java.lang.Comparable<N>>, Access1D.Sliceable<N extends java.lang.Comparable<N>>, Access1D.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.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
-
-
Constructor Summary
Constructors Constructor Description VectorTensor(Array1D.Factory<N> factory, int dimensions)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description VectorTensor<N>
add(VectorTensor<N> addend)
byte
byteValue(int index)
byte
byteValue(long index)
VectorTensor<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()
The total number of elements in this structure.double
doubleValue(int index)
double
doubleValue(long index)
boolean
equals(java.lang.Object obj)
static <N extends java.lang.Comparable<N>>
TensorFactory1D<N,VectorTensor<N>>factory(DenseArray.Factory<N> arrayFactory)
float
floatValue(int index)
float
floatValue(long index)
N
get(long index)
(package private) Array1D<N>
getArray()
int
hashCode()
int
intValue(int index)
int
intValue(long index)
long
longValue(int index)
long
longValue(long index)
VectorTensor<N>
multiply(double scalarMultiplicand)
VectorTensor<N>
multiply(N scalarMultiplicand)
VectorTensor<N>
negate()
The additive inverse of this.(package private) VectorTensor<N>
newSameShape()
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, java.lang.Comparable<?> value)
short
shortValue(int index)
short
shortValue(long index)
int
size()
The total number of elements in this structure.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, 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
-
-
-
-
Constructor Detail
-
VectorTensor
VectorTensor(Array1D.Factory<N> factory, int dimensions)
-
-
Method Detail
-
factory
public static <N extends java.lang.Comparable<N>> TensorFactory1D<N,VectorTensor<N>> factory(DenseArray.Factory<N> arrayFactory)
-
add
public VectorTensor<N> add(VectorTensor<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(int index)
-
byteValue
public byte byteValue(long index)
-
conjugate
public VectorTensor<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 java.lang.Comparable<N>>,N extends java.lang.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 java.lang.Comparable<N>>
-
doubleValue
public double doubleValue(long index)
- Specified by:
doubleValue
in interfaceAccess1D<N extends java.lang.Comparable<N>>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classArrayBasedTensor<N extends java.lang.Comparable<N>,VectorTensor<N extends java.lang.Comparable<N>>>
-
floatValue
public float floatValue(int index)
- Specified by:
floatValue
in interfaceAccess1D<N extends java.lang.Comparable<N>>
-
floatValue
public float floatValue(long index)
- Specified by:
floatValue
in interfaceAccess1D<N extends java.lang.Comparable<N>>
-
get
public N get(long index)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classArrayBasedTensor<N extends java.lang.Comparable<N>,VectorTensor<N extends java.lang.Comparable<N>>>
-
intValue
public int intValue(int index)
-
intValue
public int intValue(long index)
-
longValue
public long longValue(int index)
-
longValue
public long longValue(long index)
-
multiply
public VectorTensor<N> multiply(double scalarMultiplicand)
- Specified by:
multiply
in interfaceScalarOperation.Multiplication<VectorTensor<N extends java.lang.Comparable<N>>,N extends java.lang.Comparable<N>>
- Returns:
this * scalarMultiplicand
.
-
multiply
public VectorTensor<N> multiply(N scalarMultiplicand)
- Specified by:
multiply
in interfaceScalarOperation.Multiplication<VectorTensor<N extends java.lang.Comparable<N>>,N extends java.lang.Comparable<N>>
- Returns:
this * multiplicand
.
-
negate
public VectorTensor<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())
- Specified by:
norm
in interfaceNormedVectorSpace<VectorTensor<N extends java.lang.Comparable<N>>,N extends java.lang.Comparable<N>>
- Returns:
- The norm
-
set
public void set(long index, java.lang.Comparable<?> value)
-
shortValue
public short shortValue(int index)
- Specified by:
shortValue
in interfaceAccess1D<N extends java.lang.Comparable<N>>
-
shortValue
public short shortValue(long index)
- Specified by:
shortValue
in interfaceAccess1D<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
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
newSameShape
VectorTensor<N> newSameShape()
- Specified by:
newSameShape
in classArrayBasedTensor<N extends java.lang.Comparable<N>,VectorTensor<N extends java.lang.Comparable<N>>>
-
-