Package org.tensorics.core.tensor.lang
Class TensorSupport<V>
- java.lang.Object
-
- org.tensorics.core.scalar.lang.ScalarSupport<V>
-
- org.tensorics.core.iterable.lang.ScalarIterableSupport<V>
-
- org.tensorics.core.tensor.lang.TensorSupport<V>
-
- Type Parameters:
V
- the type of the elements of the tensor(ic)
- All Implemented Interfaces:
BasicOperationSupport<V>
public class TensorSupport<V> extends ScalarIterableSupport<V>
Extends the usage of fields by operations defined on tensors
-
-
Constructor Summary
Constructors Constructor Description TensorSupport(Environment<V> environment)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <C> OngoingTensorOperation<C,V>
calculate(Tensor<V> tensoric)
Allows to perform calculation on given tensoric.Tensor<V>
elementInverseOf(Tensor<V> tensor)
<S,R>
Tensor<R>elementwise(BinaryFunction<S,R> operation, Tensor<S> left, Tensor<S> right)
<S> Tensor<S>
elementwise(BinaryOperation<S> operation, Tensor<S> left, Tensor<S> right)
Tensor<V>
negativeOf(Tensor<V> tensor)
Tensor<V>
ones(Shape shape)
OngoingFieldAwareResamplingStart<V>
resample(Tensor<V> tensor)
Starting clause for a fluent expression to resample a tensor, using structural resamplings (e.g.Tensor<V>
zeros(Shape shape)
-
Methods inherited from class org.tensorics.core.iterable.lang.ScalarIterableSupport
averageOf, rmsOf, sizeOf, stdOf, sumOf, sumOfSquaresOf, varOf
-
Methods inherited from class org.tensorics.core.scalar.lang.ScalarSupport
absoluteValueOf, calculate, countOf, field, inverseOf, negativeOf, one, squareOf, squareRootOf, testIf, two, zero
-
-
-
-
Constructor Detail
-
TensorSupport
public TensorSupport(Environment<V> environment)
-
-
Method Detail
-
calculate
public final <C> OngoingTensorOperation<C,V> calculate(Tensor<V> tensoric)
Allows to perform calculation on given tensoric.- Parameters:
tensoric
- to calculate with.- Returns:
- expression to calculate.
-
elementInverseOf
public Tensor<V> elementInverseOf(Tensor<V> tensor)
- Parameters:
tensor
- to use.s- Returns:
- a
Tensor
with field inverse values
-
negativeOf
public Tensor<V> negativeOf(Tensor<V> tensor)
- Parameters:
tensor
- to use- Returns:
- a
Tensor
of negative values
-
resample
public OngoingFieldAwareResamplingStart<V> resample(Tensor<V> tensor)
Starting clause for a fluent expression to resample a tensor, using structural resamplings (e.g. repeating), but also field aware resamplings (e.g. linear interpolation). For example:Tensoric<Double> resampled = resample(aDoubleTensor) .repeat(String.class) .then().linear(Integer.class, Integer::doubleValue) .toTensoric();
For options which do not require a field, see the version in
TensorStructurals.resample(Tensor)
.- Parameters:
tensor
- the tensor to be resampled- Returns:
- an object to define further the strategy for resampling.
-
elementwise
public <S> Tensor<S> elementwise(BinaryOperation<S> operation, Tensor<S> left, Tensor<S> right)
-
elementwise
public <S,R> Tensor<R> elementwise(BinaryFunction<S,R> operation, Tensor<S> left, Tensor<S> right)
-
-