@@ -47,51 +47,6 @@ public static TQuantity Min<TQuantity>(TQuantity val1, TQuantity val2)
47
47
return val1 . CompareTo ( val2 ) == 1 ? val2 : val1 ;
48
48
}
49
49
50
- /// <summary>Computes the min of a sequence of <typeparamref name="TQuantity" /> values.</summary>
51
- /// <param name="source">A sequence of <typeparamref name="TQuantity" /> values to calculate the min of.</param>
52
- /// <param name="unitType">The desired unit type for the resulting quantity</param>
53
- /// <returns>The min of the values in the sequence, represented in the specified unit type.</returns>
54
- /// <exception cref="T:System.ArgumentNullException">
55
- /// <paramref name="source">source</paramref> is null.
56
- /// </exception>
57
- /// <exception cref="T:System.InvalidOperationException"><paramref name="source">source</paramref> contains no elements.</exception>
58
- /// <exception cref="ArgumentException">
59
- /// <paramref name="source">source</paramref> contains quantity types different from <paramref name="unitType" />.
60
- /// </exception>
61
- [ Obsolete ( "Duplicate of System.Linq.Min" ) ]
62
- public static TQuantity Min < TQuantity , TUnitType > ( this IEnumerable < TQuantity > source , TUnitType unitType )
63
- where TUnitType : struct , Enum
64
- where TQuantity : IQuantity < TUnitType >
65
- {
66
- return ( TQuantity ) Quantity . From ( source . Min ( x => x . As ( unitType ) ) , UnitKey . ForUnit ( unitType ) ) ;
67
- }
68
-
69
- /// <summary>
70
- /// Computes the min of the sequence of <typeparamref name="TQuantity" /> values that are obtained by invoking a
71
- /// transform function on each element of the input sequence.
72
- /// </summary>
73
- /// <param name="source">A sequence of values that are used to calculate a min.</param>
74
- /// <param name="selector">A transform function to apply to each element.</param>
75
- /// <param name="unitType">The desired unit type for the resulting quantity</param>
76
- /// <typeparam name="TSource">The type of the elements of source.</typeparam>
77
- /// <typeparam name="TQuantity">The type of quantity that is produced by this operation.</typeparam>
78
- /// <typeparam name="TUnitType">The type of unit enum.</typeparam>
79
- /// <returns>The min of the projected values, represented in the specified unit type.</returns>
80
- /// <exception cref="T:System.ArgumentNullException">
81
- /// <paramref name="source">source</paramref> or <paramref name="selector">selector</paramref> is null.
82
- /// </exception>
83
- /// <exception cref="T:System.InvalidOperationException"><paramref name="source">source</paramref> contains no elements.</exception>
84
- /// <exception cref="ArgumentException">
85
- /// <paramref name="source">source</paramref> contains quantity types different from <paramref name="unitType" />.
86
- /// </exception>
87
- [ Obsolete ( "Duplicate of System.Linq.Min" ) ]
88
- public static TQuantity Min < TSource , TQuantity , TUnitType > ( this IEnumerable < TSource > source , Func < TSource , TQuantity > selector , TUnitType unitType )
89
- where TQuantity : IQuantity < TUnitType >
90
- where TUnitType : struct , Enum
91
- {
92
- return source . Select ( selector ) . Min ( unitType ) ;
93
- }
94
-
95
50
/// <summary>Returns the larger of two <typeparamref name="TQuantity" /> values.</summary>
96
51
/// <typeparam name="TQuantity">The type of quantities to compare.</typeparam>
97
52
/// <param name="val1">The first of two <typeparamref name="TQuantity" /> values to compare.</param>
@@ -102,51 +57,6 @@ public static TQuantity Max<TQuantity>(TQuantity val1, TQuantity val2)
102
57
{
103
58
return val1 . CompareTo ( val2 ) == - 1 ? val2 : val1 ;
104
59
}
105
-
106
- /// <summary>Computes the max of a sequence of <typeparamref name="TQuantity" /> values.</summary>
107
- /// <param name="source">A sequence of <typeparamref name="TQuantity" /> values to calculate the max of.</param>
108
- /// <param name="unitType">The desired unit type for the resulting quantity</param>
109
- /// <returns>The max of the values in the sequence, represented in the specified unit type.</returns>
110
- /// <exception cref="T:System.ArgumentNullException">
111
- /// <paramref name="source">source</paramref> is null.
112
- /// </exception>
113
- /// <exception cref="T:System.InvalidOperationException"><paramref name="source">source</paramref> contains no elements.</exception>
114
- /// <exception cref="ArgumentException">
115
- /// <paramref name="source">source</paramref> contains quantity types different from <paramref name="unitType" />.
116
- /// </exception>
117
- [ Obsolete ( "Duplicate of System.Linq.Max" ) ]
118
- public static TQuantity Max < TQuantity , TUnitType > ( this IEnumerable < TQuantity > source , TUnitType unitType )
119
- where TQuantity : IQuantity < TUnitType >
120
- where TUnitType : struct , Enum
121
- {
122
- return ( TQuantity ) Quantity . From ( source . Max ( x => x . As ( unitType ) ) , UnitKey . ForUnit ( unitType ) ) ;
123
- }
124
-
125
- /// <summary>
126
- /// Computes the max of the sequence of <typeparamref name="TQuantity" /> values that are obtained by invoking a
127
- /// transform function on each element of the input sequence.
128
- /// </summary>
129
- /// <param name="source">A sequence of values that are used to calculate a max.</param>
130
- /// <param name="selector">A transform function to apply to each element.</param>
131
- /// <param name="unitType">The desired unit type for the resulting quantity</param>
132
- /// <typeparam name="TSource">The type of the elements of source.</typeparam>
133
- /// <typeparam name="TQuantity">The type of quantity that is produced by this operation.</typeparam>
134
- /// <typeparam name="TUnitType">The type of unit enum.</typeparam>
135
- /// <returns>The max of the projected values, represented in the specified unit type.</returns>
136
- /// <exception cref="T:System.ArgumentNullException">
137
- /// <paramref name="source">source</paramref> or <paramref name="selector">selector</paramref> is null.
138
- /// </exception>
139
- /// <exception cref="T:System.InvalidOperationException"><paramref name="source">source</paramref> contains no elements.</exception>
140
- /// <exception cref="ArgumentException">
141
- /// <paramref name="source">source</paramref> contains quantity types different from <paramref name="unitType" />.
142
- /// </exception>
143
- [ Obsolete ( "Duplicate of System.Linq.Max" ) ]
144
- public static TQuantity Max < TSource , TQuantity , TUnitType > ( this IEnumerable < TSource > source , Func < TSource , TQuantity > selector , TUnitType unitType )
145
- where TQuantity : IQuantity < TUnitType >
146
- where TUnitType : struct , Enum
147
- {
148
- return source . Select ( selector ) . Max ( unitType ) ;
149
- }
150
60
151
61
/// <summary>Returns <paramref name="value" /> clamped to the inclusive range of <paramref name="min" /> and <paramref name="max" />.</summary>
152
62
/// <param name="value">The value to be clamped.</param>
0 commit comments