8.18
top
← prev up next →

Semi-persistent MatricesπŸ”— i

Jay McCarthy <jay@racket-lang.org>

This package defines matrices using semi-persistent vectors from data/spvector

procedure

( build-matrix rowscolscell-f)matrix?

Constructs a matrix m such that (matrix-ref mrici) is (cell-frici).

procedure

( matrix? v)boolean?

v:any/c
Determines if v is a valid matrix.

Returns how many rows m has.

Returns how many cols m has.

procedure

( matrix-valid-ref? mrici)boolean?

Determines if (matrix-ref mrici) would error.

procedure

( matrix-ref mrici)any/c

Extracts the value of a cell in the matrix.

procedure

( matrix-set mriciv)matrix?

v:any/c
Semi-persistently modifies m.

procedure

( matrix-set! mriciv)void

v:any/c
Destructively modifies m.

procedure

( matrix-fold mrow-fcell-facc)any/c

acc:any/c
Like foldr but for matrices. row-f is called with the result of cell-f from the last column in the row. cell-f is called from left to right.

procedure

( display-matrix m)void

display s the cells of m with (newline ) separating rows.

top
← prev up next →

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /