Documentation of 'org.jquantlib.math.matrixutilities.Algebra' Java class
Algebra
org.jquantlib.math.matrixutilities

Interface Algebra<T>

  • Type Parameters:
    T -
    All Known Implementing Classes:
    Array


    public interface Algebra<T>
    This interface defines algebric operators
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      T abs()
      Applies Math.abs(double) to every element of this instance.
      double accumulate()
      Accumulate values in a range.
      double accumulate(double init)
      Accumulate values in a range.
      double accumulate(int from, int to, double init)
      Accumulate values in a range.
      T add(double scalar)
      Adds a scalar to every element of this instance of <T>.
      T add(T another)
      Adds this instance and another instance of <T>.
      T addAssign(double scalar)
      Adds a scalar to every element of this instance of <T>.
      T addAssign(T another)
      Adds this instance and another instance of <T>.
      T adjacentDifference()
      Return differences between adjacent values.
      T adjacentDifference(int from, int to)
      Return differences between adjacent values.
      T adjacentDifference(int from, int to, Ops.BinaryDoubleOp f)
      Return differences between adjacent values.
      T adjacentDifference(Ops.BinaryDoubleOp f)
      Return differences between adjacent values.
      T div(double scalar)
      Divides every element of this instance of <T> by a scalar.
      T div(T another)
      Divides this instance by another instance of <T>.
      T divAssign(double scalar)
      Divides every element of this instance of <T> by a scalar.
      T divAssign(T another)
      Divides this instance by another instance of <T>.
      double dotProduct(T another)
      The inner product generalizes the dot product to abstract vector spaces and is normally denoted by .
      double dotProduct(T another, int from, int to)
      The inner product generalizes the dot product to abstract vector spaces and is normally denoted by .
      T exp()
      Applies Math.exp(double) to every element of this instance.
      double innerProduct(T another)
      The inner product generalizes the dot product to abstract vector spaces and is normally denoted by .
      double innerProduct(T another, int from, int to)
      The inner product generalizes the dot product to abstract vector spaces and is normally denoted by .
      T log()
      Applies Math.log(double) to every element of this instance.
      int lowerBound(double val)
      Finds the first position in which val could be inserted without changing the ordering.
      int lowerBound(double val, Ops.BinaryDoublePredicate f)
      Finds the first position in which val could be inserted without changing the ordering.
      int lowerBound(int from, int to, double val)
      Finds the first position in which val could be inserted without changing the ordering.
      int lowerBound(int from, int to, double val, Ops.BinaryDoublePredicate f)
      Finds the first position in which val could be inserted without changing the ordering.
      double max()
      Return the maximum element in a range using comparison functor.
      double max(int from, int to)
      Return the maximum element in a range using comparison functor.
      double min()
      Return the minimum element in a range using comparison functor.
      double min(int from, int to)
      Return the minimum element in a range using comparison functor.
      T mul(double scalar)
      Multiplies every element of this instance of <T> by a scalar.
      T mul(Matrix matrix)
      Vectorial multiplication of this instance by a Matrix.
      T mul(T another)
      Multiplies this instance by another instance of <T>.
      T mulAssign(double scalar)
      Multiplies every element of this instance of <T> by a scalar.
      T mulAssign(T another)
      Multiplies this instance by another instance of <T>.
      T negative()
      Unary negative function applied to every element of this instance
      Matrix outerProduct(T another)
      In linear algebra, the outer product typically refers to the tensor product of two vectors.
      Matrix outerProduct(T another, int from, int to)
      In linear algebra, the outer product typically refers to the tensor product of two vectors.
      T sqr()
      Applies Math#sqr(double) to every element of this instance.
      T sqrt()
      Applies Math.sqrt(double) to every element of this instance.
      T sub(double scalar)
      Subtracts a scalar to every element of this instance of <T>.
      T sub(T another)
      Subtracts this instance by another instance of <T>.
      T subAssign(double scalar)
      Subtracts a scalar to every element of this instance of <T>.
      T subAssign(T another)
      Subtracts this instance by another instance of <T>.
      T transform(int first, int last, Ops.DoubleOp f)
      Perform an operation on a sequence in a range [first,last)
      T transform(Ops.DoubleOp func)
      Perform an operation on a sequence in a range [first,last)
      int upperBound(double val)
      Finds the last position in which val could be inserted in a sequence [begin(), end()] without changing the ordering.
      int upperBound(double val, Ops.BinaryDoublePredicate f)
      Finds the last position in which val could be inserted in a sequence [begin(), end()] without changing the ordering.
      int upperBound(int first, int last, double val)
      Finds the last position in which val could be inserted in a sequence [first,last] without changing the ordering.
      int upperBound(int first, int last, double val, Ops.BinaryDoublePredicate f)
      Finds the last position in which val could be inserted in a sequence [first,last] without changing the ordering.
    • Method Detail

      • addAssign

        T addAssign(double scalar)
        Adds a scalar to every element of this instance of <T>.
        Parameters:
        scalar -
        Returns:
        this
      • addAssign

        T addAssign(T another)
        Adds this instance and another instance of <T>.
        Parameters:
        another -
        Returns:
        this
      • subAssign

        T subAssign(double scalar)
        Subtracts a scalar to every element of this instance of <T>.
        Parameters:
        scalar -
        Returns:
        this
      • subAssign

        T subAssign(T another)
        Subtracts this instance by another instance of <T>.
        Parameters:
        another -
        Returns:
        this
      • mulAssign

        T mulAssign(double scalar)
        Multiplies every element of this instance of <T> by a scalar.
        Parameters:
        scalar -
        Returns:
        this
      • mulAssign

        T mulAssign(T another)
        Multiplies this instance by another instance of <T>.
        Parameters:
        another -
        Returns:
        this
      • divAssign

        T divAssign(double scalar)
        Divides every element of this instance of <T> by a scalar.
        Parameters:
        scalar -
        Returns:
        this
      • divAssign

        T divAssign(T another)
        Divides this instance by another instance of <T>.
        Parameters:
        another -
        Returns:
        this
      • add

        T add(double scalar)
        Adds a scalar to every element of this instance of <T>.
        Parameters:
        scalar -
        Returns:
        a new instance
      • add

        T add(T another)
        Adds this instance and another instance of <T>.
        Parameters:
        another -
        Returns:
        a new instance
      • sub

        T sub(double scalar)
        Subtracts a scalar to every element of this instance of <T>.
        Parameters:
        scalar -
        Returns:
        a new instance
      • sub

        T sub(T another)
        Subtracts this instance by another instance of <T>.
        Parameters:
        another -
        Returns:
        a new instance
      • mul

        T mul(double scalar)
        Multiplies every element of this instance of <T> by a scalar.
        Parameters:
        scalar -
        Returns:
        a new instance
      • mul

        T mul(T another)
        Multiplies this instance by another instance of <T>.
        Parameters:
        another -
        Returns:
        a new instance
      • div

        T div(double scalar)
        Divides every element of this instance of <T> by a scalar.
        Parameters:
        scalar -
        Returns:
        a new instance
      • div

        T div(T another)
        Divides this instance by another instance of <T>.
        Parameters:
        another -
        Returns:
        a new instance
      • negative

        T negative()
        Unary negative function applied to every element of this instance
        Returns:
        a new instance
      • mul

        T mul(Matrix matrix)
        Vectorial multiplication of this instance by a Matrix.
        Parameters:
        another -
        Returns:
        a new instance
      • dotProduct

        double dotProduct(T another)
        The inner product generalizes the dot product to abstract vector spaces and is normally denoted by .

        As we are working in space (real numbers), it's sufficient to understand that both inner product and dot operator give equivalent results.

        Parameters:
        another - Iterator
        Returns:
        the inner product between this Matrix and another Matrix
        See Also:
        Inner Product
      • dotProduct

        double dotProduct(T another,
                          int from,
                          int to)
        The inner product generalizes the dot product to abstract vector spaces and is normally denoted by .

        As we are working in space (real numbers), it's sufficient to understand that both inner product and dot operator give equivalent results.

        Parameters:
        another - Iterator
        from - is the start element, inclusive
        to - is the end element, exclusive
        Returns:
        the inner product between this Matrix and another Matrix
        See Also:
        Inner Product
      • innerProduct

        double innerProduct(T another)
        The inner product generalizes the dot product to abstract vector spaces and is normally denoted by .

        As we are working in space (real numbers), it's sufficient to understand that both inner product and dot operator give equivalent results.

        Parameters:
        another - Iterator
        Returns:
        the inner product between this Matrix and another Matrix
        See Also:
        Inner Product
      • innerProduct

        double innerProduct(T another,
                            int from,
                            int to)
        The inner product generalizes the dot product to abstract vector spaces and is normally denoted by .

        As we are working in space (real numbers), it's sufficient to understand that both inner product and dot operator give equivalent results.

        Parameters:
        another - Iterator
        from - is the start element, inclusive
        to - is the end element, exclusive
        Returns:
        the inner product between this Matrix and another Matrix
        See Also:
        Inner Product
      • outerProduct

        Matrix outerProduct(T another)
        In linear algebra, the outer product typically refers to the tensor product of two vectors. The result of applying the outer product to a pair of vectors is a matrix. The name contrasts with the inner product, which takes as input a pair of vectors and produces a scalar.

        Given a vector with ''m'' elements and a vector with ''n'' elements, their outer product is defined as the matrix obtained by multiplying each element of by each element of :

        Note that .

        Parameters:
        another - Iterator
        Returns:
        the outer product between this Matrix and another Matrix
        See Also:
        Outer Product
      • outerProduct

        Matrix outerProduct(T another,
                            int from,
                            int to)
        In linear algebra, the outer product typically refers to the tensor product of two vectors. The result of applying the outer product to a pair of vectors is a matrix. The name contrasts with the inner product, which takes as input a pair of vectors and produces a scalar.

        Given a vector with ''m'' elements and a vector with ''n'' elements, their outer product is defined as the matrix obtained by multiplying each element of by each element of :

        Note that .

        Parameters:
        another - Iterator
        from - is the start element, inclusive
        to - is the end element, exclusive
        Returns:
        the outer product between this Matrix and another Matrix
        See Also:
        Outer Product
      • adjacentDifference

        T adjacentDifference()
        Return differences between adjacent values.

        Computes the difference between adjacent values in the range [first,last) using subtraction to compute differences and returns the results as an Array.

        Returns:
        an array which contains the computed adjacent differences.
        See Also:
        std::adjacent_difference
      • adjacentDifference

        T adjacentDifference(int from,
                             int to)
        Return differences between adjacent values.

        Computes the difference between adjacent values in the range [first,last) using subtraction to compute differences and returns the results as an Array.

        Parameters:
        first - is the start of range
        last - is the end of range
        Returns:
        an array which contains the computed adjacent differences.
        See Also:
        std::adjacent_difference
      • adjacentDifference

        T adjacentDifference(Ops.BinaryDoubleOp f)
        Return differences between adjacent values.

        Computes the difference between adjacent values in the range [begin(),end()+1) using a function for computing the differences and returns the results as an Array.

        Parameters:
        f - is a function
        Returns:
        an array which contains the computed adjacent differences.
        See Also:
        std::adjacent_difference
      • adjacentDifference

        T adjacentDifference(int from,
                             int to,
                             Ops.BinaryDoubleOp f)
        Return differences between adjacent values.

        Computes the difference between adjacent values in the range [first,last) using a function for computing the differences and returns the results as an Array.

        Parameters:
        first - is the start of range
        last - is the end of range
        f - is a function
        Returns:
        an array which contains the computed adjacent differences.
        See Also:
        std::adjacent_difference
      • min

        double min()
        Return the minimum element in a range using comparison functor.
        Returns:
        the minimum value computed
        See Also:
        std::min_element
      • min

        double min(int from,
                   int to)
        Return the minimum element in a range using comparison functor.
        Parameters:
        from - is the initial index, inclusive
        to - is the final index, exclusive
        Returns:
        the minimum value computed
        See Also:
        std::min_element
      • max

        double max()
        Return the maximum element in a range using comparison functor.
        Returns:
        the maximum value computed
        See Also:
        std::max_element
      • max

        double max(int from,
                   int to)
        Return the maximum element in a range using comparison functor.
        Parameters:
        from - is the initial index, inclusive
        to - is the final index, exclusive
        Returns:
        the maximum value computed
        See Also:
        std::max_element
      • abs

        T abs()
        Applies Math.abs(double) to every element of this instance.
        Returns:
        a new instance
      • sqr

        T sqr()
        Applies Math#sqr(double) to every element of this instance.
        Returns:
        a new instance
      • sqrt

        T sqrt()
        Applies Math.sqrt(double) to every element of this instance.
        Returns:
        a new instance
      • log

        T log()
        Applies Math.log(double) to every element of this instance.
        Returns:
        a new instance
      • exp

        T exp()
        Applies Math.exp(double) to every element of this instance.
        Returns:
        a new instance
      • accumulate

        double accumulate()
        Accumulate values in a range.

        Accumulates the values in the range [begin,end+1). The initial value is zero. The values are processed in order.

        Returns:
        the final sum
        See Also:
        std::accumulate
      • accumulate

        double accumulate(double init)
        Accumulate values in a range.

        Accumulates the values in the range [begin(),end()+1). The initial value is init. The values are processed in order.

        Parameters:
        init - is the starting value to add other values to.
        Returns:
        the final sum
        See Also:
        std::accumulate
      • accumulate

        double accumulate(int from,
                          int to,
                          double init)
        Accumulate values in a range.

        Accumulates the values in the range [first,last). The initial value is init. The values are processed in order.

        Parameters:
        first - is the start of range, inclusive
        last - is the end of range, exclusive
        init - is the starting value to add other values to.
        Returns:
        the final sum
        See Also:
        std::accumulate
      • transform

        T transform(Ops.DoubleOp func)
        Perform an operation on a sequence in a range [first,last)

        Applies the operator to each element in the input range and assigns the results to itself. Evaluates input[first+N] = unary_op(array[first+N]) for each N in the range [0, end()-begin() ).

        Parameters:
        f - is an unary function to be applied
        Returns:
        this, i.e: performs the transformation in place
        See Also:
        std::transform
      • transform

        T transform(int first,
                    int last,
                    Ops.DoubleOp f)
        Perform an operation on a sequence in a range [first,last)

        Applies the operator to each element in the input range and assigns the results to itself. Evaluates input[first+N] = unary_op(array[first+N]) for each N in the range [0, last-first).

        Parameters:
        first - is the start of range, inclusive
        last - is the end of range, exclusive
        f - is an unary function to be applied
        Returns:
        this, i.e: performs the transformation in place
        See Also:
        std::transform
      • lowerBound

        int lowerBound(double val)
        Finds the first position in which val could be inserted without changing the ordering.
        Parameters:
        value - to be searched
        Returns:
        an index pointing to the first element "not less than" val, or end() if every element is less than val.
        See Also:
        std::lower_bound
      • lowerBound

        int lowerBound(int from,
                       int to,
                       double val)
        Finds the first position in which val could be inserted without changing the ordering.
        Parameters:
        first - element, inclusive
        last - element, inclusive
        value - to be searched
        Returns:
        an index pointing to the first element "not less than" val, or end() if every element is less than val.
        See Also:
        std::lower_bound
      • lowerBound

        int lowerBound(double val,
                       Ops.BinaryDoublePredicate f)
        Finds the first position in which val could be inserted without changing the ordering.
        Parameters:
        value - to be searched
        f - is a BinaryDoublePredicate which defines the comparison function
        Returns:
        an index pointing to the first element "not less than" val, or end() if every element is less than val.
        See Also:
        std::lower_bound
      • lowerBound

        int lowerBound(int from,
                       int to,
                       double val,
                       Ops.BinaryDoublePredicate f)
        Finds the first position in which val could be inserted without changing the ordering.
        Parameters:
        first - element, inclusive
        last - element, inclusive
        value - to be searched
        f - is a BinaryDoublePredicate which defines the comparison function
        Returns:
        an index pointing to the first element "not less than" val, or end() if every element is less than val.
        See Also:
        std::lower_bound
      • upperBound

        int upperBound(double val)
        Finds the last position in which val could be inserted in a sequence [begin(), end()] without changing the ordering.
        Parameters:
        value - to be searched
        Returns:
        an index pointing to the first element greater than val, or end() if no elements are greater than val.
        See Also:
        std::upper_bound
      • upperBound

        int upperBound(int first,
                       int last,
                       double val)
        Finds the last position in which val could be inserted in a sequence [first,last] without changing the ordering.
        Parameters:
        first - element, inclusive
        last - element, inclusive
        value - to be searched
        Returns:
        an index pointing to the first element greater than val, or end() if no elements are greater than val.
        See Also:
        std::upper_bound
      • upperBound

        int upperBound(double val,
                       Ops.BinaryDoublePredicate f)
        Finds the last position in which val could be inserted in a sequence [begin(), end()] without changing the ordering.
        Parameters:
        value - to be searched
        f - is a BinaryDoublePredicate which defines the comparison function
        Returns:
        an index pointing to the first element greater than val, or end() if no elements are greater than val.
        See Also:
        std::upper_bound
      • upperBound

        int upperBound(int first,
                       int last,
                       double val,
                       Ops.BinaryDoublePredicate f)
        Finds the last position in which val could be inserted in a sequence [first,last] without changing the ordering.
        Parameters:
        first - element, inclusive
        last - element, inclusive
        value - to be searched
        f - is a BinaryDoublePredicate which defines the comparison function
        Returns:
        an index pointing to the first element greater than val, or end() if no elements are greater than val.
        See Also:
        std::upper_bound

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.