eye Function

public function eye(n) result(res)

Constructs the identity matrix (Specification)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: n

Return Value integer(kind=int8) (n,n)


Contents

Source Code

eye

Variables

TypeVisibility AttributesNameInitial
integer, public :: i

Source Code

    function eye(n) result(res)
      !! version: experimental
      !!
      !! Constructs the identity matrix
      !! ([Specification](../page/specs/stdlib_linalg.html#description_1))
      integer, intent(in) :: n
      integer(int8) :: res(n, n)
      integer :: i
      res = 0
      do i = 1, n
         res(i, i) = 1
      end do
    end function eye