Skip to content

Identity matrix intrinsic #103

@jacobwilliams

Description

@jacobwilliams

An intrinsic to define an identity matrix would be nice. For example, Matlab has this.

Say:

real(wp),dimension(4,4),parameter :: I = eye(4)

For example, currently, to do this we have to have to do something like this:

real(wp),dimension(4,4),parameter :: I = reshape([1.0_wp,0.0_wp,0.0_wp,0.0_wp,&
                                                  0.0_wp,1.0_wp,0.0_wp,0.0_wp,&
                                                  0.0_wp,0.0_wp,1.0_wp,0.0_wp,&
                                                  0.0_wp,0.0_wp,0.0_wp,1.0_wp],[4,4])

Related maybe to #102.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Clause 16Standard Clause 16: Intrinsic procedures and modules

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions