Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

In English, every word can be verbed. Would that it were so in our programming languages.


devel / comp.lang.fortran / Re: Count function using defined array values

SubjectAuthor
o Re: Count function using defined array valuesRon Shepard

1
Re: Count function using defined array values

<LiR2M.17287$qjm2.12755@fx09.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer01.ams4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx09.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:102.0)
Gecko/20100101 Thunderbird/102.10.1
Subject: Re: Count function using defined array values
Content-Language: en-US
References: <md5:24Gw+Xq7WEEteROPHxRI0A==>
Newsgroups: comp.lang.fortran
From: nospam@nowhere.org (Ron Shepard)
In-Reply-To: <md5:24Gw+Xq7WEEteROPHxRI0A==>
X-Forwarded-Message-Id: <md5:24Gw+Xq7WEEteROPHxRI0A==>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 16
Message-ID: <LiR2M.17287$qjm2.12755@fx09.iad>
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Fri, 28 Apr 2023 10:07:23 -0500
X-Received-Bytes: 1821
 by: Ron Shepard - Fri, 28 Apr 2023 15:07 UTC

On 4/28/23 6:30 AM, Edmondo Giovannozzi wrote:
> If you have a huge number of elements and a huge number of irregular bins, you may need a different algorithm.

One easy algorithm change for the irregular bin case would be to do a
binary search on the bin index rather than the simple loop over the
bins. For random input values, this would reduce the average effort in
the search from size(bin)/2 to log2(size(bin)).

The regular bin case of course does not have this factor, so if
appropriate that would be a more efficient choice. Another possibility
is to set the bins based on some function of the value (say log(v) for
positive v, or some monotonic user function). You pay the cost of the
function evaluation for each value, but then you have just the regular
grid division operation to determine the bin index.

$.02 -Ron Shepard

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor