@@ -168,6 +168,30 @@ public static int LastActiveElement(byte[] v)
168
168
return - 1 ;
169
169
}
170
170
171
+ public static int LastActiveElement ( sbyte [ ] v )
172
+ {
173
+ for ( var i = v . Length - 1 ; i >= 0 ; i -- )
174
+ {
175
+ if ( v [ i ] != 0 )
176
+ {
177
+ return i ;
178
+ }
179
+ }
180
+ return - 1 ;
181
+ }
182
+
183
+ public static int LastActiveElement ( short [ ] v )
184
+ {
185
+ for ( var i = v . Length - 1 ; i >= 0 ; i -- )
186
+ {
187
+ if ( v [ i ] != 0 )
188
+ {
189
+ return i ;
190
+ }
191
+ }
192
+ return - 1 ;
193
+ }
194
+
171
195
public static int LastActiveElement ( ushort [ ] v )
172
196
{
173
197
for ( var i = v . Length - 1 ; i >= 0 ; i -- )
@@ -180,6 +204,18 @@ public static int LastActiveElement(ushort[] v)
180
204
return - 1 ;
181
205
}
182
206
207
+ public static int LastActiveElement ( int [ ] v )
208
+ {
209
+ for ( var i = v . Length - 1 ; i >= 0 ; i -- )
210
+ {
211
+ if ( v [ i ] != 0 )
212
+ {
213
+ return i ;
214
+ }
215
+ }
216
+ return - 1 ;
217
+ }
218
+
183
219
public static int LastActiveElement ( uint [ ] v )
184
220
{
185
221
for ( var i = v . Length - 1 ; i >= 0 ; i -- )
@@ -192,6 +228,18 @@ public static int LastActiveElement(uint[] v)
192
228
return - 1 ;
193
229
}
194
230
231
+ public static int LastActiveElement ( long [ ] v )
232
+ {
233
+ for ( var i = v . Length - 1 ; i >= 0 ; i -- )
234
+ {
235
+ if ( v [ i ] != 0 )
236
+ {
237
+ return i ;
238
+ }
239
+ }
240
+ return - 1 ;
241
+ }
242
+
195
243
public static int LastActiveElement ( ulong [ ] v )
196
244
{
197
245
for ( var i = v . Length - 1 ; i >= 0 ; i -- )
@@ -204,6 +252,30 @@ public static int LastActiveElement(ulong[] v)
204
252
return - 1 ;
205
253
}
206
254
255
+ private static int LastActiveElement ( float [ ] v )
256
+ {
257
+ for ( int i = v . Length - 1 ; i >= 0 ; i -- )
258
+ {
259
+ if ( Unsafe . BitCast < float , int > ( v [ i ] ) != 0 )
260
+ {
261
+ return i ;
262
+ }
263
+ }
264
+ return - 1 ;
265
+ }
266
+
267
+ private static int LastActiveElement ( double [ ] v )
268
+ {
269
+ for ( int i = v . Length - 1 ; i >= 0 ; i -- )
270
+ {
271
+ if ( Unsafe . BitCast < double , long > ( v [ i ] ) != 0 )
272
+ {
273
+ return i ;
274
+ }
275
+ }
276
+ return - 1 ;
277
+ }
278
+
207
279
public static byte [ ] CreateMaskForNextActiveElement ( byte [ ] mask , byte [ ] srcMask )
208
280
{
209
281
var count = srcMask . Length ;
@@ -7578,18 +7650,6 @@ public static ulong Splice(ulong[] first, ulong[] second, ulong[] maskArray, int
7578
7650
return ( index < rangeSize ) ? first [ start + index ] : second [ index - rangeSize ] ;
7579
7651
}
7580
7652
7581
- private static int LastActiveElement ( byte [ ] mask ) {
7582
- for ( int i = mask . Length - 1 ; i >= 0 ; i -- )
7583
- {
7584
- if ( mask [ i ] != 0 )
7585
- {
7586
- return i ;
7587
- }
7588
- }
7589
-
7590
- return - 1 ;
7591
- }
7592
-
7593
7653
private static byte ConditionalExtract ( byte [ ] op1 , byte op2 , byte [ ] op3 , bool after )
7594
7654
{
7595
7655
int last = LastActiveElement ( op1 ) ;
@@ -7671,18 +7731,6 @@ public static byte[] ConditionalExtractLastActiveElementAndReplicate(byte[] op1,
7671
7731
return ConditionalExtract ( op1 , op2 , op3 , /* after = */ false , /* replicate = */ true ) ;
7672
7732
}
7673
7733
7674
- private static int LastActiveElement ( sbyte [ ] mask ) {
7675
- for ( int i = mask . Length - 1 ; i >= 0 ; i -- )
7676
- {
7677
- if ( mask [ i ] != 0 )
7678
- {
7679
- return i ;
7680
- }
7681
- }
7682
-
7683
- return - 1 ;
7684
- }
7685
-
7686
7734
private static sbyte ConditionalExtract ( sbyte [ ] op1 , sbyte op2 , sbyte [ ] op3 , bool after )
7687
7735
{
7688
7736
int last = LastActiveElement ( op1 ) ;
@@ -7764,18 +7812,6 @@ public static sbyte[] ConditionalExtractLastActiveElementAndReplicate(sbyte[] op
7764
7812
return ConditionalExtract ( op1 , op2 , op3 , /* after = */ false , /* replicate = */ true ) ;
7765
7813
}
7766
7814
7767
- private static int LastActiveElement ( short [ ] mask ) {
7768
- for ( int i = mask . Length - 1 ; i >= 0 ; i -- )
7769
- {
7770
- if ( mask [ i ] != 0 )
7771
- {
7772
- return i ;
7773
- }
7774
- }
7775
-
7776
- return - 1 ;
7777
- }
7778
-
7779
7815
private static short ConditionalExtract ( short [ ] op1 , short op2 , short [ ] op3 , bool after )
7780
7816
{
7781
7817
int last = LastActiveElement ( op1 ) ;
@@ -7857,18 +7893,6 @@ public static short[] ConditionalExtractLastActiveElementAndReplicate(short[] op
7857
7893
return ConditionalExtract ( op1 , op2 , op3 , /* after = */ false , /* replicate = */ true ) ;
7858
7894
}
7859
7895
7860
- private static int LastActiveElement ( ushort [ ] mask ) {
7861
- for ( int i = mask . Length - 1 ; i >= 0 ; i -- )
7862
- {
7863
- if ( mask [ i ] != 0 )
7864
- {
7865
- return i ;
7866
- }
7867
- }
7868
-
7869
- return - 1 ;
7870
- }
7871
-
7872
7896
private static ushort ConditionalExtract ( ushort [ ] op1 , ushort op2 , ushort [ ] op3 , bool after )
7873
7897
{
7874
7898
int last = LastActiveElement ( op1 ) ;
@@ -7950,18 +7974,6 @@ public static ushort[] ConditionalExtractLastActiveElementAndReplicate(ushort[]
7950
7974
return ConditionalExtract ( op1 , op2 , op3 , /* after = */ false , /* replicate = */ true ) ;
7951
7975
}
7952
7976
7953
- private static int LastActiveElement ( int [ ] mask ) {
7954
- for ( int i = mask . Length - 1 ; i >= 0 ; i -- )
7955
- {
7956
- if ( mask [ i ] != 0 )
7957
- {
7958
- return i ;
7959
- }
7960
- }
7961
-
7962
- return - 1 ;
7963
- }
7964
-
7965
7977
private static int ConditionalExtract ( int [ ] op1 , int op2 , int [ ] op3 , bool after )
7966
7978
{
7967
7979
int last = LastActiveElement ( op1 ) ;
@@ -8043,18 +8055,6 @@ public static int[] ConditionalExtractLastActiveElementAndReplicate(int[] op1, i
8043
8055
return ConditionalExtract ( op1 , op2 , op3 , /* after = */ false , /* replicate = */ true ) ;
8044
8056
}
8045
8057
8046
- private static int LastActiveElement ( uint [ ] mask ) {
8047
- for ( int i = mask . Length - 1 ; i >= 0 ; i -- )
8048
- {
8049
- if ( mask [ i ] != 0 )
8050
- {
8051
- return i ;
8052
- }
8053
- }
8054
-
8055
- return - 1 ;
8056
- }
8057
-
8058
8058
private static uint ConditionalExtract ( uint [ ] op1 , uint op2 , uint [ ] op3 , bool after )
8059
8059
{
8060
8060
int last = LastActiveElement ( op1 ) ;
@@ -8136,18 +8136,6 @@ public static uint[] ConditionalExtractLastActiveElementAndReplicate(uint[] op1,
8136
8136
return ConditionalExtract ( op1 , op2 , op3 , /* after = */ false , /* replicate = */ true ) ;
8137
8137
}
8138
8138
8139
- private static int LastActiveElement ( long [ ] mask ) {
8140
- for ( int i = mask . Length - 1 ; i >= 0 ; i -- )
8141
- {
8142
- if ( mask [ i ] != 0 )
8143
- {
8144
- return i ;
8145
- }
8146
- }
8147
-
8148
- return - 1 ;
8149
- }
8150
-
8151
8139
private static long ConditionalExtract ( long [ ] op1 , long op2 , long [ ] op3 , bool after )
8152
8140
{
8153
8141
int last = LastActiveElement ( op1 ) ;
@@ -8234,18 +8222,6 @@ public static ulong ConditionalExtractAfterLastActiveElement(ulong[] op1, ulong
8234
8222
return ConditionalExtract ( op1 , op2 , op3 , /* after = */ true ) ;
8235
8223
}
8236
8224
8237
- private static int LastActiveElement ( ulong [ ] mask ) {
8238
- for ( int i = mask . Length - 1 ; i >= 0 ; i -- )
8239
- {
8240
- if ( mask [ i ] != 0 )
8241
- {
8242
- return i ;
8243
- }
8244
- }
8245
-
8246
- return - 1 ;
8247
- }
8248
-
8249
8225
private static ulong ConditionalExtract ( ulong [ ] op1 , ulong op2 , ulong [ ] op3 , bool after )
8250
8226
{
8251
8227
int last = LastActiveElement ( op1 ) ;
@@ -8322,18 +8298,6 @@ public static ulong[] ConditionalExtractLastActiveElementAndReplicate(ulong[] op
8322
8298
return ConditionalExtract ( op1 , op2 , op3 , /* after = */ false , /* replicate = */ true ) ;
8323
8299
}
8324
8300
8325
- private static int LastActiveElement ( float [ ] mask ) {
8326
- for ( int i = mask . Length - 1 ; i >= 0 ; i -- )
8327
- {
8328
- if ( Unsafe . BitCast < float , int > ( mask [ i ] ) != 0 )
8329
- {
8330
- return i ;
8331
- }
8332
- }
8333
-
8334
- return - 1 ;
8335
- }
8336
-
8337
8301
private static float ConditionalExtract ( float [ ] op1 , float op2 , float [ ] op3 , bool after )
8338
8302
{
8339
8303
int last = LastActiveElement ( op1 ) ;
@@ -8415,18 +8379,6 @@ public static float[] ConditionalExtractLastActiveElementAndReplicate(float[] op
8415
8379
return ConditionalExtract ( op1 , op2 , op3 , /* after = */ false , /* replicate = */ true ) ;
8416
8380
}
8417
8381
8418
- private static int LastActiveElement ( double [ ] mask ) {
8419
- for ( int i = mask . Length - 1 ; i >= 0 ; i -- )
8420
- {
8421
- if ( Unsafe . BitCast < double , long > ( mask [ i ] ) != 0 )
8422
- {
8423
- return i ;
8424
- }
8425
- }
8426
-
8427
- return - 1 ;
8428
- }
8429
-
8430
8382
private static double ConditionalExtract ( double [ ] op1 , double op2 , double [ ] op3 , bool after )
8431
8383
{
8432
8384
int last = LastActiveElement ( op1 ) ;
0 commit comments