Circulant Derived Type

type, public :: Circulant

Base type to define a Circulant matrix of size [n x n] with elements given by the vector


Constructor

public interface Circulant

This interface provides methods to construct Circulant matrices. Given a vector , the associated Circulant matrix is the following [n x n] matrix

Syntax

   integer, parameter :: n = 100
   real(dp) :: c(n)
   type(Circulant) :: A

   call random_number(c)
   A = Circulant(c)

Note

Only double precision is currently supported for this matrix type.

  • private pure module function construct(c) result(A)

    Construct a Circulant matrix from the rank-1 array c.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: c(:)

    Generating vector.

    Return Value type(Circulant)

    Corresponding Circulant matrix.


Source Code

   type, public :: Circulant
      !! Base type to define a `Circulant` matrix of size [n x n] with elements
      !! given by the vector \(c = (c[1], c[2], ..., c[n]).\)
      private
      integer(ilp) :: n
      !! Dimension of the matrix.
      real(dp), allocatable :: c(:)
      !! Generating vector.
      complex(dp), allocatable :: c_hat(:)
      !! Fourier Transform of the generating vector.
   end type Circulant