Class MultiDimensionalResampling<V>
- java.lang.Object
-
- org.tensorics.core.tensor.resample.MultiDimensionalResampling<V>
-
- Type Parameters:
V
- the type of the tensor values to resample
public class MultiDimensionalResampling<V> extends java.lang.Object
Combines several one-dimensional resamplers and creates the fully resampled object from them. The final resampling is created by chaining pairs of dimension+resamplers like:MultiDimensionalResampling<V> resampling = MultiDimensionalResampling.resample(Coord1.class, coord1Resampler) .then(Coord2.class, coord2Resampler) [...];
The actual resampled object can finally be created by calling te
resample(Tensor)
method.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <C,V>
MultiDimensionalResampling<V>resample(java.lang.Class<C> dimension, SingleDimensionResampler<C,V> resampler)
Starting point for chaining several dimensino-resampler pairs.Tensoric<V>
resample(Tensor<V> original)
Produces a resampled tensoric object out of the given tensor, by applying the resamplers configured inthis
object.<C> MultiDimensionalResampling<V>
then(java.lang.Class<C> dimension, SingleDimensionResampler<C,V> dimensionComparator)
Creates a new instance of a multidimensional resamplings, containing the resamplers fromthis
multidimensional resampling plus the given one.
-
-
-
Method Detail
-
resample
public static final <C,V> MultiDimensionalResampling<V> resample(java.lang.Class<C> dimension, SingleDimensionResampler<C,V> resampler)
Starting point for chaining several dimensino-resampler pairs.- Parameters:
dimension
- the dimension for which the given resampler shall be applied.resampler
- the resampler to apply for the given dimension- Returns:
- a new (immutable) multidimensional resampling, with exactly one dimension resampled
- Throws:
java.lang.NullPointerException
- if one of the given arguments isnull
-
then
public final <C> MultiDimensionalResampling<V> then(java.lang.Class<C> dimension, SingleDimensionResampler<C,V> dimensionComparator)
Creates a new instance of a multidimensional resamplings, containing the resamplers fromthis
multidimensional resampling plus the given one.- Parameters:
dimension
- the dimension for which the given resampler shall be useddimensionComparator
- the resampler which shall be used for the given dimension- Returns:
- a new multidimensional resampling object, containing all the resamplers of
this
object plus the given one.
-
resample
public Tensoric<V> resample(Tensor<V> original)
Produces a resampled tensoric object out of the given tensor, by applying the resamplers configured inthis
object.- Parameters:
original
- the tensor on which the resampling shall be applied- Returns:
- a tensoric object, created from the given original tensor with all the resamplers applied
-
-