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=-2.2 required=3.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,NICE_REPLY_A,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Rod Kay Newsgroups: comp.lang.ada Subject: Re: Real_Arrays on heap with overloaded operators and clean syntax Date: Mon, 23 Jan 2023 17:34:06 +1100 Organization: A noiseless patient Spider Message-ID: References: <9c7cccd9-733f-49a8-b482-087ccb14b58dn@googlegroups.com> <2039b788-bbbd-4c8e-9785-4e45d4a2027en@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Mon, 23 Jan 2023 06:33:49 -0000 (UTC) Injection-Info: reader01.eternal-september.org; posting-host="f2406f80d8a139156a3308bf3c4cc5d0"; logging-data="3700247"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+g+aS2art8aRqAtOLYfEhsi2QoiV3vUQQ=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.0 Cancel-Lock: sha1:jYWyWeFH21uw6/QWdZ5rO+FHVgU= Content-Language: en-US In-Reply-To: Xref: reader01.eternal-september.org comp.lang.ada:64864 List-Id: On 23/1/23 10:34, Rod Kay wrote: > On 23/1/23 10:20, Jim Paloander wrote: >>>> Dear ADA lovers, >>>> with stack allocation of Real_Vector ( 1 .. N ) when N >= 100,000 I >>>> get STACK_OVERFLOW ERROR while trying to check how fast operator >>>> overloading is working for an expression >>>> >>>> X := A + B + C + C + A + B, where >>>> A,B,C,X are all Real_Vector ( 1 .. N ). >>>> >>>> So my only option was to allocate on the heap using new. But then I >>>> lost the clean syntax >>>> >>>> X := A + B + C + C + A + B >>>> >>>> and I had to write instead: >>>> >>>> X.all := A.all + B.all + C.all + C.all + A.all + B.all. >>>> >>>> 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 (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! >>> If you are on linux, then you could set the stack size with >>> >>> $ ulimit -s unlimited >>> $ launch_my_app >>> >>> >>> >>> Regards. >> On Windows 10 with mingw64? > >    Not sure. I don't have a windows machine. > >    What happens when try ? > >       $ ulimit -a ulimit is available on cygwin. It is not available on mingw64 then ?