Package org.tensorics.core.tensor
Interface Tensoric<V>
-
- Type Parameters:
V
- the type of the values of the tensoric object
- All Known Subinterfaces:
MappableTensor<V>
,Scalar<V>
,Tensor<E>
,TensorView<V>
- All Known Implementing Classes:
AbstractScalar
,AbstractTensor
,BroadcastedTensorView
,ImmutableDoubleArrayBackedTensor
,ImmutableScalar
,ImmutableTensor
,ResamplingStage
public interface Tensoric<V>
The most generic interface of a multidimensional object within tensorics. Values can be retrieved from it and it knows for which positions it contains values.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
contains(java.lang.Object... coordinates)
Convenience method forcontains(Position)
, with the position constructed from the given coordinates.boolean
contains(Position position)
Returnstrue
if the tensoric object contains the given position,false
otherwise.default V
get(java.lang.Object... coordinates)
V
get(Position position)
-
-
-
Method Detail
-
get
V get(Position position)
- Parameters:
position
- the position in the N-dimensional space where to find the value.- Returns:
- the value at the given position
- Throws:
java.lang.IllegalArgumentException
- when number of coordinates is not sufficientjava.util.NoSuchElementException
- if the tensor contains no element for the given position
-
get
default V get(java.lang.Object... coordinates)
- Parameters:
coordinates
- form N-dimensional space where to find the value.- Returns:
- a value at the given coordinates.
- Throws:
java.lang.IllegalArgumentException
- if the number of coordinates in incorrectjava.util.NoSuchElementException
- if the tensor contains no element for the position constructed from the given coordinates.
-
contains
boolean contains(Position position)
Returnstrue
if the tensoric object contains the given position,false
otherwise.- Parameters:
position
- the position to be checked- Returns:
true
if the position is contained in the tensoric object,false
otherwise.
-
contains
default boolean contains(java.lang.Object... coordinates)
Convenience method forcontains(Position)
, with the position constructed from the given coordinates.- Parameters:
coordinates
- the coordinates which represent the position to be checked- Returns:
true
if the position represented by the given coordinates is contained in the tensoric object,false
otherwise.
-
-