| Deutsch English Français Italiano |
|
<2025Jul19.165100@mips.complang.tuwien.ac.at> View for Bookmarking (what is this?) Look up another Usenet article |
Path: nntp.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: Vector sum
Date: Sat, 19 Jul 2025 14:51:00 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 40
Message-ID: <2025Jul19.165100@mips.complang.tuwien.ac.at>
References: <1f433fabcb4d053d16cbc098dedc6c370608ac01@i2pn2.org> <063d4a116fb394a776b1e9313f9903cf@www.novabbs.com> <2025Jul14.095004@mips.complang.tuwien.ac.at> <a449857495e02b4d35627f9f31d37fd8@www.novabbs.com> <2025Jul16.132504@mips.complang.tuwien.ac.at> <2025Jul16.173926@mips.complang.tuwien.ac.at> <20250717101400.000074f9@tin.it> <2025Jul17.145429@mips.complang.tuwien.ac.at> <20250717224825.00007b8c@tin.it> <2025Jul19.121815@mips.complang.tuwien.ac.at> <me1f9fF1n1fU1@mid.individual.net>
Injection-Date: Sat, 19 Jul 2025 17:04:52 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7e2a3e3d33262770e6ada0b8a4819fae";
logging-data="2951809"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Xhc5zBw7dTSuCoZpl+kPb"
Cancel-Lock: sha1:IB+AjRWFOpY2tvZ2QQEcolkO5gc=
X-newsreader: xrn 10.11
minforth <minforth@gmx.net> writes:
>Am 19.07.2025 um 12:18 schrieb Anton Ertl:
>
>> One way to deal with all that would be to have a long-vector stack and
>> have something like my vector wordset
>> <https://github.com/AntonErtl/vectors>, where the sum of a vector
>> would be a word that is implemented in some lower-level way (e.g.,
>> assembly language); the sum of a vector is actually a planned, but not
>> yet existing feature of this wordset.
>>
>
>Not wanting to sound negative, but who in practice adds up long
>vectors, apart from testing compilers and fp-arithmetic?
Everyone who does dot-products.
>Dot products, on the other hand, are fundamental for many linear
>algebra algorithms, eg. matrix multiplication and AI.
If I add a vector-sum word
df+red ( dfv -- r )
\ r is the sum of the elements of dfv
to the vector wordset, then the dot-product is:
: dot-product ( dfv1 dfv2 -- r )
df*v df+red ;
Concerning matrix multiplication, while you can use the dot-product
for it, there are many other ways to do it, and some are more
efficient (although, admittedly, I have not used pairwise addition for
these ways).
- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: https://forth-standard.org/
EuroForth 2025 CFP: http://www.euroforth.org/ef25/cfp.html