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.8 required=3.0 tests=BAYES_50,FREEMAIL_FROM, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:a05:6214:3901:b0:535:5ee6:4ca5 with SMTP id nh1-20020a056214390100b005355ee64ca5mr472392qvb.96.1674423258679; Sun, 22 Jan 2023 13:34:18 -0800 (PST) X-Received: by 2002:a05:6870:e97:b0:144:bbfc:ba96 with SMTP id mm23-20020a0568700e9700b00144bbfcba96mr1390496oab.18.1674423258431; Sun, 22 Jan 2023 13:34:18 -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 13:34:18 -0800 (PST) Injection-Info: google-groups.googlegroups.com; posting-host=157.143.56.236; posting-account=Wbe3fAoAAAALa8UT9MWTy6mw2ahlRJms NNTP-Posting-Host: 157.143.56.236 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <9c7cccd9-733f-49a8-b482-087ccb14b58dn@googlegroups.com> Subject: Real_Arrays on heap with overloaded operators and clean syntax From: Jim Paloander Injection-Date: Sun, 22 Jan 2023 21:34:18 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2033 Xref: reader01.eternal-september.org comp.lang.ada:64846 List-Id: Dear ADA lovers, with stack allocation of Real_Vector ( 1 .. N ) when N >=3D 100,000 I get S= TACK_OVERFLOW ERROR while trying to check how fast operator overloading is = working for an expression=20 X :=3D A + B + C + C + A + B, where=20 A,B,C,X are all Real_Vector ( 1 .. N ).=20 So my only option was to allocate on the heap using new. But then I lost th= e clean syntax=20 X :=3D A + B + C + C + A + B=20 and I had to write instead:=20 X.all :=3D A.all + B.all + C.all + C.all + A.all + B.all.=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 vect= or products and vector updates, you do need to allocate on the heap (sizes = 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 declaring A= ,B,C,X as access Real_Vector? Thanks for your time!