#lang scribble/doc @(require scribble/manual (for-label scheme) (for-label "../matrix.ss")) @title{The @scheme[simple-matrix] Library} @table-of-contents[] This library contains basic functions for manipulating matrices and vectors. These include: iterators and looping constructs, arithmetic, and matrix-vector operations. The library does not include any functions from traditional linear algebra (such as solving linear equations, finding eigenvalues, etc). The library comes with an initial module language, @filepath{matrix-lang.ss}, which re-defines the standard scheme functions @scheme[+], @scheme[-], @scheme[*], @scheme[/] to operate on numbers, vectors and matrices, and re-provides all of @scheme['scheme] and @filepath{matrix.ss} as well. Use this module language when you are more concerned with clarity than speed---basic arithmetic operations on scalars will no longer be inlined, and performance will suffer. This library is released under the GNU GPL; see the @seclink["License"]{License} section for details. @section[#:tag "matrix-functions"]{The @filepath{matrix.ss} Module} @defmodule[(planet wmfarr/simple-matrix:1:0/matrix)] @defstruct[matrix ((rows natural-number/c) (cols natural-number/c) (elts (vectorof number?))) #:inspector #f]{ A matrix with the given dimensions. The @scheme[elts] are stored in row-major order. } @defproc[(matrix* (rows natural-number/c) (cols natural-number/c) (elt number?) ...) matrix?]{ Constructs a matrix from the given @scheme[elt ...], in row-major order. } @defproc[(matrix-ref (m matrix?) (i (and/c natural-number/c (