(j3.2006) an intrinsic for SORT()

Anton Shterenlikht mexas
Tue Feb 6 04:08:31 EST 2018


It would be useful to have a simple intrinsinc
to sort ~100 integers or reals.
I'm less sure about a sophisticated clever intrinsic
with lots of options.
I've no idea how one would sort derived type -
presumably some criterion will have to be given first.

Anyway, considering we have (as noted in MFE):
 hypot(    x,y  )
 norm2(   [x,y] )
 abs(cmplx(x,y) )
3 simple ways to calculate the L2 norm, the addition
of another semi-useful intrinsic doesn't seem too crazy.

We also have MATMUL, which presumbaly one wouldn't use
on very large matrices, particular ones with special structure.
But for small undemanding jobs, I find MATMUL useful.

There are likely other examples of intrinsics
one can easily live without.

My priority would be to strengthen existing intrinsics,
rather than add new, e.g. make bessel and error functions
accept complex arguments.

On a related note - does it make sense to talk
about parallel intrinsics? E.g. a parallel sort
that by default uses all images in a team, with
built-in necessary synchronisation?
I'm probably not using the correct terminology.
What I'm thinking is a built-in Fortran function
or subroutine that is constructed of multiple
simpler intrinsics, e.g. collectives, atomics, etc.

Anton



More information about the J3 mailing list