< prev index next >

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java

Print this page
rev 54658 : refactored mask and shuffle creation methods, moved classes to top-level
rev 54660 : Javadoc changes

*** 123,152 **** * Bytes are composed into primitive lane elements according to the * native byte order of the underlying platform * <p> * This method behaves as if it returns the result of calling the * byte buffer, offset, and mask accepting ! * {@link #fromByteBuffer(VectorSpecies<Double>, ByteBuffer, int, VectorMask) method} as follows: * <pre>{@code ! * return this.fromByteBuffer(ByteBuffer.wrap(a), i, this.maskAllTrue()); * }</pre> * * @param species species of desired vector * @param a the byte array ! * @param ix the offset into the array * @return a vector loaded from a byte array * @throws IndexOutOfBoundsException if {@code i < 0} or ! * {@code i > a.length - (this.length() * this.elementSize() / Byte.SIZE)} */ @ForceInline @SuppressWarnings("unchecked") ! public static DoubleVector fromByteArray(VectorSpecies<Double> species, byte[] a, int ix) { Objects.requireNonNull(a); ! ix = VectorIntrinsics.checkIndex(ix, a.length, species.bitSize() / Byte.SIZE); return VectorIntrinsics.load((Class<DoubleVector>) species.boxType(), double.class, species.length(), ! a, ((long) ix) + Unsafe.ARRAY_BYTE_BASE_OFFSET, ! a, ix, species, (c, idx, s) -> { ByteBuffer bbc = ByteBuffer.wrap(c, idx, a.length - idx).order(ByteOrder.nativeOrder()); DoubleBuffer tb = bbc.asDoubleBuffer(); return ((DoubleSpecies)s).op(i -> tb.get()); }); --- 123,152 ---- * Bytes are composed into primitive lane elements according to the * native byte order of the underlying platform * <p> * This method behaves as if it returns the result of calling the * byte buffer, offset, and mask accepting ! * {@link #fromByteBuffer(VectorSpecies, ByteBuffer, int, VectorMask) method} as follows: * <pre>{@code ! * return fromByteBuffer(species, ByteBuffer.wrap(a), offset, VectorMask.allTrue()); * }</pre> * * @param species species of desired vector * @param a the byte array ! * @param offset the offset into the array * @return a vector loaded from a byte array * @throws IndexOutOfBoundsException if {@code i < 0} or ! * {@code offset > a.length - (species.length() * species.elementSize() / Byte.SIZE)} */ @ForceInline @SuppressWarnings("unchecked") ! public static DoubleVector fromByteArray(VectorSpecies<Double> species, byte[] a, int offset) { Objects.requireNonNull(a); ! offset = VectorIntrinsics.checkIndex(offset, a.length, species.bitSize() / Byte.SIZE); return VectorIntrinsics.load((Class<DoubleVector>) species.boxType(), double.class, species.length(), ! a, ((long) offset) + Unsafe.ARRAY_BYTE_BASE_OFFSET, ! a, offset, species, (c, idx, s) -> { ByteBuffer bbc = ByteBuffer.wrap(c, idx, a.length - idx).order(ByteOrder.nativeOrder()); DoubleBuffer tb = bbc.asDoubleBuffer(); return ((DoubleSpecies)s).op(i -> tb.get()); });
*** 159,312 **** * Bytes are composed into primitive lane elements according to the * native byte order of the underlying platform. * <p> * This method behaves as if it returns the result of calling the * byte buffer, offset, and mask accepting ! * {@link #fromByteBuffer(VectorSpecies<Double>, ByteBuffer, int, VectorMask) method} as follows: * <pre>{@code ! * return this.fromByteBuffer(ByteBuffer.wrap(a), i, m); * }</pre> * * @param species species of desired vector * @param a the byte array ! * @param ix the offset into the array * @param m the mask * @return a vector loaded from a byte array ! * @throws IndexOutOfBoundsException if {@code i < 0} or ! * {@code i > a.length - (this.length() * this.elementSize() / Byte.SIZE)} ! * @throws IndexOutOfBoundsException if the offset is {@code < 0}, ! * or {@code > a.length}, * for any vector lane index {@code N} where the mask at lane {@code N} * is set ! * {@code i >= a.length - (N * this.elementSize() / Byte.SIZE)} */ @ForceInline ! public static DoubleVector fromByteArray(VectorSpecies<Double> species, byte[] a, int ix, VectorMask<Double> m) { ! return zero(species).blend(fromByteArray(species, a, ix), m); } /** * Loads a vector from an array starting at offset. * <p> * For each vector lane, where {@code N} is the vector lane index, the ! * array element at index {@code i + N} is placed into the * resulting vector at lane index {@code N}. * * @param species species of desired vector * @param a the array ! * @param i the offset into the array * @return the vector loaded from an array ! * @throws IndexOutOfBoundsException if {@code i < 0}, or ! * {@code i > a.length - this.length()} */ @ForceInline @SuppressWarnings("unchecked") ! public static DoubleVector fromArray(VectorSpecies<Double> species, double[] a, int i){ Objects.requireNonNull(a); ! i = VectorIntrinsics.checkIndex(i, a.length, species.length()); return VectorIntrinsics.load((Class<DoubleVector>) species.boxType(), double.class, species.length(), ! a, (((long) i) << ARRAY_SHIFT) + Unsafe.ARRAY_DOUBLE_BASE_OFFSET, ! a, i, species, (c, idx, s) -> ((DoubleSpecies)s).op(n -> c[idx + n])); } /** * Loads a vector from an array starting at offset and using a mask. * <p> * For each vector lane, where {@code N} is the vector lane index, * if the mask lane at index {@code N} is set then the array element at ! * index {@code i + N} is placed into the resulting vector at lane index * {@code N}, otherwise the default element value is placed into the * resulting vector at lane index {@code N}. * * @param species species of desired vector * @param a the array ! * @param i the offset into the array * @param m the mask * @return the vector loaded from an array ! * @throws IndexOutOfBoundsException if {@code i < 0}, or * for any vector lane index {@code N} where the mask at lane {@code N} ! * is set {@code i > a.length - N} */ @ForceInline ! public static DoubleVector fromArray(VectorSpecies<Double> species, double[] a, int i, VectorMask<Double> m) { ! return zero(species).blend(fromArray(species, a, i), m); } /** * Loads a vector from an array using indexes obtained from an index * map. * <p> * For each vector lane, where {@code N} is the vector lane index, the ! * array element at index {@code i + indexMap[j + N]} is placed into the * resulting vector at lane index {@code N}. * * @param species species of desired vector * @param a the array ! * @param 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 * @param indexMap the index map ! * @param j the offset into the index map * @return the vector loaded from an array ! * @throws IndexOutOfBoundsException if {@code j < 0}, or ! * {@code j > indexMap.length - this.length()}, * or for any vector lane index {@code N} the result of ! * {@code i + indexMap[j + N]} is {@code < 0} or {@code >= a.length} */ @ForceInline @SuppressWarnings("unchecked") ! public static DoubleVector fromArray(VectorSpecies<Double> species, double[] a, int i, int[] indexMap, int j) { Objects.requireNonNull(a); Objects.requireNonNull(indexMap); if (species.length() == 1) { ! return DoubleVector.fromArray(species, a, i + indexMap[j]); } ! // Index vector: vix[0:n] = k -> i + indexMap[j + k] ! IntVector vix = IntVector.fromArray(IntVector.species(species.indexShape()), indexMap, j).add(i); vix = VectorIntrinsics.checkIndex(vix, a.length); return VectorIntrinsics.loadWithMap((Class<DoubleVector>) species.boxType(), double.class, species.length(), IntVector.species(species.indexShape()).boxType(), a, Unsafe.ARRAY_DOUBLE_BASE_OFFSET, vix, ! a, i, indexMap, j, species, (double[] c, int idx, int[] iMap, int idy, VectorSpecies<Double> s) -> ((DoubleSpecies)s).op(n -> c[idx + iMap[idy+n]])); } /** * Loads a vector from an array using indexes obtained from an index * map and using a mask. * <p> * For each vector lane, where {@code N} is the vector lane index, * if the mask lane at index {@code N} is set then the array element at ! * index {@code i + indexMap[j + N]} is placed into the resulting vector * at lane index {@code N}. * * @param species species of desired vector * @param a the array ! * @param 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 * @param m the mask * @param indexMap the index map ! * @param j the offset into the index map * @return the vector loaded from an array ! * @throws IndexOutOfBoundsException if {@code j < 0}, or ! * {@code j > indexMap.length - this.length()}, * or for any vector lane index {@code N} where the mask at lane ! * {@code N} is set the result of {@code i + indexMap[j + N]} is * {@code < 0} or {@code >= a.length} */ @ForceInline @SuppressWarnings("unchecked") ! public static DoubleVector fromArray(VectorSpecies<Double> species, double[] a, int i, VectorMask<Double> m, int[] indexMap, int j) { // @@@ This can result in out of bounds errors for unset mask lanes ! return zero(species).blend(fromArray(species, a, i, indexMap, j), m); } /** * Loads a vector from a {@link ByteBuffer byte buffer} starting at an --- 159,309 ---- * Bytes are composed into primitive lane elements according to the * native byte order of the underlying platform. * <p> * This method behaves as if it returns the result of calling the * byte buffer, offset, and mask accepting ! * {@link #fromByteBuffer(VectorSpecies, ByteBuffer, int, VectorMask) method} as follows: * <pre>{@code ! * return fromByteBuffer(species, ByteBuffer.wrap(a), offset, m); * }</pre> * * @param species species of desired vector * @param a the byte array ! * @param offset the offset into the array * @param m the mask * @return a vector loaded from a byte array ! * @throws IndexOutOfBoundsException if {@code offset < 0} or * for any vector lane index {@code N} where the mask at lane {@code N} * is set ! * {@code offset >= a.length - (N * species.elementSize() / Byte.SIZE)} */ @ForceInline ! public static DoubleVector fromByteArray(VectorSpecies<Double> species, byte[] a, int offset, VectorMask<Double> m) { ! return zero(species).blend(fromByteArray(species, a, offset), m); } /** * Loads a vector from an array starting at offset. * <p> * For each vector lane, where {@code N} is the vector lane index, the ! * array element at index {@code offset + N} is placed into the * resulting vector at lane index {@code N}. * * @param species species of desired vector * @param a the array ! * @param offset the offset into the array * @return the vector loaded from an array ! * @throws IndexOutOfBoundsException if {@code offset < 0}, or ! * {@code offset > a.length - species.length()} */ @ForceInline @SuppressWarnings("unchecked") ! public static DoubleVector fromArray(VectorSpecies<Double> species, double[] a, int offset){ Objects.requireNonNull(a); ! offset = VectorIntrinsics.checkIndex(offset, a.length, species.length()); return VectorIntrinsics.load((Class<DoubleVector>) species.boxType(), double.class, species.length(), ! a, (((long) offset) << ARRAY_SHIFT) + Unsafe.ARRAY_DOUBLE_BASE_OFFSET, ! a, offset, species, (c, idx, s) -> ((DoubleSpecies)s).op(n -> c[idx + n])); } /** * Loads a vector from an array starting at offset and using a mask. * <p> * For each vector lane, where {@code N} is the vector lane index, * if the mask lane at index {@code N} is set then the array element at ! * index {@code offset + N} is placed into the resulting vector at lane index * {@code N}, otherwise the default element value is placed into the * resulting vector at lane index {@code N}. * * @param species species of desired vector * @param a the array ! * @param offset the offset into the array * @param m the mask * @return the vector loaded from an array ! * @throws IndexOutOfBoundsException if {@code offset < 0}, or * for any vector lane index {@code N} where the mask at lane {@code N} ! * is set {@code offset > a.length - N} */ @ForceInline ! public static DoubleVector fromArray(VectorSpecies<Double> species, double[] a, int offset, VectorMask<Double> m) { ! return zero(species).blend(fromArray(species, a, offset), m); } /** * Loads a vector from an array using indexes obtained from an index * map. * <p> * For each vector lane, where {@code N} is the vector lane index, the ! * array element at index {@code a_offset + indexMap[i_offset + N]} is placed into the * resulting vector at lane index {@code N}. * * @param species species of desired vector * @param a the array ! * @param 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 * @param indexMap the index map ! * @param i_offset the offset into the index map * @return the vector loaded from an array ! * @throws IndexOutOfBoundsException if {@code i_offset < 0}, or ! * {@code i_offset > indexMap.length - species.length()}, * or for any vector lane index {@code N} the result of ! * {@code a_offset + indexMap[i_offset + N]} is {@code < 0} or {@code >= a.length} */ @ForceInline @SuppressWarnings("unchecked") ! public static DoubleVector fromArray(VectorSpecies<Double> species, double[] a, int a_offset, int[] indexMap, int i_offset) { Objects.requireNonNull(a); Objects.requireNonNull(indexMap); if (species.length() == 1) { ! return DoubleVector.fromArray(species, a, a_offset + indexMap[i_offset]); } ! // Index vector: vix[0:n] = k -> a_offset + indexMap[i_offset + k] ! IntVector vix = IntVector.fromArray(IntVector.species(species.indexShape()), indexMap, i_offset).add(a_offset); vix = VectorIntrinsics.checkIndex(vix, a.length); return VectorIntrinsics.loadWithMap((Class<DoubleVector>) species.boxType(), double.class, species.length(), IntVector.species(species.indexShape()).boxType(), a, Unsafe.ARRAY_DOUBLE_BASE_OFFSET, vix, ! a, a_offset, indexMap, i_offset, species, (double[] c, int idx, int[] iMap, int idy, VectorSpecies<Double> s) -> ((DoubleSpecies)s).op(n -> c[idx + iMap[idy+n]])); } /** * Loads a vector from an array using indexes obtained from an index * map and using a mask. * <p> * For each vector lane, where {@code N} is the vector lane index, * if the mask lane at index {@code N} is set then the array element at ! * index {@code a_offset + indexMap[i_offset + N]} is placed into the resulting vector * at lane index {@code N}. * * @param species species of desired vector * @param a the array ! * @param 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 * @param m the mask * @param indexMap the index map ! * @param i_offset the offset into the index map * @return the vector loaded from an array ! * @throws IndexOutOfBoundsException if {@code i_offset < 0}, or ! * {@code i_offset > indexMap.length - species.length()}, * or for any vector lane index {@code N} where the mask at lane ! * {@code N} is set the result of {@code a_offset + indexMap[i_offset + N]} is * {@code < 0} or {@code >= a.length} */ @ForceInline @SuppressWarnings("unchecked") ! public static DoubleVector fromArray(VectorSpecies<Double> species, double[] a, int a_offset, VectorMask<Double> m, int[] indexMap, int i_offset) { // @@@ This can result in out of bounds errors for unset mask lanes ! return zero(species).blend(fromArray(species, a, a_offset, indexMap, i_offset), m); } /** * Loads a vector from a {@link ByteBuffer byte buffer} starting at an
*** 315,349 **** * Bytes are composed into primitive lane elements according to the * native byte order of the underlying platform. * <p> * This method behaves as if it returns the result of calling the * byte buffer, offset, and mask accepting ! * {@link #fromByteBuffer(VectorSpecies<Double>, ByteBuffer, int, VectorMask)} method} as follows: * <pre>{@code ! * return this.fromByteBuffer(b, i, this.maskAllTrue()) * }</pre> * * @param species species of desired vector * @param bb the byte buffer ! * @param ix the offset into the byte buffer * @return a vector loaded from a byte buffer * @throws IndexOutOfBoundsException if the offset is {@code < 0}, * or {@code > b.limit()}, * or if there are fewer than ! * {@code this.length() * this.elementSize() / Byte.SIZE} bytes * remaining in the byte buffer from the given offset */ @ForceInline @SuppressWarnings("unchecked") ! public static DoubleVector fromByteBuffer(VectorSpecies<Double> species, ByteBuffer bb, int ix) { if (bb.order() != ByteOrder.nativeOrder()) { throw new IllegalArgumentException(); } ! ix = VectorIntrinsics.checkIndex(ix, bb.limit(), species.bitSize() / Byte.SIZE); return VectorIntrinsics.load((Class<DoubleVector>) species.boxType(), double.class, species.length(), ! U.getReference(bb, BYTE_BUFFER_HB), U.getLong(bb, BUFFER_ADDRESS) + ix, ! bb, ix, species, (c, idx, s) -> { ByteBuffer bbc = c.duplicate().position(idx).order(ByteOrder.nativeOrder()); DoubleBuffer tb = bbc.asDoubleBuffer(); return ((DoubleSpecies)s).op(i -> tb.get()); }); --- 312,346 ---- * Bytes are composed into primitive lane elements according to the * native byte order of the underlying platform. * <p> * This method behaves as if it returns the result of calling the * byte buffer, offset, and mask accepting ! * {@link #fromByteBuffer(VectorSpecies, ByteBuffer, int, VectorMask)} method} as follows: * <pre>{@code ! * return fromByteBuffer(b, offset, VectorMask.allTrue()) * }</pre> * * @param species species of desired vector * @param bb the byte buffer ! * @param offset the offset into the byte buffer * @return a vector loaded from a byte buffer * @throws IndexOutOfBoundsException if the offset is {@code < 0}, * or {@code > b.limit()}, * or if there are fewer than ! * {@code species.length() * species.elementSize() / Byte.SIZE} bytes * remaining in the byte buffer from the given offset */ @ForceInline @SuppressWarnings("unchecked") ! public static DoubleVector fromByteBuffer(VectorSpecies<Double> species, ByteBuffer bb, int offset) { if (bb.order() != ByteOrder.nativeOrder()) { throw new IllegalArgumentException(); } ! offset = VectorIntrinsics.checkIndex(offset, bb.limit(), species.bitSize() / Byte.SIZE); return VectorIntrinsics.load((Class<DoubleVector>) species.boxType(), double.class, species.length(), ! U.getReference(bb, BYTE_BUFFER_HB), U.getLong(bb, BUFFER_ADDRESS) + offset, ! bb, offset, species, (c, idx, s) -> { ByteBuffer bbc = c.duplicate().position(idx).order(ByteOrder.nativeOrder()); DoubleBuffer tb = bbc.asDoubleBuffer(); return ((DoubleSpecies)s).op(i -> tb.get()); });
*** 357,481 **** * {@link java.nio.Buffer 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 ! * {@coce EBuffer} is the primitive buffer type, {@code e} is the ! * primitive element type, and {@code ESpecies<S>} is the primitive * species for {@code e}: * <pre>{@code * 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); * }</pre> * * @param species species of desired vector * @param bb the byte buffer ! * @param ix the offset into the byte buffer * @param m the mask * @return a vector loaded from a byte buffer * @throws IndexOutOfBoundsException if the offset is {@code < 0}, * or {@code > b.limit()}, * for any vector lane index {@code N} where the mask at lane {@code N} * is set ! * {@code i >= b.limit() - (N * this.elementSize() / Byte.SIZE)} */ @ForceInline ! public static DoubleVector fromByteBuffer(VectorSpecies<Double> species, ByteBuffer bb, int ix, VectorMask<Double> m) { ! return zero(species).blend(fromByteBuffer(species, bb, ix), m); } /** * Returns a vector where all lane elements are set to the primitive * value {@code e}. * ! * @param s species of the desired vector * @param e the value * @return a vector of vector where all lane elements are set to * the primitive value {@code e} */ @ForceInline @SuppressWarnings("unchecked") ! public static DoubleVector broadcast(VectorSpecies<Double> s, double e) { return VectorIntrinsics.broadcastCoerced( ! (Class<DoubleVector>) s.boxType(), double.class, s.length(), ! Double.doubleToLongBits(e), s, ((bits, sp) -> ((DoubleSpecies)sp).op(i -> Double.longBitsToDouble((long)bits)))); } /** ! * Returns a vector where each lane element is set to a given ! * primitive value. * <p> * For each vector lane, where {@code N} is the vector lane index, the * the primitive value at index {@code N} is placed into the resulting * vector at lane index {@code N}. * ! * @param s species of the desired vector * @param es the given primitive values ! * @return a vector where each lane element is set to a given primitive ! * value ! * @throws IndexOutOfBoundsException if {@code es.length < this.length()} */ @ForceInline @SuppressWarnings("unchecked") ! public static DoubleVector scalars(VectorSpecies<Double> s, double... es) { Objects.requireNonNull(es); ! int ix = VectorIntrinsics.checkIndex(0, es.length, s.length()); ! return VectorIntrinsics.load((Class<DoubleVector>) s.boxType(), double.class, s.length(), es, Unsafe.ARRAY_DOUBLE_BASE_OFFSET, ! es, ix, s, (c, idx, sp) -> ((DoubleSpecies)sp).op(n -> c[idx + n])); } /** * Returns a vector where the first lane element is set to the primtive * value {@code e}, all other lane elements are set to the default * value. * ! * @param s species of the desired vector * @param e the value * @return a vector where the first lane element is set to the primitive * value {@code e} */ @ForceInline ! public static final DoubleVector single(VectorSpecies<Double> s, double e) { ! return zero(s).with(0, e); } /** * Returns a vector where each lane element is set to a randomly * generated primitive value. * * The semantics are equivalent to calling * {@link ThreadLocalRandom#nextDouble()} * ! * @param s species of the desired vector * @return a vector where each lane elements is set to a randomly * generated primitive value */ ! public static DoubleVector random(VectorSpecies<Double> s) { ThreadLocalRandom r = ThreadLocalRandom.current(); ! return ((DoubleSpecies)s).op(i -> r.nextDouble()); } // Ops @Override public abstract DoubleVector add(Vector<Double> v); /** * Adds this vector to the broadcast of an input scalar. * <p> ! * This is a vector binary operation where the primitive addition operation ! * ({@code +}) is applied to lane elements. * * @param s the input scalar * @return the result of adding this vector to the broadcast of an input * scalar */ --- 354,478 ---- * {@link java.nio.Buffer 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 ! * {@code EBuffer} is the primitive buffer type, {@code e} is the ! * primitive element type, and {@code ESpecies} is the primitive * species for {@code e}: * <pre>{@code * 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); * }</pre> * * @param species species of desired vector * @param bb the byte buffer ! * @param offset the offset into the byte buffer * @param m the mask * @return a vector loaded from a byte buffer * @throws IndexOutOfBoundsException if the offset is {@code < 0}, * or {@code > b.limit()}, * for any vector lane index {@code N} where the mask at lane {@code N} * is set ! * {@code offset >= b.limit() - (N * species.elementSize() / Byte.SIZE)} */ @ForceInline ! public static DoubleVector fromByteBuffer(VectorSpecies<Double> species, ByteBuffer bb, int offset, VectorMask<Double> m) { ! return zero(species).blend(fromByteBuffer(species, bb, offset), m); } /** * Returns a vector where all lane elements are set to the primitive * value {@code e}. * ! * @param species species of the desired vector * @param e the value * @return a vector of vector where all lane elements are set to * the primitive value {@code e} */ @ForceInline @SuppressWarnings("unchecked") ! public static DoubleVector broadcast(VectorSpecies<Double> species, double e) { return VectorIntrinsics.broadcastCoerced( ! (Class<DoubleVector>) species.boxType(), double.class, species.length(), ! Double.doubleToLongBits(e), species, ((bits, sp) -> ((DoubleSpecies)sp).op(i -> Double.longBitsToDouble((long)bits)))); } /** ! * Returns a vector where each lane element is set to given ! * primitive values. * <p> * For each vector lane, where {@code N} is the vector lane index, the * the primitive value at index {@code N} is placed into the resulting * vector at lane index {@code N}. * ! * @param species species of the desired vector * @param es the given primitive values ! * @return a vector where each lane element is set to given primitive ! * values ! * @throws IndexOutOfBoundsException if {@code es.length < species.length()} */ @ForceInline @SuppressWarnings("unchecked") ! public static DoubleVector scalars(VectorSpecies<Double> species, double... es) { Objects.requireNonNull(es); ! int ix = VectorIntrinsics.checkIndex(0, es.length, species.length()); ! return VectorIntrinsics.load((Class<DoubleVector>) species.boxType(), double.class, species.length(), es, Unsafe.ARRAY_DOUBLE_BASE_OFFSET, ! es, ix, species, (c, idx, sp) -> ((DoubleSpecies)sp).op(n -> c[idx + n])); } /** * Returns a vector where the first lane element is set to the primtive * value {@code e}, all other lane elements are set to the default * value. * ! * @param species species of the desired vector * @param e the value * @return a vector where the first lane element is set to the primitive * value {@code e} */ @ForceInline ! public static final DoubleVector single(VectorSpecies<Double> species, double e) { ! return zero(species).with(0, e); } /** * Returns a vector where each lane element is set to a randomly * generated primitive value. * * The semantics are equivalent to calling * {@link ThreadLocalRandom#nextDouble()} * ! * @param species species of the desired vector * @return a vector where each lane elements is set to a randomly * generated primitive value */ ! public static DoubleVector random(VectorSpecies<Double> species) { ThreadLocalRandom r = ThreadLocalRandom.current(); ! return ((DoubleSpecies)species).op(i -> r.nextDouble()); } // Ops @Override public abstract DoubleVector add(Vector<Double> v); /** * Adds this vector to the broadcast of an input scalar. * <p> ! * This is a lane-wise binary operation which applies the primitive addition operation ! * ({@code +}) to each lane. * * @param s the input scalar * @return the result of adding this vector to the broadcast of an input * scalar */
*** 486,497 **** /** * Adds this vector to broadcast of an input scalar, * selecting lane elements controlled by a mask. * <p> ! * This is a vector binary operation where the primitive addition operation ! * ({@code +}) is applied to lane elements. * * @param s the input scalar * @param m the mask controlling lane selection * @return the result of adding this vector to the broadcast of an input * scalar --- 483,494 ---- /** * Adds this vector to broadcast of an input scalar, * selecting lane elements controlled by a mask. * <p> ! * This is a lane-wise binary operation which applies the primitive addition operation ! * ({@code +}) to each lane. * * @param s the input scalar * @param m the mask controlling lane selection * @return the result of adding this vector to the broadcast of an input * scalar
*** 502,513 **** public abstract DoubleVector sub(Vector<Double> v); /** * Subtracts the broadcast of an input scalar from this vector. * <p> ! * This is a vector binary operation where the primitive subtraction ! * operation ({@code -}) is applied to lane elements. * * @param s the input scalar * @return the result of subtracting the broadcast of an input * scalar from this vector */ --- 499,510 ---- public abstract DoubleVector sub(Vector<Double> v); /** * Subtracts the broadcast of an input scalar from this vector. * <p> ! * This is a lane-wise binary operation which applies the primitive subtraction ! * operation ({@code -}) to each lane. * * @param s the input scalar * @return the result of subtracting the broadcast of an input * scalar from this vector */
*** 518,529 **** /** * Subtracts the broadcast of an input scalar from this vector, selecting * lane elements controlled by a mask. * <p> ! * This is a vector binary operation where the primitive subtraction ! * operation ({@code -}) is applied to lane elements. * * @param s the input scalar * @param m the mask controlling lane selection * @return the result of subtracting the broadcast of an input * scalar from this vector --- 515,526 ---- /** * Subtracts the broadcast of an input scalar from this vector, selecting * lane elements controlled by a mask. * <p> ! * This is a lane-wise binary operation which applies the primitive subtraction ! * operation ({@code -}) to each lane. * * @param s the input scalar * @param m the mask controlling lane selection * @return the result of subtracting the broadcast of an input * scalar from this vector
*** 534,545 **** public abstract DoubleVector mul(Vector<Double> v); /** * Multiplies this vector with the broadcast of an input scalar. * <p> ! * This is a vector binary operation where the primitive multiplication ! * operation ({@code *}) is applied to lane elements. * * @param s the input scalar * @return the result of multiplying this vector with the broadcast of an * input scalar */ --- 531,542 ---- public abstract DoubleVector mul(Vector<Double> v); /** * Multiplies this vector with the broadcast of an input scalar. * <p> ! * This is a lane-wise binary operation which applies the primitive multiplication ! * operation ({@code *}) to each lane. * * @param s the input scalar * @return the result of multiplying this vector with the broadcast of an * input scalar */
*** 550,561 **** /** * Multiplies this vector with the broadcast of an input scalar, selecting * lane elements controlled by a mask. * <p> ! * This is a vector binary operation where the primitive multiplication ! * operation ({@code *}) is applied to lane elements. * * @param s the input scalar * @param m the mask controlling lane selection * @return the result of multiplying this vector with the broadcast of an * input scalar --- 547,558 ---- /** * Multiplies this vector with the broadcast of an input scalar, selecting * lane elements controlled by a mask. * <p> ! * This is a lane-wise binary operation which applies the primitive multiplication ! * operation ({@code *}) to each lane. * * @param s the input scalar * @param m the mask controlling lane selection * @return the result of multiplying this vector with the broadcast of an * input scalar
*** 581,592 **** public abstract DoubleVector min(Vector<Double> v, VectorMask<Double> m); /** * Returns the minimum of this vector and the broadcast of an input scalar. * <p> ! * This is a vector binary operation where the operation ! * {@code (a, b) -> Math.min(a, b)} is applied to lane elements. * * @param s the input scalar * @return the minimum of this vector and the broadcast of an input scalar */ public abstract DoubleVector min(double s); --- 578,589 ---- public abstract DoubleVector min(Vector<Double> v, VectorMask<Double> m); /** * Returns the minimum of this vector and the broadcast of an input scalar. * <p> ! * This is a lane-wise binary operation which applies the operation ! * {@code (a, b) -> Math.min(a, b)} to each lane. * * @param s the input scalar * @return the minimum of this vector and the broadcast of an input scalar */ public abstract DoubleVector min(double s);
*** 598,609 **** public abstract DoubleVector max(Vector<Double> v, VectorMask<Double> m); /** * Returns the maximum of this vector and the broadcast of an input scalar. * <p> ! * This is a vector binary operation where the operation ! * {@code (a, b) -> Math.max(a, b)} is applied to lane elements. * * @param s the input scalar * @return the maximum of this vector and the broadcast of an input scalar */ public abstract DoubleVector max(double s); --- 595,606 ---- public abstract DoubleVector max(Vector<Double> v, VectorMask<Double> m); /** * Returns the maximum of this vector and the broadcast of an input scalar. * <p> ! * This is a lane-wise binary operation which applies the operation ! * {@code (a, b) -> Math.max(a, b)} to each lane. * * @param s the input scalar * @return the maximum of this vector and the broadcast of an input scalar */ public abstract DoubleVector max(double s);
*** 612,623 **** public abstract VectorMask<Double> equal(Vector<Double> v); /** * Tests if this vector is equal to the broadcast of an input scalar. * <p> ! * This is a vector binary test operation where the primitive equals ! * operation ({@code ==}) is applied to lane elements. * * @param s the input scalar * @return the result mask of testing if this vector is equal to the * broadcast of an input scalar */ --- 609,620 ---- public abstract VectorMask<Double> equal(Vector<Double> v); /** * Tests if this vector is equal to the broadcast of an input scalar. * <p> ! * This is a lane-wise binary test operation which applies the primitive equals ! * operation ({@code ==}) each lane. * * @param s the input scalar * @return the result mask of testing if this vector is equal to the * broadcast of an input scalar */
*** 627,638 **** public abstract VectorMask<Double> notEqual(Vector<Double> v); /** * Tests if this vector is not equal to the broadcast of an input scalar. * <p> ! * This is a vector binary test operation where the primitive not equals ! * operation ({@code !=}) is applied to lane elements. * * @param s the input scalar * @return the result mask of testing if this vector is not equal to the * broadcast of an input scalar */ --- 624,635 ---- public abstract VectorMask<Double> notEqual(Vector<Double> v); /** * Tests if this vector is not equal to the broadcast of an input scalar. * <p> ! * This is a lane-wise binary test operation which applies the primitive not equals ! * operation ({@code !=}) to each lane. * * @param s the input scalar * @return the result mask of testing if this vector is not equal to the * broadcast of an input scalar */
*** 642,653 **** public abstract VectorMask<Double> lessThan(Vector<Double> v); /** * Tests if this vector is less than the broadcast of an input scalar. * <p> ! * This is a vector binary test operation where the primitive less than ! * operation ({@code <}) is applied to lane elements. * * @param s the input scalar * @return the mask result of testing if this vector is less than the * broadcast of an input scalar */ --- 639,650 ---- public abstract VectorMask<Double> lessThan(Vector<Double> v); /** * Tests if this vector is less than the broadcast of an input scalar. * <p> ! * This is a lane-wise binary test operation which applies the primitive less than ! * operation ({@code <}) to each lane. * * @param s the input scalar * @return the mask result of testing if this vector is less than the * broadcast of an input scalar */
*** 657,668 **** public abstract VectorMask<Double> lessThanEq(Vector<Double> v); /** * Tests if this vector is less or equal to the broadcast of an input scalar. * <p> ! * This is a vector binary test operation where the primitive less than ! * or equal to operation ({@code <=}) is applied to lane elements. * * @param s the input scalar * @return the mask result of testing if this vector is less than or equal * to the broadcast of an input scalar */ --- 654,665 ---- public abstract VectorMask<Double> lessThanEq(Vector<Double> v); /** * Tests if this vector is less or equal to the broadcast of an input scalar. * <p> ! * This is a lane-wise binary test operation which applies the primitive less than ! * or equal to operation ({@code <=}) to each lane. * * @param s the input scalar * @return the mask result of testing if this vector is less than or equal * to the broadcast of an input scalar */
*** 672,683 **** public abstract VectorMask<Double> greaterThan(Vector<Double> v); /** * Tests if this vector is greater than the broadcast of an input scalar. * <p> ! * This is a vector binary test operation where the primitive greater than ! * operation ({@code >}) is applied to lane elements. * * @param s the input scalar * @return the mask result of testing if this vector is greater than the * broadcast of an input scalar */ --- 669,680 ---- public abstract VectorMask<Double> greaterThan(Vector<Double> v); /** * Tests if this vector is greater than the broadcast of an input scalar. * <p> ! * This is a lane-wise binary test operation which applies the primitive greater than ! * operation ({@code >}) to each lane. * * @param s the input scalar * @return the mask result of testing if this vector is greater than the * broadcast of an input scalar */
*** 688,699 **** /** * Tests if this vector is greater than or equal to the broadcast of an * input scalar. * <p> ! * This is a vector binary test operation where the primitive greater than ! * or equal to operation ({@code >=}) is applied to lane elements. * * @param s the input scalar * @return the mask result of testing if this vector is greater than or * equal to the broadcast of an input scalar */ --- 685,696 ---- /** * Tests if this vector is greater than or equal to the broadcast of an * input scalar. * <p> ! * This is a lane-wise binary test operation which applies the primitive greater than ! * or equal to operation ({@code >=}) to each lane. * * @param s the input scalar * @return the mask result of testing if this vector is greater than or * equal to the broadcast of an input scalar */
*** 742,764 **** public abstract DoubleVector shiftER(int i); /** * Divides this vector by an input vector. * <p> ! * This is a vector binary operation where the primitive division ! * operation ({@code /}) is applied to lane elements. * * @param v the input vector * @return the result of dividing this vector by the input vector */ public abstract DoubleVector div(Vector<Double> v); /** * Divides this vector by the broadcast of an input scalar. * <p> ! * This is a vector binary operation where the primitive division ! * operation ({@code /}) is applied to lane elements. * * @param s the input scalar * @return the result of dividing this vector by the broadcast of an input * scalar */ --- 739,761 ---- public abstract DoubleVector shiftER(int i); /** * Divides this vector by an input vector. * <p> ! * This is a lane-wise binary operation which applies the primitive division ! * operation ({@code /}) to each lane. * * @param v the input vector * @return the result of dividing this vector by the input vector */ public abstract DoubleVector div(Vector<Double> v); /** * Divides this vector by the broadcast of an input scalar. * <p> ! * This is a lane-wise binary operation which applies the primitive division ! * operation ({@code /}) to each lane. * * @param s the input scalar * @return the result of dividing this vector by the broadcast of an input * scalar */
*** 766,777 **** /** * Divides this vector by an input vector, selecting lane elements * controlled by a mask. * <p> ! * This is a vector binary operation where the primitive division ! * operation ({@code /}) is applied to lane elements. * * @param v the input vector * @param m the mask controlling lane selection * @return the result of dividing this vector by the input vector */ --- 763,774 ---- /** * Divides this vector by an input vector, selecting lane elements * controlled by a mask. * <p> ! * This is a lane-wise binary operation which applies the primitive division ! * operation ({@code /}) to each lane. * * @param v the input vector * @param m the mask controlling lane selection * @return the result of dividing this vector by the input vector */
*** 779,790 **** /** * Divides this vector by the broadcast of an input scalar, selecting lane * elements controlled by a mask. * <p> ! * This is a vector binary operation where the primitive division ! * operation ({@code /}) is applied to lane elements. * * @param s the input scalar * @param m the mask controlling lane selection * @return the result of dividing this vector by the broadcast of an input * scalar --- 776,787 ---- /** * Divides this vector by the broadcast of an input scalar, selecting lane * elements controlled by a mask. * <p> ! * This is a lane-wise binary operation which applies the primitive division ! * operation ({@code /}) to each lane. * * @param s the input scalar * @param m the mask controlling lane selection * @return the result of dividing this vector by the broadcast of an input * scalar
*** 792,814 **** public abstract DoubleVector div(double s, VectorMask<Double> m); /** * Calculates the square root of this vector. * <p> ! * This is a vector unary operation where the {@link Math#sqrt} operation ! * is applied to lane elements. * * @return the square root of this vector */ public abstract DoubleVector sqrt(); /** * Calculates the square root of this vector, selecting lane elements * controlled by a mask. * <p> ! * This is a vector unary operation where the {@link Math#sqrt} operation ! * is applied to lane elements. * * @param m the mask controlling lane selection * @return the square root of this vector */ public DoubleVector sqrt(VectorMask<Double> m) { --- 789,811 ---- public abstract DoubleVector div(double s, VectorMask<Double> m); /** * Calculates the square root of this vector. * <p> ! * This is a lane-wise unary operation which applies the {@link Math#sqrt} operation ! * to each lane. * * @return the square root of this vector */ public abstract DoubleVector sqrt(); /** * Calculates the square root of this vector, selecting lane elements * controlled by a mask. * <p> ! * This is a lane-wise unary operation which applies the {@link Math#sqrt} operation ! * to each lane. * * @param m the mask controlling lane selection * @return the square root of this vector */ public DoubleVector sqrt(VectorMask<Double> m) {
*** 816,827 **** } /** * Calculates the trigonometric tangent of this vector. * <p> ! * This is a vector unary operation with same semantic definition as ! * {@link Math#tan} operation applied to lane elements. * The implementation is not required to return same * results as {@link Math#tan}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#tan} * specifications. The computed result will be within 1 ulp of the * exact result. --- 813,824 ---- } /** * Calculates the trigonometric tangent of this vector. * <p> ! * This is a lane-wise unary operation with same semantic definition as ! * {@link Math#tan} operation applied to each lane. * The implementation is not required to return same * results as {@link Math#tan}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#tan} * specifications. The computed result will be within 1 ulp of the * exact result.
*** 847,858 **** } /** * Calculates the hyperbolic tangent of this vector. * <p> ! * This is a vector unary operation with same semantic definition as ! * {@link Math#tanh} operation applied to lane elements. * The implementation is not required to return same * results as {@link Math#tanh}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#tanh} * specifications. The computed result will be within 2.5 ulps of the * exact result. --- 844,855 ---- } /** * Calculates the hyperbolic tangent of this vector. * <p> ! * This is a lane-wise unary operation with same semantic definition as ! * {@link Math#tanh} operation applied to each lane. * The implementation is not required to return same * results as {@link Math#tanh}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#tanh} * specifications. The computed result will be within 2.5 ulps of the * exact result.
*** 878,889 **** } /** * Calculates the trigonometric sine of this vector. * <p> ! * This is a vector unary operation with same semantic definition as ! * {@link Math#sin} operation applied to lane elements. * The implementation is not required to return same * results as {@link Math#sin}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#sin} * specifications. The computed result will be within 1 ulp of the * exact result. --- 875,886 ---- } /** * Calculates the trigonometric sine of this vector. * <p> ! * This is a lane-wise unary operation with same semantic definition as ! * {@link Math#sin} operation applied to each lane. * The implementation is not required to return same * results as {@link Math#sin}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#sin} * specifications. The computed result will be within 1 ulp of the * exact result.
*** 909,920 **** } /** * Calculates the hyperbolic sine of this vector. * <p> ! * This is a vector unary operation with same semantic definition as ! * {@link Math#sinh} operation applied to lane elements. * The implementation is not required to return same * results as {@link Math#sinh}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#sinh} * specifications. The computed result will be within 2.5 ulps of the * exact result. --- 906,917 ---- } /** * Calculates the hyperbolic sine of this vector. * <p> ! * This is a lane-wise unary operation with same semantic definition as ! * {@link Math#sinh} operation applied to each lane. * The implementation is not required to return same * results as {@link Math#sinh}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#sinh} * specifications. The computed result will be within 2.5 ulps of the * exact result.
*** 940,951 **** } /** * Calculates the trigonometric cosine of this vector. * <p> ! * This is a vector unary operation with same semantic definition as ! * {@link Math#cos} operation applied to lane elements. * The implementation is not required to return same * results as {@link Math#cos}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#cos} * specifications. The computed result will be within 1 ulp of the * exact result. --- 937,948 ---- } /** * Calculates the trigonometric cosine of this vector. * <p> ! * This is a lane-wise unary operation with same semantic definition as ! * {@link Math#cos} operation applied to each lane. * The implementation is not required to return same * results as {@link Math#cos}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#cos} * specifications. The computed result will be within 1 ulp of the * exact result.
*** 971,982 **** } /** * Calculates the hyperbolic cosine of this vector. * <p> ! * This is a vector unary operation with same semantic definition as ! * {@link Math#cosh} operation applied to lane elements. * The implementation is not required to return same * results as {@link Math#cosh}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#cosh} * specifications. The computed result will be within 2.5 ulps of the * exact result. --- 968,979 ---- } /** * Calculates the hyperbolic cosine of this vector. * <p> ! * This is a lane-wise unary operation with same semantic definition as ! * {@link Math#cosh} operation applied to each lane. * The implementation is not required to return same * results as {@link Math#cosh}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#cosh} * specifications. The computed result will be within 2.5 ulps of the * exact result.
*** 1002,1013 **** } /** * Calculates the arc sine of this vector. * <p> ! * This is a vector unary operation with same semantic definition as ! * {@link Math#asin} operation applied to lane elements. * The implementation is not required to return same * results as {@link Math#asin}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#asin} * specifications. The computed result will be within 1 ulp of the * exact result. --- 999,1010 ---- } /** * Calculates the arc sine of this vector. * <p> ! * This is a lane-wise unary operation with same semantic definition as ! * {@link Math#asin} operation applied to each lane. * The implementation is not required to return same * results as {@link Math#asin}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#asin} * specifications. The computed result will be within 1 ulp of the * exact result.
*** 1033,1044 **** } /** * Calculates the arc cosine of this vector. * <p> ! * This is a vector unary operation with same semantic definition as ! * {@link Math#acos} operation applied to lane elements. * The implementation is not required to return same * results as {@link Math#acos}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#acos} * specifications. The computed result will be within 1 ulp of the * exact result. --- 1030,1041 ---- } /** * Calculates the arc cosine of this vector. * <p> ! * This is a lane-wise unary operation with same semantic definition as ! * {@link Math#acos} operation applied to each lane. * The implementation is not required to return same * results as {@link Math#acos}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#acos} * specifications. The computed result will be within 1 ulp of the * exact result.
*** 1064,1075 **** } /** * Calculates the arc tangent of this vector. * <p> ! * This is a vector unary operation with same semantic definition as ! * {@link Math#atan} operation applied to lane elements. * The implementation is not required to return same * results as {@link Math#atan}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#atan} * specifications. The computed result will be within 1 ulp of the * exact result. --- 1061,1072 ---- } /** * Calculates the arc tangent of this vector. * <p> ! * This is a lane-wise unary operation with same semantic definition as ! * {@link Math#atan} operation applied to each lane. * The implementation is not required to return same * results as {@link Math#atan}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#atan} * specifications. The computed result will be within 1 ulp of the * exact result.
*** 1095,1106 **** } /** * Calculates the arc tangent of this vector divided by an input vector. * <p> ! * This is a vector binary operation with same semantic definition as ! * {@link Math#atan2} operation applied to lane elements. * The implementation is not required to return same * results as {@link Math#atan2}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#atan2} * specifications. The computed result will be within 2 ulps of the * exact result. --- 1092,1103 ---- } /** * Calculates the arc tangent of this vector divided by an input vector. * <p> ! * This is a lane-wise binary operation with same semantic definition as ! * {@link Math#atan2} operation applied to each lane. * The implementation is not required to return same * results as {@link Math#atan2}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#atan2} * specifications. The computed result will be within 2 ulps of the * exact result.
*** 1114,1125 **** /** * Calculates the arc tangent of this vector divided by the broadcast of an * an input scalar. * <p> ! * This is a vector binary operation with same semantic definition as ! * {@link Math#atan2} operation applied to lane elements. * The implementation is not required to return same * results as {@link Math#atan2}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#atan2} * specifications. The computed result will be within 1 ulp of the * exact result. --- 1111,1122 ---- /** * Calculates the arc tangent of this vector divided by the broadcast of an * an input scalar. * <p> ! * This is a lane-wise binary operation with same semantic definition as ! * {@link Math#atan2} operation applied to each lane. * The implementation is not required to return same * results as {@link Math#atan2}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#atan2} * specifications. The computed result will be within 1 ulp of the * exact result.
*** 1158,1169 **** public abstract DoubleVector atan2(double s, VectorMask<Double> m); /** * Calculates the cube root of this vector. * <p> ! * This is a vector unary operation with same semantic definition as ! * {@link Math#cbrt} operation applied to lane elements. * The implementation is not required to return same * results as {@link Math#cbrt}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#cbrt} * specifications. The computed result will be within 1 ulp of the * exact result. --- 1155,1166 ---- public abstract DoubleVector atan2(double s, VectorMask<Double> m); /** * Calculates the cube root of this vector. * <p> ! * This is a lane-wise unary operation with same semantic definition as ! * {@link Math#cbrt} operation applied to each lane. * The implementation is not required to return same * results as {@link Math#cbrt}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#cbrt} * specifications. The computed result will be within 1 ulp of the * exact result.
*** 1189,1200 **** } /** * Calculates the natural logarithm of this vector. * <p> ! * This is a vector unary operation with same semantic definition as ! * {@link Math#log} operation applied to lane elements. * The implementation is not required to return same * results as {@link Math#log}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#log} * specifications. The computed result will be within 1 ulp of the * exact result. --- 1186,1197 ---- } /** * Calculates the natural logarithm of this vector. * <p> ! * This is a lane-wise unary operation with same semantic definition as ! * {@link Math#log} operation applied to each lane. * The implementation is not required to return same * results as {@link Math#log}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#log} * specifications. The computed result will be within 1 ulp of the * exact result.
*** 1220,1231 **** } /** * Calculates the base 10 logarithm of this vector. * <p> ! * This is a vector unary operation with same semantic definition as ! * {@link Math#log10} operation applied to lane elements. * The implementation is not required to return same * results as {@link Math#log10}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#log10} * specifications. The computed result will be within 1 ulp of the * exact result. --- 1217,1228 ---- } /** * Calculates the base 10 logarithm of this vector. * <p> ! * This is a lane-wise unary operation with same semantic definition as ! * {@link Math#log10} operation applied to each lane. * The implementation is not required to return same * results as {@link Math#log10}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#log10} * specifications. The computed result will be within 1 ulp of the * exact result.
*** 1252,1263 **** /** * Calculates the natural logarithm of the sum of this vector and the * broadcast of {@code 1}. * <p> ! * This is a vector unary operation with same semantic definition as ! * {@link Math#log1p} operation applied to lane elements. * The implementation is not required to return same * results as {@link Math#log1p}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#log1p} * specifications. The computed result will be within 1 ulp of the * exact result. --- 1249,1260 ---- /** * Calculates the natural logarithm of the sum of this vector and the * broadcast of {@code 1}. * <p> ! * This is a lane-wise unary operation with same semantic definition as ! * {@link Math#log1p} operation applied to each lane. * The implementation is not required to return same * results as {@link Math#log1p}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#log1p} * specifications. The computed result will be within 1 ulp of the * exact result.
*** 1285,1296 **** } /** * Calculates this vector raised to the power of an input vector. * <p> ! * This is a vector binary operation with same semantic definition as ! * {@link Math#pow} operation applied to lane elements. * The implementation is not required to return same * results as {@link Math#pow}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#pow} * specifications. The computed result will be within 1 ulp of the * exact result. --- 1282,1293 ---- } /** * Calculates this vector raised to the power of an input vector. * <p> ! * This is a lane-wise binary operation with same semantic definition as ! * {@link Math#pow} operation applied to each lane. * The implementation is not required to return same * results as {@link Math#pow}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#pow} * specifications. The computed result will be within 1 ulp of the * exact result.
*** 1304,1315 **** /** * Calculates this vector raised to the power of the broadcast of an input * scalar. * <p> ! * This is a vector binary operation with same semantic definition as ! * {@link Math#pow} operation applied to lane elements. * The implementation is not required to return same * results as {@link Math#pow}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#pow} * specifications. The computed result will be within 1 ulp of the * exact result. --- 1301,1312 ---- /** * Calculates this vector raised to the power of the broadcast of an input * scalar. * <p> ! * This is a lane-wise binary operation with same semantic definition as ! * {@link Math#pow} operation applied to each lane. * The implementation is not required to return same * results as {@link Math#pow}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#pow} * specifications. The computed result will be within 1 ulp of the * exact result.
*** 1351,1362 **** /** * Calculates the broadcast of Euler's number {@code e} raised to the power * of this vector. * <p> ! * This is a vector unary operation with same semantic definition as ! * {@link Math#exp} operation applied to lane elements. * The implementation is not required to return same * results as {@link Math#exp}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#exp} * specifications. The computed result will be within 1 ulp of the * exact result. --- 1348,1359 ---- /** * Calculates the broadcast of Euler's number {@code e} raised to the power * of this vector. * <p> ! * This is a lane-wise unary operation with same semantic definition as ! * {@link Math#exp} operation applied to each lane. * The implementation is not required to return same * results as {@link Math#exp}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#exp} * specifications. The computed result will be within 1 ulp of the * exact result.
*** 1387,1401 **** * Calculates the broadcast of Euler's number {@code e} raised to the power * of this vector minus the broadcast of {@code -1}. * More specifically as if the following (ignoring any differences in * numerical accuracy): * <pre>{@code ! * this.exp().sub(this.species().broadcast(1)) * }</pre> * <p> ! * This is a vector unary operation with same semantic definition as ! * {@link Math#expm1} operation applied to lane elements. * The implementation is not required to return same * results as {@link Math#expm1}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#expm1} * specifications. The computed result will be within 1 ulp of the * exact result. --- 1384,1398 ---- * Calculates the broadcast of Euler's number {@code e} raised to the power * of this vector minus the broadcast of {@code -1}. * More specifically as if the following (ignoring any differences in * numerical accuracy): * <pre>{@code ! * this.exp().sub(EVector.broadcast(this.species(), 1)) * }</pre> * <p> ! * This is a lane-wise unary operation with same semantic definition as ! * {@link Math#expm1} operation applied to each lane. * The implementation is not required to return same * results as {@link Math#expm1}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#expm1} * specifications. The computed result will be within 1 ulp of the * exact result.
*** 1412,1422 **** * of this vector minus the broadcast of {@code -1}, selecting lane elements * controlled by a mask * More specifically as if the following (ignoring any differences in * numerical accuracy): * <pre>{@code ! * this.exp(m).sub(this.species().broadcast(1), m) * }</pre> * <p> * Semantics for rounding, monotonicity, and special cases are * described in {@link DoubleVector#expm1} * --- 1409,1419 ---- * of this vector minus the broadcast of {@code -1}, selecting lane elements * controlled by a mask * More specifically as if the following (ignoring any differences in * numerical accuracy): * <pre>{@code ! * this.exp(m).sub(EVector.broadcast(this.species(), 1), m) * }</pre> * <p> * Semantics for rounding, monotonicity, and special cases are * described in {@link DoubleVector#expm1} *
*** 1435,1446 **** * numerical accuracy): * <pre>{@code * this.mul(v1).add(v2) * }</pre> * <p> ! * This is a vector ternary operation where the {@link Math#fma} operation ! * is applied to lane elements. * * @param v1 the first input vector * @param v2 the second input vector * @return the product of this vector and the first input vector summed with * the second input vector --- 1432,1443 ---- * numerical accuracy): * <pre>{@code * this.mul(v1).add(v2) * }</pre> * <p> ! * This is a lane-wise ternary operation which applies the {@link Math#fma} operation ! * to each lane. * * @param v1 the first input vector * @param v2 the second input vector * @return the product of this vector and the first input vector summed with * the second input vector
*** 1450,1464 **** /** * Calculates the product of this vector and the broadcast of a first input * scalar summed with the broadcast of a second input scalar. * More specifically as if the following: * <pre>{@code ! * this.fma(this.species().broadcast(s1), this.species().broadcast(s2)) * }</pre> * <p> ! * This is a vector ternary operation where the {@link Math#fma} operation ! * is applied to lane elements. * * @param s1 the first input scalar * @param s2 the second input scalar * @return the product of this vector and the broadcast of a first input * scalar summed with the broadcast of a second input scalar --- 1447,1461 ---- /** * Calculates the product of this vector and the broadcast of a first input * scalar summed with the broadcast of a second input scalar. * More specifically as if the following: * <pre>{@code ! * this.fma(EVector.broadcast(this.species(), s1), EVector.broadcast(this.species(), s2)) * }</pre> * <p> ! * This is a lane-wise ternary operation which applies the {@link Math#fma} operation ! * to each lane. * * @param s1 the first input scalar * @param s2 the second input scalar * @return the product of this vector and the broadcast of a first input * scalar summed with the broadcast of a second input scalar
*** 1472,1483 **** * numerical accuracy): * <pre>{@code * this.mul(v1, m).add(v2, m) * }</pre> * <p> ! * This is a vector ternary operation where the {@link Math#fma} operation ! * is applied to lane elements. * * @param v1 the first input vector * @param v2 the second input vector * @param m the mask controlling lane selection * @return the product of this vector and the first input vector summed with --- 1469,1480 ---- * numerical accuracy): * <pre>{@code * this.mul(v1, m).add(v2, m) * }</pre> * <p> ! * This is a lane-wise ternary operation which applies the {@link Math#fma} operation ! * to each lane. * * @param v1 the first input vector * @param v2 the second input vector * @param m the mask controlling lane selection * @return the product of this vector and the first input vector summed with
*** 1491,1505 **** * Calculates the product of this vector and the broadcast of a first input * scalar summed with the broadcast of a second input scalar, selecting lane * elements controlled by a mask * More specifically as if the following: * <pre>{@code ! * this.fma(this.species().broadcast(s1), this.species().broadcast(s2), m) * }</pre> * <p> ! * This is a vector ternary operation where the {@link Math#fma} operation ! * is applied to lane elements. * * @param s1 the first input scalar * @param s2 the second input scalar * @param m the mask controlling lane selection * @return the product of this vector and the broadcast of a first input --- 1488,1502 ---- * Calculates the product of this vector and the broadcast of a first input * scalar summed with the broadcast of a second input scalar, selecting lane * elements controlled by a mask * More specifically as if the following: * <pre>{@code ! * this.fma(EVector.broadcast(this.species(), s1), EVector.broadcast(this.species(), s2), m) * }</pre> * <p> ! * This is a lane-wise ternary operation which applies the {@link Math#fma} operation ! * to each lane. * * @param s1 the first input scalar * @param s2 the second input scalar * @param m the mask controlling lane selection * @return the product of this vector and the broadcast of a first input
*** 1514,1525 **** * numerical accuracy): * <pre>{@code * this.mul(this).add(v.mul(v)).sqrt() * }</pre> * <p> ! * This is a vector binary operation with same semantic definition as ! * {@link Math#hypot} operation applied to lane elements. * The implementation is not required to return same * results as {@link Math#hypot}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#hypot} * specifications. The computed result will be within 1 ulp of the * exact result. --- 1511,1522 ---- * numerical accuracy): * <pre>{@code * this.mul(this).add(v.mul(v)).sqrt() * }</pre> * <p> ! * This is a lane-wise binary operation with same semantic definition as ! * {@link Math#hypot} operation applied to each lane. * The implementation is not required to return same * results as {@link Math#hypot}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#hypot} * specifications. The computed result will be within 1 ulp of the * exact result.
*** 1536,1550 **** * Calculates square root of the sum of the squares of this vector and the * broadcast of an input scalar. * More specifically as if the following (ignoring any differences in * numerical accuracy): * <pre>{@code ! * this.mul(this).add(this.species().broadcast(v * v)).sqrt() * }</pre> * <p> ! * This is a vector binary operation with same semantic definition as ! * {@link Math#hypot} operation applied to lane elements. * The implementation is not required to return same * results as {@link Math#hypot}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#hypot} * specifications. The computed result will be within 1 ulp of the * exact result. --- 1533,1547 ---- * Calculates square root of the sum of the squares of this vector and the * broadcast of an input scalar. * More specifically as if the following (ignoring any differences in * numerical accuracy): * <pre>{@code ! * this.mul(this).add(EVector.broadcast(this.species(), s * s)).sqrt() * }</pre> * <p> ! * This is a lane-wise binary operation with same semantic definition as ! * {@link Math#hypot} operation applied to each. * The implementation is not required to return same * results as {@link Math#hypot}, but adheres to rounding, monotonicity, * and special case semantics as defined in the {@link Math#hypot} * specifications. The computed result will be within 1 ulp of the * exact result.
*** 1581,1591 **** * broadcast of an input scalar, selecting lane elements controlled by a * mask. * More specifically as if the following (ignoring any differences in * numerical accuracy): * <pre>{@code ! * this.mul(this, m).add(this.species().broadcast(v * v), m).sqrt(m) * }</pre> * <p> * Semantics for rounding, monotonicity, and special cases are * described in {@link DoubleVector#hypot} * --- 1578,1588 ---- * broadcast of an input scalar, selecting lane elements controlled by a * mask. * More specifically as if the following (ignoring any differences in * numerical accuracy): * <pre>{@code ! * this.mul(this, m).add(EVector.broadcast(this.species(), s * s), m).sqrt(m) * }</pre> * <p> * Semantics for rounding, monotonicity, and special cases are * described in {@link DoubleVector#hypot} *
*** 1612,1623 **** // Type specific horizontal reductions /** * Adds all lane elements of this vector. * <p> ! * This is a vector reduction operation where the addition ! * operation ({@code +}) is applied to lane elements, * and the identity value is {@code 0.0}. * * <p>The value of a floating-point sum is a function both of the input values as well * as the order of addition operations. The order of addition operations of this method * is intentionally not defined to allow for JVM to generate optimal machine --- 1609,1620 ---- // Type specific horizontal reductions /** * Adds all lane elements of this vector. * <p> ! * This is a cross-lane reduction operation which applies the addition ! * operation ({@code +}) to lane elements, * and the identity value is {@code 0.0}. * * <p>The value of a floating-point sum is a function both of the input values as well * as the order of addition operations. The order of addition operations of this method * is intentionally not defined to allow for JVM to generate optimal machine
*** 1633,1644 **** /** * Adds all lane elements of this vector, selecting lane elements * controlled by a mask. * <p> ! * This is a vector reduction operation where the addition ! * operation ({@code +}) is applied to lane elements, * and the identity value is {@code 0.0}. * * <p>The value of a floating-point sum is a function both of the input values as well * as the order of addition operations. The order of addition operations of this method * is intentionally not defined to allow for JVM to generate optimal machine --- 1630,1641 ---- /** * Adds all lane elements of this vector, selecting lane elements * controlled by a mask. * <p> ! * This is a cross-lane reduction operation which applies the addition ! * operation ({@code +}) to lane elements, * and the identity value is {@code 0.0}. * * <p>The value of a floating-point sum is a function both of the input values as well * as the order of addition operations. The order of addition operations of this method * is intentionally not defined to allow for JVM to generate optimal machine
*** 1654,1665 **** public abstract double addAll(VectorMask<Double> m); /** * Multiplies all lane elements of this vector. * <p> ! * This is a vector reduction operation where the ! * multiplication operation ({@code *}) is applied to lane elements, * and the identity value is {@code 1.0}. * * <p>The order of multiplication operations of this method * is intentionally not defined to allow for JVM to generate optimal machine * code for the underlying platform at runtime. If the platform supports a vector --- 1651,1662 ---- public abstract double addAll(VectorMask<Double> m); /** * Multiplies all lane elements of this vector. * <p> ! * This is a cross-lane reduction operation which applies the ! * multiplication operation ({@code *}) to lane elements, * and the identity value is {@code 1.0}. * * <p>The order of multiplication operations of this method * is intentionally not defined to allow for JVM to generate optimal machine * code for the underlying platform at runtime. If the platform supports a vector
*** 1674,1685 **** /** * Multiplies all lane elements of this vector, selecting lane elements * controlled by a mask. * <p> ! * This is a vector reduction operation where the ! * multiplication operation ({@code *}) is applied to lane elements, * and the identity value is {@code 1.0}. * * <p>The order of multiplication operations of this method * is intentionally not defined to allow for JVM to generate optimal machine * code for the underlying platform at runtime. If the platform supports a vector --- 1671,1682 ---- /** * Multiplies all lane elements of this vector, selecting lane elements * controlled by a mask. * <p> ! * This is a cross-lane reduction operation which applies the ! * multiplication operation ({@code *}) to lane elements, * and the identity value is {@code 1.0}. * * <p>The order of multiplication operations of this method * is intentionally not defined to allow for JVM to generate optimal machine * code for the underlying platform at runtime. If the platform supports a vector
*** 1694,1705 **** public abstract double mulAll(VectorMask<Double> m); /** * Returns the minimum lane element of this vector. * <p> ! * This is an associative vector reduction operation where the operation ! * {@code (a, b) -> Math.min(a, b)} is applied to lane elements, * and the identity value is * {@link Double#POSITIVE_INFINITY}. * * @return the minimum lane element of this vector */ --- 1691,1702 ---- public abstract double mulAll(VectorMask<Double> m); /** * Returns the minimum lane element of this vector. * <p> ! * This is an associative cross-lane reduction operation which applies the operation ! * {@code (a, b) -> Math.min(a, b)} to lane elements, * and the identity value is * {@link Double#POSITIVE_INFINITY}. * * @return the minimum lane element of this vector */
*** 1707,1718 **** /** * Returns the minimum lane element of this vector, selecting lane elements * controlled by a mask. * <p> ! * This is an associative vector reduction operation where the operation ! * {@code (a, b) -> Math.min(a, b)} is applied to lane elements, * and the identity value is * {@link Double#POSITIVE_INFINITY}. * * @param m the mask controlling lane selection * @return the minimum lane element of this vector --- 1704,1715 ---- /** * Returns the minimum lane element of this vector, selecting lane elements * controlled by a mask. * <p> ! * This is an associative cross-lane reduction operation which applies the operation ! * {@code (a, b) -> Math.min(a, b)} to lane elements, * and the identity value is * {@link Double#POSITIVE_INFINITY}. * * @param m the mask controlling lane selection * @return the minimum lane element of this vector
*** 1720,1731 **** public abstract double minAll(VectorMask<Double> m); /** * Returns the maximum lane element of this vector. * <p> ! * This is an associative vector reduction operation where the operation ! * {@code (a, b) -> Math.max(a, b)} is applied to lane elements, * and the identity value is * {@link Double#NEGATIVE_INFINITY}. * * @return the maximum lane element of this vector */ --- 1717,1728 ---- public abstract double minAll(VectorMask<Double> m); /** * Returns the maximum lane element of this vector. * <p> ! * This is an associative cross-lane reduction operation which applies the operation ! * {@code (a, b) -> Math.max(a, b)} to lane elements, * and the identity value is * {@link Double#NEGATIVE_INFINITY}. * * @return the maximum lane element of this vector */
*** 1733,1744 **** /** * Returns the maximum lane element of this vector, selecting lane elements * controlled by a mask. * <p> ! * This is an associative vector reduction operation where the operation ! * {@code (a, b) -> Math.max(a, b)} is applied to lane elements, * and the identity value is * {@link Double#NEGATIVE_INFINITY}. * * @param m the mask controlling lane selection * @return the maximum lane element of this vector --- 1730,1741 ---- /** * Returns the maximum lane element of this vector, selecting lane elements * controlled by a mask. * <p> ! * This is an associative cross-lane reduction operation which applies the operation ! * {@code (a, b) -> Math.max(a, b)} to lane elements, * and the identity value is * {@link Double#NEGATIVE_INFINITY}. * * @param m the mask controlling lane selection * @return the maximum lane element of this vector
*** 1754,1764 **** * @param i the lane index * @return the lane element at lane index {@code i} * @throws IllegalArgumentException if the index is is out of range * ({@code < 0 || >= length()}) */ ! public abstract double get(int i); /** * Replaces the lane element of this vector at lane index {@code i} with * value {@code e}. * <p> --- 1751,1761 ---- * @param i the lane index * @return the lane element at lane index {@code i} * @throws IllegalArgumentException if the index is is out of range * ({@code < 0 || >= length()}) */ ! public abstract double lane(int i); /** * Replaces the lane element of this vector at lane index {@code i} with * value {@code e}. * <p>
*** 1801,1879 **** /** * Stores this vector into an array starting at offset. * <p> * For each vector lane, where {@code N} is the vector lane index, * the lane element at index {@code N} is stored into the array at index ! * {@code i + N}. * * @param a the array ! * @param i the offset into the array ! * @throws IndexOutOfBoundsException if {@code i < 0}, or ! * {@code i > a.length - this.length()} */ ! public abstract void intoArray(double[] a, int i); /** * Stores this vector into an array starting at offset and using a mask. * <p> * For each vector lane, where {@code N} is the vector lane index, * if the mask lane at index {@code N} is set then the lane element at ! * index {@code N} is stored into the array index {@code i + N}. * * @param a the array ! * @param i the offset into the array * @param m the mask ! * @throws IndexOutOfBoundsException if {@code i < 0}, or * for any vector lane index {@code N} where the mask at lane {@code N} ! * is set {@code i >= a.length - N} */ ! public abstract void intoArray(double[] a, int i, VectorMask<Double> m); /** * Stores this vector into an array using indexes obtained from an index * map. * <p> * For each vector lane, where {@code N} is the vector lane index, the * lane element at index {@code N} is stored into the array at index ! * {@code i + indexMap[j + N]}. * * @param a the array ! * @param 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 * @param indexMap the index map ! * @param j the offset into the index map ! * @throws IndexOutOfBoundsException if {@code j < 0}, or ! * {@code j > indexMap.length - this.length()}, * or for any vector lane index {@code N} the result of ! * {@code i + indexMap[j + N]} is {@code < 0} or {@code >= a.length} */ ! public abstract void intoArray(double[] a, int i, int[] indexMap, int j); /** * Stores this vector into an array using indexes obtained from an index * map and using a mask. * <p> * For each vector lane, where {@code N} is the vector lane index, * if the mask lane at index {@code N} is set then the lane element at * index {@code N} is stored into the array at index ! * {@code i + indexMap[j + N]}. * * @param a the array ! * @param 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 * @param m the mask * @param indexMap the index map ! * @param j the offset into the index map * @throws IndexOutOfBoundsException if {@code j < 0}, or ! * {@code j > indexMap.length - this.length()}, * or for any vector lane index {@code N} where the mask at lane ! * {@code N} is set the result of {@code i + indexMap[j + N]} is * {@code < 0} or {@code >= a.length} */ ! public abstract void intoArray(double[] a, int i, VectorMask<Double> m, int[] indexMap, int j); // Species @Override public abstract VectorSpecies<Double> species(); --- 1798,1876 ---- /** * Stores this vector into an array starting at offset. * <p> * For each vector lane, where {@code N} is the vector lane index, * the lane element at index {@code N} is stored into the array at index ! * {@code offset + N}. * * @param a the array ! * @param offset the offset into the array ! * @throws IndexOutOfBoundsException if {@code offset < 0}, or ! * {@code offset > a.length - this.length()} */ ! public abstract void intoArray(double[] a, int offset); /** * Stores this vector into an array starting at offset and using a mask. * <p> * For each vector lane, where {@code N} is the vector lane index, * if the mask lane at index {@code N} is set then the lane element at ! * index {@code N} is stored into the array index {@code offset + N}. * * @param a the array ! * @param offset the offset into the array * @param m the mask ! * @throws IndexOutOfBoundsException if {@code offset < 0}, or * for any vector lane index {@code N} where the mask at lane {@code N} ! * is set {@code offset >= a.length - N} */ ! public abstract void intoArray(double[] a, int offset, VectorMask<Double> m); /** * Stores this vector into an array using indexes obtained from an index * map. * <p> * For each vector lane, where {@code N} is the vector lane index, the * lane element at index {@code N} is stored into the array at index ! * {@code a_offset + indexMap[i_offset + N]}. * * @param a the array ! * @param 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 * @param indexMap the index map ! * @param i_offset the offset into the index map ! * @throws IndexOutOfBoundsException if {@code i_offset < 0}, or ! * {@code i_offset > indexMap.length - this.length()}, * or for any vector lane index {@code N} the result of ! * {@code a_offset + indexMap[i_offset + N]} is {@code < 0} or {@code >= a.length} */ ! public abstract void intoArray(double[] a, int a_offset, int[] indexMap, int i_offset); /** * Stores this vector into an array using indexes obtained from an index * map and using a mask. * <p> * For each vector lane, where {@code N} is the vector lane index, * if the mask lane at index {@code N} is set then the lane element at * index {@code N} is stored into the array at index ! * {@code a_offset + indexMap[i_offset + N]}. * * @param a the array ! * @param 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 * @param m the mask * @param indexMap the index map ! * @param i_offset the offset into the index map * @throws IndexOutOfBoundsException if {@code j < 0}, or ! * {@code i_offset > indexMap.length - this.length()}, * or for any vector lane index {@code N} where the mask at lane ! * {@code N} is set the result of {@code a_offset + indexMap[i_offset + N]} is * {@code < 0} or {@code >= a.length} */ ! public abstract void intoArray(double[] a, int a_offset, VectorMask<Double> m, int[] indexMap, int i_offset); // Species @Override public abstract VectorSpecies<Double> species();
< prev index next >