2 ms·
In Fortran (which since the 1990 standard has operations on arrays and array sections) the declarations tell you the array ranks, for example function matve
by Bostonian 4y ago
In Fortran (which since the 1990 standard has operations on arrays and array sections) the declarations tell you the array ranks, for example
function matvec(a,x) result(b)
real, intent(in) :: a(:,:), x(:)
real :: b(size(a,1))
if (size(a,2) /= size(x)) stop "mismatched inputs"
...
or alternatively
function matvec(a,x,n1,n2) result(b)
real, intent(in) :: a(n1,n2), x(n2)
real :: b(n1)
...