Octopus
sort_oct_m Module Reference

This module is intended to contain "only mathematical" functions and procedures. More...

Detailed Description

This module is intended to contain "only mathematical" functions and procedures.

Data Types

interface  dsort1
 from sort_low.cc More...
 
interface  dsort2
 
interface  isort1
 
interface  isort2
 
interface  lsort1
 
interface  lsort2
 
interface  robust_sort_by_abs
 
interface  sort
 This is the common interface to a sorting routine. It performs the shell algorithm, not as fast as the quicksort for large numbers, but it seems that better for moderate numbers (around 100). Their possible interfaces are: subroutine sort(a [, ind]) real(real64),_OR_INTEGER, intent(inout) :: a(:) integer, intent(inout), optional :: ind(:) ! This routine sorts, from smallest to largest, the array a. ! If the integer array ind is present, it puts in it the indexing ! of the sorting, so that other arrays can be sorted according to ! the sorting of a. end subroutine sort. More...
 

Functions/Subroutines

subroutine dsort (a, ind)
 
subroutine isort (a, ind)
 Shell sort for integer arrays. More...
 
subroutine lsort (a, ind)
 Shell sort for integer(int64) arrays. More...
 
pure logical function iless_idx (i, j, off, kabs, ksgn)
 Sorting criterium for the robust sorting below. More...
 
pure logical function dless_idx (i, j, off, kabs, ksgn)
 Sorting criterium for the robust sorting below. More...
 
logical pure function are_different (x, y)
 
recursive subroutine imergesort_perm (perm, tmp, l, r, off, kabs, ksgn)
 Perform the permutations for the sorting. More...
 
recursive subroutine dmergesort_perm (perm, tmp, l, r, off, kabs, ksgn)
 Perform the permutations for the sorting. More...
 
subroutine irobust_sort_by_abs (v, off, perm, negative_first)
 Robbust sorting of floating point numbers by absolute values. More...
 
subroutine drobust_sort_by_abs (v, off, perm, negative_first)
 
subroutine zshellsort1 (a, x)
 
subroutine zshellsort2 (a, x)
 
subroutine dshellsort1 (a, x)
 
subroutine dshellsort2 (a, x)
 
subroutine ishellsort1 (a, x)
 
subroutine ishellsort2 (a, x)
 

Function/Subroutine Documentation

◆ dsort()

subroutine sort_oct_m::dsort ( real(real64), dimension(:), intent(inout)  a,
integer, dimension(:), intent(out), optional  ind 
)
private

Definition at line 211 of file sort.F90.

◆ isort()

subroutine sort_oct_m::isort ( integer, dimension(:), intent(inout)  a,
integer, dimension(:), intent(out), optional  ind 
)
private

Shell sort for integer arrays.

Definition at line 233 of file sort.F90.

◆ lsort()

subroutine sort_oct_m::lsort ( integer(int64), dimension(:), intent(inout)  a,
integer, dimension(:), intent(out), optional  ind 
)
private

Shell sort for integer(int64) arrays.

Definition at line 254 of file sort.F90.

◆ iless_idx()

pure logical function sort_oct_m::iless_idx ( integer, intent(in)  i,
integer, intent(in)  j,
integer, dimension(:, :), intent(in)  off,
real(int64), dimension(:), intent(in)  kabs,
integer, dimension(:), intent(in)  ksgn 
)
private

Sorting criterium for the robust sorting below.

Definition at line 275 of file sort.F90.

◆ dless_idx()

pure logical function sort_oct_m::dless_idx ( integer, intent(in)  i,
integer, intent(in)  j,
real(int64), dimension(:, :), intent(in)  off,
real(int64), dimension(:), intent(in)  kabs,
integer, dimension(:), intent(in)  ksgn 
)
private

Sorting criterium for the robust sorting below.

Definition at line 305 of file sort.F90.

◆ are_different()

logical pure function sort_oct_m::are_different ( real(real64), intent(in)  x,
real(real64), intent(in)  y 
)
private

Definition at line 334 of file sort.F90.

◆ imergesort_perm()

recursive subroutine sort_oct_m::imergesort_perm ( integer, dimension(:), intent(inout)  perm,
integer, dimension(:), intent(inout)  tmp,
integer, intent(in)  l,
integer, intent(in)  r,
integer, dimension(:, :), intent(in)  off,
real(real64), dimension(:), intent(in)  kabs,
integer, dimension(:), intent(in)  ksgn 
)
private

Perform the permutations for the sorting.

Definition at line 340 of file sort.F90.

◆ dmergesort_perm()

recursive subroutine sort_oct_m::dmergesort_perm ( integer, dimension(:), intent(inout)  perm,
integer, dimension(:), intent(inout)  tmp,
integer, intent(in)  l,
integer, intent(in)  r,
real(real64), dimension(:, :), intent(in)  off,
real(real64), dimension(:), intent(in)  kabs,
integer, dimension(:), intent(in)  ksgn 
)
private

Perform the permutations for the sorting.

Definition at line 371 of file sort.F90.

◆ irobust_sort_by_abs()

subroutine sort_oct_m::irobust_sort_by_abs ( real(real64), dimension(:), intent(in)  v,
integer, dimension(:, :), intent(in)  off,
integer, dimension(size(v)), intent(out)  perm,
logical, intent(in), optional  negative_first 
)
private

Robbust sorting of floating point numbers by absolute values.

This works as follow:

  • Put negative number first
  • Use the offset integer values, assumed to be unique key, to order the degenerated points

Definition at line 407 of file sort.F90.

◆ drobust_sort_by_abs()

subroutine sort_oct_m::drobust_sort_by_abs ( real(real64), dimension(:), intent(in)  v,
real(real64), dimension(:, :), intent(in)  off,
integer, dimension(size(v)), intent(out)  perm,
logical, intent(in), optional  negative_first 
)
private

Definition at line 445 of file sort.F90.

◆ zshellsort1()

subroutine sort_oct_m::zshellsort1 ( real(real64), dimension(:), intent(inout)  a,
complex(real64), dimension(:, :), intent(inout)  x 
)
private

Definition at line 552 of file sort.F90.

◆ zshellsort2()

subroutine sort_oct_m::zshellsort2 ( real(real64), dimension(:), intent(inout)  a,
complex(real64), dimension(:, :, :), intent(inout)  x 
)
private

Definition at line 598 of file sort.F90.

◆ dshellsort1()

subroutine sort_oct_m::dshellsort1 ( real(real64), dimension(:), intent(inout)  a,
real(real64), dimension(:, :), intent(inout)  x 
)
private

Definition at line 718 of file sort.F90.

◆ dshellsort2()

subroutine sort_oct_m::dshellsort2 ( real(real64), dimension(:), intent(inout)  a,
real(real64), dimension(:, :, :), intent(inout)  x 
)
private

Definition at line 764 of file sort.F90.

◆ ishellsort1()

subroutine sort_oct_m::ishellsort1 ( real(real64), dimension(:), intent(inout)  a,
integer, dimension(:, :), intent(inout)  x 
)
private

Definition at line 884 of file sort.F90.

◆ ishellsort2()

subroutine sort_oct_m::ishellsort2 ( real(real64), dimension(:), intent(inout)  a,
integer, dimension(:, :, :), intent(inout)  x 
)
private

Definition at line 930 of file sort.F90.