1 |
|
/* |
2 |
|
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
|
* Expert Group and released to the public domain, as explained at |
4 |
< |
* http://creativecommons.org/licenses/publicdomain |
4 |
> |
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
*/ |
6 |
|
|
7 |
|
package extra166y; |
24 |
|
} |
25 |
|
|
26 |
|
/** |
27 |
< |
* Applies the given procedure |
27 |
> |
* Applies the given procedure. |
28 |
|
* @param procedure the procedure |
29 |
|
*/ |
30 |
|
public void apply(DoubleProcedure procedure) { |
32 |
|
} |
33 |
|
|
34 |
|
/** |
35 |
< |
* Returns reduction of mapped elements |
35 |
> |
* Returns reduction of mapped elements. |
36 |
|
* @param reducer the reducer |
37 |
|
* @param base the result for an empty array |
38 |
|
* @return reduction |
45 |
|
} |
46 |
|
|
47 |
|
/** |
48 |
< |
* Returns the minimum element, or Double.MAX_VALUE if empty |
48 |
> |
* Returns the minimum element, or Double.MAX_VALUE if empty. |
49 |
|
* @return minimum element, or Double.MAX_VALUE if empty |
50 |
|
*/ |
51 |
|
public double min() { |
53 |
|
} |
54 |
|
|
55 |
|
/** |
56 |
< |
* Returns the minimum element, or Double.MAX_VALUE if empty |
56 |
> |
* Returns the minimum element, or Double.MAX_VALUE if empty. |
57 |
|
* @param comparator the comparator |
58 |
|
* @return minimum element, or Double.MAX_VALUE if empty |
59 |
|
*/ |
62 |
|
} |
63 |
|
|
64 |
|
/** |
65 |
< |
* Returns the maximum element, or -Double.MAX_VALUE if empty |
65 |
> |
* Returns the maximum element, or -Double.MAX_VALUE if empty. |
66 |
|
* @return maximum element, or -Double.MAX_VALUE if empty |
67 |
|
*/ |
68 |
|
public double max() { |
70 |
|
} |
71 |
|
|
72 |
|
/** |
73 |
< |
* Returns the maximum element, or -Double.MAX_VALUE if empty |
73 |
> |
* Returns the maximum element, or -Double.MAX_VALUE if empty. |
74 |
|
* @param comparator the comparator |
75 |
|
* @return maximum element, or -Double.MAX_VALUE if empty |
76 |
|
*/ |
79 |
|
} |
80 |
|
|
81 |
|
/** |
82 |
< |
* Returns the sum of elements |
82 |
> |
* Returns the sum of elements. |
83 |
|
* @return the sum of elements |
84 |
|
*/ |
85 |
|
public double sum() { |
87 |
|
} |
88 |
|
|
89 |
|
/** |
90 |
< |
* Returns summary statistics |
90 |
> |
* Returns summary statistics. |
91 |
|
* @param comparator the comparator to use for |
92 |
|
* locating minimum and maximum elements |
93 |
< |
* @return the summary. |
93 |
> |
* @return the summary |
94 |
|
*/ |
95 |
|
public ParallelDoubleArray.SummaryStatistics summary |
96 |
|
(DoubleComparator comparator) { |
101 |
|
} |
102 |
|
|
103 |
|
/** |
104 |
< |
* Returns summary statistics, using natural comparator |
105 |
< |
* @return the summary. |
104 |
> |
* Returns summary statistics, using natural comparator. |
105 |
> |
* @return the summary |
106 |
|
*/ |
107 |
|
public ParallelDoubleArray.SummaryStatistics summary() { |
108 |
|
return summary(CommonOps.naturalDoubleComparator()); |
109 |
|
} |
110 |
|
|
111 |
|
/** |
112 |
< |
* Returns a new ParallelDoubleArray holding mappings |
112 |
> |
* Returns a new ParallelDoubleArray holding mappings. |
113 |
|
* @return a new ParallelDoubleArray holding mappings |
114 |
|
*/ |
115 |
|
public ParallelDoubleArray all() { |
306 |
|
/** |
307 |
|
* Returns an Iterable view to sequentially step through mapped |
308 |
|
* elements also obeying bound and filter constraints, without |
309 |
< |
* performing computations to evaluate them in parallel |
309 |
> |
* performing computations to evaluate them in parallel. |
310 |
|
* @return the Iterable view |
311 |
|
*/ |
312 |
|
public Iterable<Double> sequentially() { |
313 |
|
return new SequentiallyAsDouble(); |
314 |
|
} |
315 |
|
} |
316 |
– |
|