61 |
|
|
62 |
|
/** |
63 |
|
* Creates a new ParallelDoubleArray using the given executor and |
64 |
< |
* an array of the given size |
64 |
> |
* an array of the given size. |
65 |
|
* @param size the array size |
66 |
|
* @param executor the executor |
67 |
|
*/ |
154 |
|
} |
155 |
|
|
156 |
|
/** |
157 |
< |
* Returns the executor used for computations |
157 |
> |
* Returns the executor used for computations. |
158 |
|
* @return the executor |
159 |
|
*/ |
160 |
|
public ForkJoinPool getExecutor() { return ex; } |
161 |
|
|
162 |
|
/** |
163 |
< |
* Applies the given procedure to elements |
163 |
> |
* Applies the given procedure to elements. |
164 |
|
* @param procedure the procedure |
165 |
|
*/ |
166 |
|
public void apply(DoubleProcedure procedure) { |
168 |
|
} |
169 |
|
|
170 |
|
/** |
171 |
< |
* Returns reduction of elements |
171 |
> |
* Returns reduction of elements. |
172 |
|
* @param reducer the reducer |
173 |
|
* @param base the result for an empty array |
174 |
|
* @return reduction |
178 |
|
} |
179 |
|
|
180 |
|
/** |
181 |
< |
* Returns a new ParallelDoubleArray holding all elements |
181 |
> |
* Returns a new ParallelDoubleArray holding all elements. |
182 |
|
* @return a new ParallelDoubleArray holding all elements |
183 |
|
*/ |
184 |
|
public ParallelDoubleArray all() { |
209 |
|
|
210 |
|
/** |
211 |
|
* Replaces elements with the results of applying the given |
212 |
< |
* mapping to each index and current element value |
212 |
> |
* mapping to each index and current element value. |
213 |
|
* @param op the op |
214 |
|
* @return this (to simplify use in expressions) |
215 |
|
*/ |
222 |
|
* Replaces elements with the results of applying the given |
223 |
|
* generator. For example, to fill the array with uniform random |
224 |
|
* values, use |
225 |
< |
* <tt>replaceWithGeneratedValue(Ops.doubleRandom())</tt> |
225 |
> |
* <tt>replaceWithGeneratedValue(Ops.doubleRandom())</tt>. |
226 |
|
* @param generator the generator |
227 |
|
* @return this (to simplify use in expressions) |
228 |
|
*/ |
243 |
|
|
244 |
|
/** |
245 |
|
* Replaces elements with results of applying |
246 |
< |
* <tt>op(thisElement, otherElement)</tt> |
246 |
> |
* <tt>op(thisElement, otherElement)</tt>. |
247 |
|
* @param other the other array |
248 |
|
* @param combiner the combiner |
249 |
|
* @return this (to simplify use in expressions) |
258 |
|
|
259 |
|
/** |
260 |
|
* Replaces elements with results of applying |
261 |
< |
* <tt>op(thisElement, otherElement)</tt> |
261 |
> |
* <tt>op(thisElement, otherElement)</tt>. |
262 |
|
* @param other the other array |
263 |
|
* @param combiner the combiner |
264 |
|
* @return this (to simplify use in expressions) |
273 |
|
|
274 |
|
/** |
275 |
|
* Returns the index of some element equal to given target, or -1 |
276 |
< |
* if not present |
276 |
> |
* if not present. |
277 |
|
* @param target the element to search for |
278 |
|
* @return the index or -1 if not present |
279 |
|
*/ |
852 |
|
public int size() { return fence; } |
853 |
|
|
854 |
|
/** |
855 |
< |
* Returns the underlying array used for computations |
855 |
> |
* Returns the underlying array used for computations. |
856 |
|
* @return the array |
857 |
|
*/ |
858 |
|
public double[] getArray() { return array; } |
859 |
|
|
860 |
|
/** |
861 |
< |
* Returns the element of the array at the given index |
861 |
> |
* Returns the element of the array at the given index. |
862 |
|
* @param i the index |
863 |
|
* @return the element of the array at the given index |
864 |
|
*/ |
865 |
|
public double get(int i) { return array[i]; } |
866 |
|
|
867 |
|
/** |
868 |
< |
* Sets the element of the array at the given index to the given value |
868 |
> |
* Sets the element of the array at the given index to the given value. |
869 |
|
* @param i the index |
870 |
|
* @param x the value |
871 |
|
*/ |
872 |
|
public void set(int i, double x) { array[i] = x; } |
873 |
|
|
874 |
|
/** |
875 |
< |
* Equivalent to <tt>asList().toString()</tt> |
875 |
> |
* Equivalent to <tt>asList().toString()</tt>. |
876 |
|
* @return a string representation |
877 |
|
*/ |
878 |
|
public String toString() { |