From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.0 required=3.0 tests=BAYES_40,FREEMAIL_FROM, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:a05:6214:3105:b0:52a:4a2d:5e2d with SMTP id ks5-20020a056214310500b0052a4a2d5e2dmr1138077qvb.44.1674429612750; Sun, 22 Jan 2023 15:20:12 -0800 (PST) X-Received: by 2002:a05:6830:1d6f:b0:686:595c:5384 with SMTP id l15-20020a0568301d6f00b00686595c5384mr954712oti.274.1674429612508; Sun, 22 Jan 2023 15:20:12 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 22 Jan 2023 15:20:12 -0800 (PST) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=157.143.56.236; posting-account=Wbe3fAoAAAALa8UT9MWTy6mw2ahlRJms NNTP-Posting-Host: 157.143.56.236 References: <9c7cccd9-733f-49a8-b482-087ccb14b58dn@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2039b788-bbbd-4c8e-9785-4e45d4a2027en@googlegroups.com> Subject: Re: Real_Arrays on heap with overloaded operators and clean syntax From: Jim Paloander Injection-Date: Sun, 22 Jan 2023 23:20:12 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2447 Xref: reader01.eternal-september.org comp.lang.ada:64859 List-Id: > > Dear ADA lovers,=20 > > with stack allocation of Real_Vector ( 1 .. N ) when N >=3D 100,000 I g= et STACK_OVERFLOW ERROR while trying to check how fast operator overloading= is working for an expression=20 > >=20 > > X :=3D A + B + C + C + A + B, where=20 > > A,B,C,X are all Real_Vector ( 1 .. N ).=20 > >=20 > > So my only option was to allocate on the heap using new. But then I los= t the clean syntax=20 > >=20 > > X :=3D A + B + C + C + A + B=20 > >=20 > > and I had to write instead:=20 > >=20 > > X.all :=3D A.all + B.all + C.all + C.all + A.all + B.all.=20 > >=20 > > This is really ugly and annoying because when you are using Real_Arrays= for implementing some linear algebra method who relies heavilly on matrix = vector products and vector updates, you do need to allocate on the heap (si= zes are determined in runtime) and you do need a clean syntax. So, is there= any way to simplify my life without using the .all or even without declari= ng A,B,C,X as access Real_Vector?=20 > > Thanks for your time! > If you are on linux, then you could set the stack size with=20 >=20 > $ ulimit -s unlimited=20 > $ launch_my_app=20 >=20 >=20 >=20 > Regards. On Windows 10 with mingw64?