Documentation can be found at http://tcllib.sourceforge.net/doc/matrix.html . This module of the [tcllib] data [struct]ures collection provides a matrix structure, i.e. a 2-dimensional table of cells, organized in rows and columns. People in search of vector operations should look at either the [BLT] [vector] functionality or [VKIT]. ---- [LV] Is there any intended, or expected, relationship between tcllib's matrix and [Tktable]'s graphical display of rows and columns? [AK] A tcllib matrix can be linked to a tcl array (via traces) which then can be linked to a Tktable widget. In this way changes to the matrix are reflected in the widget and vice versa. [LV] Does anyone have a demo showing such a relationship? [AK] '''Yes''', see '''[Displaying Tables]'''. ---- [LV] Also, I recently saw a demo where an application used XML and XSLT to convert data into HTML in a Java client. One of the slick things the particular demo application did was to allow the user to specify via XML and XSLT how they wished to represent the data. The demo showed how they could via XSLT specify that the data be represented via a Java spreadsheet component and, without any specific support in the client (just by manipulating the stylesheet) were able to slide this ''off the shelf'' client into the visualization. Having some way to take data and visualize it seems to be particularly useful. Certainly tcllib's [report] module can be used for some degree of visualization - but perhaps other forms and crossovers would be useful. ---- [LV] Anyone have a proc that is the equivalent of a parray only for a matrix? Also, what about a function that does searching of a matrix for information? [AK] The matrix in the CVS head of tcllib has searching and when printing without a formatter we get somethng like parray. ---- One can always represent matrices as pure-value lists of lists. Manipulating these is rather easy by nested iteration over rows and columns. Here is for instance the '''extraction of a rectangular submatrix''': proc submatrix {m fromrow torow fromcol tocol} { set res {} foreach row [lrange $m $fromrow $torow] { lappend res [lrange $row $fromcol $tocol] } set res } % set m {{1 2 3 4} {5 6 7 8} {9 10 11 12}} {1 2 3 4} {5 6 7 8} {9 10 11 12} % submatrix $m 1 end 1 end {6 7 8} {10 11 12} ---- See also [NAP]. ---- See also module [struct] - [A matrix gadget] for API studies ---- [[ [Arts and Crafts of Tcl-Tk Programming] | [Category Command], package [tcllib] | [Category Data Structure] | ]]