Documentation of 'cc.redberry.core.tensor.Sum' Java class
Sum
cc.redberry.core.tensor

Class Sum

  • All Implemented Interfaces:
    java.lang.Comparable<Tensor>, java.lang.Iterable<Tensor>


    public final class Sum
    extends MultiTensor
    Representation of sum.
    Since:
    1.0
    • Method Detail

      • get

        public Tensor get(int i)
        Description copied from class: Tensor
        Returns element at i-th position.
        Specified by:
        get in class Tensor
        Parameters:
        i - position
        Returns:
        element at i-th position
      • size

        public int size()
        Description copied from class: Tensor
        Returns the number of elements in this tensor.
        Specified by:
        size in class Tensor
        Returns:
        the number of elements in this tensor
      • getRange

        public Tensor[] getRange(int from,
                                 int to)
        Description copied from class: Tensor
        Retrieves several sub-tensors from current tensor. This function is faster than sequential invocations of Tensor.get(int) method.
        Overrides:
        getRange in class Tensor
        Parameters:
        from - index of first sub-tensor to be retrieved (inclusive)
        to - next index after last sub-tensor to be retrieved (exclusive)
        Returns:
        array with retrieved tensors
      • set

        public Tensor set(int i,
                          Tensor tensor)
        Description copied from class: Tensor
        Returns new tensor instance with i-th sub-tensor replaced by provided tensor.
        Overrides:
        set in class Tensor
        Parameters:
        i - index of sub-tensor to be replaced
        tensor - tensor to replace i-th sub-tensor
        Returns:
        new instance of tensor
      • remove

        public Tensor remove(int i)
        Description copied from class: MultiTensor
        Removes tensor at the specified position and returns the result.
        Specified by:
        remove in class MultiTensor
        Parameters:
        i - position in tensor
        Returns:
        result of removing
      • hash

        public int hash()
        Description copied from class: Tensor
        Hash code of this tensor.
        Returns:
        hash code of this tensor
      • toString

        public java.lang.String toString(OutputFormat mode)
        Description copied from class: Tensor
        Returns a string representation of a tensor according to the specified OutputFormat.
        Specified by:
        toString in class Tensor
        Parameters:
        mode - output format
        Returns:
        a string representation of a tensor

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.