Interface Scalar<V>

  • Type Parameters:
    V - the type of the value of the scalar
    All Superinterfaces:
    Tensor<V>, Tensoric<V>
    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
    Still, a scalar can have a context. Indeed, this is a very valuable property in the framework of tensorics.

    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 Detail

      • value

        V value()
        Has to retrieve the value of the scalar. In implementations, this has to be equivalent to calling Tensoric.get(Object...) with an empty array of coordinates and with calling Tensoric.get(Position) with an empty position.
        Returns:
        the internal value of the scalar