News for hackers. Stuff that matters.
Re:Shape typing NumPy with pyright and variadic generics by Bostonian on Thursday March 16, 2023 @12:52PM (#35184639)
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)
   ...

There are no comments on this comment yet.