|
TNTmips Downloads Menu

|
transmat.sml
################################################################
# TransposeMatrix (matrixOut, matrixIn)
################################################################
clear();
class MATRIX h1, h2;
h1 = CreateMatrix(2,2); # create two matrices
h2 = CreateMatrix(2,2);
# fill the matrix with some values
SetMatrixItem( h1, 0, 0, 1.0 );
SetMatrixItem( h1, 0, 1, 2.0 );
SetMatrixItem( h1, 1, 0, 3.0 );
SetMatrixItem( h1, 1, 1, 4.0 );
# print the resulting matrix
# result should be | 1 2 |
# | 3 4 |
printf( "matrix before transpose\n" ) ;
PrintMatrixToConsole( h1 );
# now calculate the transpose of h1
TransposeMatrix( h2, h1 );
# print the inverse matrix
# result should be | 1 3 |
# | 2 4 |
printf( "matrix after transpose\n" ) ;
PrintMatrixToConsole( h2 );
# destroy the matrices
DestroyMatrix(h1);
DestroyMatrix(h2);
©MicroImages, Inc. 2013 Published in the United States of America
11th Floor - Sharp Tower, 206 South 13th Street, Lincoln NE 68508-2010 USA
Business & Sales: (402)477-9554 Support: (402)477-9562 Fax: (402)477-9559
Business info@microimages.com
Support support@microimages.com
Web webmaster@microimages.com
| |