| Ruud H.G. van Tol on Thu, 26 Mar 2026 18:15:35 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Re: add listsum( L, {n=#L}, {s=1} ) |
On 2026-03-26 18:01, Bill Allombert wrote:
> On Tue, Mar 24, 2026 at 11:53:26AM +0100, Ruud H.G. van Tol wrote:
>> Consider adding listsum( L, {i1 = 1}, {i2 = #L} ).
>>
>> Much like vecsum( Vec( L[ i1 .. i2 ] ) ) would be,
>> but without copying any data.
>
> Rather I just changed vecsum and vecprod to allow t_LIST in commit
> bb57edd30e55ee386794d80bf7d3556cb9af266d
>
> Thanks for the suggestion!
Thanks! What lead me to the suggestion was that I needed to efficiently
sum a sub-list.
That sub-list was almost the full list, just without a marginal initial
part,
so in my case I can work around it by subtracting the sum of that
initial part.
-- Ruud