You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It was recently suggested that the eye (#481) function is misleading. I would like to suggest that the eye function is extended by allowing a general return type. This could be accomplished by introducing an optional mold keyword:
A = eye(m, n [, mold])
that would tell the eye interface which return type should have A:
pure function eye_${rk}$(m, n, mold)
integer, intent(in) :: m
integer, intent(in), optional :: n
${rt}$, optional, intent(in) :: mold
${rt}$, dimension(:,:), allocatable :: eye
end function eye_${rk}$
Prior Art
mold is a Fortran Standard keyword that specifies that the return type of a polymorphic allocation should be taken from another variable:
allocate(a, mold=b)
Similarly, here we may want to specify that the return type of the eye matrix should be taken from the mold variable.
Additional Information
No response
The text was updated successfully, but these errors were encountered:
perazz
added
the
idea
Proposition of an idea and opening an issue to discuss it
label
Nov 30, 2024
Motivation
It was recently suggested that the
eye
(#481) function is misleading. I would like to suggest that theeye
function is extended by allowing a general return type. This could be accomplished by introducing an optionalmold
keyword:that would tell the
eye
interface which return type should haveA
:Prior Art
mold
is a Fortran Standard keyword that specifies that the return type of a polymorphic allocation should be taken from another variable:Similarly, here we may want to specify that the return type of the
eye
matrix should be taken from themold
variable.Additional Information
No response
The text was updated successfully, but these errors were encountered: