Class LongVector


  • public abstract class LongVector
    extends Vector<Long>
    A specialized Vector representing an ordered immutable sequence of long values.
    • Method Detail

      • zero

        public static LongVector zero​(Species<Long> species)
        Returns a vector where all lane elements are set to the default primitive value.
        Parameters:
        species - species of desired vector
        Returns:
        a zero vector of given species
      • fromByteArray

        public static LongVector fromByteArray​(Species<Long> species,
                                               byte[] a,
                                               int ix)
        Loads a vector from a byte array starting at an offset.

        Bytes are composed into primitive lane elements according to the native byte order of the underlying platform

        This method behaves as if it returns the result of calling the byte buffer, offset, and mask accepting method as follows:

        
         return this.fromByteBuffer(ByteBuffer.wrap(a), i, this.maskAllTrue());
         
        Parameters:
        species - species of desired vector
        a - the byte array
        ix - the offset into the array
        Returns:
        a vector loaded from a byte array
        Throws:
        IndexOutOfBoundsException - if i < 0 or i > a.length - (this.length() * this.elementSize() / Byte.SIZE)
      • fromByteArray

        public static LongVector fromByteArray​(Species<Long> species,
                                               byte[] a,
                                               int ix,
                                               Mask<Long> m)
        Loads a vector from a byte array starting at an offset and using a mask.

        Bytes are composed into primitive lane elements according to the native byte order of the underlying platform.

        This method behaves as if it returns the result of calling the byte buffer, offset, and mask accepting method as follows:

        
         return this.fromByteBuffer(ByteBuffer.wrap(a), i, m);
         
        Parameters:
        species - species of desired vector
        a - the byte array
        ix - the offset into the array
        m - the mask
        Returns:
        a vector loaded from a byte array
        Throws:
        IndexOutOfBoundsException - if i < 0 or i > a.length - (this.length() * this.elementSize() / Byte.SIZE)
        IndexOutOfBoundsException - if the offset is < 0, or > a.length, for any vector lane index N where the mask at lane N is set i >= a.length - (N * this.elementSize() / Byte.SIZE)
      • fromArray

        public static LongVector fromArray​(Species<Long> species,
                                           long[] a,
                                           int i)
        Loads a vector from an array starting at offset.

        For each vector lane, where N is the vector lane index, the array element at index i + N is placed into the resulting vector at lane index N.

        Parameters:
        species - species of desired vector
        a - the array
        i - the offset into the array
        Returns:
        the vector loaded from an array
        Throws:
        IndexOutOfBoundsException - if i < 0, or i > a.length - this.length()
      • fromArray

        public static LongVector fromArray​(Species<Long> species,
                                           long[] a,
                                           int i,
                                           Mask<Long> m)
        Loads a vector from an array starting at offset and using a mask.

        For each vector lane, where N is the vector lane index, if the mask lane at index N is set then the array element at index i + N is placed into the resulting vector at lane index N, otherwise the default element value is placed into the resulting vector at lane index N.

        Parameters:
        species - species of desired vector
        a - the array
        i - the offset into the array
        m - the mask
        Returns:
        the vector loaded from an array
        Throws:
        IndexOutOfBoundsException - if i < 0, or for any vector lane index N where the mask at lane N is set i > a.length - N
      • fromArray

        public static LongVector fromArray​(Species<Long> species,
                                           long[] a,
                                           int i,
                                           int[] indexMap,
                                           int j)
        Loads a vector from an array using indexes obtained from an index map.

        For each vector lane, where N is the vector lane index, the array element at index i + indexMap[j + N] is placed into the resulting vector at lane index N.

        Parameters:
        species - species of desired vector
        a - the array
        i - the offset into the array, may be negative if relative indexes in the index map compensate to produce a value within the array bounds
        indexMap - the index map
        j - the offset into the index map
        Returns:
        the vector loaded from an array
        Throws:
        IndexOutOfBoundsException - if j < 0, or j > indexMap.length - this.length(), or for any vector lane index N the result of i + indexMap[j + N] is < 0 or >= a.length
      • fromArray

        public static LongVector fromArray​(Species<Long> species,
                                           long[] a,
                                           int i,
                                           Mask<Long> m,
                                           int[] indexMap,
                                           int j)
        Loads a vector from an array using indexes obtained from an index map and using a mask.

        For each vector lane, where N is the vector lane index, if the mask lane at index N is set then the array element at index i + indexMap[j + N] is placed into the resulting vector at lane index N.

        Parameters:
        species - species of desired vector
        a - the array
        i - the offset into the array, may be negative if relative indexes in the index map compensate to produce a value within the array bounds
        m - the mask
        indexMap - the index map
        j - the offset into the index map
        Returns:
        the vector loaded from an array
        Throws:
        IndexOutOfBoundsException - if j < 0, or j > indexMap.length - this.length(), or for any vector lane index N where the mask at lane N is set the result of i + indexMap[j + N] is < 0 or >= a.length
      • fromByteBuffer

        public static LongVector fromByteBuffer​(Species<Long> species,
                                                ByteBuffer bb,
                                                int ix)
        Loads a vector from a byte buffer starting at an offset into the byte buffer.

        Bytes are composed into primitive lane elements according to the native byte order of the underlying platform.

        This method behaves as if it returns the result of calling the byte buffer, offset, and mask accepting #fromByteBuffer(Species, ByteBuffer, int, Mask) method} as follows:

        
           return this.fromByteBuffer(b, i, this.maskAllTrue())
         
        Parameters:
        species - species of desired vector
        bb - the byte buffer
        ix - the offset into the byte buffer
        Returns:
        a vector loaded from a byte buffer
        Throws:
        IndexOutOfBoundsException - if the offset is < 0, or > b.limit(), or if there are fewer than this.length() * this.elementSize() / Byte.SIZE bytes remaining in the byte buffer from the given offset
      • fromByteBuffer

        public static LongVector fromByteBuffer​(Species<Long> species,
                                                ByteBuffer bb,
                                                int ix,
                                                Mask<Long> m)
        Loads a vector from a byte buffer starting at an offset into the byte buffer and using a mask.

        This method behaves as if the byte buffer is viewed as a primitive buffer for the primitive element type, according to the native byte order of the underlying platform, and the returned vector is loaded with a mask from a primitive array obtained from the primitive buffer. The following pseudocode expresses the behaviour, where is the primitive buffer type, e is the primitive element type, and ESpecies<S> is the primitive species for e:

        
         EBuffer eb = b.duplicate().
             order(ByteOrder.nativeOrder()).position(i).
             asEBuffer();
         e[] es = new e[this.length()];
         for (int n = 0; n < t.length; n++) {
             if (m.isSet(n))
                 es[n] = eb.get(n);
         }
         Vector<E> r = ((ESpecies<S>)this).fromArray(es, 0, m);
         
        Parameters:
        species - species of desired vector
        bb - the byte buffer
        ix - the offset into the byte buffer
        m - the mask
        Returns:
        a vector loaded from a byte buffer
        Throws:
        IndexOutOfBoundsException - if the offset is < 0, or > b.limit(), for any vector lane index N where the mask at lane N is set i >= b.limit() - (N * this.elementSize() / Byte.SIZE)
      • broadcast

        public static LongVector broadcast​(Species<Long> s,
                                           long e)
        Returns a vector where all lane elements are set to the primitive value e.
        Parameters:
        s - species of the desired vector
        e - the value
        Returns:
        a vector of vector where all lane elements are set to the primitive value e
      • scalars

        public static LongVector scalars​(Species<Long> s,
                                         long... es)
        Returns a vector where each lane element is set to a given primitive value.

        For each vector lane, where N is the vector lane index, the the primitive value at index N is placed into the resulting vector at lane index N.

        Parameters:
        s - species of the desired vector
        es - the given primitive values
        Returns:
        a vector where each lane element is set to a given primitive value
        Throws:
        IndexOutOfBoundsException - if es.length < this.length()
      • single

        public static final LongVector single​(Species<Long> s,
                                              long e)
        Returns a vector where the first lane element is set to the primtive value e, all other lane elements are set to the default value.
        Parameters:
        s - species of the desired vector
        e - the value
        Returns:
        a vector where the first lane element is set to the primitive value e
      • random

        public static LongVector random​(Species<Long> s)
        Returns a vector where each lane element is set to a randomly generated primitive value. The semantics are equivalent to calling ThreadLocalRandom.nextLong()
        Parameters:
        s - species of the desired vector
        Returns:
        a vector where each lane elements is set to a randomly generated primitive value
      • add

        public abstract LongVector add​(long s)
        Adds this vector to the broadcast of an input scalar.

        This is a vector binary operation where the primitive addition operation (+) is applied to lane elements.

        Parameters:
        s - the input scalar
        Returns:
        the result of adding this vector to the broadcast of an input scalar
      • add

        public abstract LongVector add​(long s,
                                       Mask<Long> m)
        Adds this vector to broadcast of an input scalar, selecting lane elements controlled by a mask.

        This is a vector binary operation where the primitive addition operation (+) is applied to lane elements.

        Parameters:
        s - the input scalar
        m - the mask controlling lane selection
        Returns:
        the result of adding this vector to the broadcast of an input scalar
      • sub

        public abstract LongVector sub​(long s)
        Subtracts the broadcast of an input scalar from this vector.

        This is a vector binary operation where the primitive subtraction operation (-) is applied to lane elements.

        Parameters:
        s - the input scalar
        Returns:
        the result of subtracting the broadcast of an input scalar from this vector
      • sub

        public abstract LongVector sub​(long s,
                                       Mask<Long> m)
        Subtracts the broadcast of an input scalar from this vector, selecting lane elements controlled by a mask.

        This is a vector binary operation where the primitive subtraction operation (-) is applied to lane elements.

        Parameters:
        s - the input scalar
        m - the mask controlling lane selection
        Returns:
        the result of subtracting the broadcast of an input scalar from this vector
      • mul

        public abstract LongVector mul​(long s)
        Multiplies this vector with the broadcast of an input scalar.

        This is a vector binary operation where the primitive multiplication operation (*) is applied to lane elements.

        Parameters:
        s - the input scalar
        Returns:
        the result of multiplying this vector with the broadcast of an input scalar
      • mul

        public abstract LongVector mul​(long s,
                                       Mask<Long> m)
        Multiplies this vector with the broadcast of an input scalar, selecting lane elements controlled by a mask.

        This is a vector binary operation where the primitive multiplication operation (*) is applied to lane elements.

        Parameters:
        s - the input scalar
        m - the mask controlling lane selection
        Returns:
        the result of multiplying this vector with the broadcast of an input scalar
      • min

        public abstract LongVector min​(long s)
        Returns the minimum of this vector and the broadcast of an input scalar.

        This is a vector binary operation where the operation (a, b) -> Math.min(a, b) is applied to lane elements.

        Parameters:
        s - the input scalar
        Returns:
        the minimum of this vector and the broadcast of an input scalar
      • max

        public abstract LongVector max​(long s)
        Returns the maximum of this vector and the broadcast of an input scalar.

        This is a vector binary operation where the operation (a, b) -> Math.max(a, b) is applied to lane elements.

        Parameters:
        s - the input scalar
        Returns:
        the maximum of this vector and the broadcast of an input scalar
      • equal

        public abstract Mask<Long> equal​(long s)
        Tests if this vector is equal to the broadcast of an input scalar.

        This is a vector binary test operation where the primitive equals operation (==) is applied to lane elements.

        Parameters:
        s - the input scalar
        Returns:
        the result mask of testing if this vector is equal to the broadcast of an input scalar
      • notEqual

        public abstract Mask<Long> notEqual​(long s)
        Tests if this vector is not equal to the broadcast of an input scalar.

        This is a vector binary test operation where the primitive not equals operation (!=) is applied to lane elements.

        Parameters:
        s - the input scalar
        Returns:
        the result mask of testing if this vector is not equal to the broadcast of an input scalar
      • lessThan

        public abstract Mask<Long> lessThan​(long s)
        Tests if this vector is less than the broadcast of an input scalar.

        This is a vector binary test operation where the primitive less than operation (<) is applied to lane elements.

        Parameters:
        s - the input scalar
        Returns:
        the mask result of testing if this vector is less than the broadcast of an input scalar
      • lessThanEq

        public abstract Mask<Long> lessThanEq​(long s)
        Tests if this vector is less or equal to the broadcast of an input scalar.

        This is a vector binary test operation where the primitive less than or equal to operation (<=) is applied to lane elements.

        Parameters:
        s - the input scalar
        Returns:
        the mask result of testing if this vector is less than or equal to the broadcast of an input scalar
      • greaterThan

        public abstract Mask<Long> greaterThan​(long s)
        Tests if this vector is greater than the broadcast of an input scalar.

        This is a vector binary test operation where the primitive greater than operation (>) is applied to lane elements.

        Parameters:
        s - the input scalar
        Returns:
        the mask result of testing if this vector is greater than the broadcast of an input scalar
      • greaterThanEq

        public abstract Mask<Long> greaterThanEq​(long s)
        Tests if this vector is greater than or equal to the broadcast of an input scalar.

        This is a vector binary test operation where the primitive greater than or equal to operation (>=) is applied to lane elements.

        Parameters:
        s - the input scalar
        Returns:
        the mask result of testing if this vector is greater than or equal to the broadcast of an input scalar
      • blend

        public abstract LongVector blend​(long s,
                                         Mask<Long> m)
        Blends the lane elements of this vector with those of the broadcast of an input scalar, selecting lanes controlled by a mask.

        For each lane of the mask, at lane index N, if the mask lane is set then the lane element at N from the input vector is selected and placed into the resulting vector at N, otherwise the the lane element at N from this input vector is selected and placed into the resulting vector at N.

        Parameters:
        s - the input scalar
        m - the mask controlling lane selection
        Returns:
        the result of blending the lane elements of this vector with those of the broadcast of an input scalar
      • and

        public abstract LongVector and​(Vector<Long> v)
        Bitwise ANDs this vector with an input vector.

        This is a vector binary operation where the primitive bitwise AND operation (&) is applied to lane elements.

        Parameters:
        v - the input vector
        Returns:
        the bitwise AND of this vector with the input vector
      • and

        public abstract LongVector and​(long s)
        Bitwise ANDs this vector with the broadcast of an input scalar.

        This is a vector binary operation where the primitive bitwise AND operation (&) is applied to lane elements.

        Parameters:
        s - the input scalar
        Returns:
        the bitwise AND of this vector with the broadcast of an input scalar
      • and

        public abstract LongVector and​(Vector<Long> v,
                                       Mask<Long> m)
        Bitwise ANDs this vector with an input vector, selecting lane elements controlled by a mask.

        This is a vector binary operation where the primitive bitwise AND operation (&) is applied to lane elements.

        Parameters:
        v - the input vector
        m - the mask controlling lane selection
        Returns:
        the bitwise AND of this vector with the input vector
      • and

        public abstract LongVector and​(long s,
                                       Mask<Long> m)
        Bitwise ANDs this vector with the broadcast of an input scalar, selecting lane elements controlled by a mask.

        This is a vector binary operation where the primitive bitwise AND operation (&) is applied to lane elements.

        Parameters:
        s - the input scalar
        m - the mask controlling lane selection
        Returns:
        the bitwise AND of this vector with the broadcast of an input scalar
      • or

        public abstract LongVector or​(Vector<Long> v)
        Bitwise ORs this vector with an input vector.

        This is a vector binary operation where the primitive bitwise OR operation (|) is applied to lane elements.

        Parameters:
        v - the input vector
        Returns:
        the bitwise OR of this vector with the input vector
      • or

        public abstract LongVector or​(long s)
        Bitwise ORs this vector with the broadcast of an input scalar.

        This is a vector binary operation where the primitive bitwise OR operation (|) is applied to lane elements.

        Parameters:
        s - the input scalar
        Returns:
        the bitwise OR of this vector with the broadcast of an input scalar
      • or

        public abstract LongVector or​(Vector<Long> v,
                                      Mask<Long> m)
        Bitwise ORs this vector with an input vector, selecting lane elements controlled by a mask.

        This is a vector binary operation where the primitive bitwise OR operation (|) is applied to lane elements.

        Parameters:
        v - the input vector
        m - the mask controlling lane selection
        Returns:
        the bitwise OR of this vector with the input vector
      • or

        public abstract LongVector or​(long s,
                                      Mask<Long> m)
        Bitwise ORs this vector with the broadcast of an input scalar, selecting lane elements controlled by a mask.

        This is a vector binary operation where the primitive bitwise OR operation (|) is applied to lane elements.

        Parameters:
        s - the input scalar
        m - the mask controlling lane selection
        Returns:
        the bitwise OR of this vector with the broadcast of an input scalar
      • xor

        public abstract LongVector xor​(Vector<Long> v)
        Bitwise XORs this vector with an input vector.

        This is a vector binary operation where the primitive bitwise XOR operation (^) is applied to lane elements.

        Parameters:
        v - the input vector
        Returns:
        the bitwise XOR of this vector with the input vector
      • xor

        public abstract LongVector xor​(long s)
        Bitwise XORs this vector with the broadcast of an input scalar.

        This is a vector binary operation where the primitive bitwise XOR operation (^) is applied to lane elements.

        Parameters:
        s - the input scalar
        Returns:
        the bitwise XOR of this vector with the broadcast of an input scalar
      • xor

        public abstract LongVector xor​(Vector<Long> v,
                                       Mask<Long> m)
        Bitwise XORs this vector with an input vector, selecting lane elements controlled by a mask.

        This is a vector binary operation where the primitive bitwise XOR operation (^) is applied to lane elements.

        Parameters:
        v - the input vector
        m - the mask controlling lane selection
        Returns:
        the bitwise XOR of this vector with the input vector
      • xor

        public abstract LongVector xor​(long s,
                                       Mask<Long> m)
        Bitwise XORs this vector with the broadcast of an input scalar, selecting lane elements controlled by a mask.

        This is a vector binary operation where the primitive bitwise XOR operation (^) is applied to lane elements.

        Parameters:
        s - the input scalar
        m - the mask controlling lane selection
        Returns:
        the bitwise XOR of this vector with the broadcast of an input scalar
      • not

        public abstract LongVector not()
        Bitwise NOTs this vector.

        This is a vector unary operation where the primitive bitwise NOT operation (~) is applied to lane elements.

        Returns:
        the bitwise NOT of this vector
      • not

        public abstract LongVector not​(Mask<Long> m)
        Bitwise NOTs this vector, selecting lane elements controlled by a mask.

        This is a vector unary operation where the primitive bitwise NOT operation (~) is applied to lane elements.

        Parameters:
        m - the mask controlling lane selection
        Returns:
        the bitwise NOT of this vector
      • shiftL

        public abstract LongVector shiftL​(int s)
        Logically left shifts this vector by the broadcast of an input scalar.

        This is a vector binary operation where the primitive logical left shift operation (<<) is applied to lane elements.

        Parameters:
        s - the input scalar; the number of the bits to left shift
        Returns:
        the result of logically left shifting left this vector by the broadcast of an input scalar
      • shiftL

        public abstract LongVector shiftL​(int s,
                                          Mask<Long> m)
        Logically left shifts this vector by the broadcast of an input scalar, selecting lane elements controlled by a mask.

        This is a vector binary operation where the primitive logical left shift operation (<<) is applied to lane elements.

        Parameters:
        s - the input scalar; the number of the bits to left shift
        m - the mask controlling lane selection
        Returns:
        the result of logically left shifting this vector by the broadcast of an input scalar
      • shiftL

        public abstract LongVector shiftL​(Vector<Long> v)
        Logically left shifts this vector by an input vector.

        This is a vector binary operation where the primitive logical left shift operation (<<) is applied to lane elements.

        Parameters:
        v - the input vector
        Returns:
        the result of logically left shifting this vector by the input vector
      • shiftL

        public LongVector shiftL​(Vector<Long> v,
                                 Mask<Long> m)
        Logically left shifts this vector by an input vector, selecting lane elements controlled by a mask.

        This is a vector binary operation where the primitive logical left shift operation (<<) is applied to lane elements.

        Parameters:
        v - the input vector
        m - the mask controlling lane selection
        Returns:
        the result of logically left shifting this vector by the input vector
      • shiftR

        public abstract LongVector shiftR​(int s)
        Logically right shifts (or unsigned right shifts) this vector by the broadcast of an input scalar.

        This is a vector binary operation where the primitive logical right shift operation (>>>) is applied to lane elements.

        Parameters:
        s - the input scalar; the number of the bits to right shift
        Returns:
        the result of logically right shifting this vector by the broadcast of an input scalar
      • shiftR

        public abstract LongVector shiftR​(int s,
                                          Mask<Long> m)
        Logically right shifts (or unsigned right shifts) this vector by the broadcast of an input scalar, selecting lane elements controlled by a mask.

        This is a vector binary operation where the primitive logical right shift operation (>>>) is applied to lane elements.

        Parameters:
        s - the input scalar; the number of the bits to right shift
        m - the mask controlling lane selection
        Returns:
        the result of logically right shifting this vector by the broadcast of an input scalar
      • shiftR

        public abstract LongVector shiftR​(Vector<Long> v)
        Logically right shifts (or unsigned right shifts) this vector by an input vector.

        This is a vector binary operation where the primitive logical right shift operation (>>>) is applied to lane elements.

        Parameters:
        v - the input vector
        Returns:
        the result of logically right shifting this vector by the input vector
      • shiftR

        public LongVector shiftR​(Vector<Long> v,
                                 Mask<Long> m)
        Logically right shifts (or unsigned right shifts) this vector by an input vector, selecting lane elements controlled by a mask.

        This is a vector binary operation where the primitive logical right shift operation (>>>) is applied to lane elements.

        Parameters:
        v - the input vector
        m - the mask controlling lane selection
        Returns:
        the result of logically right shifting this vector by the input vector
      • aShiftR

        public abstract LongVector aShiftR​(int s)
        Arithmetically right shifts (or signed right shifts) this vector by the broadcast of an input scalar.

        This is a vector binary operation where the primitive arithmetic right shift operation (>>) is applied to lane elements.

        Parameters:
        s - the input scalar; the number of the bits to right shift
        Returns:
        the result of arithmetically right shifting this vector by the broadcast of an input scalar
      • aShiftR

        public abstract LongVector aShiftR​(int s,
                                           Mask<Long> m)
        Arithmetically right shifts (or signed right shifts) this vector by the broadcast of an input scalar, selecting lane elements controlled by a mask.

        This is a vector binary operation where the primitive arithmetic right shift operation (>>) is applied to lane elements.

        Parameters:
        s - the input scalar; the number of the bits to right shift
        m - the mask controlling lane selection
        Returns:
        the result of arithmetically right shifting this vector by the broadcast of an input scalar
      • aShiftR

        public abstract LongVector aShiftR​(Vector<Long> v)
        Arithmetically right shifts (or signed right shifts) this vector by an input vector.

        This is a vector binary operation where the primitive arithmetic right shift operation (>>) is applied to lane elements.

        Parameters:
        v - the input vector
        Returns:
        the result of arithmetically right shifting this vector by the input vector
      • aShiftR

        public LongVector aShiftR​(Vector<Long> v,
                                  Mask<Long> m)
        Arithmetically right shifts (or signed right shifts) this vector by an input vector, selecting lane elements controlled by a mask.

        This is a vector binary operation where the primitive arithmetic right shift operation (>>) is applied to lane elements.

        Parameters:
        v - the input vector
        m - the mask controlling lane selection
        Returns:
        the result of arithmetically right shifting this vector by the input vector
      • rotateL

        public final LongVector rotateL​(int s)
        Rotates left this vector by the broadcast of an input scalar.

        This is a vector binary operation where the operation Long.rotateLeft(long, int) is applied to lane elements and where lane elements of this vector apply to the first argument, and lane elements of the broadcast vector apply to the second argument (the rotation distance).

        Parameters:
        s - the input scalar; the number of the bits to rotate left
        Returns:
        the result of rotating left this vector by the broadcast of an input scalar
      • rotateL

        public final LongVector rotateL​(int s,
                                        Mask<Long> m)
        Rotates left this vector by the broadcast of an input scalar, selecting lane elements controlled by a mask.

        This is a vector binary operation where the operation Long.rotateLeft(long, int) is applied to lane elements and where lane elements of this vector apply to the first argument, and lane elements of the broadcast vector apply to the second argument (the rotation distance).

        Parameters:
        s - the input scalar; the number of the bits to rotate left
        m - the mask controlling lane selection
        Returns:
        the result of rotating left this vector by the broadcast of an input scalar
      • rotateR

        public final LongVector rotateR​(int s)
        Rotates right this vector by the broadcast of an input scalar.

        This is a vector binary operation where the operation Long.rotateRight(long, int) is applied to lane elements and where lane elements of this vector apply to the first argument, and lane elements of the broadcast vector apply to the second argument (the rotation distance).

        Parameters:
        s - the input scalar; the number of the bits to rotate right
        Returns:
        the result of rotating right this vector by the broadcast of an input scalar
      • rotateR

        public final LongVector rotateR​(int s,
                                        Mask<Long> m)
        Rotates right this vector by the broadcast of an input scalar, selecting lane elements controlled by a mask.

        This is a vector binary operation where the operation Long.rotateRight(long, int) is applied to lane elements and where lane elements of this vector apply to the first argument, and lane elements of the broadcast vector apply to the second argument (the rotation distance).

        Parameters:
        s - the input scalar; the number of the bits to rotate right
        m - the mask controlling lane selection
        Returns:
        the result of rotating right this vector by the broadcast of an input scalar
      • addAll

        public abstract long addAll()
        Adds all lane elements of this vector.

        This is an associative vector reduction operation where the addition operation (+) is applied to lane elements, and the identity value is 0.

        Returns:
        the addition of all the lane elements of this vector
      • addAll

        public abstract long addAll​(Mask<Long> m)
        Adds all lane elements of this vector, selecting lane elements controlled by a mask.

        This is an associative vector reduction operation where the addition operation (+) is applied to lane elements, and the identity value is 0.

        Parameters:
        m - the mask controlling lane selection
        Returns:
        the addition of the selected lane elements of this vector
      • mulAll

        public abstract long mulAll()
        Multiplies all lane elements of this vector.

        This is an associative vector reduction operation where the multiplication operation (*) is applied to lane elements, and the identity value is 1.

        Returns:
        the multiplication of all the lane elements of this vector
      • mulAll

        public abstract long mulAll​(Mask<Long> m)
        Multiplies all lane elements of this vector, selecting lane elements controlled by a mask.

        This is an associative vector reduction operation where the multiplication operation (*) is applied to lane elements, and the identity value is 1.

        Parameters:
        m - the mask controlling lane selection
        Returns:
        the multiplication of all the lane elements of this vector
      • minAll

        public abstract long minAll()
        Returns the minimum lane element of this vector.

        This is an associative vector reduction operation where the operation (a, b) -> Math.min(a, b) is applied to lane elements, and the identity value is Long.MAX_VALUE.

        Returns:
        the minimum lane element of this vector
      • minAll

        public abstract long minAll​(Mask<Long> m)
        Returns the minimum lane element of this vector, selecting lane elements controlled by a mask.

        This is an associative vector reduction operation where the operation (a, b) -> Math.min(a, b) is applied to lane elements, and the identity value is Long.MAX_VALUE.

        Parameters:
        m - the mask controlling lane selection
        Returns:
        the minimum lane element of this vector
      • maxAll

        public abstract long maxAll()
        Returns the maximum lane element of this vector.

        This is an associative vector reduction operation where the operation (a, b) -> Math.max(a, b) is applied to lane elements, and the identity value is Long.MIN_VALUE.

        Returns:
        the maximum lane element of this vector
      • maxAll

        public abstract long maxAll​(Mask<Long> m)
        Returns the maximum lane element of this vector, selecting lane elements controlled by a mask.

        This is an associative vector reduction operation where the operation (a, b) -> Math.max(a, b) is applied to lane elements, and the identity value is Long.MIN_VALUE.

        Parameters:
        m - the mask controlling lane selection
        Returns:
        the maximum lane element of this vector
      • orAll

        public abstract long orAll()
        Logically ORs all lane elements of this vector.

        This is an associative vector reduction operation where the logical OR operation (|) is applied to lane elements, and the identity value is 0.

        Returns:
        the logical OR all the lane elements of this vector
      • orAll

        public abstract long orAll​(Mask<Long> m)
        Logically ORs all lane elements of this vector, selecting lane elements controlled by a mask.

        This is an associative vector reduction operation where the logical OR operation (|) is applied to lane elements, and the identity value is 0.

        Parameters:
        m - the mask controlling lane selection
        Returns:
        the logical OR all the lane elements of this vector
      • andAll

        public abstract long andAll()
        Logically ANDs all lane elements of this vector.

        This is an associative vector reduction operation where the logical AND operation (|) is applied to lane elements, and the identity value is -1.

        Returns:
        the logical AND all the lane elements of this vector
      • andAll

        public abstract long andAll​(Mask<Long> m)
        Logically ANDs all lane elements of this vector, selecting lane elements controlled by a mask.

        This is an associative vector reduction operation where the logical AND operation (|) is applied to lane elements, and the identity value is -1.

        Parameters:
        m - the mask controlling lane selection
        Returns:
        the logical AND all the lane elements of this vector
      • xorAll

        public abstract long xorAll()
        Logically XORs all lane elements of this vector.

        This is an associative vector reduction operation where the logical XOR operation (^) is applied to lane elements, and the identity value is 0.

        Returns:
        the logical XOR all the lane elements of this vector
      • xorAll

        public abstract long xorAll​(Mask<Long> m)
        Logically XORs all lane elements of this vector, selecting lane elements controlled by a mask.

        This is an associative vector reduction operation where the logical XOR operation (^) is applied to lane elements, and the identity value is 0.

        Parameters:
        m - the mask controlling lane selection
        Returns:
        the logical XOR all the lane elements of this vector
      • get

        public abstract long get​(int i)
        Gets the lane element at lane index i
        Parameters:
        i - the lane index
        Returns:
        the lane element at lane index i
        Throws:
        IllegalArgumentException - if the index is is out of range (< 0 || >= length())
      • with

        public abstract LongVector with​(int i,
                                        long e)
        Replaces the lane element of this vector at lane index i with value e.

        This is a cross-lane operation and behaves as if it returns the result of blending this vector with an input vector that is the result of broadcasting e and a mask that has only one lane set at lane index i.

        Parameters:
        i - the lane index of the lane element to be replaced
        e - the value to be placed
        Returns:
        the result of replacing the lane element of this vector at lane index i with value e.
        Throws:
        IllegalArgumentException - if the index is is out of range (< 0 || >= length())
      • toArray

        public final long[] toArray()
        Returns an array containing the lane elements of this vector.

        This method behaves as if it intoArray(long[], int) stores} this vector into an allocated array and returns the array as follows:

        
           long[] a = new long[this.length()];
           this.intoArray(a, 0);
           return a;
         
        Returns:
        an array containing the the lane elements of this vector
      • intoArray

        public abstract void intoArray​(long[] a,
                                       int i)
        Stores this vector into an array starting at offset.

        For each vector lane, where N is the vector lane index, the lane element at index N is stored into the array at index i + N.

        Parameters:
        a - the array
        i - the offset into the array
        Throws:
        IndexOutOfBoundsException - if i < 0, or i > a.length - this.length()
      • intoArray

        public abstract void intoArray​(long[] a,
                                       int i,
                                       Mask<Long> m)
        Stores this vector into an array starting at offset and using a mask.

        For each vector lane, where N is the vector lane index, if the mask lane at index N is set then the lane element at index N is stored into the array index i + N.

        Parameters:
        a - the array
        i - the offset into the array
        m - the mask
        Throws:
        IndexOutOfBoundsException - if i < 0, or for any vector lane index N where the mask at lane N is set i >= a.length - N
      • intoArray

        public abstract void intoArray​(long[] a,
                                       int i,
                                       int[] indexMap,
                                       int j)
        Stores this vector into an array using indexes obtained from an index map.

        For each vector lane, where N is the vector lane index, the lane element at index N is stored into the array at index i + indexMap[j + N].

        Parameters:
        a - the array
        i - the offset into the array, may be negative if relative indexes in the index map compensate to produce a value within the array bounds
        indexMap - the index map
        j - the offset into the index map
        Throws:
        IndexOutOfBoundsException - if j < 0, or j > indexMap.length - this.length(), or for any vector lane index N the result of i + indexMap[j + N] is < 0 or >= a.length
      • intoArray

        public abstract void intoArray​(long[] a,
                                       int i,
                                       Mask<Long> m,
                                       int[] indexMap,
                                       int j)
        Stores this vector into an array using indexes obtained from an index map and using a mask.

        For each vector lane, where N is the vector lane index, if the mask lane at index N is set then the lane element at index N is stored into the array at index i + indexMap[j + N].

        Parameters:
        a - the array
        i - the offset into the array, may be negative if relative indexes in the index map compensate to produce a value within the array bounds
        m - the mask
        indexMap - the index map
        j - the offset into the index map
        Throws:
        IndexOutOfBoundsException - if j < 0, or j > indexMap.length - this.length(), or for any vector lane index N where the mask at lane N is set the result of i + indexMap[j + N] is < 0 or >= a.length