Skip to content

NDArray documentation + site reorganisation into subfolders#77

Merged
Quafadas merged 2 commits intomainfrom
copilot/add-ndarray-documentation
Apr 8, 2026
Merged

NDArray documentation + site reorganisation into subfolders#77
Quafadas merged 2 commits intomainfrom
copilot/add-ndarray-documentation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 8, 2026

Adds NDArray cheatsheet and runnable mdoc examples, and reorganises existing vector/matrix docs into their own subfolder.

New: site/docs/ndarray/

  • cheatsheet.md — NDArray vs NumPy vs MATLAB comparison tables covering construction, properties (ndim, numel, shape, strides, isColMajor…), indexing, slicing/views, reshape/squeeze/flatten, element-wise and unary ops, in-place ops, comparisons, and broadcasting. Calls out vecxt's explicit-broadcast-only design and column-major default.

  • examples.mdmdoc-compiled examples demonstrating the full API:

// Zero-copy views share backing data
val m = NDArray(Array.tabulate(12)(_.toDouble), Array(3, 4))
val s = m.slice(0, 1, 3)         // view of rows 1–2
s.data eq m.data                 // true

// Transpose is also zero-copy
val t = m.T                      // strides permuted, no copy

// Explicit broadcasting before binary ops
val bias  = NDArray(Array(10.0, 20.0, 30.0), Array(1, 3))
val (d2, b2) = broadcastPair(NDArray.fill(Array(4, 3), 0.0), bias)
val result = d2 + b2

Reorganised: site/docs/vectors-and-matrices/

Moved cheatsheet.md, examples.md, matrix.md, and higherkinded.md from the docs root into this subfolder. General docs (Setup.md, bounds.md, gotcha.md, index.md) remain at the top level.

Copilot AI linked an issue Apr 8, 2026 that may be closed by this pull request
…es/ subfolders

Agent-Logs-Url: https://github.com/Quafadas/vecxt/sessions/a87869a3-3ef3-434c-b673-2e112fb59e4a

Co-authored-by: Quafadas <24899792+Quafadas@users.noreply.github.com>
Copilot AI changed the title [WIP] Add NDArray documentation and reorganize site structure NDArray documentation + site reorganisation into subfolders Apr 8, 2026
Copilot AI requested a review from Quafadas April 8, 2026 09:05
@Quafadas Quafadas marked this pull request as ready for review April 8, 2026 11:28
@Quafadas Quafadas merged commit b8f3e31 into main Apr 8, 2026
7 checks passed
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.

NDArray : Documentation

2 participants