find_dense Function

private pure function find_dense(self, row, col) result(index)

Type Bound

type_dense

Arguments

Type IntentOptional Attributes Name
class(type_dense), intent(in) :: self
integer(kind=int32), intent(in) :: row
integer(kind=int32), intent(in) :: col

Return Value integer(kind=int32)


Source Code

    pure function find_dense(self, row, col) result(index)
        implicit none
        class(type_dense), intent(in) :: self
        integer(int32), intent(in) :: row
        integer(int32), intent(in) :: col
        integer(int32) :: index

        if (row < 1 .or. row > self%num_row .or. col < 1 .or. col > self%num_col) then
            index = 0
        else
            index = row + (col - 1) * self%num_row
        end if

        return
    end function find_dense