Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"Gotcha, you snot-necked weenies!" -- Post Bros. Comics


devel / comp.lang.ada / Re: Use Ada.Containers.Vectors Generic_Sorting or Ada.Containers.Ordered_Sets ?

SubjectAuthor
* Use Ada.Containers.Vectors Generic_Sorting or Ada.Containers.Ordered_Setsreinert
+* Re: Use Ada.Containers.Vectors Generic_Sorting orJeffrey R.Carter
|`* Re: Use Ada.Containers.Vectors Generic_Sorting or Ada.Containers.Ordered_Setsreinert
| `- Re: Use Ada.Containers.Vectors Generic_Sorting orG.B.
+- Re: Use Ada.Containers.Vectors Generic_Sorting or Ada.Containers.Ordered_SetsMarius Amado-Alves
`- Re: Use Ada.Containers.Vectors Generic_Sorting or Ada.Containers.Ordered_SetsBrad Moore

1
Use Ada.Containers.Vectors Generic_Sorting or Ada.Containers.Ordered_Sets ?

<b401accd-85ff-4d9e-aa3e-1a68215ef63dn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a37:2d06:0:b0:738:78e0:6040 with SMTP id t6-20020a372d06000000b0073878e06040mr81427qkh.315.1676364594504;
Tue, 14 Feb 2023 00:49:54 -0800 (PST)
X-Received: by 2002:a05:6830:1db9:b0:68b:d4cc:e72f with SMTP id
z25-20020a0568301db900b0068bd4cce72fmr61170oti.108.1676364594214; Tue, 14 Feb
2023 00:49:54 -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, 14 Feb 2023 00:49:53 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=84.209.88.37; posting-account=bPTmZAoAAAC_6HP9XLKB9aAAxBa6BuOR
NNTP-Posting-Host: 84.209.88.37
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b401accd-85ff-4d9e-aa3e-1a68215ef63dn@googlegroups.com>
Subject: Use Ada.Containers.Vectors Generic_Sorting or Ada.Containers.Ordered_Sets
?
From: reinkor@gmail.com (reinert)
Injection-Date: Tue, 14 Feb 2023 08:49:54 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1332
 by: reinert - Tue, 14 Feb 2023 08:49 UTC

Hello,

Sometimes, I have to sort records. One possibility is to use Generig_Sorting under Ada.Containers.Vectors and eksplicitly use Sort. An alternative is to use Ada.Containders.Ordered_Sets and somehow get sorting "for free".

I would like to get arguments for and against these two alternatives.

reinert

Re: Use Ada.Containers.Vectors Generic_Sorting or Ada.Containers.Ordered_Sets ?

<tsfkkr$2fmpr$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: spam.jrcarter.not@spam.acm.org.not (Jeffrey R.Carter)
Newsgroups: comp.lang.ada
Subject: Re: Use Ada.Containers.Vectors Generic_Sorting or
Ada.Containers.Ordered_Sets ?
Date: Tue, 14 Feb 2023 10:35:23 +0100
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <tsfkkr$2fmpr$1@dont-email.me>
References: <b401accd-85ff-4d9e-aa3e-1a68215ef63dn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 14 Feb 2023 09:35:24 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="af648e4fc637b087f4cbeae5e35f9a72";
logging-data="2612027"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX198DDMz/TMKsv+u8pG56cU3Jtlm0khmxPw="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.7.1
Cancel-Lock: sha1:dQJ2scCm9K5iJVnXnJoKj+PDUo8=
Content-Language: en-US
In-Reply-To: <b401accd-85ff-4d9e-aa3e-1a68215ef63dn@googlegroups.com>
 by: Jeffrey R.Carter - Tue, 14 Feb 2023 09:35 UTC

On 2023-02-14 09:49, reinert wrote:
>
> Sometimes, I have to sort records. One possibility is to use Generig_Sorting under Ada.Containers.Vectors and eksplicitly use Sort. An alternative is to use Ada.Containders.Ordered_Sets and somehow get sorting "for free".
>
> I would like to get arguments for and against these two alternatives.

Both should be O(NlogN), so the distinction is which works better for what you
do with them after they are sorted.

--
Jeff Carter
"[B]ecause of our experience in security, we are convinced
that C is too error-prone. Its loose typing, its unsafe
bitfields management, too many compiler dependent behaviors,
etc. easily lead to vulnerabilities."
EwoK developers
163

Re: Use Ada.Containers.Vectors Generic_Sorting or Ada.Containers.Ordered_Sets ?

<8e3943a0-6dc5-4d8e-8c35-a35587f0d05fn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:7d85:0:b0:3b9:b7f6:7cb0 with SMTP id c5-20020ac87d85000000b003b9b7f67cb0mr168329qtd.277.1676371590752;
Tue, 14 Feb 2023 02:46:30 -0800 (PST)
X-Received: by 2002:a05:6870:d621:b0:16d:fe76:a119 with SMTP id
a33-20020a056870d62100b0016dfe76a119mr835996oaq.274.1676371590449; Tue, 14
Feb 2023 02:46:30 -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, 14 Feb 2023 02:46:30 -0800 (PST)
In-Reply-To: <tsfkkr$2fmpr$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=84.209.88.37; posting-account=bPTmZAoAAAC_6HP9XLKB9aAAxBa6BuOR
NNTP-Posting-Host: 84.209.88.37
References: <b401accd-85ff-4d9e-aa3e-1a68215ef63dn@googlegroups.com> <tsfkkr$2fmpr$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8e3943a0-6dc5-4d8e-8c35-a35587f0d05fn@googlegroups.com>
Subject: Re: Use Ada.Containers.Vectors Generic_Sorting or Ada.Containers.Ordered_Sets
?
From: reinkor@gmail.com (reinert)
Injection-Date: Tue, 14 Feb 2023 10:46:30 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1358
 by: reinert - Tue, 14 Feb 2023 10:46 UTC

My main argument for using Ordered_Sets is that it seems to be less verbose and somehow garanteres sorting. Myset.Last/First always provides the "largest"/"smallest" element.

reinert

Re: Use Ada.Containers.Vectors Generic_Sorting or Ada.Containers.Ordered_Sets ?

<tsgl1e$2jjc5$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: bauhaus@notmyhomepage.invalid (G.B.)
Newsgroups: comp.lang.ada
Subject: Re: Use Ada.Containers.Vectors Generic_Sorting or
Ada.Containers.Ordered_Sets ?
Date: Tue, 14 Feb 2023 19:48:14 +0100
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <tsgl1e$2jjc5$1@dont-email.me>
References: <b401accd-85ff-4d9e-aa3e-1a68215ef63dn@googlegroups.com>
<tsfkkr$2fmpr$1@dont-email.me>
<8e3943a0-6dc5-4d8e-8c35-a35587f0d05fn@googlegroups.com>
Reply-To: nonlegitur@notmyhomepage.de
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 14 Feb 2023 18:48:14 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="32842b97cf7ce8b3b5513368cf34644b";
logging-data="2739589"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18BGBoMzwHwGzGnOdk5sfc1fV0Uc/bwdPg="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.6.1
Cancel-Lock: sha1:0ezGF68IAXvGW2C7ZGEvUWfbAXM=
In-Reply-To: <8e3943a0-6dc5-4d8e-8c35-a35587f0d05fn@googlegroups.com>
Content-Language: en-US
 by: G.B. - Tue, 14 Feb 2023 18:48 UTC

On 14.02.23 11:46, reinert wrote:
> My main argument for using Ordered_Sets is that it seems to be less verbose and somehow garanteres sorting. Myset.Last/First always provides the "largest"/"smallest" element.

You could measure performance of operations
that you find critical, given a typical number
of elements in the set. If there isn't any operation
that is particularly critical, some weighted
average of all set operations might be of interest.

Two similar data structures might both use a common
algorithm, such as sorting. If a program uses both
data structures, then having just one algorithm
might be advantageous, if only for the size of
the executable.

Re: Use Ada.Containers.Vectors Generic_Sorting or Ada.Containers.Ordered_Sets ?

<b94850e3-b2e5-4567-8086-af4ad493d12en@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:adf:fd52:0:b0:2ce:a631:4a0 with SMTP id h18-20020adffd52000000b002cea63104a0mr346335wrs.14.1678874735229;
Wed, 15 Mar 2023 03:05:35 -0700 (PDT)
X-Received: by 2002:a9d:4c09:0:b0:699:7d71:d2dc with SMTP id
l9-20020a9d4c09000000b006997d71d2dcmr854205otf.6.1678874734622; Wed, 15 Mar
2023 03:05:34 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.128.87.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Wed, 15 Mar 2023 03:05:34 -0700 (PDT)
In-Reply-To: <b401accd-85ff-4d9e-aa3e-1a68215ef63dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=188.37.72.29; posting-account=3cDqWgoAAAAZXc8D3pDqwa77IryJ2nnY
NNTP-Posting-Host: 188.37.72.29
References: <b401accd-85ff-4d9e-aa3e-1a68215ef63dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b94850e3-b2e5-4567-8086-af4ad493d12en@googlegroups.com>
Subject: Re: Use Ada.Containers.Vectors Generic_Sorting or Ada.Containers.Ordered_Sets
?
From: amado.alves@gmail.com (Marius Amado-Alves)
Injection-Date: Wed, 15 Mar 2023 10:05:35 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Marius Amado-Alves - Wed, 15 Mar 2023 10:05 UTC

> Sometimes, I have to sort records. One possibility is to use Generig_Sorting under Ada.Containers.Vectors and eksplicitly use Sort. An alternative is to use Ada.Containders.Ordered_Sets and somehow get sorting "for free".
>
> I would like to get arguments for and against these two alternatives.
>
> reinert

Sets have slightly stricter semantics, namely no duplicates. Normally, if the real data has this semantics, you should use sets (and populate with Include or else catch the exception raised upon trying to Insert a duplicate).

Re: Use Ada.Containers.Vectors Generic_Sorting or Ada.Containers.Ordered_Sets ?

<88ab7494-154d-4cc8-a659-b8b34cec5e06n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a37:6407:0:b0:745:bd3d:51df with SMTP id y7-20020a376407000000b00745bd3d51dfmr1763436qkb.3.1678890242596;
Wed, 15 Mar 2023 07:24:02 -0700 (PDT)
X-Received: by 2002:a05:6870:ea9b:b0:172:7220:6905 with SMTP id
s27-20020a056870ea9b00b0017272206905mr9118500oap.0.1678890242285; Wed, 15 Mar
2023 07:24:02 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Wed, 15 Mar 2023 07:24:02 -0700 (PDT)
In-Reply-To: <b401accd-85ff-4d9e-aa3e-1a68215ef63dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2604:3d09:a81:1800:712f:3d20:2471:b344;
posting-account=lzqe5AoAAADHhp_gregSufVhvwu22fBS
NNTP-Posting-Host: 2604:3d09:a81:1800:712f:3d20:2471:b344
References: <b401accd-85ff-4d9e-aa3e-1a68215ef63dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <88ab7494-154d-4cc8-a659-b8b34cec5e06n@googlegroups.com>
Subject: Re: Use Ada.Containers.Vectors Generic_Sorting or Ada.Containers.Ordered_Sets
?
From: bmoore.ada@gmail.com (Brad Moore)
Injection-Date: Wed, 15 Mar 2023 14:24:02 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Brad Moore - Wed, 15 Mar 2023 14:24 UTC

On Tuesday, February 14, 2023 at 1:49:55 AM UTC-7, reinert wrote:
> Hello,
> ,
> Sometimes, I have to sort records. One possibility is to use Generig_Sorting under Ada.Containers.Vectors and eksplicitly use Sort. An alternative is to use Ada.Containders.Ordered_Sets and somehow get sorting "for free".
>
> I would like to get arguments for and against these two alternatives.
>
> reinert

I might use the generic sorting for example, for the case where the data is more static and needs to be sorted once, whereas I'd use an ordered set if the data is continuously being updated and manipulated, or if I needed set semantics.

Brad


devel / comp.lang.ada / Re: Use Ada.Containers.Vectors Generic_Sorting or Ada.Containers.Ordered_Sets ?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor