Interface RingTensorMixin<T extends RingTensorMixin<T,U,V>,U extends RingTensorMixin<U,U,V>,V extends Ring<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 ring axioms.
All Superinterfaces:
SemiringTensorMixin<T,U,V>, TensorOverRing<T,U,V[],V>, TensorOverSemiring<T,U,V[],V>
All Known Subinterfaces:
FieldTensorMixin<T,U,V>
All Known Implementing Classes:
AbstractCooFieldMatrix, AbstractCooFieldTensor, AbstractCooFieldVector, AbstractCooRingMatrix, AbstractCooRingTensor, AbstractCooRingVector, AbstractCsrFieldMatrix, AbstractCsrRingMatrix, AbstractDenseFieldMatrix, AbstractDenseFieldTensor, AbstractDenseFieldVector, AbstractDenseRingMatrix, AbstractDenseRingTensor, AbstractDenseRingVector, CMatrix, CooCMatrix, CooCTensor, CooCVector, CooFieldMatrix, CooFieldTensor, CooFieldVector, CooRingMatrix, CooRingTensor, CooRingVector, CsrCMatrix, CsrFieldMatrix, CsrRingMatrix, CTensor, CVector, FieldMatrix, FieldTensor, FieldVector, RingMatrix, RingTensor, RingVector

public interface RingTensorMixin<T extends RingTensorMixin<T,U,V>,U extends RingTensorMixin<U,U,V>,V extends Ring<V>> extends TensorOverRing<T,U,V[],V>, SemiringTensorMixin<T,U,V>

This interface provides default functionality for all tensors whose data are elements of a Ring. 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(V b)
    Adds a scalar value to each entry of 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 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(V b)
    Multiplies a scalar value to each entry of 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
    sub(V b)
    Subtracts a scalar value from each entry of 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.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