Class eigen_value_range_class
In: HmcRationalQuarkWilsonClass/eigen_value_range_class.F90
constants_module error_class eigen_value_range_class dot/f_146.png

This module provides some arithmetic operations on a eigenvalue interval

Version

 $Id$

Methods

assign   clear   delete   eigen_value_range   get_max   get_min   is_null   new   set   union  

Included Modules

constants_module error_class

Public Instance methods

Subroutine :
this :type(eigen_value_range), intent(inout)
that :type(eigen_value_range), intent(in)

value copy assignment

this <= that

[Source]

subroutine assign_eval_range(this,that)
!
! value copy assignment
!
! this <= that
!
  implicit none
  type(eigen_value_range), intent(inout) :: this
  type(eigen_value_range), intent(in)    :: that
  this%min     = that%min
  this%max     = that%max
  this%is_null = that%is_null
  return
end subroutine
Subroutine :
this :type(eigen_value_range), intent(inout)

delete interval

[Source]

subroutine delete_eval_range(this)
!
! delete interval
!
  implicit none
  type(eigen_value_range), intent(inout) :: this
  this%min = NULL_SET
  this%max = NULL_SET
  this%is_null = .TRUE.
  return
end subroutine
Subroutine :
this :type(eigen_value_range), intent(inout)

delete interval

[Source]

subroutine delete_eval_range(this)
!
! delete interval
!
  implicit none
  type(eigen_value_range), intent(inout) :: this
  this%min = NULL_SET
  this%max = NULL_SET
  this%is_null = .TRUE.
  return
end subroutine
eigen_value_range
Derived Type :

eivenvalur range [min,max]

  0 <= min <= max

if min = max = -1.0 then this is null set.

Function :
emax :real(DP)
this :type(eigen_value_range), intent(in)

return max

[Source]

function get_max_eval_range(this) result(emax)
!
! return max
!
  implicit none
  type(eigen_value_range), intent(in) :: this
  real(DP) :: emax
  if (.not.this%is_null) then
    emax = this%max
  else
    call error_stop("get_max:eigen_value_range is null.")
  endif
  return
end function
Function :
emin :real(DP)
this :type(eigen_value_range), intent(in)

return min

[Source]

function get_min_eval_range(this) result(emin)
!
! return min
!
  implicit none
  type(eigen_value_range), intent(in) :: this
  real(DP) :: emin
  if (.not.this%is_null) then
    emin = this%min
  else
    call error_stop("get_min:eigen_value_range is null.")
  endif
  return
end function
Function :
flag :logical
this :type(eigen_value_range), intent(in)

check null set

[Source]

function is_null_eval_range(this) result(flag)
!
! check null set
!
  implicit none
  type(eigen_value_range), intent(in) :: this
  logical :: flag
  flag = this%is_null
  return
end function
Subroutine :
this :type(eigen_value_range), intent(inout)
min :real(DP), optional, intent(in)
max :real(DP), optional, intent(in)

Initialize interval

[Source]

subroutine new_eval_range(this,min,max)
!
! Initialize interval
!
  implicit none
  type(eigen_value_range), intent(inout) :: this
  real(DP), optional,      intent(in)    :: min
  real(DP), optional,      intent(in)    :: max
  logical :: flg_min,flg_max
  flg_min = present(min)
  flg_max = present(max)
  if (flg_min.and.flg_max) then
    call set(this,min,max)
  else
    this%min = NULL_SET
    this%max = NULL_SET
    this%is_null = .TRUE.
  endif
  return
end subroutine
Subroutine :
this :type(eigen_value_range), intent(inout)
min :real(DP), intent(in)
max :real(DP), intent(in)

set interval renge [min,max]

[Source]

subroutine set_eval_range(this,min,max)
!
! set interval renge [min,max]
!
  implicit none
  type(eigen_value_range), intent(inout) :: this
  real(DP),                intent(in)    :: min
  real(DP),                intent(in)    :: max
  if (min > max) then
    call error_stop("set:eigen_value_range should be min<=max.")
  endif
  if (min < 0.0_DP .or. max < 0.0_DP) then
    call error_stop("set:eigen_value_range should be 0 <= min, 0 <= max.")
  endif
  this%min = min
  this%max = max
  this%is_null = .FALSE.
  return
end subroutine
Function :
c :type(eigen_value_range)
a :type(eigen_value_range), intent(in)
b :type(eigen_value_range), intent(in)

interval union

 c = a + b

[Source]

function union_eval_range(a,b) result(c)
!
! interval union
!
!  c = a + b
!
  implicit none
  type(eigen_value_range), intent(in) :: a
  type(eigen_value_range), intent(in) :: b
  type(eigen_value_range) :: c
  logical :: a_is_null,b_is_null
  a_is_null = is_null(a)
  b_is_null = is_null(b)
  if (a_is_null .and. b_is_null) then
    call clear(c)
    return
  endif
  if (a_is_null) then
    c%min = b%min
    c%max = b%max
    c%is_null = .FALSE.
    return
  endif
  if (b_is_null) then
    c%min = a%min
    c%max = a%max
    c%is_null = .FALSE.
    return
  endif
  c%min = MIN(a%min,b%min)
  c%max = MAX(a%max,b%max)
  c%is_null = .FALSE.
  return
end function