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

Class Array

  • All Implemented Interfaces:
    java.lang.Cloneable, java.lang.Iterable<java.lang.Double>, Algebra<Array>


    public class Array
    extends Cells<Address.ArrayAddress>
    implements java.lang.Cloneable, java.lang.Iterable<java.lang.Double>, Algebra<Array>
    1-D array used in linear algebra.
    • Field Summary

      • Fields inherited from class org.jquantlib.math.matrixutilities.Cells

        $
    • Constructor Summary

      Constructors 
      Constructor and Description
      Array()
      Default constructor
      Array(Array array)
      Creates a Matrix given a double[][] array
      Array(Array array, java.util.Set<Address.Flags> flags)
      Creates a Matrix given a double[][] array
      Array(double[] array)
      Creates an Array given a double[] array
      Array(double[] array, int size)
      Creates an Array given a double[] array and the desired number of elements
      Array(double[] array, int size, java.util.Set<Address.Flags> flags)
      Creates an Array given a double[] array and the desired number of elements
      Array(double[] array, java.util.Set<Address.Flags> flags)
      Creates an Array given a double[] array
      Array(int size)
      Builds an Array of size
      Array(int size, java.util.Set<Address.Flags> flags)
      Builds an Array of size
      Array(java.util.Set<Address.Flags> flags)
      Default constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method and Description
      int _(int index)
      Deprecated. 
      Array 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 first, int last, double init)
      Accumulate values in a range.
      Array add(Array another)
      Adds this instance and another instance of <T>.
      Array add(double scalar)
      Adds a scalar to every element of this instance of <T>.
      Array addAssign(Array another)
      Adds this instance and another instance of <T>.
      Array addAssign(double scalar)
      Adds a scalar to every element of this instance of <T>.
      Array adjacentDifference()
      Return differences between adjacent values.
      Array adjacentDifference(int from, int to)
      Return differences between adjacent values.
      Array adjacentDifference(int from, int to, Ops.BinaryDoubleOp f)
      Return differences between adjacent values.
      Array adjacentDifference(Ops.BinaryDoubleOp f)
      Return differences between adjacent values.
      int begin() 
      Array clone() 
      Array div(Array another)
      Divides this instance by another instance of <T>.
      Array div(double scalar)
      Divides every element of this instance of <T> by a scalar.
      Array divAssign(Array another)
      Divides this instance by another instance of <T>.
      Array divAssign(double scalar)
      Divides every element of this instance of <T> by a scalar.
      double dotProduct(Array another)
      The inner product generalizes the dot product to abstract vector spaces and is normally denoted by .
      double dotProduct(Array another, int from, int to)
      The inner product generalizes the dot product to abstract vector spaces and is normally denoted by .
      int end() 
      Array exp()
      Applies Math.exp(double) to every element of this instance.
      Array fill(Array another) 
      Array fill(double scalar) 
      double first() 
      double get(int pos)
      Retrieves an element of this Matrix
      double innerProduct(Array another)
      The inner product generalizes the dot product to abstract vector spaces and is normally denoted by .
      double innerProduct(Array another, int from, int to)
      The inner product generalizes the dot product to abstract vector spaces and is normally denoted by .
      java.util.Iterator<java.lang.Double> iterator() 
      double last() 
      Array 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.
      Array mul(Array another)
      Multiplies this instance by another instance of <T>.
      Array mul(double scalar)
      Multiplies every element of this instance of <T> by a scalar.
      Array mul(Matrix matrix)
      Vectorial multiplication of this instance by a Matrix.
      Array mulAssign(Array another)
      Multiplies this instance by another instance of <T>.
      Array mulAssign(double scalar)
      Multiplies every element of this instance of <T> by a scalar.
      Array negative()
      Unary negative function applied to every element of this instance
      Matrix outerProduct(Array another)
      In linear algebra, the outer product typically refers to the tensor product of two vectors.
      Matrix outerProduct(Array another, int from, int to)
      In linear algebra, the outer product typically refers to the tensor product of two vectors.
      Array range(int col0) 
      Array range(int col0, int col1) 
      void set(int pos, double value)
      Stores a value into an element of this Matrix
      Array sort() 
      Array sqr()
      Applies Math#sqr(double) to every element of this instance.
      Array sqrt()
      Applies Math.sqrt(double) to every element of this instance.
      Array sub(Array another)
      Subtracts this instance by another instance of <T>.
      Array sub(double scalar)
      Subtracts a scalar to every element of this instance of <T>.
      Array subAssign(Array another)
      Returns the result of a subtraction of this Array and another Array
      Array subAssign(double scalar)
      Subtracts a scalar to every element of this instance of <T>.
      Array swap(Array another) 
      Array toFortran() 
      Array toJava() 
      java.lang.String toString() 
      Array transform(int from, int to, Ops.DoubleOp f)
      Perform an operation on a sequence in a range [first,last)
      Array transform(Ops.DoubleOp f)
      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 from, int to, double val)
      Finds the last position in which val could be inserted in a sequence [first,last] without changing the ordering.
      int upperBound(int from, int to, double val, Ops.BinaryDoublePredicate f)
      Finds the last position in which val could be inserted in a sequence [first,last] without changing the ordering.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • Array

        public Array()
        Default constructor

        Builds an Array which contains only one element.

      • Array

        public Array(java.util.Set<Address.Flags> flags)
        Default constructor

        Builds an Array which contains only one element.

        Parameters:
        flags - is a Set<Address.Flags>
        See Also:
        Address.Flags
      • Array

        public Array(int size)
        Builds an Array of size
        Parameters:
        size - is the size of this Array
        Throws:
        java.lang.IllegalArgumentException - if size are less than zero
      • Array

        public Array(int size,
                     java.util.Set<Address.Flags> flags)
        Builds an Array of size
        Parameters:
        size - is the size of this Array
        flags - is a Set<Address.Flags>
        Throws:
        java.lang.IllegalArgumentException - if size are less than zero
        See Also:
        Address.Flags
      • Array

        public Array(double[] array)
        Creates an Array given a double[] array
        Parameters:
        $ - is a unidimensional array
      • Array

        public Array(double[] array,
                     java.util.Set<Address.Flags> flags)
        Creates an Array given a double[] array
        Parameters:
        $ - is a unidimensional array
        flags - is a Set<Address.Flags>
        See Also:
        Address.Flags
      • Array

        public Array(double[] array,
                     int size)
        Creates an Array given a double[] array and the desired number of elements
        Parameters:
        $ - is a unidimensional array
        size - is the desired number of elements to be taken, counted from the first position
      • Array

        public Array(double[] array,
                     int size,
                     java.util.Set<Address.Flags> flags)
        Creates an Array given a double[] array and the desired number of elements
        Parameters:
        $ - is a unidimensional array
        size - is the desired number of elements to be taken, counted from the first position
        flags - is a Set<Address.Flags>
        See Also:
        Address.Flags
      • Array

        public Array(Array array)
        Creates a Matrix given a double[][] array
        Parameters:
        $ -
      • Array

        public Array(Array array,
                     java.util.Set<Address.Flags> flags)
        Creates a Matrix given a double[][] array
        Parameters:
        $ -
        flags - is a Set<Address.Flags>
        See Also:
        Address.Flags
    • Method Detail

      • _

        @Deprecated
        public int _(int index)
        Deprecated. 
        This is a convenience method intended to return the physical address of an element.

        The use of this method is highly discouraged

        Parameters:
        index - is a logical address of an element
        Returns:
        the physical address to an element
        See Also:
        Cells.$
      • begin

        public int begin()
      • end

        public int end()
      • first

        public double first()
      • last

        public double last()
      • get

        public double get(int pos)
        Retrieves an element of this Matrix

        This method is provided for performance reasons. See methods #getAddress(int) and #getAddress(int, int) for more details

        Parameters:
        dim - coordinate
        col - coordinate
        Returns:
        the contents of a given cell
        See Also:
        #getAddress(int), #getAddress(int, int)
      • set

        public void set(int pos,
                        double value)
        Stores a value into an element of this Matrix

        This method is provided for performance reasons. See methods #getAddress(int) and #getAddress(int, int) for more details

        Parameters:
        dim - coordinate
        col - coordinate
        See Also:
        #getAddress(int), #getAddress(int, int)
      • addAssign

        public Array addAssign(double scalar)
        Description copied from interface: Algebra
        Adds a scalar to every element of this instance of <T>.
        Specified by:
        addAssign in interface Algebra<Array>
        Returns:
        this
      • subAssign

        public Array subAssign(double scalar)
        Description copied from interface: Algebra
        Subtracts a scalar to every element of this instance of <T>.
        Specified by:
        subAssign in interface Algebra<Array>
        Returns:
        this
      • subAssign

        public Array subAssign(Array another)
        Returns the result of a subtraction of this Array and another Array
        Specified by:
        subAssign in interface Algebra<Array>
        Parameters:
        another -
        Returns:
        this
      • mulAssign

        public Array mulAssign(double scalar)
        Description copied from interface: Algebra
        Multiplies every element of this instance of <T> by a scalar.
        Specified by:
        mulAssign in interface Algebra<Array>
        Returns:
        this
      • divAssign

        public Array divAssign(double scalar)
        Description copied from interface: Algebra
        Divides every element of this instance of <T> by a scalar.
        Specified by:
        divAssign in interface Algebra<Array>
        Returns:
        this
      • addAssign

        public Array addAssign(Array another)
        Description copied from interface: Algebra
        Adds this instance and another instance of <T>.
        Specified by:
        addAssign in interface Algebra<Array>
        Returns:
        this
      • mulAssign

        public Array mulAssign(Array another)
        Description copied from interface: Algebra
        Multiplies this instance by another instance of <T>.
        Specified by:
        mulAssign in interface Algebra<Array>
        Returns:
        this
      • divAssign

        public Array divAssign(Array another)
        Description copied from interface: Algebra
        Divides this instance by another instance of <T>.
        Specified by:
        divAssign in interface Algebra<Array>
        Returns:
        this
      • add

        public Array add(double scalar)
        Description copied from interface: Algebra
        Adds a scalar to every element of this instance of <T>.
        Specified by:
        add in interface Algebra<Array>
        Returns:
        a new instance
      • sub

        public Array sub(double scalar)
        Description copied from interface: Algebra
        Subtracts a scalar to every element of this instance of <T>.
        Specified by:
        sub in interface Algebra<Array>
        Returns:
        a new instance
      • mul

        public Array mul(double scalar)
        Description copied from interface: Algebra
        Multiplies every element of this instance of <T> by a scalar.
        Specified by:
        mul in interface Algebra<Array>
        Returns:
        a new instance
      • negative

        public Array negative()
        Description copied from interface: Algebra
        Unary negative function applied to every element of this instance
        Specified by:
        negative in interface Algebra<Array>
        Returns:
        a new instance
      • div

        public Array div(double scalar)
        Description copied from interface: Algebra
        Divides every element of this instance of <T> by a scalar.
        Specified by:
        div in interface Algebra<Array>
        Returns:
        a new instance
      • add

        public Array add(Array another)
        Description copied from interface: Algebra
        Adds this instance and another instance of <T>.
        Specified by:
        add in interface Algebra<Array>
        Returns:
        a new instance
      • sub

        public Array sub(Array another)
        Description copied from interface: Algebra
        Subtracts this instance by another instance of <T>.
        Specified by:
        sub in interface Algebra<Array>
        Returns:
        a new instance
      • mul

        public Array mul(Array another)
        Description copied from interface: Algebra
        Multiplies this instance by another instance of <T>.
        Specified by:
        mul in interface Algebra<Array>
        Returns:
        a new instance
      • div

        public Array div(Array another)
        Description copied from interface: Algebra
        Divides this instance by another instance of <T>.
        Specified by:
        div in interface Algebra<Array>
        Returns:
        a new instance
      • mul

        public Array mul(Matrix matrix)
        Description copied from interface: Algebra
        Vectorial multiplication of this instance by a Matrix.
        Specified by:
        mul in interface Algebra<Array>
        Returns:
        a new instance
      • min

        public double min()
        Description copied from interface: Algebra
        Return the minimum element in a range using comparison functor.
        Specified by:
        min in interface Algebra<Array>
        Returns:
        the minimum value computed
        See Also:
        std::min_element
      • min

        public double min(int from,
                          int to)
        Description copied from interface: Algebra
        Return the minimum element in a range using comparison functor.
        Specified by:
        min in interface Algebra<Array>
        Parameters:
        from - is the initial index, inclusive
        to - is the final index, exclusive
        Returns:
        the minimum value computed
        See Also:
        std::min_element
      • max

        public double max()
        Description copied from interface: Algebra
        Return the maximum element in a range using comparison functor.
        Specified by:
        max in interface Algebra<Array>
        Returns:
        the maximum value computed
        See Also:
        std::max_element
      • max

        public double max(int from,
                          int to)
        Description copied from interface: Algebra
        Return the maximum element in a range using comparison functor.
        Specified by:
        max in interface Algebra<Array>
        Parameters:
        from - is the initial index, inclusive
        to - is the final index, exclusive
        Returns:
        the maximum value computed
        See Also:
        std::max_element
      • abs

        public Array abs()
        Description copied from interface: Algebra
        Applies Math.abs(double) to every element of this instance.
        Specified by:
        abs in interface Algebra<Array>
        Returns:
        a new instance
      • sqr

        public Array sqr()
        Description copied from interface: Algebra
        Applies Math#sqr(double) to every element of this instance.
        Specified by:
        sqr in interface Algebra<Array>
        Returns:
        a new instance
      • sqrt

        public Array sqrt()
        Description copied from interface: Algebra
        Applies Math.sqrt(double) to every element of this instance.
        Specified by:
        sqrt in interface Algebra<Array>
        Returns:
        a new instance
      • log

        public Array log()
        Description copied from interface: Algebra
        Applies Math.log(double) to every element of this instance.
        Specified by:
        log in interface Algebra<Array>
        Returns:
        a new instance
      • exp

        public Array exp()
        Description copied from interface: Algebra
        Applies Math.exp(double) to every element of this instance.
        Specified by:
        exp in interface Algebra<Array>
        Returns:
        a new instance
      • dotProduct

        public double dotProduct(Array another)
        Description copied from interface: Algebra
        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.

        Specified by:
        dotProduct in interface Algebra<Array>
        Parameters:
        another - Iterator
        Returns:
        the inner product between this Matrix and another Matrix
        See Also:
        Inner Product
      • dotProduct

        public double dotProduct(Array another,
                                 int from,
                                 int to)
        Description copied from interface: Algebra
        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.

        Specified by:
        dotProduct in interface Algebra<Array>
        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

        public double innerProduct(Array another)
        Description copied from interface: Algebra
        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.

        Specified by:
        innerProduct in interface Algebra<Array>
        Parameters:
        another - Iterator
        Returns:
        the inner product between this Matrix and another Matrix
        See Also:
        Inner Product
      • innerProduct

        public double innerProduct(Array another,
                                   int from,
                                   int to)
        Description copied from interface: Algebra
        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.

        Specified by:
        innerProduct in interface Algebra<Array>
        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

        public Matrix outerProduct(Array another)
        Description copied from interface: Algebra
        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 .

        Specified by:
        outerProduct in interface Algebra<Array>
        Parameters:
        another - Iterator
        Returns:
        the outer product between this Matrix and another Matrix
        See Also:
        Outer Product
      • outerProduct

        public Matrix outerProduct(Array another,
                                   int from,
                                   int to)
        Description copied from interface: Algebra
        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 .

        Specified by:
        outerProduct in interface Algebra<Array>
        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
      • accumulate

        public double accumulate()
        Description copied from interface: Algebra
        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.

        Specified by:
        accumulate in interface Algebra<Array>
        Returns:
        the final sum
        See Also:
        std::accumulate
      • accumulate

        public double accumulate(double init)
        Description copied from interface: Algebra
        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.

        Specified by:
        accumulate in interface Algebra<Array>
        Parameters:
        init - is the starting value to add other values to.
        Returns:
        the final sum
        See Also:
        std::accumulate
      • accumulate

        public double accumulate(int first,
                                 int last,
                                 double init)
        Description copied from interface: Algebra
        Accumulate values in a range.

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

        Specified by:
        accumulate in interface Algebra<Array>
        init - is the starting value to add other values to.
        Returns:
        the final sum
        See Also:
        std::accumulate
      • adjacentDifference

        public final Array adjacentDifference()
        Description copied from interface: Algebra
        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.

        Specified by:
        adjacentDifference in interface Algebra<Array>
        Returns:
        an array which contains the computed adjacent differences.
        See Also:
        std::adjacent_difference
      • adjacentDifference

        public final Array adjacentDifference(int from,
                                              int to)
        Description copied from interface: Algebra
        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.

        Specified by:
        adjacentDifference in interface Algebra<Array>
        Returns:
        an array which contains the computed adjacent differences.
        See Also:
        std::adjacent_difference
      • adjacentDifference

        public Array adjacentDifference(Ops.BinaryDoubleOp f)
        Description copied from interface: Algebra
        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.

        Specified by:
        adjacentDifference in interface Algebra<Array>
        Parameters:
        f - is a function
        Returns:
        an array which contains the computed adjacent differences.
        See Also:
        std::adjacent_difference
      • adjacentDifference

        public Array adjacentDifference(int from,
                                        int to,
                                        Ops.BinaryDoubleOp f)
        Description copied from interface: Algebra
        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.

        Specified by:
        adjacentDifference in interface Algebra<Array>
        f - is a function
        Returns:
        an array which contains the computed adjacent differences.
        See Also:
        std::adjacent_difference
      • transform

        public Array transform(Ops.DoubleOp f)
        Description copied from interface: Algebra
        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() ).

        Specified by:
        transform in interface Algebra<Array>
        Returns:
        this, i.e: performs the transformation in place
        See Also:
        std::transform
      • transform

        public Array transform(int from,
                               int to,
                               Ops.DoubleOp f)
        Description copied from interface: Algebra
        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).

        Specified by:
        transform in interface Algebra<Array>
        Parameters:
        from - is the start of range, inclusive
        to - 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

        public int lowerBound(double val)
        Description copied from interface: Algebra
        Finds the first position in which val could be inserted without changing the ordering.
        Specified by:
        lowerBound in interface Algebra<Array>
        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

        public int lowerBound(int from,
                              int to,
                              double val)
        Description copied from interface: Algebra
        Finds the first position in which val could be inserted without changing the ordering.
        Specified by:
        lowerBound in interface Algebra<Array>
        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

        public int lowerBound(double val,
                              Ops.BinaryDoublePredicate f)
        Description copied from interface: Algebra
        Finds the first position in which val could be inserted without changing the ordering.
        Specified by:
        lowerBound in interface Algebra<Array>
        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

        public int lowerBound(int from,
                              int to,
                              double val,
                              Ops.BinaryDoublePredicate f)
        Description copied from interface: Algebra
        Finds the first position in which val could be inserted without changing the ordering.
        Specified by:
        lowerBound in interface Algebra<Array>
        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

        public int upperBound(double val)
        Description copied from interface: Algebra
        Finds the last position in which val could be inserted in a sequence [begin(), end()] without changing the ordering.
        Specified by:
        upperBound in interface Algebra<Array>
        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

        public int upperBound(int from,
                              int to,
                              double val)
        Description copied from interface: Algebra
        Finds the last position in which val could be inserted in a sequence [first,last] without changing the ordering.
        Specified by:
        upperBound in interface Algebra<Array>
        Parameters:
        from - element, inclusive
        to - element, inclusive
        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

        public int upperBound(double val,
                              Ops.BinaryDoublePredicate f)
        Description copied from interface: Algebra
        Finds the last position in which val could be inserted in a sequence [begin(), end()] without changing the ordering.
        Specified by:
        upperBound in interface Algebra<Array>
        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

        public int upperBound(int from,
                              int to,
                              double val,
                              Ops.BinaryDoublePredicate f)
        Description copied from interface: Algebra
        Finds the last position in which val could be inserted in a sequence [first,last] without changing the ordering.
        Specified by:
        upperBound in interface Algebra<Array>
        Parameters:
        from - element, inclusive
        to - element, inclusive
        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
      • range

        public Array range(int col0)
      • range

        public Array range(int col0,
                           int col1)
      • toFortran

        public Array toFortran()
      • toJava

        public Array toJava()
      • fill

        public Array fill(double scalar)
      • sort

        public Array sort()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • iterator

        public java.util.Iterator<java.lang.Double> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<java.lang.Double>

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.