Class AbstractDoubleTensor<T extends AbstractDoubleTensor<T>>

java.lang.Object
org.flag4j.arrays.backend.AbstractTensor<T,double[],Double>
org.flag4j.arrays.backend.primitive_arrays.AbstractDoubleTensor<T>
All Implemented Interfaces:
Serializable, TensorOverField<T,T,double[],Double>, TensorOverRing<T,T,double[],Double>, TensorOverSemiring<T,T,double[],Double>
Direct Known Subclasses:
AbstractDenseDoubleTensor, CooMatrix, CooTensor, CooVector, CsrMatrix

public abstract class AbstractDoubleTensor<T extends AbstractDoubleTensor<T>> extends AbstractTensor<T,double[],Double> implements TensorOverField<T,T,double[],Double>
This is the base class of all real primitive double tensors, matrices, or vectors. The methods implemented in this class are agnostic to weather the tensor is dense or sparse.
See Also:
  • Field Summary

    Fields inherited from class org.flag4j.arrays.backend.AbstractTensor

    data, rank, shape
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractDoubleTensor(Shape shape, double[] entries)
    Creates a tensor with the specified data and shape.
  • Method Summary

    Modifier and Type
    Method
    Description
    abs()
    Computes the element-wise absolute value of this tensor.
    add(double b)
    Adds a primitive scalar value to each entry of this tensor.
    Adds a scalar value to each entry of this tensor.
    void
    addEq(double b)
    Adds a primitive scalar value to each entry of this tensor and stores the result in this tensor.
    void
    Adds a scalar value to each entry of this tensor and stores the result in this tensor.
    Computes the element-wise conjugation of this tensor.
    Creates a deep copy of this tensor.
    div(double b)
    Divides each element of this tensor by a primitive scalar value.
    Divides each element of this tensor by a scalar value.
    void
    divEq(double b)
    Divides each element of this tensor by a primitive scalar value and stores the result in this tensor.
    void
    Divides each element of this tensor by a scalar value and stores the result in this tensor.
    H(int... axes)
    Computes the conjugate transpose of this tensor.
    H(int axis1, int axis2)
    Computes the conjugate transpose of a tensor by conjugating and exchanging axis1 and axis2.
    boolean
    Checks if this tensor only contains finite values.
    boolean
    Checks if this tensor contains at least one infinite value.
    boolean
    Checks if this tensor contains at least one NaN value.
    boolean
    Checks if this tensor only contains negative values.
    boolean
    Checks if this tensor only contains ones.
    boolean
    Checks if this tensor only contains positive values.
    boolean
    Checks if this tensor only contains zeros.
    max()
    Finds the maximum value in this tensor.
    double
    Finds the maximum absolute value in this tensor.
    min()
    Finds the minimum value in this tensor.
    double
    Finds the minimum value, in absolute value, in this tensor.
    mult(double b)
    Multiplies a primitive scalar value to each entry of this tensor.
    Multiplies a scalar value to each entry of this tensor.
    void
    multEq(double b)
    Multiplies a primitive scalar value to each entry of this tensor and stores the result in this tensor.
    void
    Multiplies a scalar value to each entry of this tensor and stores the result in this tensor.
    Computes the product of all values in this tensor.
    Computes the element-wise reciprocals of this tensor.
    Rounds each entry of this tensor to the nearest whole number.
    round(int precision)
    Rounds each entry in this tensor to the nearest whole number.
    Rounds values in this tensor which are close to zero in absolute value to zero.
    roundToZero(double threshold)
    Rounds values which are close to zero in absolute value to zero.
    Computes the element-wise square root of this tensor.
    sub(double b)
    Subtracts a primitive scalar value from each entry of this tensor.
    Subtracts a scalar value from each entry of this tensor.
    void
    subEq(double b)
    Subtracts a scalar primitive value from each entry of this tensor and stores the result in this tensor.
    void
    Subtracts a scalar value from each entry of this tensor and stores the result in this tensor.
    sum()
    Computes the sum of all values in this tensor.

    Methods inherited from class org.flag4j.arrays.backend.AbstractTensor

    flatten, flatten, get, getData, getRank, getShape, makeLikeTensor, reshape, reshape, sameShape, set, T, T, T, totalEntries

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

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

    div

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

    argmax, argmaxAbs, argmin, argminAbs, 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