From owner-sc22wg5+sc22wg5-dom8=www.open-std.org@open-std.org  Wed Aug 14 23:49:54 2013
Return-Path: <owner-sc22wg5+sc22wg5-dom8=www.open-std.org@open-std.org>
X-Original-To: sc22wg5-dom8
Delivered-To: sc22wg5-dom8@www.open-std.org
Received: by www.open-std.org (Postfix, from userid 521)
	id 4EEF235722E; Wed, 14 Aug 2013 23:49:54 +0200 (CEST)
Delivered-To: sc22wg5@open-std.org
Received: from vms173017pub.verizon.net (vms173017pub.verizon.net [206.46.173.17])
	by www.open-std.org (Postfix) with ESMTP id CA094357199
	for <sc22wg5@open-std.org>; Wed, 14 Aug 2013 23:49:38 +0200 (CEST)
Received: from [10.0.1.9] ([unknown] [24.9.79.217]) by vms173017.mailsrvcs.net
 (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009))
 with ESMTPA id <0MRJ00MXYJA5K1Q0@vms173017.mailsrvcs.net> for
 sc22wg5@open-std.org; Wed, 14 Aug 2013 16:49:18 -0500 (CDT)
From: Dan Nagle <dannagle@verizon.net>
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: quoted-printable
Subject: Fwd: Sorting and searching in Fortran
Date: Wed, 14 Aug 2013 15:49:16 -0600
References: <520BBDB3.5050702@earthlink.net>
To: WG5 List <sc22wg5@open-std.org>
Message-id: <18572461-8D40-450F-8F22-B466A86D3996@verizon.net>
MIME-version: 1.0 (Mac OS X Mail 6.5 \(1508\))
X-Mailer: Apple Mail (2.1508)
Sender: owner-sc22wg5@open-std.org
Precedence: bulk

Hi,

The originator of this proposal has coauthored a book on Fortran,
and is generally well-respected in the community.

He has made a suggestion for new features for Fortran.
I told him I would forward this to the wg5 list, so here 'tis.

Begin forwarded message:

> Is this what you would need as a starting point, or should I embellish =
them some more?
>=20
> Regards,
>=20
> Walter
>=20
> =
--------------------------------------------------------------------------=
-
>=20
> Basic sorting requirements:
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
>=20
> - An intrinsic function form that can be used in expressions (ala
>   HPF 2.0 sort_up and sort_down - sans the complicated DIM argument),
>=20
> - A 'graded' intrinsic function which returns a permutation array of
>   integers which can be used to permute the input array (again, ala
>   HPF grade_up and grade_down - sans the complicated DIM argument),
>=20
> - An intrinsic subroutine form that supports 'in-place' sorts,
>=20
> - Support INTEGER, REAL, and CHARACTER(*) types directly, e.g. without
>   requiring a user-defined comparison function,
>=20
> - Support both ascending and descending sorts,
>=20
> - CHARACTER sorts support either 'default' or 'ASCII' collating
>   sequence,
>=20
> - Optional argument for a user-supplied comparison function for =
support
>   of derived types, non-standard collating sequences, etc.
>=20
>=20
> Basic binary search requirements:
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D
>=20
> - Intrinsic function which returns the index of the location of a =
value
>   in a pre-sorted array.  If a match is not found, return 0.
>=20
> - Support INTEGER, REAL, and CHARACTER(*) types directly, e.g. without
>   requiring a user-defined comparison function,
>=20
> - Support both ascending and descending sorted input arrays
>=20
> - CHARACTER search supports either 'default' or 'ASCII' collating
>   sequence
>=20
> - Optional argument for a user-supplied comparison function for search
>   of derived types, non-standard collating sequences, tolerance in
>   floating point comparisons, etc.

--=20
Cheers!

Dan Nagle




