Do not edit this generated file which gives the stdout results of pltcl running the command "source bindings/tcl/test_tclmatrix.tcl" to test the matrix capabilities of libtclmatrix. Instead, check its consistency with the latest pltcl, libtclmatrix, and bindings/tcl/test_tclmatrix.tcl by building the (Unix) target "check_libtclmatrix_capabilities" which creates the latest version of this file in bindings/tcl/test_tclmatrix.out_compare in the build tree and compares that version with bindings/tcl/test_tclmatrix.out in the source tree. If that target fails because the two versions of that file are different, diff the build-tree version with the source tree version to help evaluate the differences, and if those differences seem reasonable (say due to a known change in bindings/tcl/test_tclmatrix.tcl in the source tree), then copy the build-tree version of this file back to the source tree, verify the result by running the "check_libtclmatrix_capabilities" target, and then commit the new version of the source-tree version. Create one-dimensional x matrix using "matrix x f 4 = {0., 1., 2., 3.}" Various start:stop:step slice examples for this matrix Examples where start, stop, and step are default [x :] yields 0.0 1.0 2.0 3.0 "*" (implemented for backwards compatibility) has exactly the same effect as ":" [x *] yields 0.0 1.0 2.0 3.0 "::" has exactly the same effect as ":" [x ::] yields 0.0 1.0 2.0 3.0 Examples where start and stop are default [x ::1] yields 0.0 1.0 2.0 3.0 [x ::2] yields 0.0 2.0 [x ::3] yields 0.0 3.0 [x ::4] yields 0.0 [x ::-1] yields 3.0 2.0 1.0 0.0 [x ::-2] yields 3.0 1.0 [x ::-3] yields 3.0 0.0 [x ::-4] yields 3.0 Examples where start and step are default [x :2:] yields 0.0 1.0 [x :2] yields 0.0 1.0 Examples where stop and step are default [x 2::] yields 2.0 3.0 [x 2:] yields 2.0 3.0 Examples where start is default [x :3:2] yields 0.0 2.0 [x :-4:-2] yields 3.0 1.0 Examples where stop is default [x 1::2] yields 1.0 3.0 [x -2::-2] yields 2.0 0.0 Examples where step is default [x 1:3:] yields 1.0 2.0 [x 1:3] yields 1.0 2.0 Examples where start, stop, and step are all explicitly specified [x 1:0:2] yields [x 1:1:2] yields [x 1:2:2] yields 1.0 [x 1:3:2] yields 1.0 [x 1:4:2] yields 1.0 3.0 [x 1:5:2] yields 1.0 3.0 [x -2:-1:-2] yields [x -2:-2:-2] yields [x -2:-3:-2] yields 2.0 [x -2:-4:-2] yields 2.0 [x -2:-5:-2] yields 2.0 0.0 [x -2:-6:-2] yields 2.0 0.0 Single index (i.e., not a slice) examples [x 0] yields 0.0 [x 1] yields 1.0 [x 2] yields 2.0 [x 3] yields 3.0 [x -1] yields 3.0 [x -2] yields 2.0 [x -3] yields 1.0 [x -4] yields 0.0 Results from foreach loop over all elements are: 0.0 1.0 2.0 3.0 Results from for loop with output only for [x $i] < 3 are: 0.0 1.0 2.0 Change 3rd element using "x 2 = 7" [x :] yields 0.0 1.0 7.0 3.0 Change all elements using "x : = 3" [x :] = 3.0 3.0 3.0 3.0 Various matrix initializations and assignments Using a collection of space-separated numbers [x :] = 1.0 2.0 3.0 4.0 [y : :] = 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 Using a list of lists of numbers [x :] = 1.0 2.0 3.0 4.0 [y : :] = 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 Using slices of a previously defined matrix [z : : :] = 1.0 2.0 3.0 4.0 4.0 3.0 2.0 1.0 [y : :] = 1.0 2.0 3.0 4.0 4.0 3.0 2.0 1.0 Combination of previously defined matrices, deep lists, and space-separated numbers [a : : :] = 1.0 2.0 3.0 4.0 4.0 3.0 2.0 1.0 1e-13 2.0 3.0 4.0 [b : : :] = 1.0 2.0 3.0 4.0 4.0 3.0 2.0 1.0 1e-13 2.0 3.0 4.0