Interactively create a sparse matrix over the current ring. The system first prompts for the number of rows and columns, and then prompts for the index and polynomial value of each non-zero entry.
If a file name is given, the command uses this file as input, and the system doesn't display any prompt lines. Thus "sparse m file" is the same as "sparse m <file", where the input has been redirected to come from ``file'', except that no prompts are displayed.
For example, to create a 5 by 6 matrix named m56,
% sparse m56 ! number of rows ? 5 ! number of columns ? 6 ! row column value ? 1 1 a2+b2+cd ! row column value ? 3 5 abc ! row column value ? 5 6 -1 ! row column value ? <return> % type m ; a2-b2 2c 0 ; a2+2ab+b2 3d ac+bc-ad-bd
The row, column, and polynomial expression are separated by blanks. The row and column can be any integer expressions. To stop the input of entries, simply type <return> on your terminal. The remaining entries are set to zero.
The base ring of the matrix is the current ring.