SRC/slasrt.f(3)

✨ SRC/slasrt.f ✨

okay so bestie, this is a manpage from Library Functions Manual β€” yes, the actual manual, and the star of the show is SRC/slasrt.f πŸ’… don't worry, we're gonna get through it together.


✨ SYNOPSIS ✨

Functions/Subroutines

  • subroutine slasrt (id, n, d, info) β€” SLASRT sorts numbers in increasing or decreasing order. that's the whole gig πŸŽ€

πŸ¦‹ Function/Subroutine Documentation πŸ¦‹

subroutine slasrt (character id, integer n, real, dimension( * ) d, integer info)

SLASRT sorts numbers in increasing or decreasing order. iconic behavior, honestly πŸ‘‘

🌸 Purpose 🌸

!>
!> Sort the numbers in D in increasing order (if ID = 'I') or
!> in decreasing order (if ID = 'D' ).
!>
!> Use Quick Sort, reverting to Insertion sort on arrays of
!> size <= 20. Dimension of STACK limits N to about 2**32.
!>

so it's giving algorithm royalty β€” Quick Sort is the main character, but the moment your array is <= 20 elements it switches to Insertion sort like "nah this small one's easy" 🧚 and heads up, the dimension of STACK caps N at about 2**32. not me doing math, that's just what the page says fr fr.

πŸ’– Parameters πŸ’–

ID

!>          ID is CHARACTER*1
!>          = 'I': sort D in increasing order;
!>          = 'D': sort D in decreasing order.
!>

literally the vibe selector. 'I' = increasing, 'D' = decreasing, no in-between πŸ’…

N

!>          N is INTEGER
!>          The length of the array D.
!>

how many numbers we're dealing with. that's it, that's the whole thing.

D

!>          D is REAL array, dimension (N)
!>          On entry, the array to be sorted.
!>          On exit, D has been sorted into increasing order
!>          (D(1) <= ... <= D(N) ) or into decreasing order
!>          (D(1) >= ... >= D(N) ), depending on ID.
!>

the actual array, the whole reason we're here 🫢 it goes in unsorted, it comes out sorted β€” which way depends on ID, and those D(1) <= ... <= D(N) / D(1) >= ... >= D(N) conditions are the receipts.

INFO

!>          INFO is INTEGER
!>          = 0:  successful exit
!>          < 0:  if INFO = -i, the i-th argument had an illegal value
!>

0 means slay, we're done ✨ and < 0 means somebody messed up β€” specifically if INFO = -i, then the i-th argument had an illegal value. read the number, go fix that argument, periodt.


πŸ‘‘ Author πŸ‘‘

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

Definition at line 87 of file slasrt.f. lowkey iconic that we know exactly where it lives 😭


🌈 Author 🌈

Generated automatically by Doxygen for LAPACK from the source code. the robots wrote this one, not me πŸ™ˆ


okay that's the whole page bestie, no cap, nothing skipped πŸ’œ

LAPACK Β· Version 3.12.0 Β· SRC/slasrt.f(3) β€” mwah, go sort something πŸ“βœ¨

πŸ“¦ where this page comes from