Skip to content

docs: clarify row layout for two-dimensional matrices - #3700

Open
Hugohong258 wants to merge 1 commit into
josdejong:developfrom
Hugohong258:docs/clarify-matrix-rows
Open

Hugohong258 wants to merge 1 commit into
josdejong:developfrom
Hugohong258:docs/clarify-matrix-rows

Conversation

@Hugohong258

Copy link
Copy Markdown

Problem

The matrices guide describes the first dimension of a two-dimensional matrix as a column, which conflicts with the usual interpretation of its array representation and makes multiplication harder to understand.

Change

Clarify that the top-level elements are rows, that size reports rows before columns, and that multiply(a, b) computes a * b. Add the same row convention to the multiply API documentation.

Closes #2618.

Validation

  • npm run test:src: 6652 passing, 22 pending.
  • npx eslint --max-warnings 0 src/function/arithmetic/multiply.js: passed.
  • Checked size([[0, 1, 2], [3, 4, 5]]) and a 1×2 multiplied by a 2×1 matrix against the current code.
  • Full npm run lint was attempted on Windows but failed on CRLF formatting in an unchanged test file (test/typescript-tests/testTypes.ts).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make documentation clearer that the top-level elements of a 2D rectangular array are considered **rows** of matrices.

1 participant