org.tensorics.core.tensor.lang.OngoingStructuralReductionOptions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tensorics-core Show documentation
Show all versions of tensorics-core Show documentation
Tensorics is a java framework which uses a tensor as a central object. A tensor represents a set of values placed in an N-dimensional space. Wherever you are tempted to use maps of maps, a tensor might be a good choice ;-) Tensorics provides methods to create, transform and performing calculations with those tensors.
/**
* Copyright (c) 2015 European Organisation for Nuclear Research (CERN), All Rights Reserved.
*/
package org.tensorics.core.tensor.lang;
import org.tensorics.core.reduction.AbstractInterpolationStrategy;
import org.tensorics.core.reduction.InterpolatedSlicing;
import org.tensorics.core.reduction.InterpolationStrategy;
import org.tensorics.core.tensor.Tensor;
import org.tensorics.core.tensor.operations.TensorReduction;
/**
* @author agorzaws
* @param
* @param
*/
public class OngoingStructuralReductionOptions> {
private final Tensor tensor;
private final C slicePosition;
private final Class dimension;
public OngoingStructuralReductionOptions(C slicePosition, Tensor tensor, Class dimension) {
this.tensor = tensor;
this.slicePosition = slicePosition;
this.dimension = dimension;
}
/**
* Defines the interpolation strategy.
* See {@link AbstractInterpolationStrategy} and its extension.
*
* @param strategy to use
* @return slicing result with interpolation between the missing comparable coordinates.
*/
public Tensor interpolatingWith(InterpolationStrategy strategy) {
return new TensorReduction<>(dimension, new InterpolatedSlicing<>(slicePosition, strategy, tensor))
.apply(tensor);
}
}