![]() |
ScalES-PPM
|
gathers some base routines for combinatorial problems More...
Data Types | |
interface | combination |
produce random selection and its complement More... | |
interface | is_permutation |
establish whether an array is a permutation of another array or a range More... | |
interface | permute |
randomly permute a given array More... | |
interface | prime_factorization |
compute list of prime factors (sorted, but duplicates included) More... | |
interface | selection |
produce random selection More... | |
Functions/Subroutines | |
subroutine | permute_randomly_i4 (a) |
randomly permute a given array | |
subroutine | permute_randomly_i8 (a) |
randomly permute a given array | |
pure logical function | is_permutation_of_range_i4 (a, r) |
establish whether one array of integers is a permutation of a range | |
pure logical function | is_permutation_of_array_i4 (a, b) |
establish whether one array of integers is a permutation of another | |
subroutine | random_selection_i4 (selected, range) |
produce random selection from range | |
subroutine | random_combination_i4 (selected, not_selected, range) |
produce random selection and its complement from range | |
pure subroutine | prime_factorization_i4 (n, factors) |
compute list of prime factors (sorted, but duplicates included) | |
Variables | |
character(len= *), parameter | filename = 'ppm_combinatorics.f90' |
gathers some base routines for combinatorial problems
|
private |
establish whether one array of integers is a permutation of another
a | first array |
b | second array |
.TRUE. if a
is permutation of b
|
private |
establish whether one array of integers is a permutation of a range
a | array |
r | range |
.TRUE. if a
is permutation of r
,
.FALSE. if not
|
private |
randomly permute a given array
a | array to permute |
|
private |
randomly permute a given array
a | array to permute |
|
private |
compute list of prime factors (sorted, but duplicates included)
n | integer to factor |
factors | integers, where factor(i) is prime and PRODUCT(factors)==n, factors is allocated to the necessary size |
|
private |
produce random selection and its complement from range
range | range to select from | |
[out] | selected | array where a random selection of integers from range are written to |
[out] | not_selected | integers from range not written to selected are stored here |
|
private |
produce random selection from range
normally this procedure is only efficient when SIZE(selected) is significantly smaller than extent_size(range), when SIZE(selected) approaches extent_size(range) it's cheaper to produce a permutation and use the first SIZE(selected) elements
[out] | selected | array to fill with random selection from range, where SIZE(selected) <= extent_size(range) |
range | set of integers to selected from |
Das diesem Bericht zugrundeliegende Vorhaben wurde mit Mitteln des Bundesministeriums für Bildung, und Forschung unter dem Förderkennzeichen 01IH08004E gefördert. Die Verantwortung für den Inhalt dieser Veröffentlichung liegt beim Autor.