Skip to content
New issue

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

Fix doc. about linear from/to Cartesian indices #49343

Merged
merged 1 commit into from
Apr 13, 2023
Merged

Fix doc. about linear from/to Cartesian indices #49343

merged 1 commit into from
Apr 13, 2023

Commits on Apr 13, 2023

  1. Fix doc. about linear from/to Cartesian indices

    Since Julia (ordinary) arrays have 1-based indices and are in column-major order, the linear index `k` and the Cartesian index `(i,j)` of an element in a `m×n` Julia array are related by: `k = i + m*(j - 1)`. The examples of conversion between linear and Cartesian indices in the doc. use incorrect formulae although the results were correct in the specific element at `(1,3)`. This can be easily checked for other indices than `(1,3)` with a simple `2×3` array (as in the examples) built by `A = reshape(collect(1:6),2,3)`.
    emmt authored Apr 13, 2023
    Configuration menu
    Copy the full SHA
    01bb1ad View commit details
    Browse the repository at this point in the history