Darwin Help

Back to Index

matrix

Class matrix - a matrix of elements

Calling Sequence  CreateArray(1..m,1..n)
[[...], [...], ...]
Return Type  matrix
Methods inverse, print, Rand
Synopsis A matrix in darwin is a list of lists where all the internal lists have the same length. A matrix can be created with CreateArray, explicitly as a list of lists, with append or iteratively. Algebra between matrix and scalars or between matrix and vectors follows the normal rules of Linear Algebra. A matrix multiplied by a vector on the right assumes the vector is a column vector. A matrix multiplied by a vector on the left assumes the vector is a row vector.
Examples
> [[1,2],[2,3]];
[[1, 2], [2, 3]]
> CreateArray(1..3,1..4,777);
[[777, 777, 777, 777], [777, 777, 777, 777], [777, 777, 777, 777]]
See also Cholesky,   convolve,   CovarianceAnalysis,   CreateArray,   Eigenvalues,   GaussElim,   GivensElim,   Identity,   LinearRegression,   list,   matrix_inverse,   SvdAnalysis,   SvdBestBasis,   transpose