Skip to content

Subroutine to set diagonal elements of a matrix #555

Open
@milancurcic

Description

@milancurcic

In support of: j3-fortran/fortran_proposals#14

Prior art:

Target module: stdlib_linalg

Proposed signature:

! Scalar diagonal variant
pure subroutine set_diag(d, A, k)
  {integer(*), real(*)}, complex(*)}, intent(in) :: d !! Value to set the diagonal to 
  {integer(*), real(*)}, complex(*)}, intent(inout) :: A(:,:) !! Matrix to set the diagonal in
  integer, intent(in), optional :: k !! Number of the diagonal

! Array diagonal variant
pure subroutine set_diag(d, A, k)
  {integer(*), real(*)}, complex(*)}, intent(in) :: d(:) !! Values to set the diagonal to 
  {integer(*), real(*)}, complex(*)}, intent(inout) :: A(:,:) !! Matrix to set the diagonal in
  integer, intent(in), optional :: k !! Number of the diagonal

Metadata

Metadata

Assignees

No one assigned

    Labels

    ideaProposition of an idea and opening an issue to discuss ittopic: linalgLinear algebra

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions