Skip to content

docs: demonstrate matrix! and vector! macros in construction example#1604

Open
wilmerdooley wants to merge 1 commit into
dimforge:mainfrom
wilmerdooley:oss/issue-988
Open

docs: demonstrate matrix! and vector! macros in construction example#1604
wilmerdooley wants to merge 1 commit into
dimforge:mainfrom
wilmerdooley:oss/issue-988

Conversation

@wilmerdooley

Copy link
Copy Markdown

The matrix construction example now leads with the matrix!, dmatrix!, vector!, and dvector! macros as the preferred way to build small vectors and matrices from their entries, with the existing ::new, from_rows, from_columns, from_row_slice, from_column_slice, from_fn, and from_iterator approaches kept alongside for comparison. The fixed-size example was also extended to show vector! and dvector!, and the variable bindings were renumbered to keep the assert_eq! checks aligned with each construction method.

Resolves #988

Changes

  • Promote matrix! to the first construction method in the fixed-size example, with a comment explaining row-by-row, comma/semicolon syntax.
  • Add vector! and dvector! examples for fixed- and dynamic-size vectors in the same block.
  • Add a dmatrix! example at the top of the dynamically-sized matrix block, again with a short comment.
  • Renumber the remaining matrix construction variables (e.g. m1 -> m2, dm -> dm0, etc.) and extend the assert_eq! chains to cover the new entries.

Signed-off-by: wilmerdooley <wilmerdooley1@gmail.com>
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.

Update User Guide with matrix! use

1 participant