Interface FieldTensorMixin<T extends FieldTensorMixin<T,U,V>,U extends FieldTensorMixin<U,U,V>,V extends Field<V>>

Type Parameters:
T - Type of this tensor.
U - Dense equivalent of this tensor. If this tensor is dense, this should be the same type as T
V - Type of an element of this tensor. Satisfies field axioms.
All Superinterfaces:
RingTensorMixin<T,U,V>, SemiringTensorMixin<T,U,V>, TensorOverField<T,U,V[],V>, TensorOverRing<T,U,V[],V>, TensorOverSemiring<T,U,V[],V>
All Known Implementing Classes:
AbstractCooFieldMatrix, AbstractCooFieldTensor, AbstractCooFieldVector, AbstractCsrFieldMatrix, AbstractDenseFieldMatrix, AbstractDenseFieldTensor, AbstractDenseFieldVector, CMatrix, CooCMatrix, CooCTensor, CooCVector, CooFieldMatrix, CooFieldTensor, CooFieldVector, CsrCMatrix, CsrFieldMatrix, CTensor, CVector, FieldMatrix, FieldTensor, FieldVector

public interface FieldTensorMixin<T extends FieldTensorMixin<T,U,V>,U extends FieldTensorMixin<U,U,V>,V extends Field<V>> extends TensorOverField<T,U,V[],V>, RingTensorMixin<T,U,V>

This interface provides default functionality for all tensors whose data are elements of a Field. This includes both sparse and dense tensors.

The default methods in this interface can be overridden if desired, but it is generally recommended to use them as is.

  • Method Summary

    Modifier and Type
    Method
    Description
    default T
    add(double b)
    Adds a primitive scalar value to each entry of this tensor.
    default T
    add(V b)
    Adds a scalar value to each entry of this tensor.
    default void
    addEq(double b)
    Adds a primitive scalar value to each entry of this tensor and stores the result in this tensor.
    default void
    addEq(V b)
    Adds a scalar value to each entry of this tensor and stores the result in this tensor.
    default int[]
    Finds the indices of the maximum value in this tensor.
    default int[]
    Finds the indices of the maximum absolute value in this tensor.
    default int[]
    Finds the indices of the minimum value in this tensor.
    default int[]
    Finds the indices of the minimum absolute value in this tensor.
    default T
    Computes the element-wise conjugation of this tensor.
    default T
    div(double b)
    Divides each element of this tensor by a primitive scalar value.
    default T
    div(V b)
    Divides each element of this tensor by a scalar value.
    default void
    divEq(double b)
    Divides each element of this tensor by a primitive scalar value and stores the result in this tensor.
    default void
    divEq(V b)
    Divides each element of this tensor by a scalar value and stores the result in this tensor.
    default boolean
    Checks if this tensor only contains ones.
    default boolean
    Checks if this tensor only contains zeros.
    default V[]
    makeEmptyDataArray(int length)
    Creates an empty array of the same type as the data array of this tensor.
    default V
    max()
    Finds the maximum value in this tensor.
    default double
    Finds the maximum absolute value in this tensor.
    default V
    min()
    Finds the minimum value in this tensor.
    default double
    Finds the minimum value, in absolute value, in this tensor.
    default T
    mult(double b)
    Multiplies a primitive scalar value to each entry of this tensor.
    default T
    mult(V b)
    Multiplies a scalar value to each entry of this tensor.
    default void
    multEq(double b)
    Multiplies a primitive scalar value to each entry of this tensor and stores the result in this tensor.
    default void
    multEq(V b)
    Multiplies a scalar value to each entry of this tensor and stores the result in this tensor.
    default double
    Computes the Euclidean norm of this vector.
    default double
    norm(double p)
    Computes the p-norm of this vector.
    default V
    Computes the product of all values in this tensor (or non-zero values if this tensor is sparse).
    default T
    Computes the element-wise reciprocals of this tensor.
    default T
    sub(double b)
    Subtracts a primitive scalar value from each entry of this tensor.
    default T
    sub(V b)
    Subtracts a scalar value from each entry of this tensor.
    default void
    subEq(double b)
    Subtracts a scalar primitive value from each entry of this tensor and stores the result in this tensor.
    default void
    subEq(V b)
    Subtracts a scalar value from each entry of this tensor and stores the result in this tensor.
    default V
    sum()
    Computes the sum of all values in this tensor.

    Methods inherited from interface org.flag4j.arrays.backend.field_arrays.TensorOverField

    div, isFinite, isInfinite, isNaN, sqrt

    Methods inherited from interface org.flag4j.arrays.backend.ring_arrays.TensorOverRing

    abs, H, H, H, sub

    Methods inherited from interface org.flag4j.arrays.backend.semiring_arrays.TensorOverSemiring

    add, elemMult, getData, getRank, getShape, makeLikeTensor, tensorDot, tensorDot, tensorDot, tensorDot, tensorTr, tensorTr