Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

 *** System shutdown message from root *** System going down in 60 seconds


devel / comp.lang.ada / Re: Real_Arrays on heap with overloaded operators and clean syntax

SubjectAuthor
* Real_Arrays on heap with overloaded operators and clean syntaxJim Paloander
+* Re: Real_Arrays on heap with overloaded operators and clean syntaxJoakim Strandberg
|`* Re: Real_Arrays on heap with overloaded operators and clean syntaxJim Paloander
| +* Re: Real_Arrays on heap with overloaded operators and clean syntaxJoakim Strandberg
| |`* Re: Real_Arrays on heap with overloaded operators and clean syntaxJim Paloander
| | +- Re: Real_Arrays on heap with overloaded operators and clean syntaxJoakim Strandberg
| | `* Re: Real_Arrays on heap with overloaded operators and clean syntaxGautier write-only address
| |  `* Re: Real_Arrays on heap with overloaded operators and clean syntaxLeo Brewin
| |   `- Re: Real_Arrays on heap with overloaded operators and clean syntaxJim Paloander
| `- Re: Real_Arrays on heap with overloaded operators and clean syntaxG.B.
+* Re: Real_Arrays on heap with overloaded operators and clean syntaxDmitry A. Kazakov
|`* Re: Real_Arrays on heap with overloaded operators and clean syntaxJim Paloander
| `* Re: Real_Arrays on heap with overloaded operators and clean syntaxDmitry A. Kazakov
|  `* Re: Real_Arrays on heap with overloaded operators and clean syntaxJim Paloander
|   `* Re: Real_Arrays on heap with overloaded operators and clean syntaxJ-P. Rosen
|    `* Re: Real_Arrays on heap with overloaded operators and clean syntaxJim Paloander
|     `* Re: Real_Arrays on heap with overloaded operators and clean syntaxJ-P. Rosen
|      `* Re: Real_Arrays on heap with overloaded operators and clean syntaxGautier write-only address
|       `- Re: Real_Arrays on heap with overloaded operators and clean syntaxJim Paloander
+* Re: Real_Arrays on heap with overloaded operators and clean syntaxRod Kay
|`* Re: Real_Arrays on heap with overloaded operators and clean syntaxJim Paloander
| `* Re: Real_Arrays on heap with overloaded operators and clean syntaxRod Kay
|  +* Re: Real_Arrays on heap with overloaded operators and clean syntaxJoakim Strandberg
|  |`* Re: Real_Arrays on heap with overloaded operators and clean syntaxEgil H H
|  | `- Re: Real_Arrays on heap with overloaded operators and clean syntaxJ-P. Rosen
|  `* Re: Real_Arrays on heap with overloaded operators and clean syntaxRod Kay
|   `* Re: Real_Arrays on heap with overloaded operators and clean syntaxJim Paloander
|    `- Re: Real_Arrays on heap with overloaded operators and clean syntaxRod Kay
+* Re: Real_Arrays on heap with overloaded operators and clean syntaxGautier write-only address
|`* Re: Real_Arrays on heap with overloaded operators and clean syntaxGautier write-only address
| `- Re: Real_Arrays on heap with overloaded operators and clean syntaxJim Paloander
`* Re: Real_Arrays on heap with overloaded operators and clean syntaxJerry
 `* Re: Real_Arrays on heap with overloaded operators and clean syntaxJim Paloander
  `- Re: Real_Arrays on heap with overloaded operators and clean syntaxJerry

Pages:12
Re: Real_Arrays on heap with overloaded operators and clean syntax

<f0be0bc2-179a-4935-a0d9-15ec48c337ebn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9280&group=comp.lang.ada#9280

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:6214:292:b0:537:6a1e:d81e with SMTP id l18-20020a056214029200b005376a1ed81emr162782qvv.4.1674601342578;
Tue, 24 Jan 2023 15:02:22 -0800 (PST)
X-Received: by 2002:a05:6870:3c5:b0:160:977c:e1ec with SMTP id
h5-20020a05687003c500b00160977ce1ecmr414045oaf.63.1674601342037; Tue, 24 Jan
2023 15:02:22 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.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: Tue, 24 Jan 2023 15:02:21 -0800 (PST)
In-Reply-To: <62954fe7-8f83-40ad-823f-ef628c43c544n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a02:1210:2824:7200:e16e:d103:5ddc:cf2a;
posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG
NNTP-Posting-Host: 2a02:1210:2824:7200:e16e:d103:5ddc:cf2a
References: <9c7cccd9-733f-49a8-b482-087ccb14b58dn@googlegroups.com> <62954fe7-8f83-40ad-823f-ef628c43c544n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f0be0bc2-179a-4935-a0d9-15ec48c337ebn@googlegroups.com>
Subject: Re: Real_Arrays on heap with overloaded operators and clean syntax
From: gautier_niouzes@hotmail.com (Gautier write-only address)
Injection-Date: Tue, 24 Jan 2023 23:02:22 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1415
 by: Gautier write-only a - Tue, 24 Jan 2023 23:02 UTC

Current version of the draft is located here:
https://github.com/zertovitch/mathpaqs/blob/master/lin_alg/universal_matrices.ads

Re: Real_Arrays on heap with overloaded operators and clean syntax

<d3371ebb-d11e-4515-88fb-2ba7714d0eaan@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9281&group=comp.lang.ada#9281

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:622a:2281:b0:3b6:326f:fe37 with SMTP id ay1-20020a05622a228100b003b6326ffe37mr1162169qtb.57.1674640257391;
Wed, 25 Jan 2023 01:50:57 -0800 (PST)
X-Received: by 2002:a9d:6f05:0:b0:686:4b6f:78a8 with SMTP id
n5-20020a9d6f05000000b006864b6f78a8mr1504676otq.291.1674640257153; Wed, 25
Jan 2023 01:50:57 -0800 (PST)
Path: i2pn2.org!i2pn.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: Wed, 25 Jan 2023 01:50:56 -0800 (PST)
In-Reply-To: <f0be0bc2-179a-4935-a0d9-15ec48c337ebn@googlegroups.com>
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>
<62954fe7-8f83-40ad-823f-ef628c43c544n@googlegroups.com> <f0be0bc2-179a-4935-a0d9-15ec48c337ebn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d3371ebb-d11e-4515-88fb-2ba7714d0eaan@googlegroups.com>
Subject: Re: Real_Arrays on heap with overloaded operators and clean syntax
From: dhmos.altiotis@gmail.com (Jim Paloander)
Injection-Date: Wed, 25 Jan 2023 09:50:57 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4106
 by: Jim Paloander - Wed, 25 Jan 2023 09:50 UTC

Dear Gautier,

thank you for the draft. Indeed something like that would be great possibly without polynomials or rational numbers etc. You just need doubles and/or floats and complex numbers. Sparse matrices are another animal, and once adopted they are another dimension of complexity. This is because apart from the triplet format which is easily expandable, one may also need to convert the triplet to CSR and there multiple entries with same row and column index need first to be summed so we have a single entry (i, j, value) for each (i, j) before converting to CSR. So I mean, one would like to build a library then and I am not so sure how easy would be to hardcode this library so that operations on matrices/vectors are as efficient as in Fortran. For Dense matrices it may still be possible to support mathematical expressions without introducing temporary objects. But if you also bring sparse into the game then?
(alpha,beta,gamma scalars, while x,y,z,w vectors, A, B_sparse matrices)

does this have a chance to be executed without temporaries?
y := alpha*x + beta*A*x + gamma*B_sparse*(z-w)

this has a chance to be executed without temporaries Fortran already does it.
y := alpha*x + beta*A*x

I would create a SparseMatrix library and break the statement above in 2
y1 := B_sparse*(z-w)
y := alpha*x + beta*A*x + gamma*y1;

I could survive with that. The problem dear Gautier is the temporary objects in such libraries. Very correctly J.P.Rosen suggested BLAS. The problem is that for simple vector operations (BLAS1) there is no speedup at all and the operations of BLAS1 cannot be executed for the whole expression, just in an `axpy (a*x+y)` manner one by one. This would require transversal of the arrays many times in a long expression involving vectors as (y := x1 + x2*alpha + beta*(x3-gamma*x4) + alpha*beta*(x1-x2)). For BLAS2 operations (matrix times vector) you may see a performance gain using BLAS but for large matrices, very large. Where you definitely see such a performance gain is for BLAS3 and there we definitely need something like that.

This discussion started about techniques to avoid generation of temporaries.. Even when you manipulate complex numbers you introduce temporaries. I need to come back to you guys with some number to understand the problem better. I will be back with these numbers. But until then, please let me know, do you feel that there is a need of a performance uplifting and mathematics enabling ADA library which is not Real_Arrays or Containers, but a real Math library allowing Real and Complex math manipulation and integrating possibly some Lapack routines as Real_Arrays do at the moment?

Re: Real_Arrays on heap with overloaded operators and clean syntax

<312df16a-213d-4d72-8dbf-2278778e18a7n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9282&group=comp.lang.ada#9282

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:164d:b0:706:92f3:12ac with SMTP id c13-20020a05620a164d00b0070692f312acmr1748607qko.175.1674640377759;
Wed, 25 Jan 2023 01:52:57 -0800 (PST)
X-Received: by 2002:a05:6808:1704:b0:35b:c586:d978 with SMTP id
bc4-20020a056808170400b0035bc586d978mr1668084oib.77.1674640377528; Wed, 25
Jan 2023 01:52:57 -0800 (PST)
Path: i2pn2.org!i2pn.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: Wed, 25 Jan 2023 01:52:57 -0800 (PST)
In-Reply-To: <tqoclt$3n7q$1@dont-email.me>
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>
<tqkcdo$1u1j$1@gioia.aioe.org> <2801afb2-045f-4fec-b41e-f83b2c80e672n@googlegroups.com>
<tqlgfv$1alo$1@gioia.aioe.org> <446867f7-526d-429f-951a-da1a97efff4dn@googlegroups.com>
<tqoclt$3n7q$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <312df16a-213d-4d72-8dbf-2278778e18a7n@googlegroups.com>
Subject: Re: Real_Arrays on heap with overloaded operators and clean syntax
From: dhmos.altiotis@gmail.com (Jim Paloander)
Injection-Date: Wed, 25 Jan 2023 09:52:57 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2253
 by: Jim Paloander - Wed, 25 Jan 2023 09:52 UTC

> > ADA should provide native support of vector-math or Vector.Numerics, or AdvancedNumerics or Numerics.LinearAlgebra and/or Numerics.SparseLinearAlgebra. Honestly with all the mission critical applications ADA is used for, I would expect something like that to enable people working in scientific computing and in general wherever Linear Algebra kernels are essential tool of the core algorithms development.
> Did you consider the facilities from Annex G? Moreover, there are
> bindings to BLAS, LAPACK, and more. Try "Ada mathematical libraries" on
> Google...

Thank you, very nice and positive suggestion. Please read my answer below to Gautier. Thank you again for the nice feedback.By the way, is there any other forum/discussion for ADA in github or elsewhere where we can also post code with colours etc?

Re: Real_Arrays on heap with overloaded operators and clean syntax

<tqr6rp$lf4r$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9283&group=comp.lang.ada#9283

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: rosen@adalog.fr (J-P. Rosen)
Newsgroups: comp.lang.ada
Subject: Re: Real_Arrays on heap with overloaded operators and clean syntax
Date: Wed, 25 Jan 2023 13:21:15 +0100
Organization: Adalog
Lines: 21
Message-ID: <tqr6rp$lf4r$1@dont-email.me>
References: <9c7cccd9-733f-49a8-b482-087ccb14b58dn@googlegroups.com>
<tqkcdo$1u1j$1@gioia.aioe.org>
<2801afb2-045f-4fec-b41e-f83b2c80e672n@googlegroups.com>
<tqlgfv$1alo$1@gioia.aioe.org>
<446867f7-526d-429f-951a-da1a97efff4dn@googlegroups.com>
<tqoclt$3n7q$1@dont-email.me>
<312df16a-213d-4d72-8dbf-2278778e18a7n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 25 Jan 2023 12:21:14 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="7b8d0af44390709afb065d7547f15e3c";
logging-data="703643"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Cjo0HFTjXGyMbkxWwdudq"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Cancel-Lock: sha1:Jn9iSS8CEsJQHoHGBok+nNpSP14=
In-Reply-To: <312df16a-213d-4d72-8dbf-2278778e18a7n@googlegroups.com>
Content-Language: fr, en-US
 by: J-P. Rosen - Wed, 25 Jan 2023 12:21 UTC

Le 25/01/2023 à 10:52, Jim Paloander a écrit :
>
>>> ADA should provide native support of vector-math or Vector.Numerics, or AdvancedNumerics or Numerics.LinearAlgebra and/or Numerics.SparseLinearAlgebra. Honestly with all the mission critical applications ADA is used for, I would expect something like that to enable people working in scientific computing and in general wherever Linear Algebra kernels are essential tool of the core algorithms development.
>> Did you consider the facilities from Annex G? Moreover, there are
>> bindings to BLAS, LAPACK, and more. Try "Ada mathematical libraries" on
>> Google...
>
> Thank you, very nice and positive suggestion. Please read my answer below to Gautier. Thank you again for the nice feedback.By the way, is there any other forum/discussion for ADA in github or elsewhere where we can also post code with colours etc?

Gitter: https://gitter.im/ada-lang
LinkedIn: https://www.linkedin.com/groups/114211
Reddit: https://www.reddit.com/r/ada
StackOverflow: https://www.stackoverflow.com/questions/tagged/ada
Twitter: https://twitter.com/search?q=adaprogramming

--
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
https://www.adalog.fr https://www.adacontrol.fr

Re: Real_Arrays on heap with overloaded operators and clean syntax

<259da69f-94fc-4935-af05-81747a75b620n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9293&group=comp.lang.ada#9293

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:6214:3b0c:b0:532:2644:864d with SMTP id nm12-20020a0562143b0c00b005322644864dmr1083605qvb.36.1674686520258;
Wed, 25 Jan 2023 14:42:00 -0800 (PST)
X-Received: by 2002:a05:6808:98b:b0:35b:e9c5:24f7 with SMTP id
a11-20020a056808098b00b0035be9c524f7mr2013828oic.171.1674686519981; Wed, 25
Jan 2023 14:41:59 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.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: Wed, 25 Jan 2023 14:41:59 -0800 (PST)
In-Reply-To: <tqr6rp$lf4r$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2a02:1210:2824:7200:54dc:7728:7c3a:91b0;
posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG
NNTP-Posting-Host: 2a02:1210:2824:7200:54dc:7728:7c3a:91b0
References: <9c7cccd9-733f-49a8-b482-087ccb14b58dn@googlegroups.com>
<tqkcdo$1u1j$1@gioia.aioe.org> <2801afb2-045f-4fec-b41e-f83b2c80e672n@googlegroups.com>
<tqlgfv$1alo$1@gioia.aioe.org> <446867f7-526d-429f-951a-da1a97efff4dn@googlegroups.com>
<tqoclt$3n7q$1@dont-email.me> <312df16a-213d-4d72-8dbf-2278778e18a7n@googlegroups.com>
<tqr6rp$lf4r$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <259da69f-94fc-4935-af05-81747a75b620n@googlegroups.com>
Subject: Re: Real_Arrays on heap with overloaded operators and clean syntax
From: gautier_niouzes@hotmail.com (Gautier write-only address)
Injection-Date: Wed, 25 Jan 2023 22:42:00 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1547
 by: Gautier write-only a - Wed, 25 Jan 2023 22:41 UTC

....and: https://forum.ada-lang.io/

Re: Real_Arrays on heap with overloaded operators and clean syntax

<ebdb90a6-fd43-4a51-b451-6b43d97a321bn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9296&group=comp.lang.ada#9296

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:490e:0:b0:3b6:309a:7dc3 with SMTP id e14-20020ac8490e000000b003b6309a7dc3mr1780846qtq.337.1674760127353;
Thu, 26 Jan 2023 11:08:47 -0800 (PST)
X-Received: by 2002:a05:6870:a689:b0:163:31fe:9bd with SMTP id
i9-20020a056870a68900b0016331fe09bdmr687582oam.129.1674760126958; Thu, 26 Jan
2023 11:08:46 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.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: Thu, 26 Jan 2023 11:08:46 -0800 (PST)
In-Reply-To: <259da69f-94fc-4935-af05-81747a75b620n@googlegroups.com>
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>
<tqkcdo$1u1j$1@gioia.aioe.org> <2801afb2-045f-4fec-b41e-f83b2c80e672n@googlegroups.com>
<tqlgfv$1alo$1@gioia.aioe.org> <446867f7-526d-429f-951a-da1a97efff4dn@googlegroups.com>
<tqoclt$3n7q$1@dont-email.me> <312df16a-213d-4d72-8dbf-2278778e18a7n@googlegroups.com>
<tqr6rp$lf4r$1@dont-email.me> <259da69f-94fc-4935-af05-81747a75b620n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ebdb90a6-fd43-4a51-b451-6b43d97a321bn@googlegroups.com>
Subject: Re: Real_Arrays on heap with overloaded operators and clean syntax
From: dhmos.altiotis@gmail.com (Jim Paloander)
Injection-Date: Thu, 26 Jan 2023 19:08:47 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1935
 by: Jim Paloander - Thu, 26 Jan 2023 19:08 UTC

> ...and: https://forum.ada-lang.io/

Which one do you think is better for general discussions on both ADA and ADA libraries?
Better in the sense that it is preferred by experienced open-minded people with engineering background or
people who may not necessarily hold an engineering degree or PhDs and Masters but who
have worked for many years on real world engineering problems ADA is supposed to assist.

Re: Real_Arrays on heap with overloaded operators and clean syntax

<9d25946b-99ab-433f-99db-14057ca9088fn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9297&group=comp.lang.ada#9297

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:12c2:0:b0:3a8:1066:8859 with SMTP id b2-20020ac812c2000000b003a810668859mr1642000qtj.157.1674765569758;
Thu, 26 Jan 2023 12:39:29 -0800 (PST)
X-Received: by 2002:a05:6830:10d9:b0:684:a0bb:75e0 with SMTP id
z25-20020a05683010d900b00684a0bb75e0mr2088346oto.82.1674765569512; Thu, 26
Jan 2023 12:39:29 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.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: Thu, 26 Jan 2023 12:39:29 -0800 (PST)
In-Reply-To: <9c7cccd9-733f-49a8-b482-087ccb14b58dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=174.26.246.21; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG
NNTP-Posting-Host: 174.26.246.21
References: <9c7cccd9-733f-49a8-b482-087ccb14b58dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9d25946b-99ab-433f-99db-14057ca9088fn@googlegroups.com>
Subject: Re: Real_Arrays on heap with overloaded operators and clean syntax
From: list_email@icloud.com (Jerry)
Injection-Date: Thu, 26 Jan 2023 20:39:29 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2279
 by: Jerry - Thu, 26 Jan 2023 20:39 UTC

On Sunday, January 22, 2023 at 2:34:19 PM UTC-7, ...@gmail.com 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

Leo's answer is responsive to the OP but seems to have gotten buried in an amazingly long discussion which I haven't read. This answer appeared here years ago (was it you, Leo?) and I have used it ever since. If there needs to be a long discussion maybe it could be about why this workaround is necessary. I will pull out Leo's answer from his post and put my version here:

type Real_Vector_Access is access Real_Vector;
then
x_Ptr : Real_Vector_Access := new Real_Vector(0 .. N - 1);
x : Real_Vector renames x_Ptr.all;

That's all. All the overloaded operators work as though the vector was declared from the stack. If you have code which formerly used stack allocation (of x, in this example), it will work without modification with this trick.

Jerry

Re: Real_Arrays on heap with overloaded operators and clean syntax

<7779be64-573c-4701-bc2b-3b83ee141f64n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9298&group=comp.lang.ada#9298

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:5fcf:0:b0:3b8:2a2:5d2a with SMTP id k15-20020ac85fcf000000b003b802a25d2amr391582qta.465.1674769979326;
Thu, 26 Jan 2023 13:52:59 -0800 (PST)
X-Received: by 2002:a05:6870:f696:b0:163:1578:4012 with SMTP id
el22-20020a056870f69600b0016315784012mr883365oab.291.1674769979070; Thu, 26
Jan 2023 13:52:59 -0800 (PST)
Path: i2pn2.org!i2pn.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: Thu, 26 Jan 2023 13:52:58 -0800 (PST)
In-Reply-To: <9d25946b-99ab-433f-99db-14057ca9088fn@googlegroups.com>
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> <9d25946b-99ab-433f-99db-14057ca9088fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7779be64-573c-4701-bc2b-3b83ee141f64n@googlegroups.com>
Subject: Re: Real_Arrays on heap with overloaded operators and clean syntax
From: dhmos.altiotis@gmail.com (Jim Paloander)
Injection-Date: Thu, 26 Jan 2023 21:52:59 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3798
 by: Jim Paloander - Thu, 26 Jan 2023 21:52 UTC

> > 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
> Leo's answer is responsive to the OP but seems to have gotten buried in an amazingly long discussion which I haven't read. This answer appeared here years ago (was it you, Leo?) and I have used it ever since. If there needs to be a long discussion maybe it could be about why this workaround is necessary. I will pull out Leo's answer from his post and put my version here:
>
> type Real_Vector_Access is access Real_Vector;
> then
> x_Ptr : Real_Vector_Access := new Real_Vector(0 .. N - 1);
> x : Real_Vector renames x_Ptr.all;
>
> That's all. All the overloaded operators work as though the vector was declared from the stack. If you have code which formerly used stack allocation (of x, in this example), it will work without modification with this trick.
>
> Jerry

Thank you Jerry, that's true, this trick does the job indeed. Thanks. But to be honest among us, it seems to me that the Real_Arrays library has been implemented probably (note the probably) by people not targeting real world engineering / industrial applications. Examples are Finite Volume solutions of semiconductor device equations, or weather prediction problems. You cannot expect to solve these on the stack and of course ADA containers are impractical for such computations. Possibly a library as discussed above that provides Real_Arrays functionality but memory allocation is done internally on the heap or even on the stack if the user chooses to do so to take advantage of fast stack access. But then the mechanism for changing the stack allocation size transparently and easily should also be provided as simply as setting the memory pool in an access type.

Do you agree?

In the meantime, I am wondering whether or not a hybrid approach (stack/heap) would work provided such a mechanism to set the stack size is easy accessible as simply as a memory pool. The functionality would be during operator overloading we create fast stack allocated arrays to transfer the intermediate results stored in temporary objects. So all the temporaries described above would reside in the stack if this would translate to performance improvement until a smarter approach is introduced similar to C++ expression templates.

Re: Real_Arrays on heap with overloaded operators and clean syntax

<2c00c2af-4095-4e76-b0c7-0f878465c2f8n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9302&group=comp.lang.ada#9302

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:5bca:0:b0:3b8:6ca5:6df4 with SMTP id b10-20020ac85bca000000b003b86ca56df4mr910596qtb.18.1675375183046;
Thu, 02 Feb 2023 13:59:43 -0800 (PST)
X-Received: by 2002:a05:6870:c5a7:b0:163:2e2:fe39 with SMTP id
ba39-20020a056870c5a700b0016302e2fe39mr483028oab.41.1675375182765; Thu, 02
Feb 2023 13:59:42 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.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: Thu, 2 Feb 2023 13:59:42 -0800 (PST)
In-Reply-To: <7779be64-573c-4701-bc2b-3b83ee141f64n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=184.98.79.114; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG
NNTP-Posting-Host: 184.98.79.114
References: <9c7cccd9-733f-49a8-b482-087ccb14b58dn@googlegroups.com>
<9d25946b-99ab-433f-99db-14057ca9088fn@googlegroups.com> <7779be64-573c-4701-bc2b-3b83ee141f64n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2c00c2af-4095-4e76-b0c7-0f878465c2f8n@googlegroups.com>
Subject: Re: Real_Arrays on heap with overloaded operators and clean syntax
From: list_email@icloud.com (Jerry)
Injection-Date: Thu, 02 Feb 2023 21:59:43 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2983
 by: Jerry - Thu, 2 Feb 2023 21:59 UTC

> Thank you Jerry, that's true, this trick does the job indeed. Thanks. But to be honest among us, it seems to me that the Real_Arrays library has been implemented probably (note the probably) by people not targeting real world engineering / industrial applications. Examples are Finite Volume solutions of semiconductor device equations, or weather prediction problems. You cannot expect to solve these on the stack and of course ADA containers are impractical for such computations. Possibly a library as discussed above that provides Real_Arrays functionality but memory allocation is done internally on the heap or even on the stack if the user chooses to do so to take advantage of fast stack access. But then the mechanism for changing the stack allocation size transparently and easily should also be provided as simply as setting the memory pool in an access type.
>
> Do you agree?
>
Yes, with the minor caveat that I have no idea what I'm talking about.

When I ran into this limitation a few years ago, I learned how to increase the stack size before running my program. This helped but only a little, as large arrays still were not accommodated. (Define "large" as anything too big for stack expanded to OS limits.) I have never compared speed with stack versus heap allocation because, for me, it would serve no purpose. I can't just use smaller arrays in my work because large ones are too slow, if you follow my drift here.

The applications you mention are great but the list must be nearly endless. My applications run towards audio signals and radar (simulation) images.

Jerry


devel / comp.lang.ada / Re: Real_Arrays on heap with overloaded operators and clean syntax

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor