2 implementations of Complex_addition_bybuf:
#1
/digego/extempore/tree/v0.8.9/libs/core/math.xtm ·
#2
/digego/extempore/tree/v0.8.9/libs/core/math.xtm
(bind-func Complex_addition_bybuf
(lambda (a:Complexf* b:Complexf* c:Complexf* len:i64)
(if (evenp len)
(let ((aa:/4,float/* (cast a))
(bb:/4,float/* (cast b))
(cc:/4,float/* (cast c))
(k 0))
(dotimes (k (/ len 2))
(pset! cc k (+ (pref-ptr aa k) (pref-ptr bb k)))
void))
(let ((i 0))
(dotimes (i len)
(tset! (pref-ptr c i) 0
(+ (tref (pref-ptr a i) 0)
(tref (pref-ptr b i) 0)))
(tset! (pref-ptr c i) 1
(+ (tref (pref-ptr a i) 1)
(tref (pref-ptr b i) 1))))
void))))