!===============================================================================
!
! module_poly.F90
!
!-------------------------------------------------------------------------------
!
! Module for polynomials of the Dirac matrix
!
! Author: Taylor Haar
! Last modified: 20/03/2017
!
!-------------------------------------------------------------------------------
# include "defs.h"

!-------------------------------------------------------------------------------
module module_poly

  type :: type_poly
     integer :: type ! Type of the polynomial (2pf? 1pf? correction?)
     integer :: n ! Order of the poly
     REAL :: c ! Leading coefficient
     COMPLEX, dimension(:), pointer :: z_k ! Roots
  end type type_poly
  
  type :: type_chi
     ! Type for storage of a vector of sc fields
     ! (used for multi-shift cg methods)
     P_SPINCOL_FIELD :: sc
  end type type_chi

  ! Main storage of polynomial filter information
  type(type_poly), save :: poly(30)

  ! Counter for poly id's
  integer, save :: n_poly_id = 0

  ! Polynomial type definitions
  integer, parameter :: P_NORMAL = 1, P_CORRECTION = 2, P_RATIONAL = 3

end module module_poly

!===============================================================================
