foreng_math_sets Module

Contains functions that deal with the mathematical definition of sets. Find the union of two rank 1 arrays with . Find the intersection with . Check if a given x belongs to a set with


Uses


Contents


Interfaces

public interface intersection

Compute the intersection of two sets

  • public function intersection_int(A, B) result(inters)

    Arguments

    Type IntentOptional AttributesName
    integer, intent(in), dimension(:):: A

    set A

    integer, intent(in), dimension(:):: B

    set B

    Return Value integer, dimension(:), allocatable

  • public function intersection_r32(A, B) result(inters)

    Arguments

    Type IntentOptional AttributesName
    real(kind=real32), intent(in), dimension(:):: A

    set A

    real(kind=real32), intent(in), dimension(:):: B

    set B

    Return Value real(kind=real32), dimension(:), allocatable

  • public function intersection_r64(A, B) result(inters)

    Arguments

    Type IntentOptional AttributesName
    real(kind=real64), intent(in), dimension(:):: A

    set A

    real(kind=real64), intent(in), dimension(:):: B

    set B

    Return Value real(kind=real64), dimension(:), allocatable

public interface union

Compute the union of two sets

  • public function union_int(A, B) result(union_set)

    Arguments

    Type IntentOptional AttributesName
    integer, intent(in), dimension(:):: A

    set A

    integer, intent(in), dimension(:):: B

    set B

    Return Value integer, dimension(:), allocatable

  • public function union_r32(A, B) result(union_set)

    Arguments

    Type IntentOptional AttributesName
    real(kind=real32), intent(in), dimension(:):: A

    set A

    real(kind=real32), intent(in), dimension(:):: B

    set B

    Return Value real(kind=real32), dimension(:), allocatable

  • public function union_r64(A, B) result(union_set)

    Arguments

    Type IntentOptional AttributesName
    real(kind=real64), intent(in), dimension(:):: A

    set A

    real(kind=real64), intent(in), dimension(:):: B

    set B

    Return Value real(kind=real64), dimension(:), allocatable

public interface belongs_to

Check if
belongs to if there is at least one element in for which

  • public function belongs_to_int(x, A) result(bool)

    Check if a value belongs to a set

    Arguments

    Type IntentOptional AttributesName
    integer, intent(in) :: x
    integer, dimension(:):: A

    Return Value logical

  • public function belongs_to_r32(x, A, eps) result(bool)

    Check if a value belongs to a set within a certain tolerance . If is not specified, it will automatically calculated using the function

    Arguments

    Type IntentOptional AttributesName
    real(kind=real32), intent(in) :: x
    real(kind=real32), dimension(:):: A
    real(kind=real32), optional :: eps

    Return Value logical

  • public function belongs_to_r64(x, A, eps) result(bool)

    Check if a value belongs to a set within a certain tolerance . If is not specified, it will automatically calculated using the function

    Arguments

    Type IntentOptional AttributesName
    real(kind=real64), intent(in) :: x
    real(kind=real64), dimension(:):: A
    real(kind=real64), optional :: eps

    Return Value logical

public interface array_epsilon

  • public function array_epsilon_r32(array) result(eps)

    Arguments

    Type IntentOptional AttributesName
    real(kind=real32), intent(in), dimension(:):: array

    Return Value real(kind=real32)

  • public function array_epsilon_r64(array) result(eps)

    Arguments

    Type IntentOptional AttributesName
    real(kind=real64), intent(in), dimension(:):: array

    Return Value real(kind=real64)

public interface abs_max_val

  • public function abs_max_val_r32(array) result(abs_max_val)

    Arguments

    Type IntentOptional AttributesName
    real(kind=real32), intent(in), dimension(:):: array

    Return Value real(kind=real32)

  • public function abs_max_val_r64(array) result(abs_max_val)

    Arguments

    Type IntentOptional AttributesName
    real(kind=real64), intent(in), dimension(:):: array

    Return Value real(kind=real64)


Functions

public function intersection_int(A, B) result(inters)

Arguments

Type IntentOptional AttributesName
integer, intent(in), dimension(:):: A

set A

integer, intent(in), dimension(:):: B

set B

Return Value integer, dimension(:), allocatable

public function intersection_r32(A, B) result(inters)

Arguments

Type IntentOptional AttributesName
real(kind=real32), intent(in), dimension(:):: A

set A

real(kind=real32), intent(in), dimension(:):: B

set B

Return Value real(kind=real32), dimension(:), allocatable

public function intersection_r64(A, B) result(inters)

Arguments

Type IntentOptional AttributesName
real(kind=real64), intent(in), dimension(:):: A

set A

real(kind=real64), intent(in), dimension(:):: B

set B

Return Value real(kind=real64), dimension(:), allocatable

public function union_int(A, B) result(union_set)

Arguments

Type IntentOptional AttributesName
integer, intent(in), dimension(:):: A

set A

integer, intent(in), dimension(:):: B

set B

Return Value integer, dimension(:), allocatable

public function union_r32(A, B) result(union_set)

Arguments

Type IntentOptional AttributesName
real(kind=real32), intent(in), dimension(:):: A

set A

real(kind=real32), intent(in), dimension(:):: B

set B

Return Value real(kind=real32), dimension(:), allocatable

public function union_r64(A, B) result(union_set)

Arguments

Type IntentOptional AttributesName
real(kind=real64), intent(in), dimension(:):: A

set A

real(kind=real64), intent(in), dimension(:):: B

set B

Return Value real(kind=real64), dimension(:), allocatable

public function belongs_to_int(x, A) result(bool)

Check if a value belongs to a set

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: x
integer, dimension(:):: A

Return Value logical

public function belongs_to_r32(x, A, eps) result(bool)

Check if a value belongs to a set within a certain tolerance . If is not specified, it will automatically calculated using the function

Arguments

Type IntentOptional AttributesName
real(kind=real32), intent(in) :: x
real(kind=real32), dimension(:):: A
real(kind=real32), optional :: eps

Return Value logical

public function belongs_to_r64(x, A, eps) result(bool)

Check if a value belongs to a set within a certain tolerance . If is not specified, it will automatically calculated using the function

Arguments

Type IntentOptional AttributesName
real(kind=real64), intent(in) :: x
real(kind=real64), dimension(:):: A
real(kind=real64), optional :: eps

Return Value logical

public function array_epsilon_r32(array) result(eps)

Arguments

Type IntentOptional AttributesName
real(kind=real32), intent(in), dimension(:):: array

Return Value real(kind=real32)

public function array_epsilon_r64(array) result(eps)

Arguments

Type IntentOptional AttributesName
real(kind=real64), intent(in), dimension(:):: array

Return Value real(kind=real64)

public function abs_max_val_r32(array) result(abs_max_val)

Arguments

Type IntentOptional AttributesName
real(kind=real32), intent(in), dimension(:):: array

Return Value real(kind=real32)

public function abs_max_val_r64(array) result(abs_max_val)

Arguments

Type IntentOptional AttributesName
real(kind=real64), intent(in), dimension(:):: array

Return Value real(kind=real64)