Audience: comp.lang.tcl, comp.sys.matlab, comp.os.linux.announce The MathWizards, Inc. is pleased to announce the (beta) availability of MathXplorer/T, a Tcl package providing matrix-based numerical analysis capabilities within the Tcl environment. The MathXplorer/T package extends the Tcl environment with two built-in commands: mexpr and m2t. mexpr, like its native Tcl cousin expr, can interpret mathematical expressions in standard form. However, mexpr does much more: * it provides matrix, vector and scalar data types, both real and complex, * it supports user-defined functions and scripts * it provides a rich set of matrix factorization, signal analysis, and filtering algorithms, * it populates its own disjoint variable space, * it allows for both batch and interactive processing m2t can be used to format the variables in the MathViews variable-space as Tcl lists. For matrices, m2t creates a list of sublists; each sublists represents either a row or a column. m2t can also take a printf-style specification which it uses to format individual elements of matrices. MathXplorer/T performs all computations in the same process and thread as the Tcl process. In order to tightly integrate itself within the Tcl environment, it does NOT use pipes or sockets to communicate with an external numerical engine. Beta versions of MathXplorer/T, limited to 16K elements, are now available for the Linux, Windows, FreeBSD, and Solaris. The required files, along with a tutorial, can be found at: http://www.mathwizards.com/products/mxt. The MathWizards is interested in hearing your comments on our "nifty" little package. Please drop us a line at info@mathwizards.com. Also tell us about any bugs you may have encountered. As a brief example, let's consider a short Tcl session. In this session, we interact with both the Tcl and MathViews interpreters. In Tcl, we use text which follows a '#' to make comments. % % # start by loading the MathXplorer/T package % % load libmxt.so MathViews Parsing Engine v2.1. (c) MathWizards 1998. % % # In Windows, you would use 'load mxt.dll' % # Ok, now use mexpr to create a variable 'a' : % % mexpr a = 5 a = 5 % % # To inspect the MathViews variable space, use the command who: % % mexpr who Your variables are : _MVPATH _MVPWD a % % # now, create random 2x3 matrix: % % mexpr x = rand(2,3) x = 0.3020 0.2090 0.3484 0.1040 0.5724 0.1702 % % # Create a 3x2 matrix. Note the use of the curly-braces, % # needed to prevent Tcl from interpreting the contents of % # square-brackets. % % mexpr { y = [ 11 12 ; 21 22 ; 31 32 ] } y = 11 12 21 22 31 32 % % # Now, go into interactive mode by invoking mexpr without % # arguments. We will create a matrix z=x*y and compute its % inverse: % % mexpr >> z = x * y z = 18.5137 19.3732 18.4400 19.2865 >> invz = inv(z) invz = -109.3487 109.8403 104.5489 -104.9671 >> exit % % # Note that we used "exit" to return to the Tcl prompt. % # Now, lets format invz % % m2t invz {-109.348692 104.548946} {109.840279 -104.967105} % % # m2t created a list of two lists. By default, each sublist represents % # a column. To group by row, we use the -r option % % set byrow [ m2t -r invz ] {-109.348692 109.840279} {104.548946 -104.967105} % % # You can also remove any grouping with -f (for 'F'lat). % # Also, with the -format option, you can pass m2t a % # formatting specification: % % m2t -f -format %3.1f invz -109.3 104.5 109.8 -105.0 % % # we are done % % exit The MathWizards, info@mathwizards.com