G.2 ELL_Matrix Class Code Listing

The main documentation of the ELL_Matrix Class contains additional explanation of this code listing.

! Author: Michael L. Hall
!         P.O. Box 1663, MS-D413, LANL
!         Los Alamos, NM 87545
!         ph: 505-665-4312
!         email: Hall@LANL.gov
! Created on: 12/15/02
! CVS Info:   $Id: ell_matrix.F90,v 1.40 2009/09/11 21:44:06 hall Exp $

module Caesar_ELL_Matrix_Class

  ! Global use associations.

  use Caesar_Data_Structures_Module
  use Caesar_Mathematic_Vector_Class

  ! Start up with everything untyped and private.

  implicit none

  ! Public procedures.

  public :: Initialize, Finalize, Valid_State, Initialized
  public :: Assignment(=)
  public :: Add_Values, Average, First_Row_PE, Frobenius_Norm, Get_Columns, &
            Get_Values, Infinity_Norm, Last_Row_PE, Max_Nonzeros, MatVec, &
            Maximum, Mean, Minimum, Name, NColumns, NRows_PE, NRows_Total, &
            Norm, One_Norm, Output, Read, Read_Harwell_Boeing, Residual, &
            Set_0_Diagonal_to_1, Set_Not_Up_to_Date, Set_Value, Set_Values, &
            Sum, Total, Two_Norm_Estimate, Two_Norm_Range

  interface Initialize
    module procedure Initialize_ELL_Matrix
  end interface

  interface Finalize
    module procedure Finalize_ELL_Matrix
  end interface

  interface Valid_State
    module procedure Valid_State_ELL_Matrix
  end interface

  interface Initialized
    module procedure Initialized_ELL_Matrix
  end interface

  interface Assignment(=)
    module procedure Get_Columns_ELL_Matrix
    module procedure Get_Values_ELL_Matrix
    module procedure Set_Value_ELL_Matrix_All
  end interface

  interface Add_Values
    module procedure Add_Values_ELL_Matrix_0
    module procedure Add_Values_ELL_Matrix_1
    module procedure Add_Values_ELL_Matrix_2
  end interface

  fortext([Value],[Average First_Row_PE Frobenius_Norm Infinity_Norm 
                   Last_Row_PE Max_Nonzeros Maximum Minimum Name NColumns 
                   NRows_PE NRows_Total One_Norm Sum Two_Norm_Estimate 
    interface Value
      module procedure expand(Get_Value_ELLM)
    end interface

  interface Get_Columns
    module procedure Get_Columns_ELL_Matrix
  end interface

  interface Get_Values
    module procedure Get_Values_ELL_Matrix
  end interface

  interface MatVec
    module procedure MatVec_ELL_Matrix
  end interface

  interface Mean
    module procedure Get_Average_ELLM
  end interface

  interface Norm
    module procedure Get_Frobenius_Norm_ELLM
  end interface

  interface Output
    module procedure Output_ELL_Matrix
  end interface

  interface Read
    module procedure Read_Harwell_Boeing_ELL_Matrix
  end interface

  interface Read_Harwell_Boeing
    module procedure Read_Harwell_Boeing_ELL_Matrix
  end interface

  interface Residual
    module procedure Residual_ELL_Matrix
  end interface

  interface Set_0_Diagonal_to_1
    module procedure Set_0_Diagonal_to_1_ELL_Matrix
  end interface

  interface Set_Not_Up_to_Date
    module procedure Set_Not_Up_to_Date_ELLM
  end interface

  interface Set_Value
    module procedure Set_Value_ELL_Matrix_All
  end interface

  interface Set_Values
    module procedure Set_Values_ELL_Matrix_0
    module procedure Set_Values_ELL_Matrix_1
    module procedure Set_Values_ELL_Matrix_2
    module procedure Set_Values_ELL_Matrix_All
  end interface

  interface Total
    module procedure Get_Sum_ELLM
  end interface

  ! Public type definitions.

  public :: ELL_Matrix_type

  type ELL_Matrix_type

    ! Initialization status.

    type(integer) :: Initialized               

    ! The name for this variable.

    type(character,name_length) :: Name

    ! Basic data structures for Rows and Columns.

    type(Base_Structure_type), pointer :: Row_Structure
    type(Base_Structure_type), pointer :: Column_Structure

    ! Values for the ELL Matrix.

    type(real,2) :: Values

    ! Column numbers for the ELL Matrix.

    type(integer,2) :: Columns

    ! Maximum number of columns (nonzeros) in the matrix.

    type(integer) :: Max_Nonzeros

    ! ELL Matrix dimensionality is two.

    type(integer) :: Dimensionality=2

    ! Data Index and match number that are used for MatVecs.

    type(Data_Index_type) :: Index
    type(integer) :: Index_Match_Number

    ! Norm variables and "updated?" toggles.

    type(real) :: Average, Frobenius_Norm, Infinity_Norm, Maximum, Minimum, &
                  One_Norm, Sum, Two_Norm_Estimate
    type(real), dimension(2) :: Two_Norm_Range
    type(logical) :: Average_is_Updated, Frobenius_Norm_is_Updated, &
                     Index_is_Updated, Infinity_Norm_is_Updated, &
                     Maximum_is_Updated, Minimum_is_Updated, &
                     One_Norm_is_Updated, Sum_is_Updated, &

  end type ELL_Matrix_type


The ELL_Matrix Class contains the following routines which are listed in separate sections:

* Initialize_ELL_Matrix
* Finalize_ELL_Matrix
* Valid_State_ELL_Matrix
* Initialized_ELL_Matrix
* Add_Values_ELL_Matrix
* Get_Columns_ELL_Matrix
* Get Value ELL_Matrix
* Get_Values_ELL_Matrix
* MatVec_ELL_Matrix
* Output_ELL_Matrix
* Read_Harwell_Boeing_ELL_Matrix
* Residual_ELL_Matrix
* Set_0_Diagonal_to_1_ELL_Matrix
* Set_Not_Up_to_Date_ELLM
* Set_Values_ELL_Matrix

end module Caesar_ELL_Matrix_Class

Michael L. Hall