Package org.ojalgo.tensor
Class ArrayBasedTensor<N extends java.lang.Comparable<N>,T extends ArrayBasedTensor<N,T>>
- java.lang.Object
-
- org.ojalgo.tensor.ArrayBasedTensor<N,T>
-
- All Implemented Interfaces:
Group
,Group.Additive<T>
,NormedVectorSpace<T,N>
,Operation
,Operation.Addition<T>
,ScalarOperation
,ScalarOperation.Multiplication<T,N>
,VectorSpace<T,N>
,Tensor<N,T>
- Direct Known Subclasses:
AnyTensor
,MatrixTensor
,VectorTensor
abstract class ArrayBasedTensor<N extends java.lang.Comparable<N>,T extends ArrayBasedTensor<N,T>> extends java.lang.Object implements Tensor<N,T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ArrayBasedTensor.Factory<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.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>>
-
-
Field Summary
Fields Modifier and Type Field Description private int
myDimensions
private FunctionSet<N>
myFunctionSet
private int
myRank
private Scalar.Factory<N>
myScalarFactory
-
Constructor Summary
Constructors Constructor Description ArrayBasedTensor(int rank, int dimensions, FunctionSet<N> functionSet, Scalar.Factory<N> scalarFactory)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) void
add(Mutate1D.Fillable<N> receiver, Access1D<N> left, Access1D<N> right)
int
dimensions()
The range of the indices that identify the scalar components.boolean
equals(java.lang.Object obj)
int
hashCode()
(package private) void
multiply(Mutate1D.Fillable<N> receiver, double left, Access1D<N> right)
(package private) void
multiply(Mutate1D.Fillable<N> receiver, N left, Access1D<N> right)
(package private) void
negate(Mutate1D.Fillable<N> receiver, Access1D<N> argument)
(package private) abstract T
newSameShape()
(package private) double
norm(Access1D.Aggregatable<N> array)
int
rank()
The total number of indices required to uniquely identify each scalar component is called the order, degree or rank of the tensor.T
signum()
this == this.signum().multiply(this.norm())
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ojalgo.algebra.Group.Additive
negate
-
Methods inherited from interface org.ojalgo.algebra.NormedVectorSpace
isSmall, norm
-
Methods inherited from interface org.ojalgo.algebra.Operation.Addition
add
-
Methods inherited from interface org.ojalgo.algebra.ScalarOperation.Multiplication
multiply, multiply, multiply
-
Methods inherited from interface org.ojalgo.tensor.Tensor
components, isSameShape
-
Methods inherited from interface org.ojalgo.algebra.VectorSpace
conjugate
-
-
-
-
Field Detail
-
myDimensions
private final int myDimensions
-
myFunctionSet
private final FunctionSet<N extends java.lang.Comparable<N>> myFunctionSet
-
myRank
private final int myRank
-
myScalarFactory
private final Scalar.Factory<N extends java.lang.Comparable<N>> myScalarFactory
-
-
Constructor Detail
-
ArrayBasedTensor
ArrayBasedTensor(int rank, int dimensions, FunctionSet<N> functionSet, Scalar.Factory<N> scalarFactory)
-
-
Method Detail
-
dimensions
public final int dimensions()
Description copied from interface:Tensor
The range of the indices that identify the scalar components. Each index of a tensor ranges over the number of dimensions.- Specified by:
dimensions
in interfaceTensor<N extends java.lang.Comparable<N>,T extends ArrayBasedTensor<N,T>>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
rank
public final int rank()
Description copied from interface:Tensor
The total number of indices required to uniquely identify each scalar component is called the order, degree or rank of the tensor.
-
signum
public T signum()
Description copied from interface:NormedVectorSpace
this == this.signum().multiply(this.norm())
- Specified by:
signum
in interfaceNormedVectorSpace<N extends java.lang.Comparable<N>,T extends ArrayBasedTensor<N,T>>
- Returns:
- A unit "vector"
-
multiply
void multiply(Mutate1D.Fillable<N> receiver, double left, Access1D<N> right)
-
multiply
void multiply(Mutate1D.Fillable<N> receiver, N left, Access1D<N> right)
-
negate
void negate(Mutate1D.Fillable<N> receiver, Access1D<N> argument)
-
newSameShape
abstract T newSameShape()
-
norm
double norm(Access1D.Aggregatable<N> array)
-
-