Package org.tensorics.core.tensor
Interface Scalar<V>
-
- Type Parameters:
V
- the type of the value of the scalar
- All Known Implementing Classes:
AbstractScalar
,ImmutableScalar
public interface Scalar<V> extends Tensor<V>
The specialization of a tensor with zero dimensions and exactly one value. In detail, implementations have to guarantee the following:- Has exactly one value (not zero, no more)
- has always zero dimensions
- The only valid position to query is the 'empty' position
NOTE: It might sometimes be confusing, that in mathematics and commons language the term 'scalar' is sometimes used interchangible for a zero-dimensional tensor (what this class represents) and the values/entries of the tensors itself. Therefore, we will denote the values of a tensor (scalar) as 'values' and zero-dimensional tensors as scalars.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description V
value()
Has to retrieve the value of the scalar.
-
-
-
Method Detail
-
value
V value()
Has to retrieve the value of the scalar. In implementations, this has to be equivalent to callingTensoric.get(Object...)
with an empty array of coordinates and with callingTensoric.get(Position)
with an empty position.- Returns:
- the internal value of the scalar
-
-