use specified-output-type fold_addw
This commit is contained in:
parent
3d52d14101
commit
0ec37303ea
@ -119,7 +119,7 @@ def sum_accumulator{DE, unr, VT=[_]SE if int_els{DE,SE} and DE>SE and hasarch{'A
|
||||
|
||||
def me{...} = acc
|
||||
def into_scal{vs} = {
|
||||
def ps = each{if (exact) vfold{+,.} else fold_addw, vs}
|
||||
def ps = each{fold_addw{DE,.}, vs}
|
||||
acc_scal+= tree_fold{+, each{promote{A,.}, ps}}
|
||||
}
|
||||
def me{'from_unr'} = into_scal{slice{acc_tup, 1}}
|
||||
|
||||
@ -49,7 +49,7 @@ fn count{T if T<=i16}(tab:*u16, ov:*u16, xp:*void, n:u64, min_allowed:T) : T = {
|
||||
if (mt > mx) mx = mt
|
||||
|
||||
# Fast cases
|
||||
dt := promote{u64, fold_addw{dc}}
|
||||
dt := fold_addw{u64, dc}
|
||||
nc := TU~~(mt - jt) # Number of counts to perform: last is implicit
|
||||
if (dt < b * (vec/2) and (b + dt)*4 < b * promote{u64,nc}) {
|
||||
r0 = count_with_runs{x, tab, r}
|
||||
@ -103,7 +103,7 @@ def count_by_sum{T, V, U, xv, b, tab, r0, j0, m} = {
|
||||
e := each{{j}=>V**j, j}
|
||||
@for (xv over b) each{{c,e} => c -= xv == e, c, e}
|
||||
def add_sum{c, j} = {
|
||||
s := promote{usz, fold_addw{c}}
|
||||
s := fold_addw{usz, c}
|
||||
total -= s; inc{tab, j, s}
|
||||
}
|
||||
each{add_sum, c, j}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user