Class ByteVector


  • public abstract class ByteVector
    extends Vector<Byte>
    A specialized Vector representing an ordered immutable sequence of byte values.
    • Method Detail

      • zero

        public static ByteVector zero​(VectorSpecies<Byte> 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 ByteVector fromByteArray​(VectorSpecies<Byte> species,
                                               byte[] a,
                                               int offset)
        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 fromByteBuffer(species, ByteBuffer.wrap(a), offset, VectorMask.allTrue());
         
        Parameters:
        species - species of desired vector
        a - the byte array
        offset - the offset into the array
        Returns:
        a vector loaded from a byte array
        Throws:
        IndexOutOfBoundsException - if i < 0 or offset > a.length - (species.length() * species.elementSize() / Byte.SIZE)
      • fromByteArray

        public static ByteVector fromByteArray​(VectorSpecies<Byte> species,
                                               byte[] a,
                                               int offset,
                                               VectorMask<Byte> 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 fromByteBuffer(species, ByteBuffer.wrap(a), offset, m);
         
        Parameters:
        species - species of desired vector
        a - the byte array
        offset - the offset into the array
        m - the mask
        Returns:
        a vector loaded from a byte array
        Throws:
        IndexOutOfBoundsException - if offset < 0 or for any vector lane index N where the mask at lane N is set offset >= a.length - (N * species.elementSize() / Byte.SIZE)
      • fromArray

        public static ByteVector fromArray​(VectorSpecies<Byte> species,
                                           byte[] a,
                                           int offset)
        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 offset + N is placed into the resulting vector at lane index N.

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

        public static ByteVector fromArray​(VectorSpecies<Byte> species,
                                           byte[] a,
                                           int offset,
                                           VectorMask<Byte> 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 offset + 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
        offset - the offset into the array
        m - the mask
        Returns:
        the vector loaded from an array
        Throws:
        IndexOutOfBoundsException - if offset < 0, or for any vector lane index N where the mask at lane N is set offset > a.length - N
      • fromArray

        public static ByteVector fromArray​(VectorSpecies<Byte> species,
                                           byte[] a,
                                           int a_offset,
                                           int[] indexMap,
                                           int i_offset)
        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 a_offset + indexMap[i_offset + N] is placed into the resulting vector at lane index N.

        Parameters:
        species - species of desired vector
        a - the array
        a_offset - 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
        i_offset - the offset into the index map
        Returns:
        the vector loaded from an array
        Throws:
        IndexOutOfBoundsException - if i_offset < 0, or i_offset > indexMap.length - species.length(), or for any vector lane index N the result of a_offset + indexMap[i_offset + N] is < 0 or >= a.length
      • fromArray

        public static ByteVector fromArray​(VectorSpecies<Byte> species,
                                           byte[] a,
                                           int a_offset,
                                           VectorMask<Byte> m,
                                           int[] indexMap,
                                           int i_offset)
        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 a_offset + indexMap[i_offset + N] is placed into the resulting vector at lane index N.

        Parameters:
        species - species of desired vector
        a - the array
        a_offset - 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
        i_offset - the offset into the index map
        Returns:
        the vector loaded from an array
        Throws:
        IndexOutOfBoundsException - if i_offset < 0, or i_offset > indexMap.length - species.length(), or for any vector lane index N where the mask at lane N is set the result of a_offset + indexMap[i_offset + N] is < 0 or >= a.length
      • fromByteBuffer

        public static ByteVector fromByteBuffer​(VectorSpecies<Byte> species,
                                                ByteBuffer bb,
                                                int offset)
        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(VectorSpecies, ByteBuffer, int, VectorMask) method} as follows:

        
           return fromByteBuffer(b, offset, VectorMask.allTrue())
         
        Parameters:
        species - species of desired vector
        bb - the byte buffer
        offset - 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 species.length() * species.elementSize() / Byte.SIZE bytes remaining in the byte buffer from the given offset
      • fromByteBuffer

        public static ByteVector fromByteBuffer​(VectorSpecies<Byte> species,
                                                ByteBuffer bb,
                                                int offset,
                                                VectorMask<Byte> 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 EBuffer is the primitive buffer type, e is the primitive element type, and ESpecies is the primitive species for e:

        
         EBuffer eb = b.duplicate().
             order(ByteOrder.nativeOrder()).position(offset).
             asEBuffer();
         e[] es = new e[species.length()];
         for (int n = 0; n < t.length; n++) {
             if (m.isSet(n))
                 es[n] = eb.get(n);
         }
         EVector r = EVector.fromArray(es, 0, m);
         
        Parameters:
        species - species of desired vector
        bb - the byte buffer
        offset - 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 offset >= b.limit() - (N * species.elementSize() / Byte.SIZE)
      • broadcast

        public static ByteVector broadcast​(VectorSpecies<Byte> species,
                                           byte e)
        Returns a vector where all lane elements are set to the primitive value e.
        Parameters:
        species - species of the desired vector
        e - the value to be broadcasted
        Returns:
        a vector of vector where all lane elements are set to the primitive value e
      • scalars

        public static ByteVector scalars​(VectorSpecies<Byte> species,
                                         byte... es)
        Returns a vector where each lane element is set to given primitive values.

        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:
        species - species of the desired vector
        es - the given primitive values
        Returns:
        a vector where each lane element is set to given primitive values
        Throws:
        IndexOutOfBoundsException - if es.length < species.length()
      • single

        public static final ByteVector single​(VectorSpecies<Byte> species,
                                              byte 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:
        species - 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 ByteVector random​(VectorSpecies<Byte> species)
        Returns a vector where each lane element is set to a randomly generated primitive value. The semantics are equivalent to calling (byte)ThreadLocalRandom.nextInt()
        Parameters:
        species - species of the desired vector
        Returns:
        a vector where each lane elements is set to a randomly generated primitive value
      • add

        public abstract ByteVector add​(Vector<Byte> v)
        Adds this vector to an input vector.

        This is a lane-wise binary operation which applies the primitive addition operation (+) to each lane.

        Specified by:
        add in class Vector<Byte>
        Parameters:
        v - the input vector
        Returns:
        the result of adding this vector to the input vector
      • add

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

        This is a lane-wise binary operation which applies the primitive addition operation (+) to each lane.

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

        public abstract ByteVector add​(Vector<Byte> v,
                                       VectorMask<Byte> m)
        Adds this vector to an input vector, selecting lane elements controlled by a mask.

        This is a lane-wise binary operation which applies the primitive addition operation (+) to each lane.

        Specified by:
        add in class Vector<Byte>
        Parameters:
        v - the input vector
        m - the mask controlling lane selection
        Returns:
        the result of adding this vector to the given vector
      • add

        public abstract ByteVector add​(byte s,
                                       VectorMask<Byte> m)
        Adds this vector to broadcast of an input scalar, selecting lane elements controlled by a mask.

        This is a lane-wise binary operation which applies the primitive addition operation (+) to each lane.

        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 ByteVector sub​(Vector<Byte> v)
        Subtracts an input vector from this vector.

        This is a lane-wise binary operation which applies the primitive subtraction operation (-) to each lane.

        Specified by:
        sub in class Vector<Byte>
        Parameters:
        v - the input vector
        Returns:
        the result of subtracting the input vector from this vector
      • sub

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

        This is a lane-wise binary operation which applies the primitive subtraction operation (-) to each lane.

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

        public abstract ByteVector sub​(Vector<Byte> v,
                                       VectorMask<Byte> m)
        Subtracts an input vector from this vector, selecting lane elements controlled by a mask.

        This is a lane-wise binary operation which applies the primitive subtraction operation (-) to each lane.

        Specified by:
        sub in class Vector<Byte>
        Parameters:
        v - the input vector
        m - the mask controlling lane selection
        Returns:
        the result of subtracting the input vector from this vector
      • sub

        public abstract ByteVector sub​(byte s,
                                       VectorMask<Byte> m)
        Subtracts the broadcast of an input scalar from this vector, selecting lane elements controlled by a mask.

        This is a lane-wise binary operation which applies the primitive subtraction operation (-) to each lane.

        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 ByteVector mul​(Vector<Byte> v)
        Multiplies this vector with an input vector.

        This is a lane-wise binary operation which applies the primitive multiplication operation (*) to each lane.

        Specified by:
        mul in class Vector<Byte>
        Parameters:
        v - the input vector
        Returns:
        the result of multiplying this vector with the input vector
      • mul

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

        This is a lane-wise binary operation which applies the primitive multiplication operation (*) to each lane.

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

        public abstract ByteVector mul​(Vector<Byte> v,
                                       VectorMask<Byte> m)
        Multiplies this vector with an input vector, selecting lane elements controlled by a mask.

        This is a lane-wise binary operation which applies the primitive multiplication operation (*) to each lane.

        Specified by:
        mul in class Vector<Byte>
        Parameters:
        v - the input vector
        m - the mask controlling lane selection
        Returns:
        the result of multiplying this vector with the input vector
      • mul

        public abstract ByteVector mul​(byte s,
                                       VectorMask<Byte> m)
        Multiplies this vector with the broadcast of an input scalar, selecting lane elements controlled by a mask.

        This is a lane-wise binary operation which applies the primitive multiplication operation (*) to each lane.

        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
      • neg

        public abstract ByteVector neg()
        Negates this vector.

        This is a lane-wise unary operation which applies the primitive negation operation (-) to each lane.

        Specified by:
        neg in class Vector<Byte>
        Returns:
        the negation this vector
      • neg

        public abstract ByteVector neg​(VectorMask<Byte> m)
        Negates this vector, selecting lane elements controlled by a mask.

        This is a lane-wise unary operation which applies the primitive negation operation (-) to each lane.

        Specified by:
        neg in class Vector<Byte>
        Parameters:
        m - the mask controlling lane selection
        Returns:
        the negation this vector
      • abs

        public abstract ByteVector abs()
        Returns the modulus of this vector.

        This is a lane-wise unary operation which applies the operation (a) -> (a < 0) ? -a : a to each lane.

        Specified by:
        abs in class Vector<Byte>
        Returns:
        the modulus this vector
      • abs

        public abstract ByteVector abs​(VectorMask<Byte> m)
        Returns the modulus of this vector, selecting lane elements controlled by a mask.

        This is a lane-wise unary operation which applies the operation (a) -> (a < 0) ? -a : a to each lane.

        Specified by:
        abs in class Vector<Byte>
        Parameters:
        m - the mask controlling lane selection
        Returns:
        the modulus this vector
      • min

        public abstract ByteVector min​(Vector<Byte> v)
        Returns the minimum of this vector and an input vector.

        This is a lane-wise binary operation which applies the operation (a, b) -> a < b ? a : b to each lane.

        Specified by:
        min in class Vector<Byte>
        Parameters:
        v - the input vector
        Returns:
        the minimum of this vector and the input vector
      • min

        public abstract ByteVector min​(Vector<Byte> v,
                                       VectorMask<Byte> m)
        Returns the minimum of this vector and an input vector, selecting lane elements controlled by a mask.

        This is a lane-wise binary operation which applies the operation (a, b) -> a < b ? a : b to each lane.

        Specified by:
        min in class Vector<Byte>
        Parameters:
        v - the input vector
        m - the mask controlling lane selection
        Returns:
        the minimum of this vector and the input vector
      • min

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

        This is a lane-wise binary operation which applies the operation (a, b) -> Math.min(a, b) to each lane.

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

        public abstract ByteVector max​(Vector<Byte> v)
        Returns the maximum of this vector and an input vector.

        This is a lane-wise binary operation which applies the operation (a, b) -> a > b ? a : b to each lane.

        Specified by:
        max in class Vector<Byte>
        Parameters:
        v - the input vector
        Returns:
        the maximum of this vector and the input vector
      • max

        public abstract ByteVector max​(Vector<Byte> v,
                                       VectorMask<Byte> m)
        Returns the maximum of this vector and an input vector, selecting lane elements controlled by a mask.

        This is a lane-wise binary operation which applies the operation (a, b) -> a > b ? a : b to each lane.

        Specified by:
        max in class Vector<Byte>
        Parameters:
        v - the input vector
        m - the mask controlling lane selection
        Returns:
        the maximum of this vector and the input vector
      • max

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

        This is a lane-wise binary operation which applies the operation (a, b) -> Math.max(a, b) to each lane.

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

        public abstract VectorMask<Byte> equal​(Vector<Byte> v)
        Tests if this vector is equal to an input vector.

        This is a lane-wise binary test operation which applies the primitive equals operation (==) to each lane.

        Specified by:
        equal in class Vector<Byte>
        Parameters:
        v - the input vector
        Returns:
        the result mask of testing if this vector is equal to the input vector
      • equal

        public abstract VectorMask<Byte> equal​(byte s)
        Tests if this vector is equal to the broadcast of an input scalar.

        This is a lane-wise binary test operation which applies the primitive equals operation (==) each lane.

        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 VectorMask<Byte> notEqual​(Vector<Byte> v)
        Tests if this vector is not equal to an input vector.

        This is a lane-wise binary test operation which applies the primitive not equals operation (!=) to each lane.

        Specified by:
        notEqual in class Vector<Byte>
        Parameters:
        v - the input vector
        Returns:
        the result mask of testing if this vector is not equal to the input vector
      • notEqual

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

        This is a lane-wise binary test operation which applies the primitive not equals operation (!=) to each lane.

        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 VectorMask<Byte> lessThan​(Vector<Byte> v)
        Tests if this vector is less than an input vector.

        This is a lane-wise binary test operation which applies the primitive less than operation (<) to each lane.

        Specified by:
        lessThan in class Vector<Byte>
        Parameters:
        v - the input vector
        Returns:
        the mask result of testing if this vector is less than the input vector
      • lessThan

        public abstract VectorMask<Byte> lessThan​(byte s)
        Tests if this vector is less than the broadcast of an input scalar.

        This is a lane-wise binary test operation which applies the primitive less than operation (<) to each lane.

        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 VectorMask<Byte> lessThanEq​(Vector<Byte> v)
        Tests if this vector is less or equal to an input vector.

        This is a lane-wise binary test operation which applies the primitive less than or equal to operation (<=) to each lane.

        Specified by:
        lessThanEq in class Vector<Byte>
        Parameters:
        v - the input vector
        Returns:
        the mask result of testing if this vector is less than or equal to the input vector
      • lessThanEq

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

        This is a lane-wise binary test operation which applies the primitive less than or equal to operation (<=) to each lane.

        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 VectorMask<Byte> greaterThan​(Vector<Byte> v)
        Tests if this vector is greater than an input vector.

        This is a lane-wise binary test operation which applies the primitive greater than operation (>) to each lane.

        Specified by:
        greaterThan in class Vector<Byte>
        Parameters:
        v - the input vector
        Returns:
        the mask result of testing if this vector is greater than the input vector
      • greaterThan

        public abstract VectorMask<Byte> greaterThan​(byte s)
        Tests if this vector is greater than the broadcast of an input scalar.

        This is a lane-wise binary test operation which applies the primitive greater than operation (>) to each lane.

        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 VectorMask<Byte> greaterThanEq​(Vector<Byte> v)
        Tests if this vector is greater than or equal to an input vector.

        This is a lane-wise binary test operation which applies the primitive greater than or equal to operation (>=) to each lane.

        Specified by:
        greaterThanEq in class Vector<Byte>
        Parameters:
        v - the input vector
        Returns:
        the mask result of testing if this vector is greater than or equal to the given vector
      • greaterThanEq

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

        This is a lane-wise binary test operation which applies the primitive greater than or equal to operation (>=) to each lane.

        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 ByteVector blend​(Vector<Byte> v,
                                         VectorMask<Byte> m)
        Blends the lane elements of this vector with those of an input vector, 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 lane element at N from this vector is selected and placed into the resulting vector at N.

        Specified by:
        blend in class Vector<Byte>
        Parameters:
        v - the input vector
        m - the mask controlling lane selection
        Returns:
        the result of blending the lane elements of this vector with those of an input vector
      • blend

        public abstract ByteVector blend​(byte s,
                                         VectorMask<Byte> 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
      • rearrange

        public abstract ByteVector rearrange​(Vector<Byte> v,
                                             VectorShuffle<Byte> s,
                                             VectorMask<Byte> m)
        Rearranges the lane elements of this vector and those of an input vector, selecting lane indexes controlled by shuffles and a mask.

        This is a cross-lane operation that rearranges the lane elements of this vector and the input vector. This method behaves as if it rearranges each vector with the corresponding shuffle and then blends the two results with the mask:

        
         return this.rearrange(s1).blend(v.rearrange(s2), m);
         
        Specified by:
        rearrange in class Vector<Byte>
        Parameters:
        v - the input vector
        s - the shuffle controlling lane index selection of the input vector if corresponding mask lanes are set, otherwise controlling lane index selection of this vector
        m - the mask controlling shuffled lane selection
        Returns:
        the rearrangement of lane elements of this vector and those of an input vector
      • rearrange

        public abstract ByteVector rearrange​(VectorShuffle<Byte> m)
        Rearranges the lane elements of this vector selecting lane indexes controlled by a shuffle.

        This is a cross-lane operation that rearranges the lane elements of this vector. For each lane of the shuffle, at lane index N with lane element I, the lane element at I from this vector is selected and placed into the resulting vector at N.

        Specified by:
        rearrange in class Vector<Byte>
        Parameters:
        m - the shuffle controlling lane index selection
        Returns:
        the rearrangement of the lane elements of this vector
      • reshape

        public abstract ByteVector reshape​(VectorSpecies<Byte> s)
        Transforms this vector to a vector of same element type but different shape identified by species.

        The lane elements of this vector are copied without modification to the resulting vector, but those lane elements, before copying, may be truncated if this vector's length is greater than the desired vector's length, or appended to with default element values if this vector's length is less than desired vector's length.

        The method behaves as if this vector is stored into a byte array and then the returned vector is loaded from the byte array. The following pseudocode expresses the behavior:

        
         int alen = Math.max(this.bitSize(), s.bitSize()) / Byte.SIZE;
         byte[] a = new byte[alen];
         this.intoByteArray(a, 0);
         return $type$Vector.fromByteArray(s, a, 0);
         
        Specified by:
        reshape in class Vector<Byte>
        Parameters:
        s - species of the desired vector
        Returns:
        a vector transformed, by shape, from this vector
        See Also:
        Vector.reinterpret(VectorSpecies), Vector.cast(VectorSpecies)
      • rotateLanesLeft

        public abstract ByteVector rotateLanesLeft​(int i)
        Rotates left the lane elements of this vector by the given number of lanes, i, modulus the vector length.

        This is a cross-lane operation that permutes the lane elements of this vector. For each lane of the input vector, at lane index N, the lane element is placed into the result vector at lane index (N + i) % length().

        Specified by:
        rotateLanesLeft in class Vector<Byte>
        Parameters:
        i - the number of lanes to rotate left
        Returns:
        the result of rotating left lane elements of this vector by the given number of lanes
      • rotateLanesRight

        public abstract ByteVector rotateLanesRight​(int i)
        Rotates right the lane elements of this vector by the given number of lanes, i, modulus the vector length.

        This is a cross-lane operation that permutes the lane elements of this vector. For each lane of the input vector, at lane index N, the lane element is placed into the result vector at lane index (N + length() - (i % length())) % length()

        Specified by:
        rotateLanesRight in class Vector<Byte>
        Parameters:
        i - the number of lanes to rotate right
        Returns:
        the result of rotating right lane elements of this vector by the given number of lanes
      • shiftLanesLeft

        public abstract ByteVector shiftLanesLeft​(int i)
        Shift left the lane elements of this vector by the given number of lanes, i, modulus the vector length.

        This is a cross-lane operation that permutes the lane elements of this vector and behaves as if rotating left the lane elements by i, and then the zero value is placed into the result vector at lane indexes less than i % length().

        Specified by:
        shiftLanesLeft in class Vector<Byte>
        Parameters:
        i - the number of lanes to shift left
        Returns:
        the result of shifting left lane elements of this vector by the given number of lanes
      • shiftLanesRight

        public abstract ByteVector shiftLanesRight​(int i)
        Shift right the lane elements of this vector by the given number of lanes, i, modulus the vector length.

        This is a cross-lane operation that permutes the lane elements of this vector and behaves as if rotating right the lane elements by i, and then the zero value is placed into the result vector at lane indexes greater or equal to length() - (i % length()).

        Specified by:
        shiftLanesRight in class Vector<Byte>
        Parameters:
        i - the number of lanes to shift right
        Returns:
        the result of shifting right lane elements of this vector by the given number of lanes
      • and

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

        This is a lane-wise binary operation which applies the primitive bitwise AND operation (&) to each lane.

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

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

        This is a lane-wise binary operation which applies the primitive bitwise AND operation (&) to each lane.

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

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

        This is a lane-wise binary operation which applies the primitive bitwise AND operation (&) to each lane.

        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 ByteVector and​(byte s,
                                       VectorMask<Byte> m)
        Bitwise ANDs this vector with the broadcast of an input scalar, selecting lane elements controlled by a mask.

        This is a lane-wise binary operation which applies the primitive bitwise AND operation (&) to each lane.

        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 ByteVector or​(Vector<Byte> v)
        Bitwise ORs this vector with an input vector.

        This is a lane-wise binary operation which applies the primitive bitwise OR operation (|) to each lane.

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

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

        This is a lane-wise binary operation which applies the primitive bitwise OR operation (|) to each lane.

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

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

        This is a lane-wise binary operation which applies the primitive bitwise OR operation (|) to each lane.

        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 ByteVector or​(byte s,
                                      VectorMask<Byte> m)
        Bitwise ORs this vector with the broadcast of an input scalar, selecting lane elements controlled by a mask.

        This is a lane-wise binary operation which applies the primitive bitwise OR operation (|) to each lane.

        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 ByteVector xor​(Vector<Byte> v)
        Bitwise XORs this vector with an input vector.

        This is a lane-wise binary operation which applies the primitive bitwise XOR operation (^) to each lane.

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

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

        This is a lane-wise binary operation which applies the primitive bitwise XOR operation (^) to each lane.

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

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

        This is a lane-wise binary operation which applies the primitive bitwise XOR operation (^) to each lane.

        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 ByteVector xor​(byte s,
                                       VectorMask<Byte> m)
        Bitwise XORs this vector with the broadcast of an input scalar, selecting lane elements controlled by a mask.

        This is a lane-wise binary operation which applies the primitive bitwise XOR operation (^) to each lane.

        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 ByteVector not()
        Bitwise NOTs this vector.

        This is a lane-wise unary operation which applies the primitive bitwise NOT operation (~) to each lane.

        Returns:
        the bitwise NOT of this vector
      • not

        public abstract ByteVector not​(VectorMask<Byte> m)
        Bitwise NOTs this vector, selecting lane elements controlled by a mask.

        This is a lane-wise unary operation which applies the primitive bitwise NOT operation (~) to each lane.

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

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

        This is a lane-wise binary operation which applies the primitive logical left shift operation (<<) to each lane to left shift the element by shift value as specified by the input scalar. Only the 3 lowest-order bits of shift value are used. It is as if the shift value were subjected to a bitwise logical AND operator (&) with the mask value 0x7. The shift distance actually used is therefore always in the range 0 to 7, inclusive.

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

        public abstract ByteVector shiftLeft​(int s,
                                             VectorMask<Byte> m)
        Logically left shifts this vector by the broadcast of an input scalar, selecting lane elements controlled by a mask.

        This is a lane-wise binary operation which applies the primitive logical left shift operation (<<) to each lane to left shift the element by shift value as specified by the input scalar. Only the 3 lowest-order bits of shift value are used. It is as if the shift value were subjected to a bitwise logical AND operator (&) with the mask value 0x7. The shift distance actually used is therefore always in the range 0 to 7, inclusive.

        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
      • shiftLeft

        public abstract ByteVector shiftLeft​(Vector<Byte> v)
        Logically left shifts this vector by an input vector.

        This is a lane-wise binary operation which applies the primitive logical left shift operation (<<) to each lane. For each lane of this vector, the shift value is the corresponding lane of input vector. Only the 3 lowest-order bits of shift value are used. It is as if the shift value were subjected to a bitwise logical AND operator (&) with the mask value 0x7. The shift distance actually used is therefore always in the range 0 to 7, inclusive.

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

        public ByteVector shiftLeft​(Vector<Byte> v,
                                    VectorMask<Byte> m)
        Logically left shifts this vector by an input vector, selecting lane elements controlled by a mask.

        This is a lane-wise binary operation which applies the primitive logical left shift operation (<<) to each lane. For each lane of this vector, the shift value is the corresponding lane of input vector. Only the 3 lowest-order bits of shift value are used. It is as if the shift value were subjected to a bitwise logical AND operator (&) with the mask value 0x7. The shift distance actually used is therefore always in the range 0 to 7, inclusive.

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

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

        This is a lane-wise binary operation which applies the primitive logical right shift operation (>>>) to each lane to logically right shift the element by shift value as specified by the input scalar. Only the 3 lowest-order bits of shift value are used. It is as if the shift value were subjected to a bitwise logical AND operator (&) with the mask value 0x7. The shift distance actually used is therefore always in the range 0 to 7, inclusive.

        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
      • shiftRight

        public abstract ByteVector shiftRight​(int s,
                                              VectorMask<Byte> 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 lane-wise binary operation which applies the primitive logical right shift operation (>>) to each lane to logically right shift the element by shift value as specified by the input scalar. Only the 3 lowest-order bits of shift value are used. It is as if the shift value were subjected to a bitwise logical AND operator (&) with the mask value 0x7. The shift distance actually used is therefore always in the range 0 to 7, inclusive.

        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
      • shiftRight

        public abstract ByteVector shiftRight​(Vector<Byte> v)
        Logically right shifts (or unsigned right shifts) this vector by an input vector.

        This is a lane-wise binary operation which applies the primitive logical right shift operation (>>>) to each lane. For each lane of this vector, the shift value is the corresponding lane of input vector. Only the 3 lowest-order bits of shift value are used. It is as if the shift value were subjected to a bitwise logical AND operator (&) with the mask value 0x7. The shift distance actually used is therefore always in the range 0 to 7, inclusive.

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

        public ByteVector shiftRight​(Vector<Byte> v,
                                     VectorMask<Byte> m)
        Logically right shifts (or unsigned right shifts) this vector by an input vector, selecting lane elements controlled by a mask.

        This is a lane-wise binary operation which applies the primitive logical right shift operation (>>>) to each lane. For each lane of this vector, the shift value is the corresponding lane of input vector. Only the 3 lowest-order bits of shift value are used. It is as if the shift value were subjected to a bitwise logical AND operator (&) with the mask value 0x7. The shift distance actually used is therefore always in the range 0 to 7, inclusive.

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

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

        This is a lane-wise binary operation which applies the primitive arithmetic right shift operation (>>) to each lane to arithmetically right shift the element by shift value as specified by the input scalar. Only the 3 lowest-order bits of shift value are used. It is as if the shift value were subjected to a bitwise logical AND operator (&) with the mask value 0x7. The shift distance actually used is therefore always in the range 0 to 7, inclusive.

        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
      • shiftArithmeticRight

        public abstract ByteVector shiftArithmeticRight​(int s,
                                                        VectorMask<Byte> 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 lane-wise binary operation which applies the primitive arithmetic right shift operation (>>) to each lane to arithmetically right shift the element by shift value as specified by the input scalar. Only the 3 lowest-order bits of shift value are used. It is as if the shift value were subjected to a bitwise logical AND operator (&) with the mask value 0x7. The shift distance actually used is therefore always in the range 0 to 7, inclusive.

        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
      • shiftArithmeticRight

        public abstract ByteVector shiftArithmeticRight​(Vector<Byte> v)
        Arithmetically right shifts (or signed right shifts) this vector by an input vector.

        This is a lane-wise binary operation which applies the primitive arithmetic right shift operation (>>) to each lane. For each lane of this vector, the shift value is the corresponding lane of input vector. Only the 3 lowest-order bits of shift value are used. It is as if the shift value were subjected to a bitwise logical AND operator (&) with the mask value 0x7. The shift distance actually used is therefore always in the range 0 to 7, inclusive.

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

        public ByteVector shiftArithmeticRight​(Vector<Byte> v,
                                               VectorMask<Byte> m)
        Arithmetically right shifts (or signed right shifts) this vector by an input vector, selecting lane elements controlled by a mask.

        This is a lane-wise binary operation which applies the primitive arithmetic right shift operation (>>) to each lane. For each lane of this vector, the shift value is the corresponding lane of input vector. Only the 3 lowest-order bits of shift value are used. It is as if the shift value were subjected to a bitwise logical AND operator (&) with the mask value 0x7. The shift distance actually used is therefore always in the range 0 to 7, inclusive.

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

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

        This is a lane-wise binary operation which produces the result of rotating left the two's complement binary representation of each lane of first operand (this vector) by input scalar. Rotation by any multiple of 8 is a no-op, so only the 3 lowest-order bits of input value are used. It is as if the input value were subjected to a bitwise logical AND operator (&) with the mask value 0x7.

        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
      • rotateLeft

        public final ByteVector rotateLeft​(int s,
                                           VectorMask<Byte> m)
        Rotates left this vector by the broadcast of an input scalar, selecting lane elements controlled by a mask.

        This is a lane-wise binary operation which produces the result of rotating left the two's complement binary representation of each lane of first operand (this vector) by input scalar. Rotation by any multiple of 8 is a no-op, so only the 3 lowest-order bits of input value are used. It is as if the input value were subjected to a bitwise logical AND operator (&) with the mask value 0x7.

        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
      • rotateRight

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

        This is a lane-wise binary operation which produces the result of rotating right the two's complement binary representation of each lane of first operand (this vector) by input scalar. Rotation by any multiple of 8 is a no-op, so only the 3 lowest-order bits of input value are used. It is as if the input value were subjected to a bitwise logical AND operator (&) with the mask value 0x7.

        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
      • rotateRight

        public final ByteVector rotateRight​(int s,
                                            VectorMask<Byte> m)
        Rotates right this vector by the broadcast of an input scalar, selecting lane elements controlled by a mask.

        This is a lane-wise binary operation which produces the result of rotating right the two's complement binary representation of each lane of first operand (this vector) by input scalar. Rotation by any multiple of 8 is a no-op, so only the 3 lowest-order bits of input value are used. It is as if the input value were subjected to a bitwise logical AND operator (&) with the mask value 0x7.

        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
      • intoByteArray

        public abstract void intoByteArray​(byte[] a,
                                           int ix)
        Stores this vector into a byte array starting at an offset.

        Bytes are extracted from primitive lane elements according to the native byte order of the underlying platform.

        This method behaves as it calls the byte buffer, offset, and mask accepting method as follows:

        
         return this.intoByteBuffer(ByteBuffer.wrap(a), i, this.maskAllTrue());
         
        Specified by:
        intoByteArray in class Vector<Byte>
        Parameters:
        a - the byte array
        ix - the offset into the array
      • intoByteArray

        public abstract void intoByteArray​(byte[] a,
                                           int ix,
                                           VectorMask<Byte> m)
        Stores this vector into a byte array starting at an offset and using a mask.

        Bytes are extracted from primitive lane elements according to the native byte order of the underlying platform.

        This method behaves as it calls the byte buffer, offset, and mask accepting method as follows:

        
         return this.intoByteBuffer(ByteBuffer.wrap(a), i, m);
         
        Specified by:
        intoByteArray in class Vector<Byte>
        Parameters:
        a - the byte array
        ix - the offset into the array
        m - the mask controlling lane selection
      • intoByteBuffer

        public abstract void intoByteBuffer​(ByteBuffer bb,
                                            int ix)
        Stores this vector into a byte buffer starting at an offset into the byte buffer.

        Bytes are extracted from primitive lane elements according to the native byte order of the underlying platform.

        This method behaves as if it calls the byte buffer, offset, and mask accepting Vector.intoByteBuffer(ByteBuffer, int, VectorMask) method} as follows:

        
           this.intoByteBuffer(b, i, this.maskAllTrue())
         
        Specified by:
        intoByteBuffer in class Vector<Byte>
        Parameters:
        bb - the byte buffer
        ix - the offset into the byte buffer
      • intoByteBuffer

        public abstract void intoByteBuffer​(ByteBuffer bb,
                                            int ix,
                                            VectorMask<Byte> m)
        Stores this vector into 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 lane elements of this vector are put into the buffer if the corresponding mask lane is set. The following pseudocode expresses the behavior, where is the primitive buffer type, e is the primitive element type, and EVector is the primitive vector type for this vector:

        
         EBuffer eb = b.duplicate().
             order(ByteOrder.nativeOrder()).position(i).
             asEBuffer();
         e[] es = ((EVector)this).toArray();
         for (int n = 0; n < t.length; n++) {
             if (m.isSet(n)) {
                 eb.put(n, es[n]);
             }
         }
         
        Specified by:
        intoByteBuffer in class Vector<Byte>
        Parameters:
        bb - the byte buffer
        ix - the offset into the byte buffer
        m - the mask
      • addLanes

        public abstract byte addLanes()
        Adds all lane elements of this vector.

        This is an associative cross-lane reduction operation which applies the addition operation (+) to lane elements, and the identity value is 0.

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

        public abstract byte addLanes​(VectorMask<Byte> m)
        Adds all lane elements of this vector, selecting lane elements controlled by a mask.

        This is an associative cross-lane reduction operation which applies the addition operation (+) 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
      • mulLanes

        public abstract byte mulLanes()
        Multiplies all lane elements of this vector.

        This is an associative cross-lane reduction operation which applies the multiplication operation (*) to lane elements, and the identity value is 1.

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

        public abstract byte mulLanes​(VectorMask<Byte> m)
        Multiplies all lane elements of this vector, selecting lane elements controlled by a mask.

        This is an associative cross-lane reduction operation which applies the multiplication operation (*) 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
      • minLanes

        public abstract byte minLanes()
        Returns the minimum lane element of this vector.

        This is an associative cross-lane reduction operation which applies the operation (a, b) -> Math.min(a, b) to lane elements, and the identity value is Byte.MAX_VALUE.

        Returns:
        the minimum lane element of this vector
      • minLanes

        public abstract byte minLanes​(VectorMask<Byte> m)
        Returns the minimum lane element of this vector, selecting lane elements controlled by a mask.

        This is an associative cross-lane reduction operation which applies the operation (a, b) -> Math.min(a, b) to lane elements, and the identity value is Byte.MAX_VALUE.

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

        public abstract byte maxLanes()
        Returns the maximum lane element of this vector.

        This is an associative cross-lane reduction operation which applies the operation (a, b) -> Math.max(a, b) to lane elements, and the identity value is Byte.MIN_VALUE.

        Returns:
        the maximum lane element of this vector
      • maxLanes

        public abstract byte maxLanes​(VectorMask<Byte> m)
        Returns the maximum lane element of this vector, selecting lane elements controlled by a mask.

        This is an associative cross-lane reduction operation which applies the operation (a, b) -> Math.max(a, b) to lane elements, and the identity value is Byte.MIN_VALUE.

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

        public abstract byte orLanes()
        Logically ORs all lane elements of this vector.

        This is an associative cross-lane reduction operation which applies the logical OR operation (|) to lane elements, and the identity value is 0.

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

        public abstract byte orLanes​(VectorMask<Byte> m)
        Logically ORs all lane elements of this vector, selecting lane elements controlled by a mask.

        This is an associative cross-lane reduction operation which applies the logical OR operation (|) 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
      • andLanes

        public abstract byte andLanes()
        Logically ANDs all lane elements of this vector.

        This is an associative cross-lane reduction operation which applies the logical AND operation (|) to lane elements, and the identity value is -1.

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

        public abstract byte andLanes​(VectorMask<Byte> m)
        Logically ANDs all lane elements of this vector, selecting lane elements controlled by a mask.

        This is an associative cross-lane reduction operation which applies the logical AND operation (|) 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
      • xorLanes

        public abstract byte xorLanes()
        Logically XORs all lane elements of this vector.

        This is an associative cross-lane reduction operation which applies the logical XOR operation (^) to lane elements, and the identity value is 0.

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

        public abstract byte xorLanes​(VectorMask<Byte> m)
        Logically XORs all lane elements of this vector, selecting lane elements controlled by a mask.

        This is an associative cross-lane reduction operation which applies the logical XOR operation (^) 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
      • lane

        public abstract byte lane​(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 ByteVector with​(int i,
                                        byte 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 byte[] toArray()
        Returns an array containing the lane elements of this vector.

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

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

        public abstract void intoArray​(byte[] a,
                                       int offset)
        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 offset + N.

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

        public abstract void intoArray​(byte[] a,
                                       int offset,
                                       VectorMask<Byte> 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 offset + N.

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

        public void intoArray​(byte[] a,
                              int a_offset,
                              int[] indexMap,
                              int i_offset)
        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 a_offset + indexMap[i_offset + N].

        Parameters:
        a - the array
        a_offset - 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
        i_offset - the offset into the index map
        Throws:
        IndexOutOfBoundsException - if i_offset < 0, or i_offset > indexMap.length - this.length(), or for any vector lane index N the result of a_offset + indexMap[i_offset + N] is < 0 or >= a.length
      • intoArray

        public void intoArray​(byte[] a,
                              int a_offset,
                              VectorMask<Byte> m,
                              int[] indexMap,
                              int i_offset)
        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 a_offset + indexMap[i_offset + N].

        Parameters:
        a - the array
        a_offset - 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
        i_offset - the offset into the index map
        Throws:
        IndexOutOfBoundsException - if j < 0, or i_offset > indexMap.length - this.length(), or for any vector lane index N where the mask at lane N is set the result of a_offset + indexMap[i_offset + N] is < 0 or >= a.length
      • species

        public abstract VectorSpecies<Byte> species()
        Returns the species of this vector.
        Specified by:
        species in class Vector<Byte>
        Returns:
        the species of this vector