# \#accumulate

**URL:** https://discourse.julialang.org/tag/accumulate/1035.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Reduce/Accumulate with Matrix Matrix Product](https://discourse.julialang.org/t/reduce-accumulate-with-matrix-matrix-product/118260)

<div class="topic-metadata">

**Author:** [@xyhl](https://discourse.julialang.org/u/xyhl)\
**Replies:** 7\
**Last updated:** [August 16, 2024, 2:15pm UTC](https://discourse.julialang.org/t/reduce-accumulate-with-matrix-matrix-product/118260 "2024-08-16T14:15:30Z")

</div>

I would like to use the standard lib reduce and accumulate to calculate the matrix matrix products instead of the element wise products. mat = Array{ComplexF64}(undef, 2, 2, 3) mat\[:, :, 1\] = \[1+0.5im 0.0+0.0im; 0.0…

---

## [Is accumulate() with '+' producing the wrong results?](https://discourse.julialang.org/t/is-accumulate-with-producing-the-wrong-results/95952)

<div class="topic-metadata">

**Author:** [@P570](https://discourse.julialang.org/u/P570)\
**Replies:** 1\
**Last updated:** [March 13, 2023, 11:06am UTC](https://discourse.julialang.org/t/is-accumulate-with-producing-the-wrong-results/95952 "2023-03-13T11:06:25Z")

</div>

Hi, I lately started experimenting a bit with CUDA and was doing some exploratory work through the REPL. I was doing some addition tests with accumulate() and reduce() when I stumbled on what seems to be an issue with …

---

## [How does push!() work within accumulate()?](https://discourse.julialang.org/t/how-does-push-work-within-accumulate/81286)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 1\
**Last updated:** [May 18, 2022, 11:32pm UTC](https://discourse.julialang.org/t/how-does-push-work-within-accumulate/81286 "2022-05-18T23:32:58Z")

</div>

why are the two formulations of accumulate() different? accumulate((s,c)-\>push!(s,c),1:3,init=\[\]) != accumulate((s,c)-\>\[s;c\],1:3,init=\[\]) #true push!(\[1,2\],3)==\[\[1,2\];3\] # true
