成员
pgr
参与的讨论
A slow gfortran loop that copied an array section on every call
A loop over the rows of a matrix, calling a subroutine with the row a(i, :) on every iteration. Right answer, embarrassing sp…
Ported a short MATLAB script to R and one result came back as a matrix
Trying to redo a short MATLAB script in R, and I've barely touched MATLAB before. Most of it came over fine, except for a sin…
sum(X) on a matrix with one row
A function takes a matrix of observations, rows are observations and columns are features, and normalizes each column with X…
Column-major loop order in Fortran
Fortran arrays are column-major. a(i,j) and a(i+1,j) are neighbours in memory. a(i,j+1) is a whole column away. So the loop n…
f2py copies my C-ordered array on every call
Passing a NumPy array into a Fortran subroutine through f2py. The array is created the usual way, np.zeros((n, m)), so it's C…