We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
The text was updated successfully, but these errors were encountered:
See also #14.
Sorry, something went wrong.
I agree. But well, then there is this solution: =)
integer :: i integer, parameter :: n = 4 ! dimension of the identity matrix real(wp), parameter :: I(n,n) = RESHAPE([ (MERGE(1._wp, 0._wp, i/n==MOD(i,n)), i=0, n**2-1) ], [n,n])
No branches or pull requests
An intrinsic to define an identity matrix would be nice. For example, Matlab has this.
Say:
For example, currently, to do this we have to have to do something like this:
Related maybe to #102.
The text was updated successfully, but these errors were encountered: