copy_matrix Subroutine

private subroutine copy_matrix(left, right)

This routine provides assignment operator of tem_matrix_type

Arguments

Type IntentOptional Attributes Name
type(tem_matrix_type), intent(out) :: left
type(tem_matrix_type), intent(in) :: right

Called by

proc~~copy_matrix~~CalledByGraph proc~copy_matrix copy_matrix interface~assignment(=)~2 assignment(=) interface~assignment(=)~2->proc~copy_matrix

Contents

Source Code


Source Code

  subroutine copy_matrix(left, right)
    ! --------------------------------------------------------------------------
    type(tem_matrix_type), intent(out) :: left
    type(tem_matrix_type), intent(in) :: right
    ! --------------------------------------------------------------------------
    left%nEntries = right%nEntries
    if (allocated(right%A)) then
      allocate(left%A(right%nEntries(1), right%nEntries(2)))
      left%A = right%A
    end if

  end subroutine copy_matrix